1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00

Add prototypes for all the subroutines which fixes compilation with

Perl 5.8.7.

Reported by:	mezz
This commit is contained in:
Joe Marcus Clarke 2005-07-10 22:18:55 +00:00
parent e8843bee7d
commit 898c84cdf7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=138862

View File

@ -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;