- return utils.open_file(pathname, "w")
-
-def writeSourceList(suite, component, session):
- file = listPath(suite, component)
- for filename in getSources(suite, component, session):
+ 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(args):
+ (suite, component, incremental_mode) = args
+ (file, timestamp) = listPath(suite, component,
+ incremental_mode = incremental_mode)
+ session = DBConn().session()
+ for filename in getSources(suite, component, session, timestamp):