[X2Go-Commits] [buildscripts] 01/01: bin/sbuild-deb-package: create source tarballs with upstream version name, not the limited git branch name.

git-admin at x2go.org git-admin at x2go.org
Fri Aug 17 16:30:11 CEST 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository buildscripts.

commit 9162ee47f002540c40047a94c52b069c2c194aff
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Fri Aug 17 16:30:03 2018 +0200

    bin/sbuild-deb-package: create source tarballs with upstream version name, not the limited git branch name.
---
 bin/sbuild-deb-package | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/sbuild-deb-package b/bin/sbuild-deb-package
index f49bf8b..e3d5f10 100755
--- a/bin/sbuild-deb-package
+++ b/bin/sbuild-deb-package
@@ -347,15 +347,17 @@ build_packages() {
 					# remove or replace it with something supported by git. We'll go for replacing it with an
 					# underscore character, because that sounds most sensible (keeps the string length intact
 					# and actually shows the substitution to observant readers).
-					#                                                                                    ┌ remove epoch  ┌ remove debian rev ┌ replace tilde characters with underscores
-					UPSTREAM_VERSION="$(dpkg-parsechangelog | grep 'Version:' | cut -d ' ' -f2 | sed -e 's/^.*://' -e 's/-[^-]*$//' -e 's/~/_/g')"
+					#                                                                                    ┌ remove epoch  ┌ remove debian rev
+					UPSTREAM_VERSION="$(dpkg-parsechangelog | grep 'Version:' | cut -d ' ' -f2 | sed -e 's/^.*://' -e 's/-[^-]*$//')"
+					#                                      ┌ replace tilde characters with underscores
+					typeset upstream_git_branch="$(sed -e 's/~/_/g' <<< "${UPSTREAM_VERSION}")"
 					REVISION="$(dpkg-parsechangelog | grep 'Version:' | cut -d ' ' -f2 | sed -e 's/.*-//')"
 
 					# Before actually running git archive, we'd better fetch the branch first, in case it's new.
 					# Failures to do so are fatal now.
-					git fetch origin "refs/heads/upstream/${UPSTREAM_VERSION}:refs/heads/upstream/${UPSTREAM_VERSION}"
+					git fetch origin "refs/heads/upstream/${upstream_git_branch}:refs/heads/upstream/${upstream_git_branch}"
 
-					git archive --prefix="${PROJECT}-${UPSTREAM_VERSION}/" -o "../${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" "upstream/${UPSTREAM_VERSION}" && {
+					git archive --prefix="${PROJECT}-${UPSTREAM_VERSION}/" -o "../${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" "upstream/${upstream_git_branch}" && {
 						SA_OPTION='--debbuildopts=-sa'
 					} || echo '1.0' > "debian/source/format"
 				}

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/buildscripts.git


More information about the x2go-commits mailing list