Fixed HTTP repositories in non standard HTTP port (80).

The code didn't take into account for different ports and simply ignored
them, now they work correctly. This fixes issue 10 in googlecode.
This commit is contained in:
Juan RP 2011-10-06 19:05:16 +02:00
parent e43603847e
commit 024bec0045
3 changed files with 20 additions and 4 deletions

5
NEWS
View File

@ -1,5 +1,10 @@
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.

View File

@ -34,6 +34,11 @@
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.

View File

@ -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;