Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upCall tarfile.open with dereference=True to handle hard links. #91
Conversation
* Utils.py: Use dereference=True (instead of tarinfo=MyTarInfo) when calling tarfile.open to handle archives with hard links. * SourceFetcher.py: Use --hard-dereference when calling tar.
|
Should I also revert the rest of the commit mentionned in #46 (comment) by dropping the bloc that defines |
|
I'm too uncertain of this code to merge this, sorry. |
|
Works fine for me. |
|
Replacing hardlinks with copies may break things in the following situation:
Replacing them with symlinks usually avoids this problem, and is the correct way to go about this. However, the symlinks should ideally use relative paths. The old RelativizeSymLink tracker add-on could do this (and I have the source somewhere). But it should be done the Python way in this case, I guess. |
|
OK, I got it. Let me add this, however, just for the record ;-)
So, if there existed a package with hard links that were needed by the compilation, then it would probably fail to build due to the wrong relative links. BTW, are there any kernel developers willing to add support for hard links in BFS? |
|
hard links in BFS are not going to happen. This is not due to lazyness of our kernel programmers, it is a limitation in the design of on-disk structures for BFS making it not possible to have hard links. Fixing this would make "new" BFS incompatible with the current implementation, and possibly need major rework of the way the file system works. I think the way to go for this is symlinks with an absolute path. I'm not sure how we can achieve this, however. |
|
OK, thanks for the info. |
fbrosson commentedJun 30, 2016
Utils.py: Usedereference=True(instead oftarinfo=MyTarInfo) when callingtarfile.opento handle archives with hard links.SourceFetcher.py: Use--hard-dereferencewhen callingtar.