Date: Tue, 29 Oct 2013 12:25:22 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257328 - stable/10/usr.sbin/pkg Message-ID: <201310291225.r9TCPMSG053719@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery (ports committer) Date: Tue Oct 29 12:25:22 2013 New Revision: 257328 URL: http://svnweb.freebsd.org/changeset/base/257328 Log: 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) Modified: stable/10/usr.sbin/pkg/config.c stable/10/usr.sbin/pkg/config.h stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/usr.sbin/pkg/ (props changed) Modified: stable/10/usr.sbin/pkg/config.c ============================================================================== --- stable/10/usr.sbin/pkg/config.c Tue Oct 29 11:36:31 2013 (r257327) +++ stable/10/usr.sbin/pkg/config.c Tue Oct 29 12:25:22 2013 (r257328) @@ -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, }, Modified: stable/10/usr.sbin/pkg/config.h ============================================================================== --- stable/10/usr.sbin/pkg/config.h Tue Oct 29 11:36:31 2013 (r257327) +++ stable/10/usr.sbin/pkg/config.h Tue Oct 29 12:25:22 2013 (r257328) @@ -30,6 +30,7 @@ #define _PKG_CONFIG_H #define _LOCALBASE "/usr/local" +#define URL_SCHEME_PREFIX "pkg+" typedef enum { PACKAGESITE = 0, Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Tue Oct 29 11:36:31 2013 (r257327) +++ stable/10/usr.sbin/pkg/pkg.c Tue Oct 29 12:25:22 2013 (r257328) @@ -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",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310291225.r9TCPMSG053719>