pass CVS tag through to internal myplc build
authorMark Huang <mlhuang@cs.princeton.edu>
Mon, 24 Jul 2006 19:35:36 +0000 (19:35 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Mon, 24 Jul 2006 19:35:36 +0000 (19:35 +0000)
build.functions
build.sh
build_devel.sh
myplc.spec

index a842d37..edc6b95 100644 (file)
@@ -6,7 +6,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: build.functions,v 1.1 2006/07/17 21:31:31 mlhuang Exp $
+# $Id: build.functions,v 1.2 2006/07/24 19:32:23 mlhuang Exp $
 #
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
@@ -34,6 +34,9 @@ PLC_DEVEL_FEDORA_URL=file:///usr/share/mirrors/fedora
 # Build myplc inside myplc-devel
 PLC_DEVEL_BOOTSTRAP=true
 
+# Source tag to use for initial import of sources into local CVS
+TAG=planetlab-$(date +%Y-%m-%d)
+
 # We may be running inside a myplc-devel environment, which can
 # override these defaults. Specifically, whether to build myplc inside
 # myplc-devel (PLC_DEVEL_BOOTSTRAP).
@@ -43,16 +46,17 @@ fi
 
 usage()
 {
-    echo "Usage: build.sh [OPTION]..."
+    echo "Usage: $0 [OPTION]..."
     echo "     -l url          Fedora mirror location (default: $PLC_DEVEL_FEDORA_URL)"
     echo "     -r release      Fedora release number (default: $PLC_DEVEL_FEDORA_RELEASE)"
     echo "     -a arch         Fedora architecture (default: $PLC_DEVEL_FEDORA_ARCH)"
+    echo "     -t tag          Source tag (default: $TAG)"
     echo "     -h              This message"
     exit 1
 }
 
 # Get options
-while getopts "l:r:a:h" opt ; do
+while getopts "l:r:a:t:h" opt ; do
     case $opt in
        l)
            PLC_DEVEL_FEDORA_URL=$OPTARG
@@ -63,6 +67,9 @@ while getopts "l:r:a:h" opt ; do
        a)
            PLC_DEVEL_FEDORA_ARCH=$OPTARG
            ;;
+       t)
+           TAG=$OPTARG
+           ;;
        h|*)
            usage
            ;;
index 8b3c731..5520aee 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -14,7 +14,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: build.sh,v 1.26 2006/07/18 20:06:51 mlhuang Exp $
+# $Id: build.sh,v 1.27 2006/07/24 19:32:23 mlhuang Exp $
 #
 
 . build.functions
@@ -51,8 +51,8 @@ service plc start
 plc-config --category=plc_devel --variable=bootstrap --value="false" --save
 service plc reload
 cd /
-cvs -d /cvs checkout build
-make -C /build myplc
+cvs -d /cvs checkout -r $TAG build
+make TAG=$TAG -C /build myplc
 EOF
 
     # Yoink the image that was just built
index ff27981..4e9a8b3 100755 (executable)
@@ -14,7 +14,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: build_devel.sh,v 1.1 2006/07/17 21:31:31 mlhuang Exp $
+# $Id: build_devel.sh,v 1.2 2006/07/24 19:32:23 mlhuang Exp $
 #
 
 . build.functions
@@ -40,8 +40,7 @@ for dir in * ; do
        else
            ignore="-I !"
        fi
-       date=$(date +%Y-%m-%d)
-       cvs -d $cvsroot import -m "Initial import" -ko $ignore $dir planetlab planetlab-$date
+       cvs -d $cvsroot import -m "Initial import" -ko $ignore $dir planetlab $TAG
        popd
     fi
 done
index 1616004..fcc9a46 100644 (file)
@@ -39,8 +39,8 @@ source code, and all the tools necessary to compile it.
 
 %build
 pushd myplc
-./build_devel.sh
-./build.sh
+./build_devel.sh %{?cvstag:-t %{cvstag}}
+./build.sh %{?cvstag:-t %{cvstag}}
 popd
 
 %install