Skip to content
Browse files

MFC r257051:

  Add support for using "pkg+http://" for the PACKAGESITE.

  pkg 1.2 is adding this support as well. This should help
  lessen the confusion on why the default SRV PACKAGESITE
  does not load in a browser.

Approved by:	bapt
Approved by:	re (glebius)
  • Loading branch information...
1 parent 7fcf877 commit b8f1640fa056402fce0911df2228e42d9b90a2f5 @bdrewery bdrewery committed Oct 29, 2013
Showing with 9 additions and 1 deletion.
  1. +1 −1 usr.sbin/pkg/config.c
  2. +1 −0 usr.sbin/pkg/config.h
  3. +7 −0 usr.sbin/pkg/pkg.c
View
2 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,
},
View
1 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,
View
7 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",

0 comments on commit b8f1640

Please sign in to comment.
Something went wrong with that request. Please try again.