OLD | NEW |
1 # Copyright 1999-2011 Gentoo Foundation | 1 # Copyright 1999-2011 Gentoo Foundation |
2 # Distributed under the terms of the GNU General Public License v2 | 2 # Distributed under the terms of the GNU General Public License v2 |
3 | 3 |
4 from _emerge.AsynchronousLock import AsynchronousLock | 4 from _emerge.AsynchronousLock import AsynchronousLock |
5 from _emerge.SpawnProcess import SpawnProcess | 5 from _emerge.SpawnProcess import SpawnProcess |
6 try: | 6 try: |
7 from urllib.parse import urlparse as urllib_parse_urlparse | 7 from urllib.parse import urlparse as urllib_parse_urlparse |
8 except ImportError: | 8 except ImportError: |
9 from urlparse import urlparse as urllib_parse_urlparse | 9 from urlparse import urlparse as urllib_parse_urlparse |
10 import stat | 10 import stat |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 os.unlink(pkg_path) | 50 os.unlink(pkg_path) |
51 except OSError: | 51 except OSError: |
52 pass | 52 pass |
53 | 53 |
54 # urljoin doesn't work correctly with | 54 # urljoin doesn't work correctly with |
55 # unrecognized protocols like sftp | 55 # unrecognized protocols like sftp |
56 if bintree._remote_has_index: | 56 if bintree._remote_has_index: |
57 rel_uri = bintree._remotepkgs[pkg.cpv].get("PATH") | 57 rel_uri = bintree._remotepkgs[pkg.cpv].get("PATH") |
58 if not rel_uri: | 58 if not rel_uri: |
59 rel_uri = pkg.cpv + ".tbz2" | 59 rel_uri = pkg.cpv + ".tbz2" |
60 » » » uri = bintree._remote_base_uri.rstrip("/") + \ | 60 » » » remote_base_uri = bintree._remotepkgs[pkg.cpv]["BASE_URI
"] |
61 » » » » "/" + rel_uri.lstrip("/") | 61 » » » uri = remote_base_uri.rstrip("/") + "/" + rel_uri.lstrip
("/") |
62 else: | 62 else: |
63 uri = settings["PORTAGE_BINHOST"].rstrip("/") + \ | 63 uri = settings["PORTAGE_BINHOST"].rstrip("/") + \ |
64 "/" + pkg.pf + ".tbz2" | 64 "/" + pkg.pf + ".tbz2" |
65 | 65 |
66 if pretend: | 66 if pretend: |
67 portage.writemsg_stdout("\n%s\n" % uri, noiselevel=-1) | 67 portage.writemsg_stdout("\n%s\n" % uri, noiselevel=-1) |
68 self._set_returncode((self.pid, os.EX_OK)) | 68 self._set_returncode((self.pid, os.EX_OK)) |
69 self.wait() | 69 self.wait() |
70 return | 70 return |
71 | 71 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 class AlreadyLocked(portage.exception.PortageException): | 165 class AlreadyLocked(portage.exception.PortageException): |
166 pass | 166 pass |
167 | 167 |
168 def unlock(self): | 168 def unlock(self): |
169 if self._lock_obj is None: | 169 if self._lock_obj is None: |
170 return | 170 return |
171 self._lock_obj.unlock() | 171 self._lock_obj.unlock() |
172 self._lock_obj = None | 172 self._lock_obj = None |
173 self.locked = False | 173 self.locked = False |
174 | 174 |
OLD | NEW |