aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorMathieu Arnold <mat@FreeBSD.org>2018-03-01 12:58:53 +0000
committerMathieu Arnold <mat@FreeBSD.org>2018-03-01 12:58:53 +0000
commit60a2a2ca9d6a05d4ddb269e002b6d7131bd0bf21 (patch)
treed55eacd770eb9290b8acf684b805138ce7155ffe /Mk
parenta19dcac24720add1a8d6afc9b486dfe919993f7e (diff)
downloadports-60a2a2ca9d6a05d4ddb269e002b6d7131bd0bf21.tar.gz
ports-60a2a2ca9d6a05d4ddb269e002b6d7131bd0bf21.zip
Notes
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.sites.mk5
1 files changed, 4 insertions, 1 deletions
diff --git a/Mk/bsd.sites.mk b/Mk/bsd.sites.mk
index 6b1b18c75c38..d38a23b1845f 100644
--- a/Mk/bsd.sites.mk
+++ b/Mk/bsd.sites.mk
@@ -486,7 +486,10 @@ DISTFILES:= ${DISTFILES} ${DISTFILE_${_group}}:${_group}
MASTER_SITES:= ${MASTER_SITES} ${MASTER_SITE_GITHUB:S@%SUBDIR%@${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}/tar.gz/${GH_TAGNAME_${_group}}?dummy=/:${_group}@}
WRKSRC_${_group}:= ${WRKDIR}/${GH_PROJECT_${_group}}-${GH_TAGNAME_${_group}_EXTRACT}
. if !empty(GH_SUBDIR_${_group})
-_SITES_extract:= ${_SITES_extract} 690:post-extract-gh-${_group}
+# In order to sort the subdir extraction so that foo/bar is moved in before
+# foo/bar/baz, we count the number of / in the path and use it to order the
+# targets. This handles up to 9 levels. The max as of r463123 is 4.
+_SITES_extract:= ${_SITES_extract} 69${GH_SUBDIR_${_group}:C=[^/]+= =g:range:[-1]}:post-extract-gh-${_group}
post-extract-gh-${_group}:
@${RMDIR} ${WRKSRC}/${GH_SUBDIR_${_group}} 2>/dev/null || :
@${MKDIR} ${WRKSRC}/${GH_SUBDIR_${_group}:H} 2>/dev/null || :