#!/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 '$BUILD_RESULTS' -type f -iname '*.changes'" | \
+ xargs 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 '$BUILD_RESULTS' -type f -iname '*.changes'|xargs dupload --to debianr )"