Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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 --exclude= 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= and somehow later > tries to stat "--exclude=" 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= to this... > > tar --exclude= -cvjf test.tbz2 > > 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= is different from tar cvjf test.tbz2 --exclude= 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/