diff --git a/NEWS b/NEWS index 36f1c6a6..5ff421cd 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,9 @@ xbps-0.10.0 (???): + + * Fixed issue 10 "HTTP repositories in non standard HTTP port currently segfault". + You can now any HTTP server in non standard ports, like: + + http://yourhost:8080/your/repo * xbps-bin(8): the 'check' target now detects broken symlinks and marks them as critical errors. diff --git a/etc/xbps-conf.plist b/etc/xbps-conf.plist index 7e1c49ef..4d425275 100644 --- a/etc/xbps-conf.plist +++ b/etc/xbps-conf.plist @@ -33,7 +33,12 @@ xbps-repo(8), with the exception for updating on which all repositories will be looked at and the newest version will be choosen. - + + Optionally a non default HTTP port can also be + specified like that: + + http://foo.local:8080/xbps-repo + The order matters, and the top-most matching a package pattern or name will be used. diff --git a/lib/repository_sync_index.c b/lib/repository_sync_index.c index 0e85e66d..c7f33f73 100644 --- a/lib/repository_sync_index.c +++ b/lib/repository_sync_index.c @@ -56,14 +56,20 @@ xbps_get_remote_repo_string(const char *uri) * Replace '.' ':' and '/' characters with underscores, so that * provided URL: * - * http://www.foo.org/blah/xbps/binpkg-repo + * http://nocturno.local:8080/blah/xbps/binpkg-repo * * becomes: * - * http___www_foo_org_blah_xbps_binpkg_repo + * http___nocturno_local_8080_blah_xbps_binpkg_repo * */ - p = xbps_xasprintf("%s://%s%s", url->scheme, url->host, url->doc); + if (url->port != 0) + p = xbps_xasprintf("%s://%s:%u%s", url->scheme, + url->host, url->port, url->doc); + else + p = xbps_xasprintf("%s://%s%s", url->scheme, + url->host, url->doc); + fetchFreeURL(url); if (p == NULL) return NULL;