summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Gordon <assafgordon@gmail.com>2014-08-20 19:33:41 (GMT)
committerA. Gordon <assafgordon@gmail.com>2014-08-20 19:33:41 (GMT)
commitaeb8193c97f75ad4c06db4b1bdd759387a9983b5 (patch)
tree63ca733a9444f6878f5fd5b92e56e236a20565eb
parentca41e00454dae6e4dc2069afc95e550b1158a928 (diff)
downloadgsv-eval-aeb8193c97f75ad4c06db4b1bdd759387a9983b5.zip
gsv-eval-aeb8193c97f75ad4c06db4b1bdd759387a9983b5.tar.gz
gsv-eval-aeb8193c97f75ad4c06db4b1bdd759387a9983b5.tar.bz2
Perl: add version + minor improvments
-rwxr-xr-xgnu_savannah_eval.pl42
1 files changed, 19 insertions, 23 deletions
diff --git a/gnu_savannah_eval.pl b/gnu_savannah_eval.pl
index de971e3..a21739d 100755
--- a/gnu_savannah_eval.pl
+++ b/gnu_savannah_eval.pl
@@ -28,6 +28,9 @@ use Cwd;
use List::Util qw/max/;
use bytes; # Disable any non-ascii stuff
+# The version should be increment for every new feature/improvement.
+my $version = "0.1.1";
+
sub parse_commandline;
sub get_file_list;
sub get_files_mime_type;
@@ -84,25 +87,17 @@ my @mimetypes_bin_obj = qw|
application/x-msdownload
|;
my %mimetypes_bin_obj = map { $_ => 1 } @mimetypes_bin_obj;
+# NOTE: don't skip 'makefile`, as many packages write it manually
+# (not auto-generated)
my @skip_linux_term_files = qw|
configure
+ Makefile.in
config.status
config.guess
config.log
config.rpath
config.sub
- config/config.status
- config/config.guess
- config/config.log
- config/config.rpath
- config/config.sub
- config/ltmain.sh
- build-aux/config.status
- build-aux/config.guess
- build-aux/config.log
- build-aux/config.rpath
- build-aux/config.sub
- build-aux/ltmain.sh
+ ltmain.sh
|;
my %skip_linux_term_files = map { $_ => 1 } @skip_linux_term_files;
@@ -417,11 +412,11 @@ sub check_file_copyright
my @found_clear_copyright =
grep {
- /[Cc]opyright *(\([Cc]\))? *(19|20)[0-9][0-9][0-9 ,\-]+[A-Za-z\(< ]{4}/
+ /[Cc]opyright[ \t]+(\([Cc]\))?[ \t]*(19|20)[0-9][0-9][0-9\t ,\-]+[A-Za-z\(< \t]{4}/
||
- /[Cc]opyright *(\([Cc]\))? *(19|20)[0-9][0-9][0-9 ,\-]{16,}+$/
+ /[Cc]opyright[ \t]+(\([Cc]\))?[ \t]*(19|20)[0-9][0-9][0-9\t ,\-]{16,}+$/
||
- /[Cc]opyright *\@copyright\{\} *(19|20)[0-9][0-9]/
+ /[Cc]opyright[ \t]+\@copyright\{\}[ \t]+(19|20)[0-9][0-9]/
} @lines;
# Have valid copyright - stop now
@@ -709,7 +704,7 @@ sub check_file_misuse_linux
# as the usage in them is usually technical and correct
# (such as host/build/target triplets in all sorts of variations).
return if $filename =~ /^m4\/[\w\-]+\.m4$/ ||
- exists $skip_linux_term_files{$filename};
+ exists $skip_linux_term_files{basename($filename)};
my @lines_with_linux = grep { /\blinux\b/i } @lines ;
@@ -720,6 +715,7 @@ sub check_file_misuse_linux
/linux[ \-][0-9]\.[0-9]/i ||
m;/usr/[a-zA-Z0-9\/\_\-]+linux; ||
m;include[a-zA-Z0-9\/\-]+linux; ||
+ m;#include +["<]linux/; ||
/gnu.linux/i
) } @lines_with_linux;
@lines_with_linux = map { s/[\r\n]//gs; $_ } @lines_with_linux;
@@ -772,13 +768,13 @@ sub print_markdown_report
print " for $project_name" if $project_name;
print "\n\n";
- print "Generated on ", "" . gmtime, "\n\n";
- print "Source: \`$input_source\`\n\n";
+ print "Generated on ", "" . gmtime, " \n";
+ print "Source: \`$input_source\` \n";
+ print "Detection script version: $version \n";
if ($vcs_type) {
print<<"EOF";
-$vcs_type URL: \`$vcs_origin\`
-
-$vcs_type revision: \`$vcs_id\`
+$vcs_type URL: \`$vcs_origin\`
+$vcs_type revision: \`$vcs_id\`
EOF
}
@@ -1092,7 +1088,7 @@ EOF
print join("", map { " $_\n" } @binary_data_files),"\n";
}
- if (!$have_plain_text_license) {
+ if (scalar(@files)>1 && !$have_plain_text_license) {
print<<'EOF';
## Missing plain-text license file
@@ -1110,7 +1106,7 @@ for your project. If your project uses a non-standard name
EOF
}
- if (!$have_readme) {
+ if (scalar(@files)>1 && !$have_readme) {
print<<'EOF';
## Missing plain-text README file