1
0
Fork 0

don't move existing diff/tar.bz2 file away asking if it's ok to overwrite,

but rather copy the files to mktemp generated & guaranteed unique files
(don't worry, this is the last patch for today :-)
This commit is contained in:
mfranz 2007-03-06 21:48:28 +00:00
parent d719f7ac63
commit 9a1d1e389a

View file

@ -61,13 +61,13 @@ function diffstat {
# create temporary dir that's automatcally removed on exit
TMP=$(mktemp -d /tmp/$SELF.$AIRCRAFT.XXXXXX) || (echo "$0: can't create temporary dir"; exit 1)
TMP=$(mktemp -d -t $SELF.$AIRCRAFT.XXX) || (echo "$0: can't create temporary dir"; exit 1)
trap "rm -rf $TMP" 0 1 2 3 13 15
# move older archive or diff file out of the way
[ -f $DIFF ] && mv -i $DIFF $DIFF~
[ -f $ARCHIVE ] && mv -i $ARCHIVE $ARCHIVE~
[ -f $DIFF ] && mv $DIFF $(mktemp $DIFF.X)
[ -f $ARCHIVE ] && mv $ARCHIVE $(mktemp $ARCHIVE.X)
LOG "updating and checking for changed and new files ..."