aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2016-10-29 17:30:14 +0800
committermat <mat@FreeBSD.org>2016-10-29 17:30:14 +0800
commit2534dcae9401a97fe13103fd6c5ada5a75e88837 (patch)
tree206391c49d2d2e1ae3b991e829e691c2a24541ce /Mk
parentb2a7583055493029a7d0154e0d0238e135d2c59f (diff)
downloadfreebsd-ports-gnome-2534dcae9401a97fe13103fd6c5ada5a75e88837.tar.gz
freebsd-ports-gnome-2534dcae9401a97fe13103fd6c5ada5a75e88837.tar.zst
freebsd-ports-gnome-2534dcae9401a97fe13103fd6c5ada5a75e88837.zip
Fix file modes after extracting.
Some port's archives contains files modes that are a bit too restrictive for some usage. For example: BUILD_DEPENDS= ${NONEXISTENT}:foo/bar:configure When building as a regular user, dependencies are installed/built as root, so if the archive contains files that have a mode of, say, 600, they will not be readable by the port requesting the dependency. This will also fix broken distribution files where directories don't have the executable bit on. OSVERSION 1100077 is after base r283997: Change directory permissions in pre-order. In this order, it won't try to recurse into a directory for which it doesn't have permission, before changing that permission. This follows an existing behavior in other BSDs, linux, OS X. PR: 213574 Submitted by: mat Exp-run by: antoine Sponsored by: Absolight
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk12
1 files changed, 12 insertions, 0 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 5ae2a0b4e086..ae88477e3dd5 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -3830,6 +3830,17 @@ checksum: fetch
.endif
.endif
+# Some port's archives contains files modes that are a bit too restrictive for
+# some usage. For example:
+# BUILD_DEPENDS= ${NONEXISTENT}:foo/bar:configure
+# When building as a regular user, dependencies are installed/built as root, so
+# if the archive contains files that have a mode of, say, 600, they will not be
+# readable by the port requesting the dependency.
+# This will also fix broken distribution files where directories don't have the
+# executable bit on.
+extract-fixup-modes:
+ @${CHMOD} -R u+w,a+rX ${WRKDIR}
+
################################################################
# The special package-building targets
# You probably won't need to touch these
@@ -5201,6 +5212,7 @@ _EXTRACT_SEQ= 010:check-build-conflicts 050:extract-message 100:checksum \
150:extract-depends 190:clean-wrkdir 200:${EXTRACT_WRKDIR} \
300:pre-extract 450:pre-extract-script 500:do-extract \
700:post-extract 850:post-extract-script \
+ 999:extract-fixup-modes \
${_OPTIONS_extract} ${_USES_extract} ${_SITES_extract}
_PATCH_DEP= extract
_PATCH_SEQ= 050:ask-license 100:patch-message 150:patch-depends \