[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

X Strike Force XFree86 SVN commit: r1748 - in trunk/debian: . local



Author: fabbione
Date: 2004-08-24 11:17:10 -0500 (Tue, 24 Aug 2004)
New Revision: 1748

Modified:
   trunk/debian/CHANGESETS
   trunk/debian/local/dexconf
Log:
Make dexconf survive when destination file does not exists yet.


Modified: trunk/debian/CHANGESETS
===================================================================
--- trunk/debian/CHANGESETS	2004-08-24 15:56:47 UTC (rev 1747)
+++ trunk/debian/CHANGESETS	2004-08-24 16:17:10 UTC (rev 1748)
@@ -433,6 +433,6 @@
   breakfast and still see the One True Upgrade Path!", or "You silly
   person, of *course* dpkg and apt accept 'Conflicts: (4.3.0.dfsg.1-4 <<)
   xserver-xfree86 (<< 4.3.0.dfsg.1-7)'!"
-    1746, 1747
+    1746, 1747, 1748
 
 vim:set ai et sts=4 sw=4 tw=80:

Modified: trunk/debian/local/dexconf
===================================================================
--- trunk/debian/local/dexconf	2004-08-24 15:56:47 UTC (rev 1747)
+++ trunk/debian/local/dexconf	2004-08-24 16:17:10 UTC (rev 1748)
@@ -444,18 +444,26 @@
   fi
 done
 
-# Ensure we can write to our destination.
-if [ ! -w "$XF86CONFIG" ]; then
-  bomb "unable to write to \"$XF86CONFIG\""
+# Ensure we can write to our destination if it already exits.
+if [ -e "$XF86CONFIG" ]; then
+  if [ ! -w "$XF86CONFIG" ]; then
+    bomb "unable to write to \"$XF86CONFIG\""
+  fi
 fi
 
-# Create a backup of the existing configuration file.
-cat "$XF86CONFIG" >"$DEXCONFTMPDIR/backup"
+BACKUP=
+# Create a backup of the existing configuration file if it already exists.
+if [ -e "$XF86CONFIG" ]; then
+  cat "$XF86CONFIG" >"$DEXCONFTMPDIR/backup"
+  BACKUP=true
+fi
 
 # Move the new file into place.
 if ! cat "$OUTFILE" >"$XF86CONFIG"; then
   # Failed; try to restore the backup.
-  cat "$DEXCONFTMPDIR/backup" >"$XF86CONFIG"
+  if [ -n "$BACKUP" ]; then
+    cat "$DEXCONFTMPDIR/backup" >"$XF86CONFIG"
+  fi
 fi
 
 rm -rf "$DEXCONFTMPDIR"



Reply to: