aboutsummaryrefslogtreecommitdiff
path: root/Keywords
diff options
context:
space:
mode:
authorAntoine Brodin <antoine@FreeBSD.org>2014-09-01 17:06:19 +0000
committerAntoine Brodin <antoine@FreeBSD.org>2014-09-01 17:06:19 +0000
commit26222800aa8fb7588152c92e30e65bed37dee412 (patch)
tree30b9f411ae0f09270332ca8a1c3f95470871f870 /Keywords
parent0698010b197ecab3be625054343108cf95fdc2a8 (diff)
downloadports-26222800aa8fb7588152c92e30e65bed37dee412.tar.gz
ports-26222800aa8fb7588152c92e30e65bed37dee412.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
Notes
Notes: svn path=/head/; revision=366901
Diffstat (limited to 'Keywords')
-rw-r--r--Keywords/sample.ucl10
-rw-r--r--Keywords/sample.yaml10
2 files changed, 16 insertions, 4 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}"