pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
mk/*-package.mk: detect obsolete variable definitions
Module Name: pkgsrc-wip
Committed By: Roland Illig <rillig%NetBSD.org@localhost>
Pushed By: rillig
Date: Sat Mar 3 18:05:36 2018 +0000
Changeset: b67b83075a26b82e4b562ff68984e1cfb427e0db
Modified Files:
mk/cvs-package.mk
mk/fossil-package.mk
mk/git-package.mk
mk/hg-package.mk
mk/svn-package.mk
Log Message:
mk/*-package.mk: detect obsolete variable definitions
To help packages in non-public pkgsrc repositories, provide warnings
instead of silently changing variable names. These warnings will turn
into errors soon.
Finish the migration from *_MODULE to *_EXTRACTDIR.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=b67b83075a26b82e4b562ff68984e1cfb427e0db
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
mk/cvs-package.mk | 2 ++
mk/fossil-package.mk | 15 ++++++++++++++-
mk/git-package.mk | 7 ++++++-
mk/hg-package.mk | 39 ++++++++++++++++++++++-----------------
mk/svn-package.mk | 20 ++++++++++++++------
5 files changed, 58 insertions(+), 25 deletions(-)
diffs:
diff --git a/mk/cvs-package.mk b/mk/cvs-package.mk
index c729f50602..ef0452fed0 100644
--- a/mk/cvs-package.mk
+++ b/mk/cvs-package.mk
@@ -227,6 +227,7 @@ do-cvs-extract: .PHONY
# Debug info for show-all and show-all-cvs
_VARGROUPS+= cvs
+_USER_VARS.cvs+= CHECKOUT_DATE
_PKG_VARS.cvs+= CVS_ROOT CVS_MODULE CVS_TAG CHECKOUT_DATE CVS_EXTRACTDIR CVS_REPOSITORIES
_SYS_VARS.cvs+= DISTFILES PKGNAME PKGREVISION WRKSRC
_SYS_VARS.cvs+= CVS_ROOT_GNU CVS_ROOT_NONGNU CVS_ROOT_SOURCEFORGE CVS_PROJECT
@@ -239,3 +240,4 @@ _PKG_VARS.cvs+= ${varbase}.${repo}
_SYS_VARS.cvs+= ${varbase}.${repo}
. endfor
.endfor
+_USE_VARS.cvs+= DISTNAME
diff --git a/mk/fossil-package.mk b/mk/fossil-package.mk
index 7d21278547..cb307b166c 100644
--- a/mk/fossil-package.mk
+++ b/mk/fossil-package.mk
@@ -74,7 +74,7 @@ PKGREVISION?= ${${DATE} -u +'%Y%m%d':L:sh}
.if defined(FOSSIL_REPO)
FOSSIL_REPOSITORIES+= default
FOSSIL_REPO.default= ${FOSSIL_REPO}
-FOSSIL_EXTRACTDIR.default= ${DISTNAME:C,-[0-9].*,,}
+FOSSIL_EXTRACTDIR.default= ${DISTNAME:U${PKGNAME}:C,-[0-9].*,,}
. if defined(FOSSIL_VERSION)
FOSSIL_VERSION.default= ${FOSSIL_VERSION}
. endif
@@ -90,6 +90,17 @@ PKG_FAIL_REASON+= "[fossil-package.mk] FOSSIL_REPOSITORIES must be set."
. if empty(FOSSIL_REPO.${repo})
PKG_FAIL_REASON+= "[fossil-package.mk] FOSSIL_REPO."${repo:Q}" must be set."
. endif
+. for varbase in FOSSIL_BRANCH FOSSIL_REVISION FOSSIL_TAG # To be removed after 2019-01-01
+. if defined(${varbase}.${repo})
+WARNINGS+= "[fossil-package.mk] ${varbase}.* is obsolete; use FOSSIL_VERSION.${repo} instead."
+FOSSIL_VERSION.${repo}?= ${${varbase}.${repo}}
+. endif
+. endfor
+. for varbase in FOSSIL_ENV # To be removed after 2019-01-01
+. if defined(${varbase}.${repo})
+WARNINGS+= "[fossil-package.mk] ${varbase}.* is obsolete."
+. endif
+. endfor
.endfor
USE_TOOLS+= date pax
@@ -151,6 +162,7 @@ do-fossil-extract: .PHONY
# Debug info for show-all and show-all-fossil
_VARGROUPS+= fossil
+_USER_VARS.fossil+= CHECKOUT_DATE
_PKG_VARS.fossil+= FOSSIL_REPO FOSSIL_EXTRACTDIR FOSSIL_VERSION FOSSIL_REPOSITORIES
_SYS_VARS.fossil+= DISTFILES PKGREVISION WRKSRC
_SYS_VARS.fossil+= _FOSSIL_DISTDIR
@@ -162,3 +174,4 @@ _PKG_VARS.fossil+= ${varbase}.${repo}
_SYS_VARS.fossil+= ${varbase}.${repo}
. endfor
.endfor
+_USE_VARS.fossil+= DISTNAME PKGNAME
diff --git a/mk/git-package.mk b/mk/git-package.mk
index 7ffd4cec72..7932bb99a5 100644
--- a/mk/git-package.mk
+++ b/mk/git-package.mk
@@ -114,7 +114,11 @@ PKG_FAIL_REASON+= "[git-package.mk] GIT_REPOSITORIES must be set."
.for repo in ${GIT_REPOSITORIES}
. if empty(GIT_REPO.${repo})
-PKG_FAIL_REASON+= "[git-package.mk] GIT_REPO."${repo:Q}" must be set."
+WARNINGS+= "[git-package.mk] GIT_REPO."${repo:Q}" must be set."
+. endif
+. if defined(GIT_MODULE.${repo}) # To be removed after 2019-01-01
+WARNINGS+= "[git-package.mk] GIT_MODULE.* is obsolete; use GIT_EXTRACTDIR.${repo} instead."
+GIT_EXTRACTDIR.${repo}?= ${GIT_MODULE.${repo}}
. endif
.endfor
@@ -228,6 +232,7 @@ do-git-extract: .PHONY
# Debug info for show-all and show-all-git
_VARGROUPS+= git
+_USER_VARS.git+= CHECKOUT_DATE
_PKG_VARS.git= GIT_REPOSITORIES
_PKG_VARS.git+= GIT_REPO GIT_EXTRACTDIR GIT_BRANCH GIT_REVISION GIT_TAG GIT_ENV
_SYS_VARS.git= DISTFILES PKGREVISION WRKSRC
diff --git a/mk/hg-package.mk b/mk/hg-package.mk
index d52c1927ef..0448f54783 100644
--- a/mk/hg-package.mk
+++ b/mk/hg-package.mk
@@ -57,11 +57,11 @@ PKGREVISION?= ${_HG_PKGVERSION:S/.//g}
# The common case of a single repository
.if defined(HG_REPO)
-HG_MODULE?= ${HG_REPO:S,/$,,:T}
+HG_EXTRACTDIR?= ${HG_REPO:S,/$,,:T}
HG_REPOSITORIES+= default
HG_REPO.default= ${HG_REPO}
-HG_MODULE.default= ${HG_MODULE}
-WRKSRC?= ${WRKDIR}/${HG_MODULE}
+HG_EXTRACTDIR.default= ${HG_EXTRACTDIR}
+WRKSRC?= ${WRKDIR}/${HG_EXTRACTDIR}
.endif
HG_REPOSITORIES?= # none
@@ -71,7 +71,11 @@ PKG_FAIL_REASON+= "[hg-package.mk] HG_REPOSITORIES must be set."
.for repo in ${HG_REPOSITORIES}
. if empty(HG_REPO.${repo})
-PKG_FAIL_REASON+= "[hg-package.mk] HG_REPO."${repo:Q}" must be set."
+WARNINGS+= "[hg-package.mk] HG_REPO."${repo:Q}" must be set."
+. endif
+. if defined(HG_MODULE.${repo}) # To be removed after 2019-01-01
+WARNINGS+= "[hg-package.mk] HG_MODULE is obsolete; use HG_EXTRACTDIR.${repo} instead."
+HG_EXTRACTDIR.${repo}?= ${HG_MODULE.${repo}}
. endif
.endfor
@@ -91,7 +95,7 @@ _HG_DISTDIR?= ${DISTDIR}/hg-packages
#
.for repo in ${HG_REPOSITORIES}
-HG_MODULE.${repo}?= ${repo}
+HG_EXTRACTDIR.${repo}?= ${repo}
# determine appropriate checkout date or tag
. if defined(HG_TAG.${repo})
@@ -115,7 +119,7 @@ _HG_DISTFILE.${repo}= ${PKGBASE}-${repo}-${_HG_TAG.${repo}}.tar.gz
# Define the shell variables used by the following commands
_HG_CMD.vars.${repo}= \
repo=${HG_REPO.${repo}:Q}; \
- module=${HG_MODULE.${repo}:Q}; \
+ extractdir=${HG_EXTRACTDIR.${repo}:Q}; \
archive=${_HG_DISTDIR}/${_HG_DISTFILE.${repo}:Q}
# Extract the cached archive
@@ -127,23 +131,23 @@ _HG_CMD.extract_archive.${repo}= \
fi
_HG_CMD.checkout.${repo}= \
- ${STEP_MSG} "Checking out $$module from $$repo."; \
- ${_HG_CMD} clone ${_HG_FLAGS} "$$repo" "$$module"; \
- ${_HG_CMD} --cwd "$$module" update ${_HG_FLAGS} ${_HG_TAG_FLAG.${repo}:Q}
+ ${STEP_MSG} "Checking out $$extractdir from $$repo."; \
+ ${_HG_CMD} clone ${_HG_FLAGS} "$$repo" "$$extractdir"; \
+ ${_HG_CMD} --cwd "$$extractdir" update ${_HG_FLAGS} ${_HG_TAG_FLAG.${repo}:Q}
# Create the cached archive from the checked out repository
_HG_CMD.create_archive.${repo}= \
${STEP_MSG} "Creating cached Mercurial archive $${archive\#\#*/}."; \
${MKDIR} "$${archive%/*}"; \
- pax -w "$$module" | gzip > "$$archive.tmp"; \
+ pax -w "$$extractdir" | gzip > "$$archive.tmp"; \
${MV} "$$archive.tmp" "$$archive"
.endfor
hg-cleandir: .PHONY
.for repo in ${HG_REPOSITORIES}
${RUN} cd ${WRKDIR}; \
- if [ -d ${HG_MODULE.${repo}:Q} ]; then \
- cd ${HG_MODULE.${repo}:Q} && rm -rf *; \
+ if [ -d ${HG_EXTRACTDIR.${repo}:Q} ]; then \
+ cd ${HG_EXTRACTDIR.${repo}:Q} && rm -rf *; \
fi
.endfor
${RUN} cd ${WRKDIR} && rm -f .*_done && rm -rf .cwrapper
@@ -155,12 +159,12 @@ do-hg-extract: .PHONY
${RUN} \
cd ${WRKDIR}; \
${_HG_CMD.vars.${repo}}; \
- if [ ! -d "$$module/.hg" ]; then \
+ if [ ! -d "$$extractdir/.hg" ]; then \
${_HG_CMD.extract_archive.${repo}}; \
${_HG_CMD.checkout.${repo}}; \
${_HG_CMD.create_archive.${repo}}; \
else \
- cd "$$module"; \
+ cd "$$extractdir"; \
${_HG_CMD} pull ${_HG_FLAGS}; \
${_HG_CMD} update -C ${_HG_FLAGS}; \
fi
@@ -168,15 +172,16 @@ do-hg-extract: .PHONY
# Debug info for show-all and show-all-hg
_VARGROUPS+= hg
-_USR_VARS.hg+= CHECKOUT_DATE
-_PKG_VARS.hg+= HG_REPO HG_MODULE HG_TAG HG_REPOSITORIES
+_USER_VARS.hg+= CHECKOUT_DATE
+_PKG_VARS.hg+= HG_REPO HG_EXTRACTDIR HG_TAG HG_REPOSITORIES
_SYS_VARS.hg+= DISTFILES PKGNAME PKGREVISION WRKSRC
_SYS_VARS.hg+= _HG_PKGVERSION _HG_DISTDIR
.for repo in ${HG_REPOSITORIES}
-. for varbase in HG_REPO HG_MODULE HG_TAG
+. for varbase in HG_REPO HG_EXTRACTDIR HG_TAG
_PKG_VARS.hg+= ${varbase}.${repo}
. endfor
. for varbase in _HG_TAG_FLAG _HG_TAG _HG_DISTFILE
_SYS_VARS.hg+= ${varbase}.${repo}
. endfor
.endfor
+_USE_VARS.hg+= DISTNAME
diff --git a/mk/svn-package.mk b/mk/svn-package.mk
index ad65e6bd8b..7dc50183e5 100644
--- a/mk/svn-package.mk
+++ b/mk/svn-package.mk
@@ -82,6 +82,13 @@ PKG_FAIL_REASON+= "[svn-package.mk] SVN_REPOSITORIES must be set."
. if empty(SVN_REPO.${repo})
PKG_FAIL_REASON+= "[svn-package.mk] SVN_REPO."${repo:Q}" must be set."
. endif
+. if defined(SVN_MODULE.${repo}) # To be removed after 2019-01-01
+WARNINGS+= "[svn-package.mk] SVN_MODULE.* is obsolete; use SVN_EXTRACTDIR.${repo} instead."
+SVN_EXTRACTDIR.${repo}?= ${SVN_MODULE.${repo}}
+. endif
+. if defined(SVN_ENV.${repo}) # To be removed after 2019-01-01
+WARNINGS+= "[svn-package.mk] SVN_ENV.* is obsolete."
+. endif
.endfor
USE_TOOLS+= date gzip pax
@@ -161,15 +168,16 @@ do-svn-extract: .PHONY
.endfor
# Debug info for show-all and show-all-svn
-_VARGROUPS+= svn
-_PKG_VARS.svn+= SVN_REPO SVN_REVISION SVN_EXTRACTDIR SVN_REPOSITORIES
-_SYS_VARS.svn+= DISTFILES PKGREVISION
-_SYS_VARS.svn+= _SVN_DISTDIR
+_VARGROUPS+= svn
+_USER_VARS.svn+= CHECKOUT_DATE
+_PKG_VARS.svn+= SVN_REPO SVN_REVISION SVN_EXTRACTDIR SVN_REPOSITORIES
+_SYS_VARS.svn+= DISTFILES PKGREVISION
+_SYS_VARS.svn+= _SVN_DISTDIR
.for repo in ${SVN_REPOSITORIES}
. for varbase in SVN_REPO SVN_EXTRACTDIR SVN_REVISION SVN_CERTS
-_PKG_VARS.svn+= ${varbase}.${repo}
+_PKG_VARS.svn+= ${varbase}.${repo}
. endfor
. for varbase in _SVN_DISTFILE
-_SYS_VARS.svn+= ${varbase}.${repo}
+_SYS_VARS.svn+= ${varbase}.${repo}
. endfor
.endfor
Home |
Main Index |
Thread Index |
Old Index