diff --git a/scripts/pkg.sh b/scripts/pkg.sh index 77536a9d..88c042f1 100644 --- a/scripts/pkg.sh +++ b/scripts/pkg.sh @@ -1088,7 +1088,11 @@ cmd_milk_install_log() file=`echo /$file | sed 's/inst-root\///; s%^//*%/%'` #echo file is now \"$file\" >&2 #echo grep \"$prefix/*$file$\" $in >&2 - line=`grep $file$ $in` + # match the end of the log line against + # the file path literally; the line may + # carry a prefix before the path, and a + # regex grep lets dots match other lines + line=`awk -v f="$file" '{ if (substr($0, length($0) - length(f) + 1) == f) print }' $in | head -n 1` perm=`milk_install_log_spec_attr 1 "$line"` owner=`milk_install_log_spec_attr 2 "$line"` group=`milk_install_log_spec_attr 3 "$line"`