[tor-bugs] #3234 [Metrics Data Processor]: Fix tarball script on yatei and/or `tar u`

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Thu May 19 09:46:08 UTC 2011


#3234: Fix tarball script on yatei and/or `tar u`
------------------------------------+---------------------------------------
 Reporter:  karsten                 |          Owner:  karsten
     Type:  defect                  |         Status:  new    
 Priority:  normal                  |      Milestone:         
Component:  Metrics Data Processor  |        Version:         
 Keywords:                          |         Parent:         
   Points:                          |   Actualpoints:         
------------------------------------+---------------------------------------
 GNU tar 1.20 contains a yet unconfirmed [http://lists.gnu.org/archive/html
 /bug-tar/2011-03/msg00018.html bug] that ignores files if the archive
 modification time is greater than or equal to the folder modification
 time.

 Unfortunately, this breaks our tarball script on yatei that attempts to
 update an existing tarball using `tar u`:

 {{{
 for (( i = 0 ; i < ${#TARBALLS[@]} ; i++ )); do
   if [ -f ${TARBALLS[$i]}.tar ]; then
     echo `date` "Updating" ${TARBALLS[$i]}'.tar'
     tar uhf ${TARBALLS[$i]}.tar ${TARBALLS[$i]}
   else
     echo `date` "Creating" ${TARBALLS[$i]}'.tar'
     tar chf ${TARBALLS[$i]}.tar ${TARBALLS[$i]}
   fi
 done
 }}}

 I thought that a workaround would be to touch the folder before calling
 `tar u` on it, but that does not work for contained subdirectories.  Now,
 I could use `find` to touch all contained subdirectories, but this seems
 like a really ugly workaround.

 Is there a better workaround?  Or should we look into GNU tar and fix the
 problem there---even though getting no response to the bug report isn't
 really encouraging.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/3234>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list