mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Fix PR#1557 - chained package dependencies using URLs didn't work.
This commit is contained in:
parent
c27ebf26ac
commit
82d4f7288d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18929
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static const char *rcsid = "$Id: perform.c,v 1.35 1996/06/20 18:33:33 jkh Exp $";
|
||||
static const char *rcsid = "$Id: perform.c,v 1.36 1996/07/31 21:52:33 jkh Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -221,43 +221,44 @@ pkg_do(char *pkg)
|
||||
continue;
|
||||
if (Verbose)
|
||||
printf("Package `%s' depends on `%s'.\n", PkgName, p->name);
|
||||
if (!Fake && vsystem("pkg_info -e %s", p->name)) {
|
||||
if (vsystem("pkg_info -e %s", p->name)) {
|
||||
char path[FILENAME_MAX], *cp = NULL;
|
||||
|
||||
if (!Fake && !isURL(pkg) && !getenv("PKG_ADD_BASE")) {
|
||||
snprintf(path, FILENAME_MAX, "%s/%s.tgz", Home, p->name);
|
||||
if (fexists(path))
|
||||
cp = path;
|
||||
else
|
||||
cp = fileFindByPath(pkg, p->name);
|
||||
if (cp) {
|
||||
if (Verbose)
|
||||
printf("Loading it from %s.\n", cp);
|
||||
if (vsystem("pkg_add %s", cp)) {
|
||||
whinge("Autoload of dependency `%s' failed%s", cp, Force ? " (proceeding anyway)" : "!");
|
||||
if (!Force)
|
||||
++code;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!Fake && (cp = fileGetURL(pkg, p->name)) != NULL) {
|
||||
if (Verbose)
|
||||
printf("Finished loading %s over FTP.\n", p->name);
|
||||
if (!Fake) {
|
||||
if (!fexists("+CONTENTS"))
|
||||
whinge("Autoloaded package %s has no +CONTENTS file?", p->name);
|
||||
if (!Fake) {
|
||||
if (!isURL(pkg) && !getenv("PKG_ADD_BASE")) {
|
||||
snprintf(path, FILENAME_MAX, "%s/%s.tgz", Home, p->name);
|
||||
if (fexists(path))
|
||||
cp = path;
|
||||
else
|
||||
if (vsystem("(pwd; cat +CONTENTS) | pkg_add %s-S", Verbose ? "-v " : "")) {
|
||||
whinge("pkg_add of dependency `%s' failed%s",
|
||||
p->name, Force ? " (proceeding anyway)" : "!");
|
||||
cp = fileFindByPath(pkg, p->name);
|
||||
if (cp) {
|
||||
if (Verbose)
|
||||
printf("Loading it from %s.\n", cp);
|
||||
if (vsystem("pkg_add %s", cp)) {
|
||||
whinge("Autoload of dependency `%s' failed%s", cp, Force ? " (proceeding anyway)" : "!");
|
||||
if (!Force)
|
||||
++code;
|
||||
}
|
||||
else if (Verbose)
|
||||
printf("\t`%s' loaded successfully.\n", p->name);
|
||||
}
|
||||
}
|
||||
else if ((cp = fileGetURL(pkg, p->name)) != NULL) {
|
||||
if (Verbose)
|
||||
printf("Finished loading %s over FTP.\n", p->name);
|
||||
if (!fexists("+CONTENTS")) {
|
||||
whinge("Autoloaded package %s has no +CONTENTS file?", p->name);
|
||||
if (!Force)
|
||||
++code;
|
||||
}
|
||||
else if (vsystem("(pwd; cat +CONTENTS) | pkg_add %s-S", Verbose ? "-v " : "")) {
|
||||
whinge("pkg_add of dependency `%s' failed%s", p->name, Force ? " (proceeding anyway)" : "!");
|
||||
if (!Force)
|
||||
++code;
|
||||
}
|
||||
else if (Verbose)
|
||||
printf("\t`%s' loaded successfully.\n", p->name);
|
||||
/* Nuke the temporary playpen */
|
||||
leave_playpen(cp);
|
||||
}
|
||||
/* Nuke the temporary playpen */
|
||||
leave_playpen(cp);
|
||||
}
|
||||
else {
|
||||
if (Verbose)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static const char *rcsid = "$Id: file.c,v 1.22 1996/06/20 18:33:51 jkh Exp $";
|
||||
static const char *rcsid = "$Id: file.c,v 1.23 1996/08/01 12:13:20 jkh Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -204,6 +204,7 @@ fileGetURL(char *base, char *spec)
|
||||
*(cp + 1) = '\0';
|
||||
strcat(cp, "All/");
|
||||
strcat(cp, spec);
|
||||
strcat(cp, ".tgz");
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
@ -268,10 +269,10 @@ fileGetURL(char *base, char *spec)
|
||||
}
|
||||
else
|
||||
printf("Error: Unable to construct a new playpen for FTP!\n");
|
||||
fclose(ftp);
|
||||
}
|
||||
else
|
||||
printf("Error: FTP Unable to get %s\n", fname);
|
||||
fclose(ftp);
|
||||
return rp;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user