Hi Richard, > On upgrading from GNU tar 1.20, I see an > unexpected change in listing/restoring behavior when the > --strip-components=N option is used with --occurrence=1 option. I > don't know if this is specific to directories in which the file names > begin with the same string as the directory requested, but in the > past, I would get the entire directory rather than just the first file > in the directory when doing a restore.
Yes, this was a side effect of several bug fixes (namely, commits 9c194c99 and 28e91b48). The problem is that it is not quite clear how --occurrence should interact with --strip-components. For example, given this archive: $ tar tf archive.tar ./ ./b/ ./b/file1 ./b/file2 ./b/file3 the command `tar --occurrence=1 --strip=2 -x -v -f ../a.tar ./b' will produce a single file `./b/file1', because the `./b' prefix gets stripped off the file name and the directory member itself is not explicitly extracted (if it were, the entire directory contents would be extracted along with it). I agree that this behavior is counter-intuitive. Allow me some time to fix it. Regards, Sergey
