From abc@anchorageinternet.org  Thu Oct 17 23:10:15 2002
Return-Path: <abc@anchorageinternet.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B9AA437B404
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 17 Oct 2002 23:10:15 -0700 (PDT)
Received: from groggy.anc.acsalaska.net (groggy.anc.acsalaska.net [208.151.119.232])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 36A6843E9E
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 17 Oct 2002 23:10:13 -0700 (PDT)
	(envelope-from abc@anchorageinternet.org)
Received: from en26.groggy.anc.acsalaska.net (root@printer [192.168.0.26])
	by groggy.anc.acsalaska.net (8.11.6/8.11.6) with ESMTP id g9I6A9Y18273
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 17 Oct 2002 22:10:09 -0800 (AKDT)
	(envelope-from abc@anchorageinternet.org)
Received: (from abc@localhost)
	by en26.groggy.anc.acsalaska.net (8.12.6/8.12.6) id g9I6AAoH000766
	for "Send-PR" <FreeBSD-gnats-submit@freebsd.org>; Fri, 18 Oct 2002 06:10:10 GMT
	(envelope-from abc@anchorageinternet.org)
Message-Id: <200210180610.g9I6AAoH000766@en26.groggy.anc.acsalaska.net>
Date: Fri, 18 Oct 2002 06:10:10 GMT
From: abc@anchorageinternet.org
To: "Send-PR" <FreeBSD-gnats-submit@freebsd.org>
Subject: tar (sort option)

>Number:         44196
>Category:       gnu
>Synopsis:       tar (sort option)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 17 23:20:01 PDT 2002
>Closed-Date:    Fri Oct 18 06:37:59 PDT 2002
>Last-Modified:  Sat Oct 19 05:40:01 PDT 2002
>Originator:     Joe Public
>Release:        i386 FreeBSD 4.7-RELEASE
>Organization:
no org
>Environment:
^^^^^^^^^^^^^^^^^^^^^^^^
>Description:
tar is LONG overdue for a sort option.
>How-To-Repeat:
find -s/xargs/tar is a kludge and doesn't
                preserve owner/perms nor empty directories.
>Fix:
dunno.
>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@ringlet.net>
To: abc@anchorageinternet.org
Cc: bug-followup@FreeBSD.org
Subject: Re: gnu/44196: tar (sort option)
Date: Fri, 18 Oct 2002 13:38:29 +0300

 On Fri, Oct 18, 2002 at 06:10:10AM +0000, abc@anchorageinternet.org wrote:
 > 
 > >Number:         44196
 > >Category:       gnu
 > >Synopsis:       tar (sort option)
 > >Originator:     Joe Public
 > >Release:        i386 FreeBSD 4.7-RELEASE
 > >Organization:
 > no org
 > >Environment:
 > ^^^^^^^^^^^^^^^^^^^^^^^^
 > >Description:
 > tar is LONG overdue for a sort option.
 > >How-To-Repeat:
 > find -s/xargs/tar is a kludge and doesn't
 > preserve owner/perms nor empty directories.
 
 What exactly is it that you are trying to do?  IMHO, tar(1) does a very
 good job of preserving file access attributes, when presented with the
 right command-line parameters..
 
 G'luck,
 Peter
 
 -- 
 Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
 PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 If you think this sentence is confusing, then change one pig.

