diff options
author | bapt <bapt@FreeBSD.org> | 2016-06-08 22:04:50 +0800 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2016-06-08 22:04:50 +0800 |
commit | 980306962ba4450dfc28d3a586e398b70fe40162 (patch) | |
tree | 0b56884dbe1fa03f2e35a20a1b1fa6a9cafeb7d2 /ports-mgmt | |
parent | 4e29ef351b468a0f79429e00fcca5933c13b6124 (diff) | |
download | freebsd-ports-gnome-980306962ba4450dfc28d3a586e398b70fe40162.tar.gz freebsd-ports-gnome-980306962ba4450dfc28d3a586e398b70fe40162.tar.zst freebsd-ports-gnome-980306962ba4450dfc28d3a586e398b70fe40162.zip |
Add a patch to fix grabbing mirror lists over https
Note that people are using mirror_type: http when they should not
most probably due to bad documentation on our side so we will improve that later
mirror_type: http is only useful if you actually host multiple mirror of your
repos see pkg-repository(5).
Diffstat (limited to 'ports-mgmt')
-rw-r--r-- | ports-mgmt/pkg/Makefile | 1 | ||||
-rw-r--r-- | ports-mgmt/pkg/files/patch-https-mirrors | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/ports-mgmt/pkg/Makefile b/ports-mgmt/pkg/Makefile index 5bee207ee284..15e8ad91ac36 100644 --- a/ports-mgmt/pkg/Makefile +++ b/ports-mgmt/pkg/Makefile @@ -2,6 +2,7 @@ PORTNAME= pkg DISTVERSION= 1.8.4 +PORTREVISION= 1 _PKG_VERSION= ${DISTVERSION} CATEGORIES= ports-mgmt MASTER_SITES= \ diff --git a/ports-mgmt/pkg/files/patch-https-mirrors b/ports-mgmt/pkg/files/patch-https-mirrors new file mode 100644 index 000000000000..bf3f01c9f1af --- /dev/null +++ b/ports-mgmt/pkg/files/patch-https-mirrors @@ -0,0 +1,19 @@ +diff --git libpkg/fetch.c libpkg/fetch.c +index 4804ad0..16ab9c7 100644 +--- libpkg/fetch.c ++++ libpkg/fetch.c +@@ -549,8 +549,12 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest, + srv_current = repo->srv; + } else if (repo != NULL && repo->mirror_type == HTTP && + strncmp(u->scheme, "http", 4) == 0) { +- if (u->port == 0) +- u->port = 80; ++ if (u->port == 0) { ++ if (strcmp(u->scheme, "https") == 0) ++ u->port = 443; ++ else ++ u->port = 80; ++ } + snprintf(zone, sizeof(zone), + "%s://%s:%d", u->scheme, u->host, u->port); + if (repo->http == NULL) |