mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-18 13:03:58 +01:00
projects.py: Remove reference to deprecated sets module
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
e0adaa815d
commit
6c0c3af50f
1 changed files with 7 additions and 8 deletions
|
|
@ -5,7 +5,6 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
import pwd
|
import pwd
|
||||||
from sets import Set
|
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from os.path import isdir
|
from os.path import isdir
|
||||||
from os.path import expanduser
|
from os.path import expanduser
|
||||||
|
|
@ -90,7 +89,7 @@ class Build(object):
|
||||||
p.wait()
|
p.wait()
|
||||||
if p.returncode:
|
if p.returncode:
|
||||||
raise Exception("failed to get " + prereq_type + " prerequisites for " + cur + ": " + cmd)
|
raise Exception("failed to get " + prereq_type + " prerequisites for " + cur + ": " + cmd)
|
||||||
r = Set()
|
r = set()
|
||||||
pattern = re.compile(r'.*') # might be useful at a later point, currently pointless
|
pattern = re.compile(r'.*') # might be useful at a later point, currently pointless
|
||||||
for line in iter(p.stdout.readline,''):
|
for line in iter(p.stdout.readline,''):
|
||||||
debug(cmd + ' returned: ', line)
|
debug(cmd + ' returned: ', line)
|
||||||
|
|
@ -113,7 +112,7 @@ class Build(object):
|
||||||
debug('already handled module ' + cur)
|
debug('already handled module ' + cur)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
deps = Set()
|
deps = set()
|
||||||
all_deps.add(cur)
|
all_deps.add(cur)
|
||||||
for t in prereq_types:
|
for t in prereq_types:
|
||||||
debug("checking prereqisites of type " + t)
|
debug("checking prereqisites of type " + t)
|
||||||
|
|
@ -124,7 +123,7 @@ class Build(object):
|
||||||
return len(deps)
|
return len(deps)
|
||||||
|
|
||||||
def calculate_order(self, order, modules, prereq_types):
|
def calculate_order(self, order, modules, prereq_types):
|
||||||
all_deps = Set()
|
all_deps = set()
|
||||||
dep_tree = {}
|
dep_tree = {}
|
||||||
for m in modules:
|
for m in modules:
|
||||||
debug("--- adding dependency tree of module " + m)
|
debug("--- adding dependency tree of module " + m)
|
||||||
|
|
@ -462,10 +461,10 @@ def get_modules_from_project_txt(names, section, keys, add_self, scope,
|
||||||
names_only = True):
|
names_only = True):
|
||||||
if isinstance(keys, basestring):
|
if isinstance(keys, basestring):
|
||||||
keys = [ keys ]
|
keys = [ keys ]
|
||||||
#r = Set()
|
#r = set()
|
||||||
r = []
|
r = []
|
||||||
for key in keys:
|
for key in keys:
|
||||||
visited = Set()
|
visited = set()
|
||||||
for name in names:
|
for name in names:
|
||||||
rr = []
|
rr = []
|
||||||
add_modules_from_project_txt_cached(rr, visited, name, section, key, add_self, scope,
|
add_modules_from_project_txt_cached(rr, visited, name, section, key, add_self, scope,
|
||||||
|
|
@ -801,7 +800,7 @@ def flip_graph(graph):
|
||||||
for m, deps in graph.iteritems():
|
for m, deps in graph.iteritems():
|
||||||
for d in deps:
|
for d in deps:
|
||||||
if not d in r:
|
if not d in r:
|
||||||
r[d] = Set()
|
r[d] = set()
|
||||||
r[d].add(m)
|
r[d].add(m)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
@ -831,7 +830,7 @@ def cmd_check(args_):
|
||||||
path = []
|
path = []
|
||||||
read_dep_graph(args.module, args.flavour, graph)
|
read_dep_graph(args.module, args.flavour, graph)
|
||||||
unvisited = graph.keys()
|
unvisited = graph.keys()
|
||||||
temp = Set()
|
temp = set()
|
||||||
while len(unvisited) is not 0:
|
while len(unvisited) is not 0:
|
||||||
m = unvisited[0]
|
m = unvisited[0]
|
||||||
debug('checking circular dependency of', m)
|
debug('checking circular dependency of', m)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue