Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Oct 2002 05:30:03 -0700 (PDT)
From:      Peter Pentchev <roam@ringlet.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: gnu/44196: tar (sort option)
Message-ID:  <200210181230.g9ICU3Jp049475@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR gnu/44196; it has been noted by GNATS.

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.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210181230.g9ICU3Jp049475>