diff options
author | Will Andrews <will@FreeBSD.org> | 2000-08-06 02:51:30 +0000 |
---|---|---|
committer | Will Andrews <will@FreeBSD.org> | 2000-08-06 02:51:30 +0000 |
commit | 9f764ffc420cc4ee45a0dffc4646fefb77e39869 (patch) | |
tree | e5a87549df8e16f61955f226ba460447d5e925b7 /Tools/scripts/addport | |
parent | Upgrade to version 1.5.6. (diff) |
Fix special case where people use ``.'' for the argument to -d. I'm not
very good with perl yet, so anyone who can propose a better way to do
this (with s/// or m// or something using regex) that might also include
the case where the argument contains slashes (i.e. games/somegame). But
anyways, this should catch folks who use ``.''. :->
Submitted by: obrien, sada
Notes
Notes:
svn path=/head/; revision=31331
Diffstat (limited to 'Tools/scripts/addport')
-rwxr-xr-x | Tools/scripts/addport | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Tools/scripts/addport b/Tools/scripts/addport index c8eba80582e0..e8760c10d001 100755 --- a/Tools/scripts/addport +++ b/Tools/scripts/addport @@ -161,13 +161,18 @@ END { } } - if ($dir eq "") { warnx("Please specify a directory to import a new port from."); usage(); exit 1; } +# account for special case +if ($dir eq ".") { + chomp(local $pwd = `pwd`); + $dir = `basename $pwd`; +} + $dir = "$pwd/$dir" if ($dir !~ m,^/,); $dir =~ s,/$,,g; |