mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-13 15:37:02 +00:00
python-apt/precise workaround: Don't prematurely close TagFile fd
Don't close underlying fd right after opening an apt_pkg.TagFile, as that will prematurely end the iteration. This seems to work with more recent python3-apt, but not with Ubuntu 12.04 LTS.
This commit is contained in:
parent
32f33baf09
commit
c5f6ad6452
11
britney.py
11
britney.py
@ -590,8 +590,8 @@ class Britney(object):
|
|||||||
filename = os.path.join(basedir, "Sources")
|
filename = os.path.join(basedir, "Sources")
|
||||||
self.__log("Loading source packages from %s" % filename)
|
self.__log("Loading source packages from %s" % filename)
|
||||||
|
|
||||||
with open(filename, encoding='utf-8') as f:
|
f = open(filename, encoding='utf-8')
|
||||||
Packages = apt_pkg.TagFile(f)
|
Packages = apt_pkg.TagFile(f)
|
||||||
get_field = Packages.section.get
|
get_field = Packages.section.get
|
||||||
step = Packages.step
|
step = Packages.step
|
||||||
|
|
||||||
@ -614,6 +614,7 @@ class Britney(object):
|
|||||||
False,
|
False,
|
||||||
get_field('Testsuite', '').startswith('autopkgtest'),
|
get_field('Testsuite', '').startswith('autopkgtest'),
|
||||||
]
|
]
|
||||||
|
f.close()
|
||||||
return sources
|
return sources
|
||||||
|
|
||||||
def read_binaries(self, basedir, distribution, arch, intern=sys.intern):
|
def read_binaries(self, basedir, distribution, arch, intern=sys.intern):
|
||||||
@ -647,8 +648,8 @@ class Britney(object):
|
|||||||
filename = os.path.join(basedir, "Packages_%s" % arch)
|
filename = os.path.join(basedir, "Packages_%s" % arch)
|
||||||
self.__log("Loading binary packages from %s" % filename)
|
self.__log("Loading binary packages from %s" % filename)
|
||||||
|
|
||||||
with open(filename, encoding='utf-8') as f:
|
f = open(filename, encoding='utf-8')
|
||||||
Packages = apt_pkg.TagFile(f)
|
Packages = apt_pkg.TagFile(f)
|
||||||
get_field = Packages.section.get
|
get_field = Packages.section.get
|
||||||
step = Packages.step
|
step = Packages.step
|
||||||
|
|
||||||
@ -735,6 +736,8 @@ class Britney(object):
|
|||||||
# add the resulting dictionary to the package list
|
# add the resulting dictionary to the package list
|
||||||
packages[pkg] = dpkg
|
packages[pkg] = dpkg
|
||||||
|
|
||||||
|
f.close()
|
||||||
|
|
||||||
# loop again on the list of packages to register reverse dependencies and conflicts
|
# loop again on the list of packages to register reverse dependencies and conflicts
|
||||||
register_reverses(packages, provides, check_doubles=False)
|
register_reverses(packages, provides, check_doubles=False)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user