Skip to content

Commit

Permalink
Warn if a file is marked executable. Welcome to 3.77.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
schmonz committed Jun 6, 2004
1 parent b5fba10 commit 368a1c6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkgtools/pkglint/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
30 changes: 28 additions & 2 deletions pkgtools/pkglint/files/pkglint.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down Expand Up @@ -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$/);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -304,6 +306,8 @@ sub checkdistinfo {
local($file) = @_; # distinfo
local(%indistinfofile);

&checkperms("$portdir/$file");

open(SUM,"<$portdir/$file") || return 0;
$_ = <SUM>;
if (! /^\$NetBSD(:.*|)\$$/) {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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?$/) {
Expand Down Expand Up @@ -520,13 +528,27 @@ sub checkplist {
return 1;
}

sub checkperms {
local($file) = @_;

if (-f $file && -x $file) {
&perror("WARN: \"$file\" is executable.");
}
}

#
# misc files
#
sub checkpathname {
local($file) = @_;
local($whole);

&checkperms("$portdir/$file");

if ($file =~ /$filesdir\//) {
return 1;
}

open(IN, "< $portdir/$file") || return 0;
$whole = '';
while (<IN>) {
Expand Down Expand Up @@ -573,6 +595,8 @@ sub checkpatch {
." and rerun '@MAKE@ makepatchsum'");
}

&checkperms("$portdir/$file");

open(IN, "< $portdir/$file") || return 0;
$whole = '';
while (<IN>) {
Expand Down Expand Up @@ -692,6 +716,8 @@ sub checkmakefile {
local($realwrksrc, $wrksrc, $nowrksubdir) = ('', '', '');
local($includefile);

&checkperms("$portdir/$file");

$tmp = 0;
$rawwhole = readmakefile("$portdir/$file");
if ($rawwhole eq '') {
Expand Down

0 comments on commit 368a1c6

Please sign in to comment.