Fix tarball script on yatei and/or `tar u`
GNU tar 1.20 contains a yet unconfirmed 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.