subcommand parameter cleanup
authorHuaxu Wan <huaxu.wan@intel.com>
Mon, 28 Nov 2011 13:14:53 +0000 (21:14 +0800)
committerHuaxu Wan <huaxu.wan@intel.com>
Mon, 28 Nov 2011 13:14:53 +0000 (21:14 +0800)
data/build.sh
data/packaging.sh

index b076dde..25e0724 100755 (executable)
@@ -1,13 +1,34 @@
 #!/bin/bash
+USAGE="usage:
+    tizenpkg build [target OBS project]
+Build package at remote build server, the default target OBS project
+is home:<user_id>:branches:Trunk
 
+options:
+    -h    print this info
+"
 
 die()
 {
     echo "Fatal Error:"
     echo "    " $1
+    echo "$USAGE"
     exit 
 }
 
+while :
+do
+    case $1 in
+        -h) echo "$USAGE"
+            exit
+            ;;
+        *) target_obsproject=$1
+            break
+            ;;
+    esac
+    shift
+done
+
 git branch -a|sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'|grep "release" > /dev/null 2>&1 || die "Please run this command under release branch"
 
 git status|grep "modified">/dev/null 2>&1 &&die "Please save you local changes before this command, eg git commit"
@@ -35,7 +56,7 @@ fi
 
 echo "Submiting your changes to build server"
 
-curl -s -i -u$user:$passwd -Fname=package.tar.bz2 -Ffile0=@package.tar.bz2 -Fjson='{"parameter": [{"name": "package.tar.bz2", "file": "file0"},{"name":"pkg", "value":"'$prj_name'"},{"name":"obsproject","value":"'$1'"}]}' -FSubmit=Build "$HUDSON_SERVER/job/build/build" 
+curl -s -i -u$user:$passwd -Fname=package.tar.bz2 -Ffile0=@package.tar.bz2 -Fjson='{"parameter": [{"name": "package.tar.bz2", "file": "file0"},{"name":"pkg", "value":"'$prj_name'"},{"name":"obsproject","value":"'$target_obsproject'"}]}' -FSubmit=Build "$HUDSON_SERVER/job/build/build" 
 
 sleep 0.5
 last_id=`curl -s -u$user:$passwd "$HUDSON_SERVER/job/build/lastBuild/buildNumber"`
index 4ab1611..fde2726 100755 (executable)
@@ -1,10 +1,9 @@
 #!/bin/bash
 
 USAGE="usage:
-    tizenpkg packaging <git object> [-s] [-f spec_file]
+    tizenpkg packaging <git object> [-s]
 options:
     -s    silence remove patch without question
-    -f    specify a spec file
     -h    print this info
 "