summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authortnn <tnn>2015-03-09 15:50:18 +0000
committertnn <tnn>2015-03-09 15:50:18 +0000
commit0025b5f7a555374b78b72584579ea45f8326f28b (patch)
tree6b3f777ca1a34d3bd810a22174093e25e7cf5627 /mk
parentc078841b71bab1cdb4e6d6b4fdaae762c5053602 (diff)
downloadpkgsrc-0025b5f7a555374b78b72584579ea45f8326f28b.tar.gz
Use SITES.${_GITHUB_DEFAULT_DISTFILES} instead of ugly := assignment
to MASTER_SITES which could conceivably break some use cases. Also add comment in bsd.fetch-vars.mk.
Diffstat (limited to 'mk')
-rw-r--r--mk/fetch/bsd.fetch-vars.mk6
-rw-r--r--mk/fetch/github.mk14
2 files changed, 15 insertions, 5 deletions
diff --git a/mk/fetch/bsd.fetch-vars.mk b/mk/fetch/bsd.fetch-vars.mk
index 0eadd0b1776..0ffc2a4839c 100644
--- a/mk/fetch/bsd.fetch-vars.mk
+++ b/mk/fetch/bsd.fetch-vars.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.fetch-vars.mk,v 1.18 2015/03/07 21:14:32 tnn Exp $
+# $NetBSD: bsd.fetch-vars.mk,v 1.19 2015/03/09 15:50:18 tnn Exp $
#
# This Makefile fragment is included separately by bsd.pkg.mk and
# defines some variables which must be defined earlier than where
@@ -38,7 +38,9 @@ _SYS_VARS.fetch= DEFAULT_DISTFILES
_DISTDIR= ${DISTDIR}/${DIST_SUBDIR}
.if defined(DISTNAME) && !empty(DISTNAME)
. if defined(GITHUB_TAG) && !empty(GITHUB_TAG:M[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]*)
-# if the github tag is a git hash (7 or more hex digits), encode it in the distfile name
+# If the github tag is a git hash (7 or more hex digits), encode it in the
+# distfile name. It would be better to use ${_GITHUB_DEFAULT_DISTFILES} here,
+# but that gets assigned much later.
DEFAULT_DISTFILES= ${DISTNAME}-${GITHUB_TAG}${EXTRACT_SUFX}
. else
DEFAULT_DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
diff --git a/mk/fetch/github.mk b/mk/fetch/github.mk
index a1f1b57928d..042b04b10d1 100644
--- a/mk/fetch/github.mk
+++ b/mk/fetch/github.mk
@@ -1,4 +1,4 @@
-# $NetBSD: github.mk,v 1.6 2015/03/09 13:10:45 tnn Exp $
+# $NetBSD: github.mk,v 1.7 2015/03/09 15:50:18 tnn Exp $
#
# github.com master site handling
#
@@ -54,12 +54,20 @@ GITHUB_TYPE= tag
. endif
. endif
+. if defined(GITHUB_TAG) && !empty(GITHUB_TAG:M[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]*)
+# If the github tag is a git hash (7 or more hex digits), encode it in the
+# distfile name.
+_GITHUB_DEFAULT_DISTFILES= ${DISTNAME}-${GITHUB_TAG}${EXTRACT_SUFX}
+. else
+_GITHUB_DEFAULT_DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
+. endif
+
. if !empty(GITHUB_TYPE:Mrelease)
-MASTER_SITES:= ${MASTER_SITES:=${GITHUB_PROJECT}/releases/download/${GITHUB_RELEASE}/}
+SITES.${_GITHUB_DEFAULT_DISTFILES}= ${MASTER_SITES:=${GITHUB_PROJECT}/releases/download/${GITHUB_RELEASE}/}
. endif
. if !empty(GITHUB_TYPE:Mtag)
-MASTER_SITES:= -${MASTER_SITES:=${GITHUB_PROJECT}/archive/${GITHUB_TAG}${EXTRACT_SUFX}}
+SITES.${_GITHUB_DEFAULT_DISTFILES}= -${MASTER_SITES:=${GITHUB_PROJECT}/archive/${GITHUB_TAG}${EXTRACT_SUFX}}
. endif
.endif