summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorschmonz <schmonz@pkgsrc.org>2004-06-06 16:37:53 +0000
committerschmonz <schmonz@pkgsrc.org>2004-06-06 16:37:53 +0000
commit368a1c635514dd3b385b903ab2644184fd010399 (patch)
tree7d142f88dfa8da637c15dfab11175acfcf1f15e8 /pkgtools
parentb5fba10e3c8a8f3b7864c097f67287748d92bbb7 (diff)
downloadpkgsrc-368a1c635514dd3b385b903ab2644184fd010399.tar.gz
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 (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/files/pkglint.pl30
2 files changed, 30 insertions, 4 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index 72602189a70..01938bd2d7c 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -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 --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 9fcaafaeff3..fe9d9d58360 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.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>,
@@ -148,7 +148,7 @@ if (! -f "$portdir/Makefile") {
%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 @@ sub checkdescr {
"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 @@ sub checkdistinfo {
local($file) = @_; # distinfo
local(%indistinfofile);
+ &checkperms("$portdir/$file");
+
open(SUM,"<$portdir/$file") || return 0;
$_ = <SUM>;
if (! /^\$NetBSD(:.*|)\$$/) {
@@ -354,6 +358,8 @@ sub checkmessage {
local($file) = @_;
local($longlines, $lastline, $tmp) = (0, "", "");
+ &checkperms("$portdir/$file");
+
$shortname = basename($file);
open(IN, "< $portdir/$file") || return 0;
@@ -398,6 +404,8 @@ sub checkplist {
local($docseen) = 0;
local($etcseen) = 0;
+ &checkperms("$portdir/$file");
+
open(IN, "< $portdir/$file") || return 0;
while (<IN>) {
if ($_ =~ /[ \t]+\n?$/) {
@@ -520,6 +528,14 @@ sub checkplist {
return 1;
}
+sub checkperms {
+ local($file) = @_;
+
+ if (-f $file && -x $file) {
+ &perror("WARN: \"$file\" is executable.");
+ }
+}
+
#
# misc files
#
@@ -527,6 +543,12 @@ sub checkpathname {
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 @@ sub checkpatch {
." and rerun '@MAKE@ makepatchsum'");
}
+ &checkperms("$portdir/$file");
+
open(IN, "< $portdir/$file") || return 0;
$whole = '';
while (<IN>) {
@@ -692,6 +716,8 @@ sub checkmakefile {
local($realwrksrc, $wrksrc, $nowrksubdir) = ('', '', '');
local($includefile);
+ &checkperms("$portdir/$file");
+
$tmp = 0;
$rawwhole = readmakefile("$portdir/$file");
if ($rawwhole eq '') {