aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Keywords/sample.ucl10
-rw-r--r--Keywords/sample.yaml10
-rw-r--r--Mk/Scripts/check-stagedir.sh12
3 files changed, 25 insertions, 7 deletions
diff --git a/Keywords/sample.ucl b/Keywords/sample.ucl
index 6c9ac688bd0d..a1d7085dc24e 100644
--- a/Keywords/sample.ucl
+++ b/Keywords/sample.ucl
@@ -16,14 +16,20 @@
actions: [file]
post-install: <<EOD
- sample_file="%D/%@"
+ case "%@" in
+ /*) sample_file="%@" ;;
+ *) sample_file="%D/%@" ;;
+ esac
target_file="${sample_file%.sample}"
if ! [ -f "${target_file}" ]; then
/bin/cp -p "${sample_file}" "${target_file}"
fi
EOD
pre-deinstall: <<EOD
- sample_file="%D/%@"
+ case "%@" in
+ /*) sample_file="%@" ;;
+ *) sample_file="%D/%@" ;;
+ esac
target_file="${sample_file%.sample}"
if cmp -s "${target_file}" "${sample_file}"; then
rm -f "${target_file}"
diff --git a/Keywords/sample.yaml b/Keywords/sample.yaml
index 4d56793acca1..854320df7f07 100644
--- a/Keywords/sample.yaml
+++ b/Keywords/sample.yaml
@@ -16,13 +16,19 @@
actions: [file]
post-install: |
- sample_file="%D/%@"
+ case "%@" in
+ /*) sample_file="%@" ;;
+ *) sample_file="%D/%@" ;;
+ esac
target_file="${sample_file%.sample}"
if ! [ -f "${target_file}" ]; then
/bin/cp -p "${sample_file}" "${target_file}"
fi
pre-deinstall: |
- sample_file="%D/%@"
+ case "%@" in
+ /*) sample_file="%@" ;;
+ *) sample_file="%D/%@" ;;
+ esac
target_file="${sample_file%.sample}"
if cmp -s "${target_file}" "${sample_file}"; then
rm -f "${target_file}"
diff --git a/Mk/Scripts/check-stagedir.sh b/Mk/Scripts/check-stagedir.sh
index d7bb5f566f4c..092e38fa47b0 100644
--- a/Mk/Scripts/check-stagedir.sh
+++ b/Mk/Scripts/check-stagedir.sh
@@ -73,8 +73,16 @@ parse_plist() {
set -- $line
shift
# Ignore the actual file if it is in stagedir
+ case "$@" in
+ /*)
+ echo "@comment ${@%.sample}"
+ echo "${comment}$@"
+ ;;
+ *)
echo "@comment ${cwd}/${@%.sample}"
echo "${comment}${cwd}/$@"
+ ;;
+ esac
;;
# Handle [dirrmty] Keywords
@fc\ *|@fcfontsdir\ *|@fontsdir\ *)
@@ -234,13 +242,11 @@ setup_plist_seds() {
${sed_portdocsexamples} /^share\/licenses/d;"
sed_dirs_gen="s!${PREFIX}/!!g; ${sed_plist_sub} s,^,@dirrmtry ,; \
${sed_portdocsexamples} \
- s!@dirrmtry \(/.*\)!@unexec rmdir \"\1\" >/dev/null 2>\&1 || :!; \
/^@dirrmtry share\/licenses/d;"
# These prevent ignoring DOCS/EXAMPLES dirs with sed_portdocsexamples
sed_files="s!${PREFIX}/!!g; ${sed_plist_sub} /^share\/licenses/d;"
sed_dirs="s!${PREFIX}/!!g; ${sed_plist_sub} s,^,@dirrmtry ,; \
- s!@dirrmtry \(/.*\)!@unexec rmdir \"\1\" >/dev/null 2>\&1 || :!; \
/^@dirrmtry share\/licenses/d;"
}
@@ -334,7 +340,7 @@ check_invalid_directories_mtree() {
if [ "${PREFIX}" != "${LOCALBASE}" ]; then
case "${line}" in
"@dirrmtry info") continue ;;
- "@unexec rmdir \"${PREFIX}\" >/dev/null 2>&1 || :") continue ;;
+ "@dirrmtry ${PREFIX}") continue ;;
esac
fi
ret=1