diff options
author | will <will@FreeBSD.org> | 2000-08-06 10:51:30 +0800 |
---|---|---|
committer | will <will@FreeBSD.org> | 2000-08-06 10:51:30 +0800 |
commit | 4170baeabe2d94cdddadc73889656c5fb2c02f17 (patch) | |
tree | 632e5db97f1a1ba12c12eac56461507581d2699e | |
parent | 40eaff4dc03893c1a5d042cc9deed5bbea1c43f3 (diff) | |
download | freebsd-ports-gnome-4170baeabe2d94cdddadc73889656c5fb2c02f17.tar.gz freebsd-ports-gnome-4170baeabe2d94cdddadc73889656c5fb2c02f17.tar.zst freebsd-ports-gnome-4170baeabe2d94cdddadc73889656c5fb2c02f17.zip |
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
-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; |