+ file = utils.open_file(pathname, "a")
+ timestamp = None
+ if incremental_mode:
+ timestamp = os.fstat(file.fileno())[stat.ST_MTIME]
+ else:
+ file.seek(0)
+ file.truncate()
+ return (file, timestamp)
+
+def writeSourceList(suite_id, component_id, incremental_mode):
+ session = DBConn().session()
+ suite = Suite.get(suite_id, session)
+ component = Component.get(component_id, session)
+ (file, timestamp) = listPath(suite, component,
+ incremental_mode = incremental_mode)
+
+ message = "sources list for %s %s" % (suite.suite_name, component.component_name)
+
+ for _, filename in getSources(suite, component, session, timestamp):
+ file.write(filename + '\n')
+ session.rollback()
+ file.close()
+ return (PROC_STATUS_SUCCESS, message)
+
+def writeAllList(suite_id, component_id, architecture_id, type, incremental_mode):
+ session = DBConn().session()
+ suite = Suite.get(suite_id, session)
+ component = Component.get(component_id, session)
+ architecture = Architecture.get(architecture_id, session)
+ (file, timestamp) = listPath(suite, component, architecture, type,
+ incremental_mode)
+
+ message = "all list for %s %s (arch=%s, type=%s)" % (suite.suite_name, component.component_name, architecture.arch_string, type)