summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorEmanuel Haupt <ehaupt@FreeBSD.org>2017-04-24 17:27:58 +0000
committerEmanuel Haupt <ehaupt@FreeBSD.org>2017-04-24 17:27:58 +0000
commitf361fdd649e5a6b1ab62becd46420ce0bcaa9512 (patch)
treeb2b6a1e0742f642e5d33ca51559de1d09d47986b /Tools
parentmail/libsrs2: fix linking error... (diff)
Fix shebang. If /usr/bin/env is used the -w flag can't be passed after perl.
Use 'use warnings;' instead. While here remove distinfochecker. It's not needed anymore as it was written for a simple purpose eleven years ago.
Notes
Notes: svn path=/head/; revision=439336
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/bump_revision.pl3
-rwxr-xr-xTools/scripts/chkversion.pl3
-rwxr-xr-xTools/scripts/distinfochecker135
-rwxr-xr-xTools/scripts/mark_safe.pl2
4 files changed, 5 insertions, 138 deletions
diff --git a/Tools/scripts/bump_revision.pl b/Tools/scripts/bump_revision.pl
index f8bccee44966..c131dbab9623 100755
--- a/Tools/scripts/bump_revision.pl
+++ b/Tools/scripts/bump_revision.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# $FreeBSD$
@@ -8,6 +8,7 @@
use Getopt::Std;
use strict;
+use warnings;
use Cwd;
use Data::Dumper;
use File::Basename;
diff --git a/Tools/scripts/chkversion.pl b/Tools/scripts/chkversion.pl
index 6fb6bc390575..bd3adb6d21e5 100755
--- a/Tools/scripts/chkversion.pl
+++ b/Tools/scripts/chkversion.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
#
# Copyright (c) 2004 Oliver Eikemeier. All rights reserved.
#
@@ -66,6 +66,7 @@
require 5.005;
use strict;
+use warnings;
use POSIX;
use File::Find;
use Cwd 'abs_path';
diff --git a/Tools/scripts/distinfochecker b/Tools/scripts/distinfochecker
deleted file mode 100755
index c485108ef575..000000000000
--- a/Tools/scripts/distinfochecker
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/usr/bin/env perl -w
-
-#
-# $FreeBSD$
-#
-# Author: Edwin Groothuis <edwin@FreeBSD.org>
-#
-
-#
-# Small tool to find distinfo with missing MD5/SHA256/SIZE statements,
-# based on the assumption that if there is one of the MD5/SHA256/SIZE
-# statements, then there should be all of them (except for SIZE
-# when MD5/SHA256 is set to IGNORE).
-#
-# Usage: distinfochecker [-v] [-d directory]
-# -v - verbose (print)
-# -d - use directory instead of /usr/ports
-#
-
-use Getopt::Std;
-use strict;
-use Data::Dumper;
-
-my $UP="/usr/ports";
-my $verbose=0;
-
-my %opts=();
-getopt('d:v',\%opts);
-
-$UP=$opts{d} if (defined $opts{d});
-$verbose=1 if (defined $opts{v});
-
-my $errors=0;
-my $checked=0;
-
-opendir(DHUP,$UP);
-while (my $c=readdir(DHUP)) {
-
- next if ($c=~/^\./);
- next if ($c=~/^[A-Z]/);
- next if ($c=~/^distfiles/);
-
- opendir(DHUPC,"$UP/$c");
- while (my $p=readdir(DHUPC)) {
- next if ($p=~/^\./);
- next if ($p=~/^Makefile/);
-
- if (!-f "$UP/$c/$p/distinfo") {
- print "$c/$p - No distinfo found\n" if ($verbose);
- next;
- }
- open(FIN,"$UP/$c/$p/distinfo");
- my @lines=<FIN>;
- chomp(@lines);
- close(FIN);
-
- my %MD5=();
- my %SHA256=();
- my %SIZE=();
-
- foreach my $line (@lines) {
- if ($line=~/^MD5 \((.+?)\) = (.+?)$/) {
- if (defined $MD5{$1}) {
- print "$c/$p - Duplicate MD5 for $1\n";
- $errors++;
- }
- $MD5{$1}=$2;
- }
- if ($line=~/^SHA256 \((.+?)\) = (.+?)$/) {
- if (defined $SHA256{$1}) {
- print "$c/$p - Duplicate SHA256 for $1\n";
- $errors++;
- }
- $SHA256{$1}=$2;
- }
- if ($line=~/^SIZE \((.+?)\) = (.+?)$/) {
- if (defined $SIZE{$1}) {
- print "$c/$p - Duplicate SIZE for $1\n";
- $errors++;
- }
- $SIZE{$1}=$2;
- }
- }
-
- foreach my $f (sort(keys(%MD5))) {
- if (!defined ($SHA256{$f})) {
- print "$c/$p - Missing SHA256 for $f\n";
- $SHA256{$f}="missing";
- $errors++;
- }
- if ($MD5{$f} ne "IGNORE") {
- if (!defined ($SIZE{$f})) {
- print "$c/$p - Missing SIZE for $f\n";
- $SIZE{$f}="missing";
- $errors++;
- }
- }
- $checked++;
- }
-
- foreach my $f (sort(keys(%SHA256))) {
- if (!defined ($MD5{$f})) {
- print "$c/$p - Missing MD5 for $f\n";
- $MD5{$f}="missing";
- $errors++;
- }
- if ($SHA256{$f} ne "IGNORE") {
- if (!defined ($SIZE{$f})) {
- print "$c/$p - Missing SIZE for $f\n";
- $SIZE{$f}="missing";
- $errors++;
- }
- }
- }
-
- foreach my $f (sort(keys(%SIZE))) {
- if (!defined ($MD5{$f})) {
- print "$c/$p - Missing MD5 for $f\n";
- $MD5{$f}="missing";
- $errors++;
- }
- if (!defined ($SHA256{$f})) {
- print "$c/$p - Missing SHA256 for $f\n";
- $SHA256{$f}="missing";
- $errors++;
- }
- }
-
-
- }
- closedir(DHUPC);
-}
-closedir(DHUP);
-
-print "Errors: $errors\nChecked: $checked\n";
diff --git a/Tools/scripts/mark_safe.pl b/Tools/scripts/mark_safe.pl
index b84e45532904..313319d051ed 100755
--- a/Tools/scripts/mark_safe.pl
+++ b/Tools/scripts/mark_safe.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# $FreeBSD$
#