summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2017-03-03 23:51:13 +0100
committerPanu Matilainen <pmatilai@redhat.com>2017-10-26 10:40:47 +0300
commit0af7ce8fc60f9ea42c34f409b2c22c40a7162bc2 (patch)
treef561e2fb07131419d80b8f042c2bbc8b63a99cd3
parentdeb6436828a6f87330bbc0ea5d9f9aacbc300136 (diff)
downloadrpm-0af7ce8fc60f9ea42c34f409b2c22c40a7162bc2.tar.gz
tests/tpmbuild.at: Make file sed regexp more strict to extract BuildID.
In some testcases we extract the BuildID with the file command. Unfortunately the file command output changed slightly between versions. Make the sed regexp more strict by only matching a hex-string. Also properly "escape" [ and ] which inside an AT_CHECK should be [[ and ]]. Tested against file versions 5.11, 5.29 and 5.30. Signed-off-by: Mark Wielaard <mark@klomp.org> Backported from commit f0a581925ad4c948dc58cc8f9a55399ad8de351e
-rw-r--r--tests/rpmbuild.at10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
index 1531700e1..33c201227 100644
--- a/tests/rpmbuild.at
+++ b/tests/rpmbuild.at
@@ -411,14 +411,14 @@ test -f ./usr/lib/debug/.dwz/hello2-1.0-1.* || exit 1
# linking them to the debug packages.
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello2-1.0-1.*.rpm \
| cpio -diu
-id1=$(file ./usr/local/bin/hello | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
-id2=$(file ./usr/local/bin/hello2 | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id1=$(file ./usr/local/bin/hello | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
+id2=$(file ./usr/local/bin/hello2 | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
id1debug=$(file ./usr/lib/debug/usr/local/bin/hello.debug \
- | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+ | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
id2debug=$(file ./usr/lib/debug/usr/local/bin/hello2.debug \
- | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+ | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
idmulti=$(file ./usr/lib/debug/.dwz/hello2-1.0-1.* \
- | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+ | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
test "$id1" = "$id1debug" || exit 1
test "$id2" = "$id2debug" || exit 1