diff options
author | Will Andrews <will@FreeBSD.org> | 2000-08-11 21:44:18 +0000 |
---|---|---|
committer | Will Andrews <will@FreeBSD.org> | 2000-08-11 21:44:18 +0000 |
commit | 727770ca84ea817fc9e9c661c7b30b34965c09f3 (patch) | |
tree | afd07abaab949511914d8f16e708ff3778e69bab /Tools | |
parent | Ooops, forgot to remove this too, in moving backfract from x11 to graphics. (diff) |
Properly check -d argument, and return usage() if it's not there. Also use
Sys::Hostname with hostname() instead of `hostname`.
Hostname stolen from: CVSROOT/log_accum.pl
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/addport | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Tools/scripts/addport b/Tools/scripts/addport index ca4d94aa8cad..1aa311873ed0 100755 --- a/Tools/scripts/addport +++ b/Tools/scripts/addport @@ -14,17 +14,14 @@ use Cwd "abs_path"; use Getopt::Std; +use Sys::Hostname; use strict; my %opts; -if (getopts('d:h:intu:v', \%opts)) { - usage(); - exit 1; -} +getopts('d:h:intu:v', \%opts); my $dir = $opts{'d'}; -print "dir = $dir\n"; my $h = "freefall.FreeBSD.org"; $h = $opts{'h'} if ($opts{'h'} ne ""); my $n = $opts{'n'}; @@ -48,7 +45,7 @@ my $mv = "mv"; my $rm = "rm"; # now check to make sure this isn't running on freefall -chomp(my $myhost = lc(`hostname`)); +chomp(my $myhost = lc(hostname())); if ($myhost ne lc($h)) { $ssh = "$ENV{CVS_RSH} $u\@$h"; $repo = "$u\@$h:/home/ncvs"; @@ -88,6 +85,12 @@ if (!$vanilla) { } } +if ($dir eq "") { + warnx("Need to specify a directory with -d argument!"); + usage(); + exit 1; +} + my @dirs = split(/\,/, $dir); my $portname; foreach my $thisdir (@dirs) { |