Change in osmo-ci[master]: osmocom 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 11:41:29 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10343 )

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

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
---
M scripts/osmocom-latest-packages.sh
M scripts/osmocom-nightly-packages.sh
2 files changed, 11 insertions(+), 4 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



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 @@
   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 @@
   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 @@
 
   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/"
 

-- 
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: merged
Gerrit-Change-Id: I76e3713f0b01a6110091ff90e8e53aa79533c374
Gerrit-Change-Number: 10343
Gerrit-PatchSet: 4
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180806/07b44f1a/attachment.htm>


More information about the gerrit-log mailing list