+ for dir in dirs:
+ try:
+ os.rmdir(os.path.join(root, dir))
+ except OSError:
+ pass
+ stats['files'] += len(files)
+ stats['files'] -= stats['removed']
+
+ print 'make-changelog: file exporting finished'
+ print ' * New packages unpacked: %d' % stats['unpack']
+ print ' * New files created: %d' % stats['created']
+ print ' * New files removed: %d' % stats['removed']
+ print ' * Unpack errors: %d' % stats['errors']
+ print ' * Files available into changelog pool: %d' % stats['files']
+
+def generate_export_filelist(clpool):
+ clfiles = {}
+ for root, dirs, files in os.walk(clpool):
+ for file in [f for f in files if f != filelist]:
+ clpath = os.path.join(root, file).replace(clpool, '').strip('/')
+ source = clpath.split('/')[2]
+ elements = clpath.split('/')[3].split('_')
+ if source not in clfiles:
+ clfiles[source] = {}
+ if elements[0] == source:
+ if elements[1] not in clfiles[source]:
+ clfiles[source][elements[1]] = []
+ clfiles[source][elements[1]].append(clpath)
+ else:
+ if elements[0] not in clfiles[source]:
+ clfiles[source][elements[0]] = []
+ clfiles[source][elements[0]].append(clpath)
+ with open(os.path.join(clpool, filelist), 'w+') as fd:
+ safe_dump(clfiles, fd, default_flow_style=False)