diff options
author | will <will@FreeBSD.org> | 2000-08-06 02:51:30 +0000 |
---|---|---|
committer | will <will@FreeBSD.org> | 2000-08-06 02:51:30 +0000 |
commit | 4170baeabe2d94cdddadc73889656c5fb2c02f17 (patch) | |
tree | 632e5db97f1a1ba12c12eac56461507581d2699e /Tools | |
parent | 40eaff4dc03893c1a5d042cc9deed5bbea1c43f3 (diff) | |
download | FreeBSD-ports-4170baeabe2d94cdddadc73889656c5fb2c02f17.zip FreeBSD-ports-4170baeabe2d94cdddadc73889656c5fb2c02f17.tar.gz |
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
Diffstat (limited to 'Tools')
-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 c8eba80..e8760c1 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; |