pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Update to 3.93, from Roland Illig:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3aa2f5bdd14e
branches:  trunk
changeset: 481992:3aa2f5bdd14e
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sat Oct 16 15:04:26 2004 +0000

description:
Update to 3.93, from Roland Illig:
- Renamed PORTSDIR to PKGSRCDIR
- Added warning option -Wno-workdir
- Fixed some places where absolute and relative pathnames had
  been used incorrectly.

Clean up Makefile.

diffstat:

 pkgtools/pkglint/Makefile         |  32 ++++++++++------------
 pkgtools/pkglint/files/pkglint.1  |   9 ++++-
 pkgtools/pkglint/files/pkglint.pl |  55 +++++++++++++++++++-------------------
 3 files changed, 50 insertions(+), 46 deletions(-)

diffs (238 lines):

diff -r a54446c4d4cd -r 3aa2f5bdd14e pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Sat Oct 16 14:49:00 2004 +0000
+++ b/pkgtools/pkglint/Makefile Sat Oct 16 15:04:26 2004 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.206 2004/10/15 12:14:14 wiz Exp $
+# $NetBSD: Makefile,v 1.207 2004/10/16 15:04:26 wiz Exp $
 #
 
-DISTNAME=      pkglint-3.92
+DISTNAME=      pkglint-3.93
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
@@ -22,32 +22,30 @@
 NO_CONFIGURE=  yes
 USE_LANGUAGES= # empty
 
