From nobody@FreeBSD.org  Sat Dec 29 20:03:25 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ECF0416A418
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 29 Dec 2007 20:03:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id DB22213C43E
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 29 Dec 2007 20:03:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id lBTK2hdV037478
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 29 Dec 2007 20:02:43 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id lBTK2h95037477;
	Sat, 29 Dec 2007 20:02:43 GMT
	(envelope-from nobody)
Message-Id: <200712292002.lBTK2h95037477@www.freebsd.org>
Date: Sat, 29 Dec 2007 20:02:43 GMT
From: Volker Theile <votdev@gmx.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: tar does not compress whole dirs in FreeBSD 6.3RC1 as it does in 6.2
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         119141
>Category:       bin
>Synopsis:       bsdtar(1): tar does not compress whole dirs in FreeBSD 6.3RC1 as it does in 6.2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kientzle
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 29 20:10:01 UTC 2007
>Closed-Date:    Fri Sep 05 05:47:11 UTC 2008
>Last-Modified:  Fri Sep 05 05:47:11 UTC 2008
>Originator:     Volker Theile
>Release:        FreeBSD6.3RC1
>Organization:
FreeNAS
>Environment:
>Description:
Compressing a whole directory creates different archives on FreeBSD 6.3RC1 and 6.2. On 6.3 a directory called '.' is created in the archive which contains the dirrctory structure i wanted to be compressed originally.

FreeBSD6.2# tar -c -v -f - -C /usr/share/zoneinfo/ . | gzip -cv > /tmp/zoneinfo.tgz
a .
a Africa
a America
a Antarctica
a Arctic
a Asia
..
a Africa/Harare
a Africa/Ceuta
 85.7%

FreeBSD6.3# tar -c -v -f - -C /usr/share/zoneinfo/ . | gzip -cv > /tmp/zoneinfo.tgz
a ./.
a ./Africa
a ./America
a ./Antarctica
a ./Arctic
a ./Asia
..
a ./Africa/Harare
a ./Africa/Ceuta
 85.7%

>How-To-Repeat:
Execute the following command:

tar -c -v -f - -C /usr/share/zoneinfo/ . | gzip -cv > /tmp/zoneinfo.tgz

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->tkientzle 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Dec 29 20:15:10 UTC 2007 
Responsible-Changed-Why:  
Assign to tar maintainer.  Note to submitter: in what sense 
is this a "critical" bug? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119141 
Responsible-Changed-From-To: tkientzle->kientzle 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Dec 29 20:24:01 UTC 2007 
Responsible-Changed-Why:  
Correct user name 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119141 

From: Tim Kientzle <kientzle@freebsd.org>
To: bug-followup@freebsd.org, votdev@gmx.de
Cc:  
Subject: Re: bin/119141: tar does not compress whole dirs in FreeBSD 6.3RC1
 as it does in 6.2
Date: Sat, 29 Dec 2007 16:13:40 -0800

 This was changed deliberately.
 
 tar now removes leading "./" from files being archived;
 this shortens file names slightly, which allows slightly
 longer paths to be stored without requiring pax extensions,
 which in turn improves portability of the resulting
 archives.
 
 Since "./file" and "file" are semantically the same,
 this should not cause any problems.  Note that tar
 is also more intelligent now about filename matching,
 in particular, attempting to extract "./file" will match
 "file" in the archive itself (or vice-versa, of course).
 
 If this change does introduce problems, please let me
 know the usage in which that problem occurs; I'll certainly
 consider changing it back in the 6_STABLE series if
 it causes problems.

From: Tim Kientzle <kientzle@freebsd.org>
To: bug-followup@freebsd.org, votdev@gmx.de
Cc:  
Subject: Re: bin/119141: tar does not compress whole dirs in FreeBSD 6.3RC1
 as it does in 6.2
Date: Sat, 29 Dec 2007 17:05:05 -0800

 My apologies; ignore my previous message.  That message
 explained why 6.2 did strip "./" but not why 6.3 no longer
 does so.  <sigh>
 
 bsdtar no longer strips leading "./" because it caused
 a lot of confusion for people that were interchanging
 archives between e.g., GNU tar and bsdtar.  A number of
 scripts extracted specific files using command lines of
 the form:
     tar -xf archive.tgz ./dir/filename
 
 These scripts broke if bsdtar wrote the entries without
 the leading './' since the filename matching at extract
 time would see a different archive.
 
 I hope this explains the change.  Again, if this is
 a critical problem, please let me know and I'll consider
 changing it back in 6_STABLE.
 
 Tim Kientzle
 

From: "Volker Theile" <votdev@gmx.de>
To: Tim Kientzle <kientzle@freebsd.org>, bug-followup@freebsd.org
Cc:  
Subject: Re: bin/119141: tar does not compress whole dirs in FreeBSD 6.3RC1 as
 it does in 6.2
Date: Tue, 01 Jan 2008 15:15:59 +0100

 Hi,
 
 this makes sense. But on the other side many people using bsdtar expect a archive with striped "./". So way not adding a switch to let the user choose which type of archive he wants to get. The swicth maybe called --gtar-comp or so.
 
 Regards
 Volker
 
 -------- Original-Nachricht --------
 > Datum: Sat, 29 Dec 2007 17:05:05 -0800
 > Von: Tim Kientzle <kientzle@freebsd.org>
 > An: bug-followup@freebsd.org, votdev@gmx.de
 > Betreff: Re: bin/119141: tar does not compress whole dirs in FreeBSD 6.3RC1 as it does in 6.2
 
 > My apologies; ignore my previous message.  That message
 > explained why 6.2 did strip "./" but not why 6.3 no longer
 > does so.  <sigh>
 > 
 > bsdtar no longer strips leading "./" because it caused
 > a lot of confusion for people that were interchanging
 > archives between e.g., GNU tar and bsdtar.  A number of
 > scripts extracted specific files using command lines of
 > the form:
 >     tar -xf archive.tgz ./dir/filename
 > 
 > These scripts broke if bsdtar wrote the entries without
 > the leading './' since the filename matching at extract
 > time would see a different archive.
 > 
 > I hope this explains the change.  Again, if this is
 > a critical problem, please let me know and I'll consider
 > changing it back in 6_STABLE.
 > 
 > Tim Kientzle
 
 -- 
 GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
 Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/119141: commit references a PR
Date: Mon, 18 Aug 2008 04:59:12 +0000 (UTC)

 kientzle    2008-08-18 04:58:54 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.bin/tar          matching.c 
   Log:
   SVN rev 181821 on 2008-08-18 04:58:54Z by kientzle
   
   Strip leading "./" or ".//" from patterns and filenames
   so that "./foo" matches "foo" (and vice versa).
   
   This is related to PR bin/119141.
   
   PR:             bin/119141
   MFC after:      4 days
   
   Revision  Changes    Path
   1.15      +39 -3     src/usr.bin/tar/matching.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: kientzle 
State-Changed-When: Fri Sep 5 05:43:43 UTC 2008 
State-Changed-Why:  
I do not intend to change this behavior now. 
It may have been a mistake to make this change between 6.2 and 6.3, 
but it would be a worse mistake to change it back between 6.3 and 6.4 
and then have it change again for people who move from 6.4 to 7.x. 
(I intend to keep the current behavior for 7-STABLE and future.) 
I have made some minor changes to how pattern-matching works so that 
the same patterns can be used for either style.  That should 
make this less troublesome for people. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119141 
>Unformatted:
