summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2013-10-24 10:49:55 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2013-10-24 10:49:55 +0000
commit62940ea951c273780217d7540ba4aa5c4ca0e359 (patch)
tree49f8ae4782583f334e083551b14968b105deb283
parent3a1f3e0d0c49850f65c1eaa56e2156bfde7c5027 (diff)
downloadsrc-test2-62940ea951c273780217d7540ba4aa5c4ca0e359.tar.gz
src-test2-62940ea951c273780217d7540ba4aa5c4ca0e359.zip
Notes
-rw-r--r--usr.sbin/pkg/config.c2
-rw-r--r--usr.sbin/pkg/config.h1
-rw-r--r--usr.sbin/pkg/pkg.c7
3 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c
index 429aad6e999f..6a6b27d0c425 100644
--- a/usr.sbin/pkg/config.c
+++ b/usr.sbin/pkg/config.c
@@ -62,7 +62,7 @@ static struct config_entry c[] = {
[PACKAGESITE] = {
PKG_CONFIG_STRING,
"PACKAGESITE",
- "http://pkg.FreeBSD.org/${ABI}/latest",
+ URL_SCHEME_PREFIX "http://pkg.FreeBSD.org/${ABI}/latest",
NULL,
false,
},
diff --git a/usr.sbin/pkg/config.h b/usr.sbin/pkg/config.h
index e592f6dee592..c3d877e8fe7b 100644
--- a/usr.sbin/pkg/config.h
+++ b/usr.sbin/pkg/config.h
@@ -30,6 +30,7 @@
#define _PKG_CONFIG_H
#define _LOCALBASE "/usr/local"
+#define URL_SCHEME_PREFIX "pkg+"
typedef enum {
PACKAGESITE = 0,
diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c
index 840f2a2f942c..812ae5383ad3 100644
--- a/usr.sbin/pkg/pkg.c
+++ b/usr.sbin/pkg/pkg.c
@@ -168,6 +168,13 @@ bootstrap_pkg(void)
warnx("No MIRROR_TYPE defined");
return (-1);
}
+
+ /* Support pkg+http:// for PACKAGESITE which is the new format
+ in 1.2 to avoid confusion on why http://pkg.FreeBSD.org has
+ no A record. */
+ if (strncmp(URL_SCHEME_PREFIX, packagesite,
+ strlen(URL_SCHEME_PREFIX)) == 0)
+ packagesite += strlen(URL_SCHEME_PREFIX);
snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", packagesite);
snprintf(tmppkg, MAXPATHLEN, "%s/pkg.txz.XXXXXX",