summaryrefslogtreecommitdiff
path: root/ports-mgmt/pkg-devel/files
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2013-05-30 17:53:07 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2013-05-30 17:53:07 +0000
commitaf74337567694e5cdb40240656154280a13a4c8b (patch)
tree3a9bab50e472913d3d2a34f37068cb45c5b015a7 /ports-mgmt/pkg-devel/files
parent- Trim Makefile header (diff)
Fix pkg audit -F
Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Notes
Notes: svn path=/head/; revision=319440
Diffstat (limited to 'ports-mgmt/pkg-devel/files')
-rw-r--r--ports-mgmt/pkg-devel/files/patch-audit48
1 files changed, 48 insertions, 0 deletions
diff --git a/ports-mgmt/pkg-devel/files/patch-audit b/ports-mgmt/pkg-devel/files/patch-audit
new file mode 100644
index 000000000000..b202d8a61ada
--- /dev/null
+++ b/ports-mgmt/pkg-devel/files/patch-audit
@@ -0,0 +1,48 @@
+diff --git libpkg/fetch.c libpkg/fetch.c
+index 88979da..5dd3a94 100644
+--- libpkg/fetch.c
++++ libpkg/fetch.c
+@@ -250,7 +250,7 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest, time_t *t
+ doc = u->doc;
+ while (remote == NULL) {
+ if (retry == max_retry) {
+- if (repo->mirror_type == SRV &&
++ if (repo != NULL && repo->mirror_type == SRV &&
+ (strncmp(u->scheme, "http", 4) == 0
+ || strcmp(u->scheme, "ftp") == 0)) {
+ snprintf(zone, sizeof(zone),
+@@ -258,7 +258,7 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest, time_t *t
+ if (repo->srv == NULL)
+ repo->srv = dns_getsrvinfo(zone);
+ srv_current = repo->srv;
+- } else if (repo->mirror_type == HTTP &&
++ } else if (repo != NULL && repo->mirror_type == HTTP &&
+ strncmp(u->scheme, "http", 4) == 0) {
+ snprintf(zone, sizeof(zone),
+ "%s://%s", u->scheme, u->host);
+@@ -268,9 +268,9 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest, time_t *t
+ }
+ }
+
+- if (repo->mirror_type == SRV && repo->srv != NULL)
++ if (repo != NULL && repo->mirror_type == SRV && repo->srv != NULL)
+ strlcpy(u->host, srv_current->host, sizeof(u->host));
+- else if (repo->mirror_type == HTTP && repo->http != NULL) {
++ else if (repo != NULL && repo->mirror_type == HTTP && repo->http != NULL) {
+ strlcpy(u->scheme, http_current->url->scheme, sizeof(u->scheme));
+ strlcpy(u->host, http_current->url->host, sizeof(u->host));
+ snprintf(docpath, MAXPATHLEN, "%s%s", http_current->url->doc, doc);
+@@ -291,11 +291,11 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest, time_t *t
+ retcode = EPKG_FATAL;
+ goto cleanup;
+ }
+- if (repo->mirror_type == SRV && repo->srv != NULL) {
++ if (repo != NULL && repo->mirror_type == SRV && repo->srv != NULL) {
+ srv_current = srv_current->next;
+ if (srv_current == NULL)
+ srv_current = repo->srv;
+- } else if (repo->mirror_type == HTTP && repo->http != NULL) {
++ } else if (repo != NULL && repo->mirror_type == HTTP && repo->http != NULL) {
+ http_current = repo->http->next;
+ if (http_current == NULL)
+ http_current = repo->http;