Change in osmo-ci[master]: osmocom-nightly-packages: Ensure PACKAGE_VERSION is set correctly

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Aug 6 09:06:26 UTC 2018


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10343


Change subject: osmocom-nightly-packages: Ensure PACKAGE_VERSION is set correctly
......................................................................

osmocom-nightly-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
---
M scripts/osmocom-nightly-packages.sh
1 file changed, 4 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/43/10343/1

diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh
index b616a8f..320e376 100755
--- a/scripts/osmocom-nightly-packages.sh
+++ b/scripts/osmocom-nightly-packages.sh
@@ -42,8 +42,8 @@
   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*
+  version=$(test -x ./git-version-gen && ./git-version-gen . > .tarball-version 2>/dev/null)
   # debian doesn't allow '-' in version.
   version=$(echo "$version" | sed  's/-/./g' )
 
@@ -88,7 +88,8 @@
 
   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-postexport='cp $GBP_GIT_DIR/../.tarball-version $GBP_TMP_DIR/' $gitbpargs
 
   mv "$DATA/$name/"*.tar* "$DATA/$name/"*.dsc "$oscdir/"
 

-- 
To view, visit https://gerrit.osmocom.org/10343
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I76e3713f0b01a6110091ff90e8e53aa79533c374
Gerrit-Change-Number: 10343
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180806/53ea970e/attachment.htm>


More information about the gerrit-log mailing list