Sun Mar 2 08:39:01 2014 UTC ()
We can put any files in files/.


(obache)
diff -r1.862 -r1.863 pkgsrc/pkgtools/pkglint/files/pkglint.pl

cvs diff -r1.862 -r1.863 pkgsrc/pkgtools/pkglint/files/Attic/pkglint.pl (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkglint/files/Attic/pkglint.pl 2014/01/13 01:54:52 1.862
+++ pkgsrc/pkgtools/pkglint/files/Attic/pkglint.pl 2014/03/02 08:39:01 1.863
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1#! @PERL@ 1#! @PERL@
2# $NetBSD: pkglint.pl,v 1.862 2014/01/13 01:54:52 cheusov Exp $ 2# $NetBSD: pkglint.pl,v 1.863 2014/03/02 08:39:01 obache Exp $
3# 3#
4 4
5# pkglint - static analyzer and checker for pkgsrc packages 5# pkglint - static analyzer and checker for pkgsrc packages
6# 6#
7# Written by: 7# Written by:
8# Roland Illig <rillig@NetBSD.org> 8# Roland Illig <rillig@NetBSD.org>
9# 9#
10# Based on work by: 10# Based on work by:
11# Hubert Feyrer <hubertf@NetBSD.org> 11# Hubert Feyrer <hubertf@NetBSD.org>
12# Thorsten Frueauf <frueauf@NetBSD.org> 12# Thorsten Frueauf <frueauf@NetBSD.org>
13# Thomas Klausner <wiz@NetBSD.org> 13# Thomas Klausner <wiz@NetBSD.org>
14# and others. 14# and others.
15# 15#
@@ -7052,26 +7052,28 @@ sub checkfile($) { @@ -7052,26 +7052,28 @@ sub checkfile($) {
7052 if ($opt_import) { 7052 if ($opt_import) {
7053 log_error($fname, NO_LINE_NUMBER, "Must be cleaned up before committing the package."); 7053 log_error($fname, NO_LINE_NUMBER, "Must be cleaned up before committing the package.");
7054 } 7054 }
7055 return; 7055 return;
7056 } 7056 }
7057 7057
7058 if (!($st = lstat($fname))) { 7058 if (!($st = lstat($fname))) {
7059 log_error($fname, NO_LINE_NUMBER, "$!"); 7059 log_error($fname, NO_LINE_NUMBER, "$!");
7060 return; 7060 return;
7061 } 7061 }
7062 if (S_ISDIR($st->mode)) { 7062 if (S_ISDIR($st->mode)) {
7063 if ($basename eq "files" || $basename eq "patches" || $basename eq "CVS") { 7063 if ($basename eq "files" || $basename eq "patches" || $basename eq "CVS") {
7064 # Ok 7064 # Ok
 7065 } elsif ($fname =~ m"(?:^|/)files/[^/]*$") {
 7066 # Ok
7065 7067
7066 } elsif (!is_emptydir($fname)) { 7068 } elsif (!is_emptydir($fname)) {
7067 log_warning($fname, NO_LINE_NUMBER, "Unknown directory name."); 7069 log_warning($fname, NO_LINE_NUMBER, "Unknown directory name.");
7068 } 7070 }
7069 7071
7070 } elsif (S_ISLNK($st->mode)) { 7072 } elsif (S_ISLNK($st->mode)) {
7071 if ($basename !~ m"^work") { 7073 if ($basename !~ m"^work") {
7072 log_warning($fname, NO_LINE_NUMBER, "Unknown symlink name."); 7074 log_warning($fname, NO_LINE_NUMBER, "Unknown symlink name.");
7073 } 7075 }
7074 7076
7075 } elsif (!S_ISREG($st->mode)) { 7077 } elsif (!S_ISREG($st->mode)) {
7076 log_error($fname, NO_LINE_NUMBER, "Only files and directories are allowed in pkgsrc."); 7078 log_error($fname, NO_LINE_NUMBER, "Only files and directories are allowed in pkgsrc.");
7077 7079
@@ -7107,26 +7109,28 @@ sub checkfile($) { @@ -7107,26 +7109,28 @@ sub checkfile($) {
7107 7109
7108 } elsif ($basename =~ m"^PLIST") { 7110 } elsif ($basename =~ m"^PLIST") {
7109 $opt_check_PLIST and checkfile_PLIST($fname); 7111 $opt_check_PLIST and checkfile_PLIST($fname);
7110 7112
7111 } elsif ($basename eq "TODO" || $basename eq "README") { 7113 } elsif ($basename eq "TODO" || $basename eq "README") {
7112 # Ok 7114 # Ok
7113 7115
7114 } elsif ($basename =~ m"^CHANGES-.*") { 7116 } elsif ($basename =~ m"^CHANGES-.*") {
7115 load_doc_CHANGES($fname); 7117 load_doc_CHANGES($fname);
7116 7118
7117 } elsif (!-T $fname) { 7119 } elsif (!-T $fname) {
7118 log_warning($fname, NO_LINE_NUMBER, "Unexpectedly found a binary file."); 7120 log_warning($fname, NO_LINE_NUMBER, "Unexpectedly found a binary file.");
7119 7121
 7122 } elsif ($fname =~ m"(?:^|/)files/[^/]*$") {
 7123 # Ok
7120 } else { 7124 } else {
7121 log_warning($fname, NO_LINE_NUMBER, "Unexpected file found."); 7125 log_warning($fname, NO_LINE_NUMBER, "Unexpected file found.");
7122 $opt_check_extra and checkfile_extra($fname); 7126 $opt_check_extra and checkfile_extra($fname);
7123 } 7127 }
7124} 7128}
7125 7129
7126sub my_split($$) { 7130sub my_split($$) {
7127 my ($delimiter, $s) = @_; 7131 my ($delimiter, $s) = @_;
7128 my ($pos, $next, @result); 7132 my ($pos, $next, @result);
7129 7133
7130 $pos = 0; 7134 $pos = 0;
7131 for ($pos = 0; $pos != -1; $pos = $next) { 7135 for ($pos = 0; $pos != -1; $pos = $next) {
7132 $next = index($s, $delimiter, $pos); 7136 $next = index($s, $delimiter, $pos);