feat: update skills

This commit is contained in:
2026-09-15 12:29:40 +08:00
parent 2783946cec
commit ca090cd7f2
6 changed files with 199 additions and 5 deletions
+4 -2
View File
@@ -87,8 +87,10 @@ if dpkg-deb --control "$package" "$control_dir" 2>/dev/null; then
for script in preinst postinst prerm postrm; do
if [[ -f "$control_dir/$script" ]]; then
found_scripts=true
mode=$(stat -c '%a' "$control_dir/$script")
if [[ $mode =~ .*[2367]$ ]]; then
# Use -x: octal last digit [2367] is "other write", so 755 (r-x) was
# reported as not executable. 644 still fails because it is not -x.
mode=$(stat -c '%a' "$control_dir/$script" 2>/dev/null || stat -f '%OLp' "$control_dir/$script")
if [[ -x "$control_dir/$script" ]]; then
echo "OK: $script mode $mode"
else
echo "FAIL: $script not executable (mode $mode)" >&2