pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Warn if a file is marked executable. ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/199eea6010d4
branches:  trunk
changeset: 476319:199eea6010d4
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Sun Jun 06 16:37:53 2004 +0000

description:
Warn if a file is marked executable. Welcome to 3.77.

It's misleading to have uninstalled rc.d scripts in ${FILESDIR}
marked executable just because they were inadvertently committed
that way; they need to be processed by the install machinery in
order to work.

Since we set desired permissions at install time, it's generally
best to avoid having "executable" files in pkgsrc (with the notable
exception of pkglocate, which runs in place).

For files not yet committed, please correct the permissions before
committing. For files already in the repository, you'll need help
from an administrator.

diffstat:

 pkgtools/pkglint/Makefile         |   4 ++--
 pkgtools/pkglint/files/pkglint.pl |  30 ++++++++++++++++++++++++++++--
 2 files changed, 30 insertions(+), 4 deletions(-)

diffs (116 lines):

diff -r 44abdf6e2bbb -r 199eea6010d4 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Sun Jun 06 16:24:55 2004 +0000
+++ b/pkgtools/pkglint/Makefile Sun Jun 06 16:37:53 2004 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.189 2004/05/13 10:46:01 salo Exp $
+# $NetBSD: Makefile,v 1.190 2004/06/06 16:37:53 schmonz Exp $
 #
 
-DISTNAME=      pkglint-3.76
+DISTNAME=      pkglint-3.77
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 44abdf6e2bbb -r 199eea6010d4 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sun Jun 06 16:24:55 2004 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sun Jun 06 16:37:53 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.105 2004/05/13 10:46:01 salo Exp $
+# $NetBSD: pkglint.pl,v 1.106 2004/06/06 16:37:53 schmonz Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by Hubert Feyrer <hubertf%netbsd.org@localhost>,
@@ -148,7 +148,7 @@
 %checker = ("$pkgdir/DESCR", 'checkdescr');
 
 if ($extrafile) {
-       foreach $i ((<$portdir/$scriptdir/*>, <$portdir/$pkgdir/*>)) {
+       foreach $i ((<$portdir/$filesdir/*>, <$portdir/$pkgdir/*>)) {
                next if (! -T $i);
                next if ($i =~ /distinfo$/);
                next if ($i =~ /Makefile$/);
@@ -271,6 +271,8 @@
                                   "lines, make it shorter if possible");
        local($longlines, $linecnt, $tmp) = (0, 0, "");
 
+       &checkperms("$portdir/$file");
+
        $shortname = basename($file);
        open(IN, "< $portdir/$file") || return 0;
 
@@ -304,6 +306,8 @@
        local($file) = @_;      # distinfo
        local(%indistinfofile);
 
+       &checkperms("$portdir/$file");
+
        open(SUM,"<$portdir/$file") || return 0;
        $_ = <SUM>;
        if (! /^\$NetBSD(:.*|)\$$/) {
@@ -354,6 +358,8 @@
        local($file) = @_;
        local($longlines, $lastline, $tmp) = (0, "", "");
 
+       &checkperms("$portdir/$file");
+
        $shortname = basename($file);
        open(IN, "< $portdir/$file") || return 0;
 
@@ -398,6 +404,8 @@
        local($docseen) = 0;
        local($etcseen) = 0;
 
+       &checkperms("$portdir/$file");
+
        open(IN, "< $portdir/$file") || return 0;
        while (<IN>) {
                if ($_ =~ /[ \t]+\n?$/) {
@@ -520,6 +528,14 @@
        return 1;
 }
 
+sub checkperms {
+       local($file) = @_;
+
+       if (-f $file && -x $file) {
+               &perror("WARN: \"$file\" is executable.");
+       }
+}
+
 #
 # misc files
 #
@@ -527,6 +543,12 @@
        local($file) = @_;
        local($whole);
 
+       &checkperms("$portdir/$file");
+
+       if ($file =~ /$filesdir\//) {
+               return 1;
+       }
+
        open(IN, "< $portdir/$file") || return 0;
        $whole = '';
        while (<IN>) {
@@ -573,6 +595,8 @@
                       ."      and rerun '@MAKE@ makepatchsum'");
        }
 
+       &checkperms("$portdir/$file");
+
        open(IN, "< $portdir/$file") || return 0;
        $whole = '';
        while (<IN>) {
@@ -692,6 +716,8 @@
        local($realwrksrc, $wrksrc, $nowrksubdir) = ('', '', '');
        local($includefile);
 
+       &checkperms("$portdir/$file");
+
        $tmp = 0;
        $rawwhole = readmakefile("$portdir/$file");
        if ($rawwhole eq '') {



Home | Main Index | Thread Index | Old Index