Make pkg_add -r package1 package2 package3 ... work correctly.

Reviewed by:	billf
This commit is contained in:
Chris Piazza 1999-11-18 23:32:43 +00:00
parent b5ee3fc069
commit 79e970edde
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=53388

View File

@ -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");