diff options
author | jkh <jkh@FreeBSD.org> | 1996-10-14 19:41:44 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-10-14 19:41:44 +0000 |
commit | 34c1fc6b4c443af12c5291d3126b51b4f1ee7fc8 (patch) | |
tree | cbd92e44057f5549844e91cf2d6a22dd99c63211 /usr.sbin/pkg_install | |
parent | ae8e60c1450d4218db663293d75388fde3eee90e (diff) | |
download | FreeBSD-src-34c1fc6b4c443af12c5291d3126b51b4f1ee7fc8.zip FreeBSD-src-34c1fc6b4c443af12c5291d3126b51b4f1ee7fc8.tar.gz |
Fix PR#1557 - chained package dependencies using URLs didn't work.
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r-- | usr.sbin/pkg_install/add/perform.c | 63 | ||||
-rw-r--r-- | usr.sbin/pkg_install/lib/file.c | 5 |
2 files changed, 35 insertions, 33 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c index 2c935a23..95e4ac7 100644 --- a/usr.sbin/pkg_install/add/perform.c +++ b/usr.sbin/pkg_install/add/perform.c @@ -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) diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c index c268ce2..19a93ce 100644 --- a/usr.sbin/pkg_install/lib/file.c +++ b/usr.sbin/pkg_install/lib/file.c @@ -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; } |