[precise/master-next 2/3] UBUNTU: [debian] Fix regression with ABI subversions and backport
Andy Whitcroft
apw at canonical.com
Mon Aug 5 08:37:34 UTC 2019
From: dann frazier <dann.frazier at canonical.com>
Tim pointed out that 443b5814ee77f8c9083079ce0e6a0806e087630f broke the parsing
of backport versions, such as 8.13~14.10+ppa.1. This should fix it. I used the
following script to validate the regular expressions:
dannf at fluid:~$ cat test.sh
set -e
splitver() {
local ver="$1"
local abinum="$(echo $ver | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)?$/\1/')"
local uploadnum="$(echo $ver | sed -r -e 's/[^\+~]*\.([^\.~]+)(~.*)?(\+.*)?$/\1/')"
echo "$abinum $uploadnum"
}
do_test() {
local ver="$1"
local expected="$2"
local actual="$(splitver $ver)"
if [ "$actual" = "$expected" ]; then
echo "PASS: $ver"
return 0
fi
echo "FAIL: $ver split as $actual"
return 1
}
do_test "33.58" "33 58"
do_test "33.59.58" "33.59 58"
do_test "8.13~14.10" "8 13"
do_test "8.13~14.10+ppa.1" "8 13"
do_test "8.13.99~14.10+ppa.3" "8.13 99"
dannf at fluid:~$ ./test.sh
PASS: 33.58
PASS: 33.59.58
PASS: 8.13~14.10
PASS: 8.13~14.10+ppa.1
PASS: 8.13.99~14.10+ppa.3
Signed-off-by: dann frazier <dann.frazier at canonical.com>
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
[apw at canonical.com: drop getabis changes as that has separately been
backported wholesale.]
BugLink: http://bugs.launchpad.net/bugs/1838610
Signed-off-by: Andy Whitcroft <apw at canonical.com>
---
debian/rules.d/0-common-vars.mk | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
index 1fd6daffcb02..701639f58e01 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -70,11 +70,11 @@ ifeq ($(full_build),false)
skipdbg=true
endif
-abinum := $(shell echo $(revision) | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$$/\1/')$(abi_suffix)
-prev_abinum := $(shell echo $(prev_revision) | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$$/\1/')$(abi_suffix)
+abinum := $(shell echo $(revision) | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)?$$/\1/')$(abi_suffix)
+prev_abinum := $(shell echo $(prev_revision) | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)?$$/\1/')$(abi_suffix)
abi_release := $(release)-$(abinum)
-uploadnum := $(shell echo $(revision) | sed -r -e 's/[^\+]*\.([^\.]+(\+.*)?$$)/\1/')
+uploadnum := $(shell echo $(revision) | sed -r -e 's/[^\+~]*\.([^\.~]+)(~.*)?(\+.*)?$$/\1/')
ifneq ($(full_build),false)
uploadnum := $(uploadnum)-Ubuntu
endif
--
2.20.1
More information about the kernel-team
mailing list