From: abc@anchorageinternet.org
To: Peter Pentchev <roam@ringlet.net>
Cc:  
Subject: Re: gnu/44196: tar (sort option)
Date: Fri, 18 Oct 2002 11:57:39 GMT

 > > >Number:         44196
 > > >Category:       gnu
 > > >Synopsis:       tar (sort option)
 > > >Originator:     Joe Public
 > > >Release:        i386 FreeBSD 4.7-RELEASE
 > > >Organization:
 > > no org
 > > >Environment:
 > > ^^^^^^^^^^^^^^^^^^^^^^^^
 > > >Description:
 > > tar is LONG overdue for a sort option.
 > > >How-To-Repeat:
 > > find -s/xargs/tar is a kludge and doesn't
 > > preserve owner/perms nor empty directories.
 > 
 > What exactly is it that you are trying to do?  IMHO, tar(1) does a very
 > good job of preserving file access attributes, when presented with the
 > right command-line parameters..
 
 find -s "$I" ! -type d | xargs tar rvf "$I.tar" && \
 && gzip -f9 "$I.tar" && mv "$I.tar.gz" "$I.tgz" 
 
 this is the only way i know to create a *.tgz archive
 of a directory tree, and i am leaving out the "rm" to
 insure no pre-existing *.tar archive exists, since
 you are forced to use tar's "append" mode to
 accomplish such a task.
 
 i have heard that the order is not important in the
 past - but this is untrue.  creating sorted archives
 is important for many reasons.  some quickies i can
 think of off the top of my head are:
 
 1) makes finding files in the listing of archives easier/simpler.
 2) gives you a better idea of how far along an extraction is.
 3) in the case of archive corruption, it insures "order" to the
     point of corruption, which is important for say:
 
     a) you have "frames", or other sequence of files/images,
         if the archive corrupts, you would like to at least have
         and ordered set to the point of corruption.
     b) you create some new files, if the archive corrupts,
         you don't want them at the end of the archive, which
         is where they will be without sorting.  sorting ensures
         a higher likelihood that new files you created will be
         in the middle, ahead of the corruption in the archive.
  
 > G'luck,
 > Peter
 
 thank you.

From: Peter Pentchev <roam@ringlet.net>
To: abc@anchorageinternet.org
Cc: bug-followup@FreeBSD.org
Subject: Re: gnu/44196: tar (sort option)
Date: Fri, 18 Oct 2002 15:23:05 +0300

 On Fri, Oct 18, 2002 at 05:00:10AM -0700, abc@anchorageinternet.org wrote:
 >  > > >Number:         44196
 >  > > >Category:       gnu
 >  > > >Synopsis:       tar (sort option)
 >  > > >Originator:     Joe Public
 >  > > >Release:        i386 FreeBSD 4.7-RELEASE
 >  > > >Organization:
 >  > > no org
 >  > > >Environment:
 >  > > ^^^^^^^^^^^^^^^^^^^^^^^^
 >  > > >Description:
 >  > > tar is LONG overdue for a sort option.
 >  > > >How-To-Repeat:
 >  > > find -s/xargs/tar is a kludge and doesn't
 >  > > preserve owner/perms nor empty directories.
 >  >=20
 >  > What exactly is it that you are trying to do?  IMHO, tar(1) does a very
 >  > good job of preserving file access attributes, when presented with the
 >  > right command-line parameters..
 > =20
 >  find -s "$I" ! -type d | xargs tar rvf "$I.tar" && \
 >  && gzip -f9 "$I.tar" && mv "$I.tar.gz" "$I.tgz"=20
 > =20
 >  this is the only way i know to create a *.tgz archive
 >  of a directory tree, and i am leaving out the "rm" to
 >  insure no pre-existing *.tar archive exists, since
 >  you are forced to use tar's "append" mode to
 >  accomplish such a task.
 
 OK, then, how about tar(1)'s -T (or -I, or --files-from) option? :)
 Something like..
 
   find -s "$I" \! -type d > files.lst
   tar -czf "$I.tgz" -T files.lst
 
 Or, even a bit simpler, using the standard Unix convention that '-'
 as a file name means the standard input (or output, as appropriate):
 
   find -s "$I" \! -type d | tar -czf "$I.tgz" -T -
 
 Would that work for you?
 
 G'luck,
 Peter
 
 --=20
 Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
 PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 This sentence contains exactly threee erors.

