[rhel6-branch 1/2] Add productIsFinal variable (#740164)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This variable is set from .buildstamp.
---
 product.py           |   12 +++++++++---
 scripts/buildinstall |   12 ++++++++----
 scripts/mk-images    |   11 ++++++++++-
 3 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/product.py b/product.py
index 68df00c..896d0d4 100644
--- a/product.py
+++ b/product.py
@@ -40,13 +40,19 @@ if path is not None:
     f = open(path, "r")
     lines = f.readlines()
     del f
-    if len(lines) >= 3:
+    if len(lines) >= 4:
         productStamp = lines[0][:-1]
         productArch = productStamp[productStamp.index(".")+1:]
         productName = lines[1][:-1]
         productVersion = lines[2][:-1]
-    if len(lines) >= 4:
-        bugUrl = lines[3][:-1]
+
+        # set productIsFinal
+        isfinal = lines[3].strip().lower()
+        key, sep, isfinal = isfinal.partition("=")
+        productIsFinal = (key == "final" and isfinal == "yes")
+
+    if len(lines) >= 5:
+        bugUrl = lines[4][:-1]
 
 if os.environ.has_key("ANACONDA_PRODUCTNAME"):
     productName = os.environ["ANACONDA_PRODUCTNAME"]
diff --git a/scripts/buildinstall b/scripts/buildinstall
index efacfb5..ae28ccb 100755
--- a/scripts/buildinstall
+++ b/scripts/buildinstall
@@ -28,7 +28,7 @@ die() {
 }
 
 usage() {
-    echo "Usage: buildinstall --version <version> --brand <brand> --product <product> --release <comment> [--output outputdir] [--discs <discstring>] <root>" >&2
+    echo "Usage: buildinstall --version <version> --brand <brand> --product <product> --release <comment> --final [--output outputdir] [--discs <discstring>] <root>" >&2
     exit 1
 }
 
@@ -60,6 +60,10 @@ while [ $# -gt 0 ]; do
             RELEASESTR=$2
             shift; shift
         ;;
+        --final)
+            ISFINAL="--final"
+            shift
+        ;;
         --product)
             PRODUCTSTR=$2
             shift; shift
@@ -244,11 +248,11 @@ $MK_TREEINFO --family="$PRODUCTSTR" ${VARIANT:+--variant="$VARIANT"} --version=$
 
 # FIXME: need to update mk-images to take the yumconf
 echo "Making images: $PWD"
-echo $MK_IMAGES $DEBUGSTR $NOGRSTR --imgdir $TREEDIR/install --arch $BASEARCH --product "$PRODUCTSTR" --version $VERSION --bugurl "$BUGURL" --output $OUTPUT $yumconf
+echo $MK_IMAGES $DEBUGSTR $NOGRSTR --imgdir $TREEDIR/install --arch $BASEARCH --product "$PRODUCTSTR" --version $VERSION $ISFINAL --bugurl "$BUGURL" --output $OUTPUT $yumconf
 if [ -z "$DEBUGSTR" ]; then
-    $MK_IMAGES $DEBUGSTR $NOGRSTR --imgdir $TREEDIR/install --arch $BASEARCH --product "$PRODUCTSTR" --version $VERSION --bugurl "$BUGURL" --output $OUTPUT $yumconf || die "image creation failed"
+    $MK_IMAGES $DEBUGSTR $NOGRSTR --imgdir $TREEDIR/install --arch $BASEARCH --product "$PRODUCTSTR" --version $VERSION $ISFINAL --bugurl "$BUGURL" --output $OUTPUT $yumconf || die "image creation failed"
 else
-    /bin/sh -x $MK_IMAGES $DEBUGSTR $NOGRSTR --imgdir $TREEDIR/install --arch $BASEARCH --product "$PRODUCTSTR" --version $VERSION --bugurl "$BUGURL" --output $OUTPUT $yumconf || die "image creation failed"
+    /bin/sh -x $MK_IMAGES $DEBUGSTR $NOGRSTR --imgdir $TREEDIR/install --arch $BASEARCH --product "$PRODUCTSTR" --version $VERSION $ISFINAL --bugurl "$BUGURL" --output $OUTPUT $yumconf || die "image creation failed"
 fi
 
 echo "Writing .discinfo file"
diff --git a/scripts/mk-images b/scripts/mk-images
index 1f69959..a9f74a0 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -25,7 +25,7 @@ IMAGEUUID=$(date +%Y%m%d%H%M).$(uname -i)
 TMPDIR=${TMPDIR:-/tmp}
 
 usage () {
-    echo "usage: mk-images <pkgsrc> <toplevel> <template> <imgdir> <buildarch> <productname> <version> [<productpath>]"
+    echo "usage: mk-images <pkgsrc> <toplevel> <template> <imgdir> <buildarch> <productname> <version> <final> [<productpath>]"
     exit 0
 }
 
@@ -59,6 +59,10 @@ while [ $# -gt 0 ]; do
             VERSION=$2
             shift; shift
         ;;
+        --final)
+            ISFINAL="yes"
+            shift
+        ;;
         --bugurl)
             BUGURL=$2
             shift; shift
@@ -368,6 +372,11 @@ makeproductfile() {
     echo $IMAGEUUID > $root/.buildstamp
     echo $PRODUCT >> $root/.buildstamp
     echo $VERSION >> $root/.buildstamp
+    if [ -n "$ISFINAL" ]; then
+        echo "FINAL=YES" >> $root/.buildstamp
+    else
+        echo "FINAL=NO" >> $root/.buildstamp
+    fi
     if [ -n "$BUGURL" ]; then
         echo $BUGURL >> $root/.buildstamp
     fi
-- 
1.7.5.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux