summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-05-07 15:10:24 +0000
committerrillig <rillig@pkgsrc.org>2005-05-07 15:10:24 +0000
commit31057f0fbddabadb4a9c288d51657fcd9050dcfd (patch)
tree1e4d3481339be22445af8c3867acd3370c99a6fd /pkgtools
parent08b419557ef342ddb8139a547582acef03263718 (diff)
downloadpkgsrc-31057f0fbddabadb4a9c288d51657fcd9050dcfd.tar.gz
Swapped out the definition of deprecated variables to an external file.
Welcome to 4.13. Approved by wiz.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/Makefile5
-rw-r--r--pkgtools/pkglint/files/deprecated.map22
-rw-r--r--pkgtools/pkglint/files/pkglint.pl93
3 files changed, 54 insertions, 66 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index 60c2a1fae4f..5f23a801b92 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.231 2005/04/12 15:12:33 tv Exp $
+# $NetBSD: Makefile,v 1.232 2005/05/07 15:10:24 rillig Exp $
#
-DISTNAME= pkglint-4.12.1
+DISTNAME= pkglint-4.13
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
@@ -62,5 +62,6 @@ do-install:
${INSTALL_MAN} ${WRKSRC}/pkglint.0 ${PREFIX}/man/cat1
${INSTALL_MAN} ${WRKSRC}/pkglint.1 ${PREFIX}/man/man1
${INSTALL_DATA} ${FILESDIR}/makevars.map ${PREFIX}/share/pkglint/
+ ${INSTALL_DATA} ${FILESDIR}/deprecated.map ${PREFIX}/share/pkglint/
.include "../../mk/bsd.pkg.mk"
diff --git a/pkgtools/pkglint/files/deprecated.map b/pkgtools/pkglint/files/deprecated.map
new file mode 100644
index 00000000000..a8c4fb8c4ed
--- /dev/null
+++ b/pkgtools/pkglint/files/deprecated.map
@@ -0,0 +1,22 @@
+# $NetBSD
+#
+
+# This file contains names of Makefile variables and a short explanation
+# what to do to make the warning disappear.
+
+ALL_TARGET Use BUILD_TARGET instead.
+DIGEST_FILE Use DISTINFO_FILE instead.
+IGNORE Use PKG_FAIL_REASON or PKG_SKIP_REASON instead.
+IS_INTERACTIVE Use INTERACTIVE_STAGE instead.
+MD5_FILE Use DISTINFO_FILE instead.
+MIRROR_DISTFILE Use NO_BIN_ON_FTP and/or NO_SRC_ON_FTP instead.
+NO_CDROM Use NO_BIN_ON_CDROM and/or NO_SRC_ON_CDROM instead.
+NO_PACKAGE Don't use it to enforce license restrictions.
+NO_PATCH You can just remove it.
+NO_WRKSUBDIR Use WRKSRC=${WRKDIR} instead.
+PATCH_SUM_FILE Use DISTINFO_FILE instead.
+USE_BUILDLINK2 You can just remove it.
+USE_BUILDLINK3 You can just remove it.
+USE_GMAKE Use USE_GNU_TOOLS+=make instead.
+USE_PKGLIBTOOL Use USE_LIBTOOL instead.
+USE_SSL Include "../../security/openssl/buildlink3.mk" instead.
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 81c63458cb4..53d6ab7f007 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -11,7 +11,7 @@
# Freely redistributable. Absolutely no warranty.
#
# From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp
-# $NetBSD: pkglint.pl,v 1.141 2005/05/01 11:41:17 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.142 2005/05/07 15:10:24 rillig Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by Hubert Feyrer <hubertf@netbsd.org>,
@@ -1171,6 +1171,31 @@ sub check_Makefile_variables($) {
return true;
}
+sub checkfile_Makefile_deprecated($) {
+ my ($whole) = @_;
+ my ($fname) = ("${conf_datadir}/deprecated.map");
+ my ($deprecated) = load_file($fname);
+
+ if (!$deprecated) {
+ log_error($fname, NO_LINE_NUMBER, "Cannot be loaded.");
+ return false;
+ }
+
+ foreach my $line (@{$deprecated}) {
+ if ($line->text =~ qr"^#" || $line->text =~ qr"^\s*$") {
+ next;
+ } elsif ($line->text =~ qr"^(\S+)\s+(.*)$") {
+ my ($varname, $howto_fix) = ($1, $2);
+ if ($whole =~ qr"\n\Q$varname\E\b") {
+ log_warning(NO_FILE, NO_LINE_NUMBER, "${varname} is deprecated. ${howto_fix}");
+ }
+ } else {
+ $line->log_error("internal error: Unknown line format.");
+ }
+ }
+ return true;
+}
+
sub checkfile_Makefile($) {
my ($file) = @_;
my ($fname) = ("$opt_packagedir/$file");
@@ -1270,6 +1295,8 @@ sub checkfile_Makefile($) {
"FILESDIR: $filesdir, PKGDIR: $pkgdir, ".
"DISTINFO: $distinfo\n");
+ checkfile_Makefile_deprecated($whole);
+
#
# whole file: INTERACTIVE_STAGE
#
@@ -1283,19 +1310,7 @@ sub checkfile_Makefile($) {
"FOR_CDROM.");
}
}
- log_info(NO_FILE, NO_LINE_NUMBER, "checking USE_BUILDLINK[23].");
- if ($whole =~ /\n(USE_BUILDLINK[23])/) {
- log_error(NO_FILE, NO_LINE_NUMBER, "$1 is deprecated, ".
- "and no longer used.");
- }
- if ($whole =~ /\nALL_TARGET/) {
- log_error(NO_FILE, NO_LINE_NUMBER, "ALL_TARGET is deprecated, ".
- "use BUILD_TARGET instead.");
- }
- if ($whole =~ /\nIS_INTERACTIVE/) {
- log_error(NO_FILE, NO_LINE_NUMBER, "IS_INTERACTIVE is deprecated, ".
- "use INTERACTIVE_STAGE instead.");
- }
+
log_info(NO_FILE, NO_LINE_NUMBER, "checking for PLIST_SRC.");
if ($whole =~ /\nPLIST_SRC/) {
$seen_PLIST_SRC = true;
@@ -1312,60 +1327,10 @@ sub checkfile_Makefile($) {
if ($whole =~ /\nUSE_PERL[^5]/) {
log_warning(NO_FILE, NO_LINE_NUMBER, "USE_PERL found -- you probably mean USE_PERL5.");
}
- log_info(NO_FILE, NO_LINE_NUMBER, "checking USE_PKGLIBTOOL.");
- if ($whole =~ /\nUSE_PKGLIBTOOL/) {
- log_error(NO_FILE, NO_LINE_NUMBER, "USE_PKGLIBTOOL is deprecated, ".
- "use USE_LIBTOOL instead.");
- }
log_info(NO_FILE, NO_LINE_NUMBER, "checking for USE_PKGLOCALEDIR.");
if ($whole =~ /\nUSE_PKGLOCALEDIR/) {
$seen_USE_PKGLOCALEDIR = true;
}
- log_info(NO_FILE, NO_LINE_NUMBER, "checking USE_SSL.");
- if ($whole =~ /\nUSE_SSL/) {
- log_error(NO_FILE, NO_LINE_NUMBER, "USE_SSL is deprecated, ".
- "use the openssl buildlink3.mk instead.");
- }
- log_info(NO_FILE, NO_LINE_NUMBER, "checking NO_WRKSUBDIR.");
- if ($whole =~ /\nNO_WRKSUBDIR/) {
- log_error(NO_FILE, NO_LINE_NUMBER, "NO_WRKSUBDIR is deprecated, ".
- "use WRKSRC=\$\{WRKDIR\} instead.");
- }
- log_info(NO_FILE, NO_LINE_NUMBER, "checking MD5_FILE, DIGEST_FILE and PATCH_SUM_FILE.");
- if ($whole =~ /\n(MD5_FILE)/ or $whole =~ /\n(DIGEST_FILE)/ or
- $whole =~ /\n(PATCH_SUM_FILE)/) {
- log_error(NO_FILE, NO_LINE_NUMBER, "$1 is deprecated, ".
- "use DISTINFO_FILE instead.");
- }
- log_info(NO_FILE, NO_LINE_NUMBER, "checking MIRROR_DISTFILE.");
- if ($whole =~ /\nMIRROR_DISTFILE/) {
- log_warning(NO_FILE, NO_LINE_NUMBER, "use of MIRROR_DISTFILE deprecated, ".
- "use NO_BIN_ON_FTP and/or NO_SRC_ON_FTP instead.");
- }
- log_info(NO_FILE, NO_LINE_NUMBER, "checking NO_CDROM.");
- if ($whole =~ /\nNO_CDROM/) {
- log_warning(NO_FILE, NO_LINE_NUMBER, "use of NO_CDROM discouraged, ".
- "use NO_BIN_ON_CDROM and/or NO_SRC_ON_CDROM instead.");
- }
- log_info(NO_FILE, NO_LINE_NUMBER, "checking NO_PACKAGE.");
- if ($whole =~ /\nNO_PACKAGE/) {
- log_warning(NO_FILE, NO_LINE_NUMBER, "use of NO_PACKAGE to enforce license ".
- "restrictions is deprecated.");
- }
- log_info(NO_FILE, NO_LINE_NUMBER, "checking NO_PATCH.");
- if ($whole =~ /\nNO_PATCH/) {
- log_warning(NO_FILE, NO_LINE_NUMBER, "use of NO_PATCH deprecated.");
- }
- log_info(NO_FILE, NO_LINE_NUMBER, "checking IGNORE.");
- if ($whole =~ /\nIGNORE/) {
- log_error(NO_FILE, NO_LINE_NUMBER, "use of IGNORE deprecated, ".
- "use PKG_FAIL_REASON or PKG_SKIP_REASON instead.");
- }
- log_info(NO_FILE, NO_LINE_NUMBER, "checking USE_GMAKE.");
- if ($whole =~ /\nUSE_GMAKE/) {
- log_error(NO_FILE, NO_LINE_NUMBER, "use of USE_GMAKE deprecated, ".
- "use USE_GNU_TOOLS+=make instead.");
- }
log_info(NO_FILE, NO_LINE_NUMBER, "checking for MKDIR.");
if ($whole =~ m|\${MKDIR}.*(\${PREFIX}[/0-9a-zA-Z\${}]*)|) {
log_warning(NO_FILE, NO_LINE_NUMBER, "\${MKDIR} $1: consider using INSTALL_*_DIR");