aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pantyukhin <sat@FreeBSD.org>2006-09-03 15:23:03 +0000
committerAndrew Pantyukhin <sat@FreeBSD.org>2006-09-03 15:23:03 +0000
commitaa5fbade3d32342af28d235f3a5190b884b4610c (patch)
tree1288edb1dc97daf0ae903e6b7ec6b8d06c98b028
parente6f344844d5399f1b5f0e9dd67df8700f919a0da (diff)
The following functional changes were made to bsd.sites.mk:
* MASTER_SITES variable can now look like MACRO1/subdir1 MACRO2/subdir2, and be expanded in a way that you expect it to, that is apply different subdirs to different sites. You can safely replace ${M_S_FOO:S/%SUBDIR%/bar/} with FOO/bar. * If M_S_SUBDIR is unset, a macro in M_S won't set it anymore, but rather substitute %SUBDIR% all by itself. Now it's possible to use macros with different default subdirs and they will expand in a proper way.
Notes
Notes: svn path=/head/; revision=172060
-rw-r--r--CHANGES13
-rw-r--r--Mk/bsd.sites.mk21
2 files changed, 29 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index aa2e5d54ed5f..1734b595f4c8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,19 @@ in the release notes.
All ports committers are allowed to commit to this file.
+20060903:
+AUTHOR: sat@FreeBSD.org
+The following functional changes were made to bsd.sites.mk:
+
+ * MASTER_SITES variable can now look like MACRO1/subdir1 MACRO2/subdir2, and
+ be expanded in a way that you expect it to, that is apply different subdirs
+ to different sites. You can safely replace ${M_S_FOO:S/%SUBDIR%/bar/} with
+ FOO/bar.
+
+ * If M_S_SUBDIR is unset, a macro in M_S won't set it anymore, but rather
+ substitute %SUBDIR% all by itself. Now it's possible to use macros with
+ different default subdirs and they will expand in a proper way.
+
20060805:
AUTHOR: sat@FreeBSD.org
The following functional changes were made to bsd.sites.mk:
diff --git a/Mk/bsd.sites.mk b/Mk/bsd.sites.mk
index a727fd5a15d0..3bb88bcccf6f 100644
--- a/Mk/bsd.sites.mk
+++ b/Mk/bsd.sites.mk
@@ -1294,15 +1294,22 @@ MASTER_SITES_SUBDIRS= \
SOURCEFORGE:${PORTNAME:L} \
SOURCEFORGE_EXTENDED:${PORTNAME:L}
-.if defined(MASTER_SITES) && ${MASTER_SITES:N*/*}
+.if defined(MASTER_SITES) && ${MASTER_SITES:N*\:/*}
.for _site__ in ${MASTER_SITES}
_site_=${_site__}
-. if ${_site_:M*/*}
+. if ${_site_:M*\:/*}
MASTER_SITES_EXP+= ${_site_}
MASTER_SITES_EXP:= ${MASTER_SITES_EXP}
. else
-_site_url_= ${_site_:C@^(.*):[^/:]+$@\1@}
+_site_urlpath_= ${_site_:C@^(.*):[^/:]+$@\1@}
+. if ${_site_urlpath_:M*/*}
+_site_url_= ${_site_urlpath_:C@^([^/]+)/.*$@\1@}
+_site_subdir_= ${_site_urlpath_:S/^${_site_urlpath_:C@^([^/]+)/.*$@\1@}//:S!^/!!:S!/$!!}
+. else
+_site_url_= ${_site_urlpath_}
+.undef _site_subdir_
+. endif
_site_group_= ${_site_:S/^${_site_:C@^(.*):[^/:]+$@\1@}//:S/^://}
. for _abbrev_ in ${MASTER_SITES_ABBREVS}
. if ${_site_url_} == ${_abbrev_:C/:.*//}
@@ -1310,12 +1317,16 @@ _site_url_= ${_abbrev_:C/.*://}
. endif
. endfor
. for _subdir_ in ${MASTER_SITES_SUBDIRS}
-. if ${_site_url_} == ${_subdir_:C/:.*//}
-MASTER_SITE_SUBDIR?= ${_subdir_:C/.*://}
+. if ${_site_url_} == ${_subdir_:C/:.*//} && !defined(MASTER_SITE_SUBDIR)
+_site_subdir_?= ${_subdir_:C/.*://}
. endif
. endfor
. ifdef MASTER_SITE_${_site_url_}
+. ifdef _site_subdir_
+MASTER_SITES_EXP+= ${MASTER_SITE_${_site_url_}:S^%SUBDIR%^${_site_subdir_}^:S/$/:${_site_group_}/:S/:$//}
+. else
MASTER_SITES_EXP+= ${MASTER_SITE_${_site_url_}:S/$/:${_site_group_}/:S/:$//}
+. endif
MASTER_SITES_EXP:= ${MASTER_SITES_EXP}
. endif
. endif