Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bee-install: fix a tar-1.23 -> tar 1.26 default behavior
-h / --dereference is needed to let tar >1.23 keep symlinks to directories this fixes a problem where the /lib64 -> /lib symlink of tc-binutils_pass1 was overwritten by the /lib64 tc-gcc_pass1 directory in the bee-lfs proof of concept project. adding -h to tar just restores the default behavior of tar <= 1.23 for now. the desired behavior for bee is not discussed yet and may change in the future. if package A adds a symlink aaa to some directory and package B adds a directory aaa there is a unresolvable conflict in those packages. So these packages need to be fixed. may be we should decide to not define any bahavior of bee at all if this happens. so for now: expected result is undefined if a package tries to replace a symlink with a directory. for the files: the test case: (output from tar 1.26) (using tar 1.23 both runs show the same result as the second run of tar 1.26 including -h) rm -fr xxx yyy && \ mkdir -p xxx yyy && \ touch xxx/aaa && \ touch yyy/bbb && \ tar cf xxx.tar xxx yyy && \ rm -fr xxx yyy && \ mkdir yyy && \ ln -s yyy xxx && \ ln -s ccc yyy/bbb && \ touch yyy/ccc && \ find xxx yyy -ls && \ tar -xf xxx.tar && \ echo "after tar -xf:" && \ find xxx yyy -ls 46024 0 lrwxrwxrwx 1 root system 3 Jan 26 13:55 xxx -> yyy 1229 0 drwxr-xr-x 2 root system 96 Jan 26 13:55 yyy 136947 0 lrwxrwxrwx 1 root system 3 Jan 26 13:55 yyy/bbb -> ccc 136949 0 -rw-r--r-- 1 root system 0 Jan 26 13:55 yyy/ccc after tar -xf: 46024 0 drwxr-xr-x 2 root system 72 Jan 26 13:55 xxx 136950 0 -rw-r--r-- 1 root system 0 Jan 26 13:55 xxx/aaa 1229 0 drwxr-xr-x 2 root system 96 Jan 26 13:55 yyy 136947 0 -rw-r--r-- 1 root system 0 Jan 26 13:55 yyy/bbb 136949 0 -rw-r--r-- 1 root system 0 Jan 26 13:55 yyy/ccc rm -fr xxx yyy && \ mkdir -p xxx yyy && \ touch xxx/aaa && \ touch yyy/bbb && \ tar cf xxx.tar xxx yyy && \ rm -fr xxx yyy && \ mkdir yyy && \ ln -s yyy xxx && \ ln -s ccc yyy/bbb && \ touch yyy/ccc && \ find xxx yyy -ls && \ tar -xhf xxx.tar && \ echo "after tar -xhf:" && \ find xxx yyy -ls 46024 0 lrwxrwxrwx 1 root system 3 Jan 26 13:56 xxx -> yyy 1229 0 drwxr-xr-x 2 root system 96 Jan 26 13:56 yyy 136947 0 lrwxrwxrwx 1 root system 3 Jan 26 13:56 yyy/bbb -> ccc 136949 0 -rw-r--r-- 1 root system 0 Jan 26 13:56 yyy/ccc after tar -xhf: 46024 0 lrwxrwxrwx 1 root system 3 Jan 26 13:56 xxx -> yyy 1229 0 drwxr-xr-x 2 root system 120 Jan 26 13:56 yyy 136950 0 -rw-r--r-- 1 root system 0 Jan 26 13:56 yyy/aaa 136947 0 -rw-r--r-- 1 root system 0 Jan 26 13:56 yyy/bbb 136949 0 -rw-r--r-- 1 root system 0 Jan 26 13:56 yyy/ccc
- Loading branch information