Commit 7e837649 authored by dann frazier's avatar dann frazier Committed by Tim Gardner

UBUNTU: [debian] Fix regression with ABI subversions and backport

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@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@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: default avatardann frazier <dann.frazier@canonical.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 806ba6e4
...@@ -61,11 +61,11 @@ ifeq ($(full_build),false) ...@@ -61,11 +61,11 @@ ifeq ($(full_build),false)
skipdbg=true skipdbg=true
endif endif
abinum := $(shell echo $(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) prev_abinum := $(shell echo $(prev_revision) | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)?$$/\1/')$(abi_suffix)
abi_release := $(release)-$(abinum) 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) ifneq ($(full_build),false)
uploadnum := $(uploadnum)-Ubuntu uploadnum := $(uploadnum)-Ubuntu
endif endif
......
...@@ -11,7 +11,7 @@ fi ...@@ -11,7 +11,7 @@ fi
ver=$1 ver=$1
revision=$2 revision=$2
abi=$(echo $revision | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$/\1/') abi=$(echo $revision | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)?$/\1/')
verabi=$ver-$abi verabi=$ver-$abi
verfull=$ver-$revision verfull=$ver-$revision
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment