delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/27/11:47:09

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: ericblake AT comcast DOT net (Eric Blake)
To: Alan Hourihane <alanh AT fairlite DOT demon DOT co DOT uk>
Cc: cygwin AT cygwin DOT com
Subject: Re: tar 1.15.1 broken
Date: Thu, 27 Oct 2005 15:46:52 +0000
Message-Id: <102720051546.25478.4360F66C000A391D0000638622007456720A050E040D0C079D0A@comcast.net>

> 
> This works with tar 1.13.25
> 
> tar cvjf test.tbz2 <files> --exclude=<file>

Hmm, I agree that the behavior has changed, but am not yet sure
it is a bug.  I'll ask upstream if the change in behavior was intentional,
or whether it should be construed as a bug.

> 
> In 1.15.1 it mucks up parsing of --exclude=<file> and somehow later
> tries to stat "--exclude=<file>" as being the complete filename. But
> actually when it reports the "Cannot stat: No such file or directory"
> message the filename is correct.
> 
> Moving --exclude=<file> to this...
> 
> tar --exclude=<file> -cvjf test.tbz2 <files>
> 
> makes it work.

The info pages for 1.15 are more explicit - tar supports three types
of argument parsing - traditional, short, and long options.  Traditional
options use no dash, and must be the very first argument.  The
traditional options also have weird behavior; when using multiple
options that require an argument, such as f and b, the syntax is
"tar fb file blocking" (ie. the number of options that required an
argument consume that many more arguments).  If you are mixing
option types, then once the traditional options have been consumed,
the next argument must be a short or long option, otherwise all
remaining arguments are treated as filenames even if they look like
options.  The upshot of this is that:

tar cvjf test.tbz2 --exclude=<file> <files>

is different from

tar cvjf test.tbz2 <files> --exclude=<file>

Fixing your invocation to use long options followed by short
options instead of traditional options followed by long options
is an appropriate workaround.

--
Eric Blake



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019