From: abc@anchorageinternet.org
To: Peter Pentchev <roam@ringlet.net>
Cc:  
Subject: Re: gnu/44196: tar (sort option)
Date: Fri, 18 Oct 2002 13:23:33 GMT

 > >  > > >Number:         44196
 > >  > > >Category:       gnu
 > >  > > >Synopsis:       tar (sort option)
 > >  > > >Originator:     Joe Public
 > >  > > >Release:        i386 FreeBSD 4.7-RELEASE
 > >  > > >Organization:
 > >  > > no org
 > >  > > >Environment:
 > >  > > ^^^^^^^^^^^^^^^^^^^^^^^^
 > >  > > >Description:
 > >  > > tar is LONG overdue for a sort option.
 > >  > > >How-To-Repeat:
 > >  > > find -s/xargs/tar is a kludge and doesn't
 > >  > > preserve owner/perms nor empty directories.
 > >  > 
 > >  > What exactly is it that you are trying to do?  IMHO, tar(1) does a very
 > >  > good job of preserving file access attributes, when presented with the
 > >  > right command-line parameters..
 > >  
 > >  find -s "$I" ! -type d | xargs tar rvf "$I.tar" && \
 > >  && gzip -f9 "$I.tar" && mv "$I.tar.gz" "$I.tgz" 
 > >  
 > >  this is the only way i know to create a *.tgz archive
 > >  of a directory tree, and i am leaving out the "rm" to
 > >  insure no pre-existing *.tar archive exists, since
 > >  you are forced to use tar's "append" mode to
 > >  accomplish such a task.
 > 
 > OK, then, how about tar(1)'s -T (or -I, or --files-from) option? :)
 > Something like..
 > 
 >   find -s "$I" \! -type d > files.lst
 >   tar -czf "$I.tgz" -T files.lst
 > 
 > Or, even a bit simpler, using the standard Unix convention that '-'
 > as a file name means the standard input (or output, as appropriate):
 > 
 >   find -s "$I" \! -type d | tar -czf "$I.tgz" -T -
 > 
 > Would that work for you?
 > 
 > G'luck,
 > Peter
 
 -T !!!
 
 works great :) :) :)  thanks!
 i don't know how i missed that option.
 thank you, and i apologize for wasting your
 time on that ...  thanks.
State-Changed-From-To: open->closed 
State-Changed-By: roam 
State-Changed-When: Fri Oct 18 06:37:11 PDT 2002 
State-Changed-Why:  
The originator is satisfied with tar's -T option. 

Thanks for trying to make FreeBSD better by reporting what you considered 
a genuine problem! 

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

