X-Git-Url: https://git.tld-linux.org/?p=tld-builder.git;a=blobdiff_plain;f=TLD_Builder%2Fget_br.py;h=867e233af1cf1383447bd7256139ca0a18e61df2;hp=933548c172d60c81a6c5034172fefcef0fd9f58b;hb=98531ab4a0e4e065d3b11b051b3e4bd7653c6ac0;hpb=e6b6d095d23af595e207bb278697e1b9423fbc53 diff --git a/TLD_Builder/get_br.py b/TLD_Builder/get_br.py index 933548c..867e233 100644 --- a/TLD_Builder/get_br.py +++ b/TLD_Builder/get_br.py @@ -13,10 +13,10 @@ def get_build_requires(spec, bconds_with, bconds_without): def expand_conds(l): def expand_one(m): if m.group(1) == "?": - if macros.has_key(m.group(2)): + if m.group(2) in macros: return m.group(3) else: - if not macros.has_key(m.group(2)): + if not m.group(2) in macros: return m.group(3) return "" @@ -29,8 +29,8 @@ def get_build_requires(spec, bconds_with, bconds_without): macro_rx = re.compile(r"%\{([a-zA-Z0-9_+]+)\}") def expand_macros(l): def expand_one(m): - if macros.has_key(m.group(1)): - return string.strip(macros[m.group(1)]) + if m.group(1) in macros: + return macros[m.group(1)].strip() else: return m.group(0) # don't change @@ -63,7 +63,7 @@ def get_build_requires(spec, bconds_with, bconds_without): f = open(spec) for l in f: - l = string.strip(l) + l = l.strip() if l == "%changelog": break # %bcond_with.. @@ -71,10 +71,10 @@ def get_build_requires(spec, bconds_with, bconds_without): if m: bcond = m.group(2) if m.group(1) == "with": - if macros.has_key("_with_%s" % bcond): + if "_with_%s" % bcond in macros: macros["with_%s" % bcond] = 1 else: - if not macros.has_key("_without_%s" % bcond): + if not "_without_%s" % bcond in macros: macros["with_%s" % bcond] = 1 continue