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

Side by Side Diff: pym/portage/dbapi/vartree.py

Issue 6377009: Commit fast-build patch to portage_tool repository. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/portage_tool.git@cros-2.1.9
Patch Set: Created 9 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 1998-2011 Gentoo Foundation 1 # Copyright 1998-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 __all__ = [ 4 __all__ = [
5 "vardbapi", "vartree", "dblink"] + \ 5 "vardbapi", "vartree", "dblink"] + \
6 ["write_contents", "tar_contents"] 6 ["write_contents", "tar_contents"]
7 7
8 import portage 8 import portage
9 portage.proxy.lazyimport.lazyimport(globals(), 9 portage.proxy.lazyimport.lazyimport(globals(),
10 'portage.checksum:_perform_md5_merge@perform_md5', 10 'portage.checksum:_perform_md5_merge@perform_md5',
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 return self._get_protect_obj().isprotected(obj) 1288 return self._get_protect_obj().isprotected(obj)
1289 1289
1290 def updateprotect(self): 1290 def updateprotect(self):
1291 self._get_protect_obj().updateprotect() 1291 self._get_protect_obj().updateprotect()
1292 1292
1293 def lockdb(self): 1293 def lockdb(self):
1294 if self._lock_vdb: 1294 if self._lock_vdb:
1295 raise AssertionError("Lock already held.") 1295 raise AssertionError("Lock already held.")
1296 # At least the parent needs to exist for the lock file. 1296 # At least the parent needs to exist for the lock file.
1297 ensure_dirs(self.dbroot) 1297 ensure_dirs(self.dbroot)
1298 » » if self._scheduler is None: 1298 » » if os.environ.get("PORTAGE_LOCKS") != "false":
1299 » » » self._lock_vdb = lockdir(self.dbroot) 1299 » » » if self._scheduler is None:
1300 » » else: 1300 » » » » self._lock_vdb = lockdir(self.dbroot)
1301 » » » async_lock = AsynchronousLock(path=self.dbroot, 1301 » » » else:
1302 » » » » scheduler=self._scheduler) 1302 » » » » async_lock = AsynchronousLock(path=self.dbroot,
1303 » » » async_lock.start() 1303 » » » » » scheduler=self._scheduler)
1304 » » » async_lock.wait() 1304 » » » » async_lock.start()
1305 » » » self._lock_vdb = async_lock 1305 » » » » async_lock.wait()
1306 » » » » self._lock_vdb = async_lock
1306 1307
1307 def unlockdb(self): 1308 def unlockdb(self):
1308 if self._lock_vdb is not None: 1309 if self._lock_vdb is not None:
1309 if isinstance(self._lock_vdb, AsynchronousLock): 1310 if isinstance(self._lock_vdb, AsynchronousLock):
1310 self._lock_vdb.unlock() 1311 self._lock_vdb.unlock()
1311 else: 1312 else:
1312 unlockdir(self._lock_vdb) 1313 unlockdir(self._lock_vdb)
1313 self._lock_vdb = None 1314 self._lock_vdb = None
1314 1315
1315 def getpath(self): 1316 def getpath(self):
(...skipping 2843 matching lines...) Expand 10 before | Expand all | Expand 10 after
4159 encoding=object.__getattribute__(os, '_e ncoding'), 4160 encoding=object.__getattribute__(os, '_e ncoding'),
4160 errors='strict'), 'rb') 4161 errors='strict'), 'rb')
4161 try: 4162 try:
4162 tar.addfile(tarinfo, f) 4163 tar.addfile(tarinfo, f)
4163 finally: 4164 finally:
4164 f.close() 4165 f.close()
4165 else: 4166 else:
4166 tar.addfile(tarinfo) 4167 tar.addfile(tarinfo)
4167 if onProgress: 4168 if onProgress:
4168 onProgress(maxval, curval) 4169 onProgress(maxval, curval)
OLDNEW
« 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