aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorWill Andrews <will@FreeBSD.org>2000-08-06 02:51:30 +0000
committerWill Andrews <will@FreeBSD.org>2000-08-06 02:51:30 +0000
commit9f764ffc420cc4ee45a0dffc4646fefb77e39869 (patch)
treee5a87549df8e16f61955f226ba460447d5e925b7 /Tools
parent916158f3cbce1213742fd60faa25c8c435476c67 (diff)
downloadports-9f764ffc420cc4ee45a0dffc4646fefb77e39869.tar.gz
ports-9f764ffc420cc4ee45a0dffc4646fefb77e39869.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
Notes
Notes: svn path=/head/; revision=31331
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/addport7
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;