anom/transpkg
1
1
Fork
You've already forked transpkg
0

Tar --delete's Drawbacks #5

Open
opened 2026年04月16日 19:21:01 +02:00 by anom · 2 comments
Owner
Copy link

If you want to recreate package with the same hash as original, you better not to use tar --delete.

What if I want to use --delete?

You can still get the same hash in theory by repacking original package into a package that excludes "removed" files from tar's content. Repacked package's hash should match recreated package's hash that we get from the transpkg.

Why transpkg cant support tar --delete

We dont know how to read deleted files nor see where exactly they were marked as deleted in the tar's content list.
Thus, it is impossible to implement this feature without tar experts.

Note: We cant be sure where files were before getting deleted and where they got marked as deleted. This information is crucial and should be applied keeping the order to get the hash right.

Related feature was issued here #3 and cant be implemented at the moment, as we dont know how to read "deleted" files and cant see the "markers that remove files".

If you want to recreate package with the same hash as original, you better not to use tar --delete. # What if I want to use --delete? You can still get the same hash in theory by repacking original package into a package that excludes "removed" files from tar's content. Repacked package's hash should match recreated package's hash that we get from the transpkg. # Why transpkg cant support tar --delete We dont know how to read deleted files nor see where exactly they were marked as deleted in the tar's content list. Thus, it is impossible to implement this feature without tar experts. Note: We cant be sure where files were before getting deleted and where they got marked as deleted. This information is crucial and should be applied keeping the order to get the hash right. Related feature was issued here #3 and cant be implemented at the moment, as we dont know how to read "deleted" files and cant see the "markers that remove files".
Author
Owner
Copy link

How to clean package from --delete's affects

Note: Do not remove files in tars using --delete if you want to get same original hash using TransPkg (or tp for short).

If you do "remove" files from tar marking them as removed, they wont be exported and thus the removed file nor "marker about removed file" will remain in recreated packages by tp.

If recreated package's hash does not match with package that used (tar --delete) you can still try to repack your package (to clean it from files that are marked as deleted) to check if it eventually will get the same hash.

In case if repacking did not solve hash mismatch, you can open new Issue.

# How to clean package from --delete's affects Note: Do not remove files in tars using --delete if you want to get same original hash using TransPkg (or tp for short). If you do "remove" files from tar marking them as removed, they wont be exported and thus the removed file nor "marker about removed file" will remain in recreated packages by tp. If recreated package's hash does not match with package that used (tar --delete) you can still try to repack your package (to clean it from files that are marked as deleted) to check if it eventually will get the same hash. In case if repacking did not solve hash mismatch, you can open new Issue.
Author
Owner
Copy link

Also, its important that package should be repacked in the same working directory where it was initially packed as tar stores the path to it inside it.

Source

Also, its important that package should be repacked in the same working directory where it was initially packed as tar stores the path to it inside it. [Source](https://superuser.com/questions/1808928/when-tar-the-same-two-packages-its-md5-are-not-same)
Sign in to join this conversation.
No Branch/Tag specified
master
No results found.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
anom/transpkg#5
Reference in a new issue
anom/transpkg
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?