diff options
author | mat <mat@FreeBSD.org> | 2017-12-16 16:53:07 +0800 |
---|---|---|
committer | mat <mat@FreeBSD.org> | 2017-12-16 16:53:07 +0800 |
commit | 81709df68249bf5d927b1935e29a53922e1c6a1a (patch) | |
tree | 00a1d15a94055fd89390529fa0ddcf775472d73e /Mk | |
parent | 3e9931f1b39d3bae9315b0d3ca2c8e2221200bcb (diff) | |
download | freebsd-ports-gnome-81709df68249bf5d927b1935e29a53922e1c6a1a.tar.gz freebsd-ports-gnome-81709df68249bf5d927b1935e29a53922e1c6a1a.tar.zst freebsd-ports-gnome-81709df68249bf5d927b1935e29a53922e1c6a1a.zip |
Fix a edge case in the fetch related targets.
This would have given an error when:
- The port uses DIST_SUBDIR
- That sub-directory does not exist
- The current user does not have permission to write in DISTDIR.
Something like:
$ sudo rmdir /usr/ports/distfiles/gallery2
$ make fetch-urlall-list
mkdir: /usr/ports/distfiles/gallery2: Permission denied
*** Error code 1
PR: 222819
Reported by: sunpoet
Sponsored by: Absolight
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/Scripts/do-fetch.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Mk/Scripts/do-fetch.sh b/Mk/Scripts/do-fetch.sh index 6b646c96a83c..6b1fba18dd1a 100644 --- a/Mk/Scripts/do-fetch.sh +++ b/Mk/Scripts/do-fetch.sh @@ -17,10 +17,14 @@ validate_env dp_DEVELOPER dp_DISABLE_SIZE dp_DISTDIR dp_DISTINFO_FILE \ set -u -if [ ! -d "${dp_DISTDIR}" ]; then - mkdir -p "${dp_DISTDIR}" -fi -cd "${dp_DISTDIR}" +case ${dp_TARGET} in + do-fetch|makesum) + if [ ! -d "${dp_DISTDIR}" ]; then + mkdir -p "${dp_DISTDIR}" + fi + cd "${dp_DISTDIR}" + ;; +esac for _file in "${@}"; do file=${_file%%:*} |