pkg.sh: Fix chown and chmod lines in generated postinst
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m57s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 5m11s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m34s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m48s
CI / Packaging test (push) Successful in 0s
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m57s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 5m11s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m34s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m48s
CI / Packaging test (push) Successful in 0s
The postinst generator looks up the install log line of each file with a regex grep on the file path, and the dots of the path match any character. When the grep returns several lines, milk_install_log_spec_attr() passes the extra lines through, so the emitted chown and chmod commands split across lines, dpkg -i reports errors for the fragments, and the owner and mode of the file are not applied. Match the end of the log line against the file path literally and take the first match. The install log line ends in the file path, but may carry a build prefix before it, so the literal comparison of the tail of the line selects exactly the line of the file, for plain and %config entries alike. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.4.0 Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
88b5d668a8
commit
97cc7fbecd
1 changed files with 5 additions and 1 deletions
|
|
@ -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"`
|
||||
|
|
|
|||
Loading…
Reference in a new issue