From: Mark Wielaard
Like commit f0a5819 for rpmbuild.at. In the case of rpmbuildid.at the
sed expression looked to work, but only matched by accident. Make the sed
regexp more strict by only matching a hex-string. And properly "escape"
[ and ] which inside an AT_CHECK should be [[ and ]].
Signed-off-by: Mark Wielaard
---
tests/rpmbuildid.at | 44 ++--
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/tests/rpmbuildid.at b/tests/rpmbuildid.at
index 15c0620..1c06ca1 100644
--- a/tests/rpmbuildid.at
+++ b/tests/rpmbuildid.at
@@ -97,7 +97,7 @@ main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from the main file
-id_main=$(file $main_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id_main=$(file $main_file | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
id_main_file="./usr/lib/debug/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_main_file" || echo "No build-id file $id_main_file"
@@ -120,7 +120,7 @@ debug_file=./usr/lib/debug/usr/local/bin/hello.debug
test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
-id_debug=$(file $debug_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id_debug=$(file $debug_file | sed 's/.*,
BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
test ${id_main} = ${id_debug} || echo "unequal main and debug id"
@@ -190,7 +190,7 @@ main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from the main file
-id_main=$(file $main_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id_main=$(file $main_file | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
id_main_file="./usr/lib/debug/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_main_file" || echo "No build-id file $id_main_file"
@@ -213,7 +213,7 @@ debug_file=./usr/lib/debug/usr/local/bin/hello-*.debug
test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
-id_debug=$(file $debug_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id_debug=$(file $debug_file | sed 's/.*,
BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
test ${id_main} = ${id_debug} || echo "unequal main and debug id"
@@ -283,7 +283,7 @@ main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from the main file
-id_main=$(file $main_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id_main=$(file $main_file | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
id_main_file="./usr/lib/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_main_file" || echo "No build-id file $id_main_file"
@@ -306,7 +306,7 @@ debug_file=./usr/lib/debug/usr/local/bin/hello.debug
test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
-id_debug=$(file $debug_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id_debug=$(file $debug_file | sed 's/.*,
BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
test ${id_main} = ${id_debug} || echo "unequal main and debug id"
@@ -375,7 +375,7 @@ main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from the main file
-id_main=$(file $main_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id_main=$(file $main_file | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
id_main_file="./usr/lib/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_main_file" || echo "No build-id file $id_main_file"
@@ -398,7 +398,7 @@ debug_file=./usr/lib/debug/usr/local/bin/hello-*.debug
test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
-id_debug=$(file $debug_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id_debug=$(file $debug_file | sed 's/.*,
BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
test ${id_main} = ${id_debug} || echo "unequal main and debug id"
@@ -469,7 +469,7 @@ main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from the main file
-id_main=$(file $main_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id_main=$(file $main_file | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
id_main_file="./usr/lib/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_main_file" || echo "No build-id file $id_main_file"
@@ -492,7 +492,7 @@ debug_file=./usr/lib/debug/usr/local/bin/hello.debug
test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
-id_debug=$(file $debug_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id_debug=$(file $debug_file | sed 's/.*,
BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
test ${id_main} = ${id_debug} || echo "unequal main and debug id"
@@ -574,7 +574,7 @@ main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from