bin/sign: More care with replacing the old publish directory.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 5 Sep 2011 09:17:55 +0000 (10:17 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 5 Sep 2011 09:17:55 +0000 (10:17 +0100)
Don't delete the old backup or try to rename if there isn't a good newer
version.  It'll fail, and clobber the only good version we have.

bin/sign

index 5e75ea9..833c2a1 100755 (executable)
--- a/bin/sign
+++ b/bin/sign
@@ -73,7 +73,9 @@ rm publish.new/hosts.list
 run_gpg --export --armor -o publish.new/ca-gnupg.asc
 
 ## Done.
-rm -rf publish.old
-mv publish publish.old
+if [ -d publish ]; then
+  rm -rf publish.old
+  mv publish publish.old
+fi
 mv publish.new publish
 rm -rf publish.old