Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Dec 2017 08:53:07 +0000 (UTC)
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r456460 - head/Mk/Scripts
Message-ID:  <201712160853.vBG8r7KR086136@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mat
Date: Sat Dec 16 08:53:07 2017
New Revision: 456460
URL: https://svnweb.freebsd.org/changeset/ports/456460

Log:
  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

Modified:
  head/Mk/Scripts/do-fetch.sh   (contents, props changed)

Modified: head/Mk/Scripts/do-fetch.sh
==============================================================================
--- head/Mk/Scripts/do-fetch.sh	Sat Dec 16 08:37:17 2017	(r456459)
+++ head/Mk/Scripts/do-fetch.sh	Sat Dec 16 08:53:07 2017	(r456460)
@@ -17,10 +17,14 @@ validate_env dp_DEVELOPER dp_DISABLE_SIZE dp_DISTDIR d
 
 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%%:*}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712160853.vBG8r7KR086136>