On Fri, Jul 06, 2012 at 12:21:24PM +0200, Joerg Schilling wrote: >> Denis Excoffier <[email protected]> wrote: >> >> > >> > Hello, >> > >> > When tar (e.g. tar-1.26) creates an archive of a directory, the >> > ordering of files (as shown by "ls -f") is preserved in the archive. >> > >> > I would like an option to make this ordering constant (e.g. alphanumeric), >> > in order that two directories that compare equal (with "diff -r") would >> > produce the same archive (provided of course that appropriate --mtime, >> > --owner, --group and --mode options are also set to the same values). >> >> Why exactly do you like to have this?
When i deliver software to my "customers", i need to deliver only what is "contractual", ie file names and file contents. Therefore, my tar incantation usually contains --owner, --group etc. Also, as directory order is not contractual, i have to use some variation of 'find|sort|tar' to get rid of it. It would be more convenient (for me at least) that tar gives us an option to just do this. The fact that i used 'diff' in my original post was only for explanation purposes. Nevertheless, 'diff' also sorts directory entries. >> >> > Note. "diff -r" is not the better tool for directory comparison since >> > symbolic links are always traversed. But you get the picture. >> >> Because diff -r is not useful for tree comparing in general, star supports a >> user tailorable -diff option. >> >> Did you check "star -diff -v diffopts=...."? >> I'm afraid not. In fact, i have applied a patch that introduces a -K (--no-dereference) option in order not to traverse symlinks. I'm happy with it. Regards, Denis Excoffier.
