diff options
author | sobomax <sobomax@FreeBSD.org> | 2002-09-03 06:59:33 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2002-09-03 06:59:33 +0000 |
commit | 667ea4927b59940ae12e7e06a5ef0d51adbf1509 (patch) | |
tree | 8fe10f4065002928d711d8f511ca2201788205a1 /usr.sbin/pkg_install/add | |
parent | 15a569fc657c1c03293e521886504b8f4837d166 (diff) | |
download | FreeBSD-src-667ea4927b59940ae12e7e06a5ef0d51adbf1509.zip FreeBSD-src-667ea4927b59940ae12e7e06a5ef0d51adbf1509.tar.gz |
When installing package from a local file assume that all subsequent
autoinstalled dependencies will have the same extension, not just
".tbz".
Pointy hat to: obrien
X-MFC after: -1 day
Diffstat (limited to 'usr.sbin/pkg_install/add')
-rw-r--r-- | usr.sbin/pkg_install/add/perform.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c index e1ef7a3..90d4420 100644 --- a/usr.sbin/pkg_install/add/perform.c +++ b/usr.sbin/pkg_install/add/perform.c @@ -267,8 +267,12 @@ pkg_do(char *pkg) if (!Fake) { if (!isURL(pkg) && !getenv("PKG_ADD_BASE")) { - /* XXX: need to handle .tgz also */ - snprintf(path, FILENAME_MAX, "%s/%s.tbz", getenv("_TOP"), p->name); + const char *ext; + + ext = strrchr(pkg_fullname, '.'); + if (ext == NULL) + ext = ".tbz"; + snprintf(path, FILENAME_MAX, "%s/%s%s", getenv("_TOP"), p->name, ext); if (fexists(path)) cp = path; else |