-MAKE_ENV=      PKGSRCDIR=${PKGSRCDIR:Q}
-
 DISTVER=       ${DISTNAME:S/pkglint-//}
 
 INSTALLATION_DIRS=     bin man/cat1 man/man1
 
-SUBST_FILES=   lintpkgsrc.0 lintpkgsrc.1 lintpkgsrc.pl pkglint.1 pkglint.0
-SUBST_FILES+=  pkglint.pl plist-clash.pl
+SUBST_CLASSES+=                pkglint
+SUBST_STAGE.pkglint=   pre-build
+SUBST_FILES.pkglint+=  lintpkgsrc.0 lintpkgsrc.1 lintpkgsrc.pl
+SUBST_FILES.pkglint+=  pkglint.0 pkglint.1 pkglint.pl
+SUBST_FILES.pkglint+=  plist-clash.pl
+SUBST_SED.pkglint+=    -e 's|@PREFIX@|${PREFIX}|g'
+SUBST_SED.pkglint+=    -e 's|@PKGSRCDIR@|${PKGSRCDIR}|g'
+SUBST_SED.pkglint+=    -e 's|@DISTVER@|${DISTVER}|g'
+SUBST_SED.pkglint+=    -e 's|@MAKE@|${MAKE}|g'
+SUBST_SED.pkglint+=    -e 's|@PERL@|${PERL5}|g'
 
 .include "../../mk/bsd.prefs.mk"
 
 do-extract:
-       @${MKDIR} ${WRKSRC}/src
-.for FILE in ${SUBST_FILES}
-       ${CP} ${FILESDIR}/${FILE} ${WRKSRC}/src/${FILE}
+.for _f_ in ${SUBST_FILES.pkglint}
+       @${CP} ${FILESDIR}/${_f_} ${WRKSRC}/${_f_}
 .endfor
 
 do-build:
-.for FILE in ${SUBST_FILES}
-       ${SED} -e 's|@PREFIX@|${PREFIX}|g'              \
-               -e 's|@PORTSDIR@|${PKGSRCDIR}|g'        \
-               -e 's|@DISTVER@|${DISTVER}|g'           \
-               -e 's|@MAKE@|${MAKE}|g'                 \
-               -e 's|@PERL@|${PERL5}|g'                \
-               ${WRKSRC}/src/${FILE} > ${WRKSRC}/${FILE}
-.endfor
+       @${DO_NADA}
 .if ${OPSYS} == "SunOS" || ${OPSYS} == "AIX"
    # the pre-generated man-pages are 'mandoc';  these OS need 'man'
 .  for FILE in lintpkgsrc pkglint
diff -r a54446c4d4cd -r 3aa2f5bdd14e pkgtools/pkglint/files/pkglint.1
--- a/pkgtools/pkglint/files/pkglint.1  Sat Oct 16 14:49:00 2004 +0000
+++ b/pkgtools/pkglint/files/pkglint.1  Sat Oct 16 15:04:26 2004 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkglint.1,v 1.8 2004/09/24 15:33:26 wiz Exp $
+.\"    $NetBSD: pkglint.1,v 1.9 2004/10/16 15:04:26 wiz Exp $
 .\"    From FreeBSD: portlint.1,v 1.8 1997/11/25 14:53:14 itojun Exp
 .\"
 .\" Copyright (c) 1997 by Jun-ichiro Itoh <itojun%itojun.org@localhost>.
@@ -6,7 +6,7 @@
 .\"
 .\" Roland Illig <roland.illig%gmx.de@localhost>, 2004.
 .\"
-.Dd September 23, 2004
+.Dd October 16, 2004
 .Dt PKGLINT 1
 .Sh NAME
 .Nm pkglint
@@ -111,6 +111,11 @@
 .It [no-]patches
 Warn if a patch file patches more than one file or if the patches differ
 from what is recorded in the distinfo file.
+.It [no-]workdir
+Warn about existing
+.Pa work*
+directories.
+They might be committed to CVS accidentally.
 .El
 .Pp
 .Bl -tag -width Fl
diff -r a54446c4d4cd -r 3aa2f5bdd14e pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sat Oct 16 14:49:00 2004 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sat Oct 16 15:04:26 2004 +0000
@@ -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.120 2004/10/15 12:14:14 wiz Exp $
+# $NetBSD: pkglint.pl,v 1.121 2004/10/16 15:04:26 wiz Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by Hubert Feyrer <hubertf%netbsd.org@localhost>,
@@ -226,7 +226,7 @@
 
 # Buildtime configuration
 my $conf_rcsidstr      = 'NetBSD';
-my $conf_portsdir      = '@PORTSDIR@';
+my $conf_pkgsrcdir     = '@PKGSRCDIR@';
 my $conf_localbase     = '@PREFIX@';
 my $conf_distver       = '@DISTVER@';
 my $conf_make          = '@MAKE@';
@@ -269,12 +269,14 @@
 my $opt_warn_absname   = true;
 my $opt_warn_directcmd = true;
 my $opt_warn_paren     = true;
+my $opt_warn_workdir   = true;
 my (%warnings) = (
        "patches"       => [\$opt_warn_patches, "warn on non-optimal patch files"],
        "exec"          => [\$opt_warn_exec, "warn if source files are executable"],
        "absname"       => [\$opt_warn_absname, "warn about use of absolute file names"],
        "directcmd"     => [\$opt_warn_directcmd, "warn about use of direct command names instead of Make variables"],
        "paren"         => [\$opt_warn_paren, "warn about usa of \$(VAR) instead of \${VAR} in Makefiles"],
+       "workdir"       => [\$opt_warn_workdir, "warn that work* should not be committed into CVS"],
 );
 
 # Constants
@@ -449,9 +451,9 @@
 sub main() {
        parse_command_line();
 
-       log_info(NO_FILE, NO_LINE_NUMBER, "config: portsdir: \"$conf_portsdir\" ".
-               "rcsidstr: \"$conf_rcsidstr\" ".
-               "localbase: $conf_localbase");
+       log_info(NO_FILE, NO_LINE_NUMBER, "pkgsrcdir: $conf_pkgsrcdir");
+       log_info(NO_FILE, NO_LINE_NUMBER, "rcsidstr: $conf_rcsidstr");
+       log_info(NO_FILE, NO_LINE_NUMBER, "localbase: $conf_localbase");
 
        if (-f "$opt_packagedir/../Packages.txt") {
                log_info(NO_FILE, NO_LINE_NUMBER, "checking category Makefile.");
@@ -511,7 +513,8 @@
        my %checker = ("$pkgdir/DESCR", \&checkfile_DESCR);
 
        if ($opt_check_MESSAGE) {
-               foreach my $msg (<$opt_packagedir/$filesdir/*>, <$opt_packagedir/$pkgdir/*>) {
+               foreach my $abs_msg (<$opt_packagedir/$filesdir/*>, <$opt_packagedir/$pkgdir/*>) {
+                       my ($msg) = (substr($abs_msg, length("$opt_packagedir/")));
                        if ($msg =~ qr"MESSAGE") {
                                push(@checker, $msg);
                                $checker{$msg} = \&checkfile_MESSAGE;
@@ -519,7 +522,8 @@
                }
        }
        if ($opt_check_PLIST) {
-               foreach my $plist (<$opt_packagedir/$filesdir/*>, <$opt_packagedir/$pkgdir/*>) {
+               foreach my $abs_plist (<$opt_packagedir/$filesdir/*>, <$opt_packagedir/$pkgdir/*>) {
+                       my ($plist) = (substr($abs_plist, length("$opt_packagedir/")));
                        if ($plist =~ qr"PLIST") {
                                push(@checker, $plist);
                                $checker{$plist} = \&checkfile_PLIST;
@@ -527,12 +531,12 @@
                }
        }
        if ($opt_check_patches) {
-               foreach my $i (<$opt_packagedir/$patchdir/patch-*>) {
-                       next if (! -T $i);
-                       $i =~ s/^\Q$opt_packagedir\E\///;
-                       next if (defined $checker{$i});
-                       push(@checker, $i);
-                       $checker{$i} = \&checkfile_patches_patch;
+               foreach my $abs_patch (<$opt_packagedir/$patchdir/patch-*>) {
+                       my ($patch) = (substr($abs_patch, length("$opt_packagedir/")));
+                       next if (! -T $abs_patch);
+                       next if (defined $checker{$patch});
+                       push(@checker, $patch);
+                       $checker{$patch} = \&checkfile_patches_patch;
                }
        }
        if ($opt_check_distinfo) {
@@ -558,14 +562,14 @@
                }
        }
        if ($opt_check_extra) {
-               foreach my $i ((<$opt_packagedir/$filesdir/*>, <$opt_packagedir/$pkgdir/*>)) {
-                       next if (! -T $i);
-                       $i =~ s/^\Q$opt_packagedir\E\///;
-                       next if ($i =~ qr"(?:distinfo$|Makefile$|PLIST|MESSAGE)");
-                       next if (defined $checker{$i});
+               foreach my $abs_extra ((<$opt_packagedir/$filesdir/*>, <$opt_packagedir/$pkgdir/*>)) {
+                       my ($extra) = (substr($abs_extra, length("$opt_packagedir/")));
+                       next if (! -T $abs_extra);
+                       next if ($extra =~ qr"(?:distinfo$|Makefile$|PLIST|MESSAGE)");
+                       next if (defined $checker{$extra});
 
-                       push(@checker, $i);
-                       $checker{$i} = \&checkpathname;
+                       push(@checker, $extra);
+                       $checker{$extra} = \&checkpathname;
                }
        }
 
@@ -614,7 +618,7 @@
                log_warning(NO_FILE, NO_LINE_NUMBER, "no PLIST or PLIST-mi, and PLIST_SRC and NO_PKG_REGISTER unset.\n     Are you sure PLIST handling is ok?");
        }
        if ($opt_committer) {
-               if (scalar(@_ = <$opt_packagedir/work*/*>) || -d "$opt_packagedir/work*") {
+               if ($opt_warn_workdir && (scalar(@_ = <$opt_packagedir/work*/*>) || -d "$opt_packagedir/work*")) {
                        log_warning(NO_FILE, NO_LINE_NUMBER, "be sure to cleanup $opt_packagedir/work* ".
                                "before committing the package.");
                }
@@ -1733,9 +1737,6 @@
            $tmp =~ /BUILD_USES_MSGFMT/) {
                &checkearlier($tmp, @varnames);
 
-               if (!defined $ENV{'PORTSDIR'}) {
-                       $ENV{'PORTSDIR'} = $conf_portsdir;
-               }
                foreach my $i (grep(/^[A-Z_]*DEPENDS[?+]?=/, split(/\n/, $tmp))) {
                        $i =~ s/^([A-Z_]*DEPENDS)[?+]?=[ \t]*//;
                        my $j = $1;
@@ -1986,8 +1987,8 @@
 
        log_info(NO_FILE, NO_LINE_NUMBER, "checking direct use of pathnames, phase 1.");
        my %abspathnames = split(/\n|\t+/, <<EOF);
-/usr/opt       \${PORTSDIR} instead
-$conf_portsdir \${PORTSDIR} instead
+/usr/pkgsrc    \${PKGSRCDIR} instead
+$conf_pkgsrcdir        \${PKGSRCDIR} instead
 $conf_localbase        \${PREFIX} or \${LOCALBASE}, as appropriate
 /usr/X11       \${PREFIX} or \${X11BASE}, as appropriate
 /usr/X11R6     \${PREFIX} or \${X11BASE}, as appropriate
@@ -2055,7 +2056,7 @@
                log_error($file, NO_LINE_NUMBER, "No RCS Id tag found.");
        }
 
-       @filesys_subdirs = grep { ($_ = substr($_, 0, -1)) ne "CVS"; } glob("*/");
+       @filesys_subdirs = grep { ($_ = substr($_, length($opt_packagedir) + 1, -1)) ne "CVS"; } glob("$opt_packagedir/*/");
        
        my ($first, $last_subdir, $comment_seen) = (true, undef, false);
        foreach my $line (@$lines) {



Home | Main Index | Thread Index | Old Index