Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Unified Diff: chromite/lib/binpkg.py

Issue 5414001: Remove more broken urlparse.urljoin examples. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromite/lib/binpkg.py
diff --git a/chromite/lib/binpkg.py b/chromite/lib/binpkg.py
index 48adccb2093f04cc998a0d64a72db0171abc0068..75c86bcbac179519ff6fd2690c59a53b457caed7 100644
--- a/chromite/lib/binpkg.py
+++ b/chromite/lib/binpkg.py
@@ -11,7 +11,6 @@ import os
import tempfile
import time
import urllib2
-import urlparse
class PackageIndex(object):
"""A parser for the Portage Packages index file.
@@ -54,7 +53,7 @@ class PackageIndex(object):
cpv, sha1 = pkg['CPV'], pkg.get('SHA1')
if sha1:
path = pkg.get('PATH', cpv + '.tbz2')
- db[sha1] = urlparse.urljoin(uri, path)
+ db[sha1] = '%s/%s' % (uri.rstrip('/'), path)
def _ReadPkgIndex(self, pkgfile):
"""Read a list of key/value pairs from the Packages file into a dictionary.
@@ -201,7 +200,7 @@ class PackageIndex(object):
"""
self.header['URI'] = base_uri
for pkg in self.packages:
- pkg['PATH'] = urlparse.urljoin(path_prefix, pkg['CPV'] + '.tbz2')
+ pkg['PATH'] = '%s/%s' % (path_prefix.rstrip('/'), pkg['CPV'] + '.tbz2')
def Write(self, pkgfile):
"""Write a packages file to disk.
@@ -277,7 +276,7 @@ def GrabRemotePackageIndex(binhost_url):
server returns status code 404, None is returned.
"""
- url = urlparse.urljoin(binhost_url, 'Packages')
+ url = '%s/Packages' % binhost_url.rstrip('/')
try:
f = _RetryUrlOpen(url)
except urllib2.HTTPError as e:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698