RKrahl / archive-tools

Tools for managing archives
Apache License 2.0
1 stars 2 forks source link

Should sort the members of an archive #11

Closed RKrahl closed 5 years ago

RKrahl commented 5 years ago

It might be convenient to sort the members before adding them to the archive. That would make the outcome more predictable and would make it easier to find entries in the manifest. E.g. the following:

>>> archive = Archive("archive.tar", mode="x:", paths=["base/c", "base/a", "base/b"])
>>> [fi.path for fi in archive.manifest]
[PosixPath('base/c'), PosixPath('base/a'), PosixPath('base/b')]

should yield [PosixPath('base/a'), PosixPath('base/b'), PosixPath('base/c')] instead.