Make package error check safe for "/" inside the package string
authorMichael Prokop <mika@grml.org>
Fri, 19 Jun 2015 08:40:10 +0000 (10:40 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 19 Jun 2015 08:40:10 +0000 (10:40 +0200)
Otherwise for something like linux-base/squeeze-backports
and initramfs-tools/squeeze-backports it will fail with:

|  * Missing packages found, generating junit report.
| awk: line 1: syntax error at or near {
| awk: line 1: syntax error at or near {

grml-live

index ccef89f..6d02701 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -809,7 +809,7 @@ else
 <testsuite name="grml-live-missing-packages" tests="${package_count}" time="1" failures="${package_errors}" errors="${package_errors}" skipped="0" assertions="0">
 EOF
 
-  for package in $(awk '{print $1}' "${CHECKLOG}/package_errors.log") ; do
+  for package in $(awk '{print $1}' "${CHECKLOG}/package_errors.log" | sed 's;/;\\/;') ; do
     failure_reason="$(awk "/$package/ {print \$2}" "${CHECKLOG}/package_errors.log")"
     cat >> "${REPORT_MISSING_PACKAGES}" << EOF
   <testcase name="test_missing_packages_${package}" time="0" assertions="0">