Partial work on deps.
[cdist.git] / vmbuild
diff --git a/vmbuild b/vmbuild
index 1906c426435b02c1215cd84af8510759f3b29e65..3e6cec9570b71f622741cb6fda13b60463d4ac68 100755 (executable)
--- a/vmbuild
+++ b/vmbuild
@@ -6,21 +6,24 @@ if [ "$1" == "" -o "$2" == "" ]; then
     exit 1
 fi
 
-IFS='-' read distro version bits <<< $1
+target=$1
+
+IFS='-' read distro version bits <<< $target
 
 checkout=$2
 output=$3
 
-if [ "$bits" == "32" ]; then
-    port=2000
-elif [ "$bits" == "64" ]; then
-    port=2001
-else
+case $target in
+fedora-22-32) port=2000;;
+fedora-22-64) port=2001;;
+fedora-23-32) port=2002;;
+fedora-23-64) port=2003;;
+*)
     echo "Unrecognised bit depth $bits"
     exit 1
-fi
+esac
 
-nohup vboxheadless --startvm fedora-22-$bits &
+nohup vboxheadless --startvm $target &
 vbox=$!
 sleep 10
 ssh -p $port carl@localhost "rm -rf fedora-*"
@@ -30,7 +33,7 @@ if [ "$output" != "" ]; then
     echo "copy from vm to $output..."
     tmp=/var/tmp/copy.$$
     mkdir -p $tmp
-    scp -P $port carl@localhost:fedora-22-$bits/* $tmp/
+    scp -P $port carl@localhost:$target/* $tmp/
     scp $tmp/*.rpm $output/
     rm -rf $tmp
 fi