pkg.sh: Fix chown and chmod lines in generated postinst #157
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/fix/20261027-pkg-sh-fix-chown-and-chmod-lines-in-generated-postinst"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
pkg.sh: Fix chown and chmod lines in generated postinst
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.