X-Git-Url: https://git.tld-linux.org/?p=tld-builder.git;a=blobdiff_plain;f=TLD_Builder%2Fdeps.py;h=d8cc9c4cc6050d3f69983352cfa07d4043ca7ee4;hp=404b25cac7ed3a2edb4c47d0293cb35edfd91049;hb=98531ab4a0e4e065d3b11b051b3e4bd7653c6ac0;hpb=e6b6d095d23af595e207bb278697e1b9423fbc53 diff --git a/TLD_Builder/deps.py b/TLD_Builder/deps.py index 404b25c..d8cc9c4 100644 --- a/TLD_Builder/deps.py +++ b/TLD_Builder/deps.py @@ -26,9 +26,9 @@ def compute_deps(): while 1: l = f.readline() if l == "": break - l = string.strip(l) + l = l.strip() if l == "@": - cur_pkg = string.strip(f.readline()) + cur_pkg = f.readline().strip() rpm_req[cur_pkg] = [] continue rpm_req[cur_pkg].append(l) @@ -38,7 +38,7 @@ def compute_deps(): msg("done\n") def add_provides(pkg, what): - if rpm_prov.has_key(what): + if what in rpm_prov: msg("[%s: %s, %s] " % (what, rpm_prov[what], pkg)) else: rpm_prov[what] = pkg @@ -50,9 +50,9 @@ def compute_deps(): while 1: l = f.readline() if l == "": break - l = string.strip(l) + l = l.strip() if l == "@": - cur_pkg = string.strip(f.readline()) + cur_pkg = f.readline().strip() continue add_provides(cur_pkg, l) if l[0] == '/': @@ -68,11 +68,11 @@ def compute_deps(): while 1: l = f.readline() if l == "": break - l = string.strip(l) + l = l.strip() if l == "@": - cur_pkg = string.strip(f.readline()) + cur_pkg = f.readline().strip() continue - if req_files.has_key(l): + if l in req_files: add_provides(cur_pkg, l) f.close() msg("done\n") @@ -83,7 +83,7 @@ def compute_deps(): pkg_reqs = [] for req in reqs: if req[0:7] == "rpmlib(": continue - if rpm_prov.has_key(req): + if req in rpm_prov: if rpm_prov[req] not in pkg_reqs: pkg_reqs.append(rpm_prov[req]) else: @@ -109,13 +109,13 @@ def remove_list(req, need): """ need_m = {} def close(n): - if need_m.has_key(n): return + if n in need_m: return need_m[n] = 1 - if not req.has_key(n): return + if not n in req: return for k in req[n]: close(k) for n in need: close(n) rm = [] for p in req.keys(): - if not need_m.has_key(p): rm.append(p) + if not p in need_m: rm.append(p) return rm