diff options
author | marcus <marcus@FreeBSD.org> | 2005-07-11 06:18:55 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2005-07-11 06:18:55 +0800 |
commit | ad5b6dde59d715a4cc3c500edf9eff190b870de9 (patch) | |
tree | 9d006361b47e7466fef0e9ff50e012ea5067aa53 /Tools/scripts | |
parent | 2516dd72495bb305d8e26ae223a52b12074ae3d9 (diff) | |
download | freebsd-ports-gnome-ad5b6dde59d715a4cc3c500edf9eff190b870de9.tar.gz freebsd-ports-gnome-ad5b6dde59d715a4cc3c500edf9eff190b870de9.tar.zst freebsd-ports-gnome-ad5b6dde59d715a4cc3c500edf9eff190b870de9.zip |
Add prototypes for all the subroutines which fixes compilation with
Perl 5.8.7.
Reported by: mezz
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-x | Tools/scripts/addport | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/Tools/scripts/addport b/Tools/scripts/addport index 377953c28a9a..c3b2d8de091d 100755 --- a/Tools/scripts/addport +++ b/Tools/scripts/addport @@ -43,6 +43,17 @@ use Sys::Hostname; use locale; use strict; +# Subroutine prototypes +sub warnx($); +sub err($$); +sub errx($$); +sub prompt($); +sub query($); +sub usage(); +sub contains($@); +sub lsports(); +sub lastcomment(); + my %opts; getopts('ac:d:fgh:il:M:mns:tu:', \%opts); @@ -349,12 +360,12 @@ the Contributors' List if they are not already there. To do this, edit doc/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml. EOF -sub warnx { +sub warnx($) { my ($msg) = @_; print STDERR $0 . ": " . $msg . "\n"; } -sub err { +sub err($$) { my ($ex, $msg) = @_; warnx("WARNING: err called incorrectly") if (($ex !~ m/^\d+/) || ($msg eq "")); @@ -362,7 +373,7 @@ sub err { exit $ex; } -sub errx { +sub errx($$) { my ($ex,$msg) = @_; warnx("WARNING: errx called incorrectly") if (($ex !~ m/^\d+/) || ($msg eq "")); @@ -370,14 +381,14 @@ sub errx { exit $ex; } -sub prompt { +sub prompt($) { my ($msg) = @_; my $reply = query($msg); return 0 if ($reply =~ m/^[Yy]/); return 1 if ($reply =~ m/^[Nn]/); } -sub query { +sub query($) { my ($msg) = @_; print "$msg"; @@ -386,7 +397,7 @@ sub query { return $reply; } -sub usage { +sub usage() { #addport,v \$Revision: 1.21 $ print <<EOF; authors: <will\@FreeBSD.org>, <mharo\@FreeBSD.org> @@ -442,7 +453,7 @@ EXAMPLES EOF } -sub contains { +sub contains($@) { # look if the first parameter is contained in the list following it my ($item, @list) = @_; @@ -452,7 +463,7 @@ sub contains { return 0; } -sub lsports { +sub lsports() { my @rv = (); open(F, "Makefile") || die "can't open Makefile: $!"; @@ -469,7 +480,7 @@ sub lsports { } # this finds the last comment in the Makefile -sub lastcomment { +sub lastcomment() { my $num = 0; my $diff = 0; |