[X2Go-Commits] [buildscripts] 01/01: bin/sbuild-deb-package: replace tilde characters in upstream version with underscore characters.

git-admin at x2go.org git-admin at x2go.org
Sat Jun 30 23:10:49 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 0b22c59b083b85ee7ada98384ffb7646729f3b9a
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sat Jun 30 23:07:20 2018 +0200

    bin/sbuild-deb-package: replace tilde characters in upstream version with underscore characters.
    
    Git does not support tilde characters in branch names, since the tilde
    character is used to denote the commits Xth parent in a refspec.
---
 bin/sbuild-deb-package | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/bin/sbuild-deb-package b/bin/sbuild-deb-package
index 044cfd9..999f365 100755
--- a/bin/sbuild-deb-package
+++ b/bin/sbuild-deb-package
@@ -331,8 +331,15 @@ build_packages() {
 				SA_OPTION=""
 				test -f "debian/source/format" && grep -Eqs '^3.0.*\(quilt\)$' "debian/source/format" && {
 					git fetch origin upstream:upstream || true
-					#                                                                                    v remove epoch  v remove debian revision
-					UPSTREAM_VERSION="$(dpkg-parsechangelog | grep "Version:" | cut -d " " -f2 | sed -e 's/^.*://' -e 's/-[^-]*$//')"
+					# Short explanation for replacing tilde characters with underscores:
+					# Yes, they are legit characters in a version string, but that's where the fun ends.
+					# Since we expect the non-modified version to be available as a branch called "upstream/#{UPSTREAM_VERSION}"
+					# and git does not support the tilde character in the branch name, we will have to either
+					# 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')"
 					REVISION="$(dpkg-parsechangelog | grep "Version:" | cut -d " " -f2 | sed -e 's/.*-//')"
 					git archive --prefix="${PROJECT}-${UPSTREAM_VERSION}/" -o "../${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" "upstream/${UPSTREAM_VERSION}" && {
 						SA_OPTION="--debbuildopts=-sa"

--
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