On Sat, 2002-04-13 at 09:06, Brad Fritz wrote: > > On 13 Apr 2002 08:33:44 PDT Mike Noyes wrote: > > > Anyone, > > Is there a way to get tar to return the date of the most recent file in > > a tarball? > > > > Example: > > $ tar tvzf leaf/devel/ddouthitt/packages/cal.lrp > > -rwxr-xr-x root/root 9648 2001-12-17 06:42:08 usr/bin/cal > > -rw-r--r-- root/root 32 2001-12-17 06:42:21 > > var/lib/lrpkg/cal.list > > > > Desired output: 2001-12-17 > > If you can't get tar to tell you directly, > > tar tvfz $TARBALL_FILE \ > | awk '{print $4}' \ > | sort -n \ > | tail -n 1 > > might work for you.
Brad, Thanks. This works fairly well. I still get errors from tar, but I don't see any way to force it to ignore them. Examples: $ ./package-date.sh > test.txt tar: Archive contains future timestamp 2003-03-05 03:02:00 tar: Archive contains future timestamp 2003-03-03 15:12:22 tar: Archive contains future timestamp 2003-03-05 03:02:16 tar: Archive contains future timestamp 2003-03-03 13:47:49 tar: Archive contains future timestamp 2003-03-05 03:00:48 tar: Archive contains future timestamp 2003-03-05 03:00:30 tar: Archive contains future timestamp 2003-03-03 14:03:05 tar: Archive contains future timestamp 2003-03-03 14:03:02 tar: Archive contains future timestamp 2003-03-03 14:03:02 tar: Archive contains future timestamp 2003-03-03 14:03:05 tar: Archive contains future timestamp 2003-03-05 03:00:30 tar: Archive contains future timestamp 2003-03-05 03:00:48 tar: Archive contains future timestamp 2003-03-05 03:02:16 tar: Archive contains future timestamp 2003-03-05 03:02:00 gzip: stdin has more than one entry--rest ignored tar: Child returned status 2 tar: Error exit delayed from previous errors tar: Archive contains future timestamp 2021-02-15 20:53:31 tar: Archive contains future timestamp 2021-02-16 03:57:58 gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now tar: Archive contains future timestamp 2021-03-01 21:58:48 tar: Archive contains future timestamp 2021-03-01 21:58:48 tar: Child died with signal 11 tar: Error exit delayed from previous errors The current shell script is: #! /bin/bash find leaf/ -iname "*.lrp" | while read file ; do echo `basename "$file"` $'\t' \ `tar tvzf "$file" | awk '{print $4}' | sort -n | tail -n 1` $'\t' \ "$file"; done | sort This provides a nice tab delimited text file, and gives me a commit order. http://leaf.sourceforge.net/pub/packages/test.txt Now all I have to do is get the program name and version. Then determine the libc version with ldd. Jeff provided this snippet for checking the libc version with ldd. md ${package} cd ${package} gunzip ${packagelrppath} ldd `ls bin/* sbin/* usr/bin usr/sbin usr/local/bin usr/local/sbin` \ | grep -v ':$' | sort | uniq cd .. rm -R ${package} I'll have to take a look at each package to determine program name and version. var/lib/lrpkg/package.help var/lib/lrpkg/package.version Any suggestions for accomplishing these tasks are appreciated. Thanks again for the help. :-) -- Mike Noyes <[EMAIL PROTECTED]> http://sourceforge.net/users/mhnoyes/ http://leaf-project.org/ _______________________________________________ Leaf-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-devel