aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-08-06 10:58:30 +0200
committerHarald Welte <laforge@gnumonks.org>2018-08-06 12:02:00 +0200
commitaef62b0c77a00e5cbb960fd4eb61c8e47db50d0b (patch)
tree70299b35bebbc901291a7fcaaa94dfb36bd5088e /scripts
parenteb844d933a691c152db061a5cd5768e9fa0c5711 (diff)
osmocom packages: Ensure PACKAGE_VERSION is set correctly
At the "autorecon -fi" stage, Osmocom programs either need the .git directory peresent, or a .tarball-version file in order to determine the exact source code version. Normally, "make dist" exists exactly for this purpose: It runs git-version-gen and saves the result to .tarball-version, and we then include this file in the .tar.gz we generate. However, as the nightly paackaging scripts use git-buildpackage, it bypasses the "make dist" logic and hence we need to 1) manually generate the .tarball-version file 2) copy it over to the directory specified as --git-export-dir This way, the .tarball-version is inside the tar.xz generated by gbp, and autoreconf then has something to use as PACKAGE_VERSION. This commit fixes "UNKNOWN-dirty" in .pc files of libraries, as well as in "show version" commands on the vty. Closes: OS#3449 Change-Id: I76e3713f0b01a6110091ff90e8e53aa79533c374
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/osmocom-latest-packages.sh5
-rwxr-xr-xscripts/osmocom-nightly-packages.sh10
2 files changed, 11 insertions, 4 deletions
diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh
index e8d61a3..3d4f340 100755
--- a/scripts/osmocom-latest-packages.sh
+++ b/scripts/osmocom-latest-packages.sh
@@ -34,7 +34,10 @@ build() {
git fetch
VER=$(git tag -l --sort=v:refname | grep "^[0-9]*.[0-9]*.[0-9]*$" | tail -n 1)
git checkout -f -B "$VER" "refs/tags/$VER"
- gbp buildpackage -d -S -uc -us "--git-export-dir=$output" "--git-debian-branch=$VER"
+ test -x ./git-version-gen && ./git-version-gen . > .tarball-version 2>/dev/null
+ gbp buildpackage -d -S -uc -us "--git-export-dir=$output" "--git-debian-branch=$VER" \
+ --git-ignore-new \
+ --git-postexport='cp $GBP_GIT_DIR/../.tarball-version $GBP_TMP_DIR/'
if [ ! -d "$TOP/$PROJ/$1" ] ; then
# creating a new package is different from using old ones
diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh
index b616a8f..0d1ce0f 100755
--- a/scripts/osmocom-nightly-packages.sh
+++ b/scripts/osmocom-nightly-packages.sh
@@ -42,8 +42,9 @@ get_commit_version() {
local version
local date
- # git version
- version=$(test -x ./git-version-gen && ./git-version-gen . 2>/dev/null)
+ # determine git version *and generate the .tarball-version file*
+ test -x ./git-version-gen && ./git-version-gen . > .tarball-version 2>/dev/null
+ version=$(cat .tarball-version)
# debian doesn't allow '-' in version.
version=$(echo "$version" | sed 's/-/./g' )
@@ -88,7 +89,10 @@ build() {
mkdir -p "$DATA/$name"
# source code build without dependency checks and unsigned source and unsigned change log
- gbp buildpackage -S -uc -us -d --git-ignore-branch "--git-export-dir=$DATA/$name" $gitbpargs
+ gbp buildpackage -S -uc -us -d --git-ignore-branch "--git-export-dir=$DATA/$name" \
+ --git-ignore-new \
+ --git-postexport='cp $GBP_GIT_DIR/../.tarball-version $GBP_TMP_DIR/' \
+ $gitbpargs
mv "$DATA/$name/"*.tar* "$DATA/$name/"*.dsc "$oscdir/"