diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2003-10-22 15:30:59 +0000 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2003-10-22 15:30:59 +0000 |
commit | 0e2747064dcaa71467ebd5cba8df56b1102d1e9c (patch) | |
tree | 44e4c38dc9267b3622bcd2c78ca20196a2f311de /scripts | |
parent | c68dbc731f073e0385d2f235f767dbda713b0806 (diff) | |
download | quilt-0e2747064dcaa71467ebd5cba8df56b1102d1e9c.tar.gz |
Never replace the series file; just replace its contents. This is
necessary if the series file is a symlink.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/patchfns.in | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/scripts/patchfns.in b/scripts/patchfns.in index 0de9c85..ccd5c42 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -140,12 +140,11 @@ change_db_strip_level() } { print } ' $SERIES > $tmpfile - if cmp $SERIES $tmpfile >/dev/null 2>/dev/null + if ! cmp $SERIES $tmpfile >/dev/null 2>/dev/null then - rm -f $tmpfile - else - mv -f $tmpfile $SERIES + cat $tmpfile > $SERIES fi + rm -f $tmpfile else return 1 fi @@ -190,13 +189,14 @@ insert_in_series() return 1 fi else - echo $patch$patch_args > $tmpfile + echo "$patch$patch_args" > $tmpfile if [ -e $SERIES ] then cat $SERIES >> $tmpfile fi fi - mv -f $tmpfile $SERIES + cat $tmpfile > $SERIES + rm -f $tmpfile } remove_from_series() @@ -208,13 +208,13 @@ remove_from_series() ! /^'"$(quote_re $patch)"'(|\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)/ \ { print } ' $SERIES > $tmpfile - if [ $? -eq 0 ] + if [ $? -ne 0 ] then - mv -f $tmpfile $SERIES - else rm -f $tmpfile return 1 fi + cat $tmpfile > $SERIES + rm -f $tmpfile } rename_in_series() @@ -230,13 +230,13 @@ rename_in_series() { print } END { exit(! good) } ' $SERIES > $tmpfile - if [ $? -eq 0 ] + if [ $? -ne 0 ] then - mv -f $tmpfile $SERIES - else rm -f $tmpfile return 1 fi + cat $tmpfile > $SERIES + rm -f $tmpfile } pc_file_name() |