Переглянути джерело

build-version: read VERSION from file, too

Previously, the version file's name was supposed to be the version number, too.
This change allows version files to be named "branch_version", for example, as
the actual version number gets pulled from the file.
Helge Jung 9 роки тому
батько
коміт
5f8eda0a3f
1 змінених файлів з 2 додано та 0 видалено
  1. 2 0
      build-version.sh

+ 2 - 0
build-version.sh

@@ -13,11 +13,13 @@ versionfile="${MY_DIR}/versions/${version}"
 
 base=`awk 'BEGIN { FS="=" } /^GLUON=([a-f0-9]+)(\s*#.+)?$/ { print $2; }' $versionfile | awk 'BEGIN { FS="#" } { print $1; }'`
 branch=`awk 'BEGIN { FS="=" } /^BRANCH=([a-z]+)$/ { print $2; }' $versionfile`
+version=`awk 'BEGIN { FS="=" } /^VERSION=([0-9\.\-+~a-z]+)$/ { print $2; }' $versionfile`
 site=`awk 'BEGIN { FS="=" } /^SITE=([a-f0-9]+)(\s*#.+)?$/ { print $2; }' $versionfile | awk 'BEGIN { FS="#" } { print $1; }'`
 ts=`awk 'BEGIN { FS="=" } /^TS=.+$/ { print $2; }' $versionfile`
 
 [ -z "$base" ] && abort "Failed to parse Gluon base commit-id from version file."
 [ -z "$branch" ] && abort "Failed to parse branch name from version file."
+[ -z "$version" ] && abort "Failed to parse version from version file."
 [ -z "$site" ] && abort "Failed to parse site repo commit-id from version file."
 [ -z "$ts" ] && abort "Failed to parse timestamp from version file."