Supress duplicate setup_requires in mirror.

Use an unordered set to ensure that when we add setup_requires
to the list of frozen requirements we don't have duplicates.

Change-Id: I1f11cfe52b6732b5d7dc24b687b6f9f7ba3ffb99
Reviewed-on: https://review.openstack.org/24949
Reviewed-by: Khai Do <zaro0508@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
This commit is contained in:
James E. Blair 2013-03-20 16:59:35 -07:00 committed by Jenkins
parent 2143170750
commit 69dd377ae9

View File

@ -143,14 +143,14 @@ class Mirror(object):
return new_reqs
def find_pkg_info(self, path):
versions = []
versions = set()
for root, dirs, files in os.walk(path):
if not root.endswith('.egg'):
continue
if not os.path.exists(os.path.join(root, 'EGG-INFO', 'PKG-INFO')):
continue
package = pkginfo.Develop(root)
versions.append('%s==%s' % (package.name, package.version))
versions.add('%s==%s' % (package.name, package.version))
return versions
def build_mirror(self, mirror):
@ -232,8 +232,7 @@ class Mirror(object):
for line in freeze.split("\n"):
if line.startswith("-e ") or (
"==" in line and " " not in line):
if line not in requires:
requires.append(line)
requires.add(line)
for r in requires:
reqfd.write(r + "\n")
reqfd.close()