'''
Returns the header for the Contents files as a string.
'''
- header_file = None
- try:
- filename = os.path.join(Config()['Dir::Templates'], 'contents')
- header_file = open(filename)
+ filename = os.path.join(Config()['Dir::Templates'], 'contents')
+ with open(filename) as header_file:
return header_file.read()
- finally:
- if header_file:
- header_file.close()
def write_file(self):
'''
deb_id = get_override_type('deb', session).overridetype_id
udeb_id = get_override_type('udeb', session).overridetype_id
pool = Pool()
+
+ # Lock tables so that nobody can change things underneath us
+ session.execute("LOCK TABLE bin_contents IN SHARE MODE")
+ session.execute("LOCK TABLE src_contents IN SHARE MODE")
+
for suite in suite_query:
suite_id = suite.suite_id
for component in component_query: