+ if not os.path.exists(os.path.join(path, \
+ '%s_%s.changelog' % (p, sources[p][s][0]))):
+ if not unpack.has_key(os.path.join(pool, sources[p][s][1])):
+ unpack[os.path.join(pool, sources[p][s][1])] = (path, set())
+ unpack[os.path.join(pool, sources[p][s][1])][1].add(s)
+ else:
+ for file in glob('%s/%s_%s*' % (path, p, sources[p][s][0])):
+ link = '%s%s' % (s, file.split('%s_%s' \
+ % (p, sources[p][s][0]))[1])
+ try:
+ os.unlink(os.path.join(path, link))
+ except OSError:
+ pass
+ os.link(os.path.join(path, file), os.path.join(path, link))
+
+ for p in unpack.keys():
+ package = os.path.splitext(os.path.basename(p))[0].split('_')
+ try:
+ unpacked = UnpackedSource(p)
+ tempdir = unpacked.get_root_directory()
+ stats['unpack'] += 1