From: abc@anchorageinternet.org
To: Giorgos Keramidas <keramida@FreeBSD.org>
Cc:  
Subject: Re: gnu/44196: tar (sort option)
Date: Sat, 19 Oct 2002 12:01:18 GMT

 see end of email.  these solutions do not work as expected.
 so - i still say it is a fairly critical 'deficiency' bug
 in tar - that it cannot archive sorted files without an
 extensive command line as contained herein (and again,
 this method fails in the sense that owner/group/permission
 data gets lost, and also, empty directories are not saved),
 and that the ability to create a sorted archive are very
 important for the reasons cited herein.
 
 > >  > > >Number:         44196
 > >  > > >Category:       gnu
 > >  > > >Synopsis:       tar (sort option)
 > >  > > >Originator:     Joe Public
 > >  > > >Release:        i386 FreeBSD 4.7-RELEASE
 > >  > > >Organization:   no org
 > >  > > >Environment:
 > >  > > >Description:
 > >  > > tar is LONG overdue for a sort option.
 > >  > > >How-To-Repeat:
 > >  > > find -s/xargs/tar is a kludge and doesn't
 > >  > > preserve owner/perms nor empty directories.
 > >  >
 > >  > What exactly is it that you are trying to do?  IMHO, tar(1) does a very
 > >  > good job of preserving file access attributes, when presented with the
 > >  > right command-line parameters..
 > >
 > >     rm 2>&- "$I.tar; "find -s "$I" \! -type d | \
 > >     xargs tar rvf "$I.tar" && gzip -f9 "$I.tar" && \
 > >     mv "$I.tar.gz" "$I.tgz"
 > >
 > >  this is the only way i know to create a *.tgz archive
 > >  of a directory tree (you are forced to use tar's "append"
 > >  mode to accomplish such a task).  and as previously stated,
 > >  this method of using tar does not preserve owner/group/permissions,
 > >  and does not archive empty directories.
 >
 > OK, then, how about tar(1)'s -T (or -I, or --files-from) option? :)
 > Something like..
 >
 >   find -s "$I" \! -type d > files.lst
 >   tar -czf "$I.tgz" -T files.lst
 >
 > Or, even a bit simpler, using the standard Unix convention that '-'
 > as a file name means the standard input (or output, as appropriate):
 >
 >   find -s "$I" \! -type d | tar -czf "$I.tgz" -T -
 >
 > Would that work for you?
 >
 > G'luck,
 > Peter
 
 * -T !!!
 *
 * works great :) :) :)  thanks!
 * i don't know how i missed that option.
 * thank you, and i apologize for wasting your
 * time on that ...  thanks.
 
 actually - these solutions do not work.  upon
 testing these solutions, i have determined that:
 
 for some reason, tar(1) will not archive files in
 the sorted order passed to it by find(1).  tar(1)
 takes the files passed to it, and archives them
 in tar's own sense of order.
 
 * * *
 
 importance
 ----------
 i have heard that the order is not important in the
 past - but this is untrue.  creating sorted archives
 is important for many reasons.  some quickies i can
 think of off the top of my head are:
 
 1) makes finding files in the listing of archives easier/simpler.
 2) gives you a better idea of how far along an extraction is.
 3) in the case of archive corruption, it insures "order" to the
     point of corruption, which may be important, for example:
 
     a) you have "frames", or other sequence of files/images,
         if the archive corrupts, you would like to at least have
         an ordered set to the point of corruption.
 
     b) you create some new files - if the archive corrupts,
         you don't want them at the end of the archive, which
         is where they will be without sorting.  sorting ensures
         a higher likelihood that new files you created will be
         in the middle, ahead of the corruption in the archive.

From: Peter Pentchev <roam@ringlet.net>
To: abc@anchorageinternet.org
Cc: Giorgos Keramidas <keramida@FreeBSD.org>,
	bug-followup@FreeBSD.org, "Kerr, Greg" <greg@kerr1.com>,
	"Choudhury, Raj" <raj.choudhury@de.opel.com>
Subject: Re: gnu/44196: tar (sort option)
Date: Sat, 19 Oct 2002 15:37:37 +0300

 On Sat, Oct 19, 2002 at 12:01:18PM +0000, abc@anchorageinternet.org wrote:
 > see end of email.  these solutions do not work as expected.
 > so - i still say it is a fairly critical 'deficiency' bug
 > in tar - that it cannot archive sorted files without an
 > extensive command line as contained herein (and again,
 > this method fails in the sense that owner/group/permission
 > data gets lost, and also, empty directories are not saved),
 > and that the ability to create a sorted archive are very
 > important for the reasons cited herein.
 
 Owner/group info is preserved for the individual files, if you use
 tar's -p option on both archive creation and extraction.  It will not
 be preserved for the directories themselves, because you have not
 really asked tar to preserve it; this, along with the empty dirs
 problem, is solved by, once again, examining tar's available options
 and noticing the '-n' one, which tells it to not recurse into subdirs,
 but just add an archive entry for the directory itself.
 
 So, the next thing you might want to try is:
 
   find -s $dir | tar -cznspf $dir.tgz -T -
 
 ..and then using tar -xzpf $dir.tgz to extract it.
 
 Does this help?
 
 G'luck,
 Peter
 
 -- 
 Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
 PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 If you think this sentence is confusing, then change one pig.
>Unformatted:
