bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] GNU tar fails to treat leading slash consistently


From: Sergey Poznyakoff
Subject: Re: [Bug-tar] GNU tar fails to treat leading slash consistently
Date: Tue, 26 Jan 2010 09:09:18 +0200

Hi Stan,

> (This is my first email to any GNU bug report destination, so please
> forgive me if I screwed up protocol-wise.)

No problem, never mind the protocol.

> Bug 1:
>  
>    GNU tar fails to strip the leading slash when looking for a file to 
> restore (and -P 
>    is not specified).  (Example failure shown earlier.)

This is intended. GNU tar has no way of knowing if the archive was
created with or without -P. If it had stripped leading slashes, it would
have been unable to correctly list archives containing absolute
filenames.

>    Note that fixing this will not hurt existing tar users ... I doubt any do
>    things like:
>             tar cvf ... /something  (i.e., no "-P")
>    and then *count* on: tar xvf ... /something  *FAILING*.

Yes, but the reverse is true. People often do `tar cvfP archive
/something', and then expect `tar xf archive /something' to work.
   
> 
> Bug 2 (minor, misnamed keyword)
> 
>    (Background: the index file shows each file with a leading slash, even 
> without -P)

Tar 1.14 is almost 6 years old. Use a newer tar release: it has the
`--show-transformed-names' (alias `--show-stored-names') option which
instructs tar to display file names as stored in the archive.

For your information, the latest release of GNU tar is 1.22 and
1.23 will be released soon. The `--show-stored-names' first appeared
in tar 1.15.91, in mid-2006.

>    The "index-file" option is misnamed ...

That's true. I'd rather call it `--listing-file'.

>    I see three fixes:
> 
>       1. rename the option to list-of-processed-files 
>          (and quietly recognize "index-file" as a synonym for it)

I'll consider this, but `--list-of-processed-files' looks too long for
an option name.

>       2. have the index-file should contain the de-slashed names, and truly 
> be an index file.
>  
>       3. fix bug 1 above, which allows filenames from the current
>       index file

Instead of this, just download the recent tar version and use:

 tar --totals --show-stored-names --index-file=backup.index -cRf backup.tar /c

Regards,
Sergey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]