]> git.donarmstrong.com Git - bin.git/blobdiff - sign_and_upload_debian_r
change escape rules for sign_and_upload
[bin.git] / sign_and_upload_debian_r
index fa6215636d8c367346b2c01894505e03f14ece34..1475080745d4911241865815bf716031f3643169 100755 (executable)
@@ -1,14 +1,23 @@
 #!/bin/sh
 
 C2DEBMACHINE=ignes.vpn.donarmstrong.com
-if [ "x$(hostname)" == "xarchimedes" ]; then
+if [ "x$(hostname)" = "xarchimedes" ]; then
     C2DEBMACHINE="$(echo -n $C2DEBMACHINE|sed 's/vpn/int/')"
 fi;
 
 KEYID=9D05D0BE;
 
-ssh $C2DEBMACHINE 'find "$(ls -td ~/c2d/build_results*|head -n1)"' \
-    -type f -iname "'*.changes'"|xargs debsign -r $C2DEBMACHINE \
-    -k$KEYID; 
+if [ -z "$1" ]; then
+    BUILD_RESULTS="$(ssh $C2DEBMACHINE 'ls -td ~/c2d/build_results*|head -n1')"
+else
+    BUILD_RESULTS="$1"
+fi;
+
+
+ssh $C2DEBMACHINE find . -type f -iname '*.changes' -print0 \| \
+    perl -n0e '$b = $_; $b =~ s/.changes/.upload/; -e $b || print $_.qq(\0);' | \
+    xargs -0 debsign -r $C2DEBMACHINE  -k$KEYID;
 
-ssh $C2DEBMACHINE '(find "$(ls -td ~/c2d/build_results*|head -n1)" -type f -iname "*.changes"|xargs dupload --to debianr )'
+ssh $C2DEBMACHINE find . -type f -iname '*.changes' -print0 \| \
+    perl -n0e '$b = $_; $b =~ s/.changes/.upload/; -e $b || print $_.qq(\0);' \| \
+    xargs -0 dupload --to debianr;