summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/lib
diff options
context:
space:
mode:
authorjpaetzel <jpaetzel@FreeBSD.org>2012-05-30 21:01:06 +0000
committerjpaetzel <jpaetzel@FreeBSD.org>2012-05-30 21:01:06 +0000
commitd180b79aba010f40355b761a3cbc9d929a22780f (patch)
tree5870933a1ee3ebda24b057de60b18a54804c1774 /usr.sbin/pkg_install/lib
parentdc64091687e3961e47dd73228c98b19328e0afe2 (diff)
downloadFreeBSD-src-d180b79aba010f40355b761a3cbc9d929a22780f.zip
FreeBSD-src-d180b79aba010f40355b761a3cbc9d929a22780f.tar.gz
Let pkg_add use the ENV variable PACKAGESUFFIX. This
can be used to override the default .tbz package extension to .txz .tgz or .tar Submitted by: kmoore Obtained from: PC-BSD Sponsored by: iXsystems MFC after: 3 days
Diffstat (limited to 'usr.sbin/pkg_install/lib')
-rw-r--r--usr.sbin/pkg_install/lib/file.c2
-rw-r--r--usr.sbin/pkg_install/lib/url.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c
index 79d4df7..98413c6 100644
--- a/usr.sbin/pkg_install/lib/file.c
+++ b/usr.sbin/pkg_install/lib/file.c
@@ -140,7 +140,7 @@ fileFindByPath(const char *base, const char *fname)
{
static char tmp[FILENAME_MAX];
char *cp;
- const char *suffixes[] = {".tbz", ".tgz", ".tar", NULL};
+ const char *suffixes[] = {".tbz", ".tgz", ".tar", ".txz", NULL};
int i;
if (fexists(fname) && isfile(fname)) {
diff --git a/usr.sbin/pkg_install/lib/url.c b/usr.sbin/pkg_install/lib/url.c
index 0097a91..80d306c 100644
--- a/usr.sbin/pkg_install/lib/url.c
+++ b/usr.sbin/pkg_install/lib/url.c
@@ -73,7 +73,10 @@ fileGetURL(const char *base, const char *spec, int keep_package)
*(cp + 1) = '\0';
strcat(cp, "All/");
strcat(cp, spec);
- strcat(cp, ".tbz");
+ if (getenv("PACKAGESUFFIX"))
+ strcat(cp, getenv("PACKAGESUFFIX"));
+ else
+ strcat(cp, ".tbz");
}
else
return NULL;
@@ -85,7 +88,10 @@ fileGetURL(const char *base, const char *spec, int keep_package)
*/
strcpy(fname, hint);
strcat(fname, spec);
- strcat(fname, ".tbz");
+ if (getenv("PACKAGESUFFIX"))
+ strcat(fname, getenv("PACKAGESUFFIX"));
+ else
+ strcat(fname, ".tbz");
}
}
else
OpenPOWER on IntegriCloud