]> git.mxchange.org Git - flightgear.git/commitdiff
don't move existing diff/tar.bz2 file away asking if it's ok to overwrite,
authormfranz <mfranz>
Tue, 6 Mar 2007 21:48:28 +0000 (21:48 +0000)
committermfranz <mfranz>
Tue, 6 Mar 2007 21:48:28 +0000 (21:48 +0000)
but rather copy the files to mktemp generated & guaranteed unique files
(don't worry, this is the last patch for today :-)

scripts/tools/fg-submit

index c9b9e7e599b8fe93527dd1aa7aa43a95213eba06..f113f6b6db811356041d43fb54b62d0237214c5b 100755 (executable)
@@ -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 ..."