aboutsummaryrefslogtreecommitdiffstats
path: root/Keywords/sample.ucl
diff options
context:
space:
mode:
authorantoine <antoine@FreeBSD.org>2014-09-02 01:06:19 +0800
committerantoine <antoine@FreeBSD.org>2014-09-02 01:06:19 +0800
commite44e200e66d70c8ac399c7fdfe36b029482fd6f1 (patch)
tree30b9f411ae0f09270332ca8a1c3f95470871f870 /Keywords/sample.ucl
parentd7a45dba15aa14e693a6e4d4c52b048451f3ccd0 (diff)
downloadfreebsd-ports-gnome-e44e200e66d70c8ac399c7fdfe36b029482fd6f1.tar.gz
freebsd-ports-gnome-e44e200e66d70c8ac399c7fdfe36b029482fd6f1.tar.zst
freebsd-ports-gnome-e44e200e66d70c8ac399c7fdfe36b029482fd6f1.zip
- Make it possible to use sample keyword with a full path
- Prefer @dirrmtry over @unexec rmdir in makeplist Differential Revision: https://reviews.freebsd.org/D705 Reviewed by: bapt With hat: portmgr
Diffstat (limited to 'Keywords/sample.ucl')
-rw-r--r--Keywords/sample.ucl10
1 files changed, 8 insertions, 2 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}"