summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/vartree.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-10-25 02:32:35 -0700
committerZac Medico <zmedico@gentoo.org>2012-10-25 02:35:02 -0700
commitfa83d9cbe167f5fb54052f544cad4ddd7a264843 (patch)
tree7b784133258ebdb6d1d42b0b352bca6740770cbe /pym/portage/dbapi/vartree.py
parent10b6d0129d062f4d5d8a7611023c3f8cc43f1eab (diff)
downloadportage-fa83d9cbe167f5fb54052f544cad4ddd7a264843.tar.gz
portage-fa83d9cbe167f5fb54052f544cad4ddd7a264843.tar.bz2
portage-fa83d9cbe167f5fb54052f544cad4ddd7a264843.zip
MergeProcess: cache syncfs libc library lookup
Diffstat (limited to 'pym/portage/dbapi/vartree.py')
-rw-r--r--pym/portage/dbapi/vartree.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index edc477a09..beaeda730 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -4694,7 +4694,7 @@ class dblink(object):
"merge-sync" not in self.settings.features:
return
- syncfs = self._get_syncfs()
+ syncfs = _get_syncfs()
if syncfs is None:
try:
proc = subprocess.Popen(["sync"])
@@ -4716,19 +4716,6 @@ class dblink(object):
finally:
os.close(fd)
- def _get_syncfs(self):
- if platform.system() == "Linux":
- filename = find_library("c")
- if filename is not None:
- library = LoadLibrary(filename)
- if library is not None:
- try:
- return library.syncfs
- except AttributeError:
- pass
-
- return None
-
def merge(self, mergeroot, inforoot, myroot=None, myebuild=None, cleanup=0,
mydbapi=None, prev_mtimes=None, counter=None):
"""
@@ -4907,6 +4894,19 @@ class dblink(object):
finally:
self.unlockdb()
+def _get_syncfs():
+ if platform.system() == "Linux":
+ filename = find_library("c")
+ if filename is not None:
+ library = LoadLibrary(filename)
+ if library is not None:
+ try:
+ return library.syncfs
+ except AttributeError:
+ pass
+
+ return None
+
def merge(mycat, mypkg, pkgloc, infloc,
myroot=None, settings=None, myebuild=None,
mytree=None, mydbapi=None, vartree=None, prev_mtimes=None, blockers=None,