summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install
diff options
context:
space:
mode:
authorcpiazza <cpiazza@FreeBSD.org>1999-11-18 23:32:43 +0000
committercpiazza <cpiazza@FreeBSD.org>1999-11-18 23:32:43 +0000
commit6fa2680934f68818044d1483f8acab7d2e09b712 (patch)
tree1b60a6dd7709351ba969a9d712f3ca6144645e20 /usr.sbin/pkg_install
parente5e1ccbdfe3abe9f1463c8a607b4c25dbb981c30 (diff)
downloadFreeBSD-src-6fa2680934f68818044d1483f8acab7d2e09b712.zip
FreeBSD-src-6fa2680934f68818044d1483f8acab7d2e09b712.tar.gz
Make `pkg_add -r package1 package2 package3 ...` work correctly.
Reviewed by: billf
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r--usr.sbin/pkg_install/add/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/add/main.c b/usr.sbin/pkg_install/add/main.c
index 174479c..f96940e 100644
--- a/usr.sbin/pkg_install/add/main.c
+++ b/usr.sbin/pkg_install/add/main.c
@@ -62,7 +62,8 @@ main(int argc, char **argv)
char *cp;
char *remotepkg = NULL, *ptr;
- static char packageroot[MAXPATHLEN] = "ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/";
+ static const char packageroot[MAXPATHLEN] = "ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/";
+ static char temppackageroot[MAXPATHLEN];
start = argv;
while ((ch = getopt(argc, argv, Options)) != -1) {
@@ -129,11 +130,12 @@ main(int argc, char **argv)
/* Get all the remaining package names, if any */
for (ch = 0; *argv; ch++, argv++) {
if (Remote) {
+ strcpy(temppackageroot, packageroot);
if (getenv("PACKAGESITE") == NULL)
- strcat(packageroot, getpackagesite());
+ strcat(temppackageroot, getpackagesite());
else
- strcpy(packageroot, (getenv("PACKAGESITE")));
- remotepkg = strcat(packageroot, *argv);
+ strcpy(temppackageroot, (getenv("PACKAGESITE")));
+ remotepkg = strcat(temppackageroot, *argv);
if (!((ptr = strrchr(remotepkg, '.')) && ptr[1] == 't' &&
ptr[2] == 'g' && ptr[3] == 'z' && !ptr[4]))
strcat(remotepkg, ".tgz");
OpenPOWER on IntegriCloud