diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-07-01 12:53:07 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-07-01 12:53:07 +0000 |
commit | 56aea2672000174743514bcc7f58f41733f64ce4 (patch) | |
tree | c6d9cb04d5b2d50eb0670354a42123ac4e78c44c /bin/repoman | |
parent | a4c79bdfd0b8e5a58ce1bfd181a41a8625370b73 (diff) | |
download | portage-56aea2672000174743514bcc7f58f41733f64ce4.tar.gz portage-56aea2672000174743514bcc7f58f41733f64ce4.tar.bz2 portage-56aea2672000174743514bcc7f58f41733f64ce4.zip |
Py3k compatibility patch #5 by Ali Polatel <hawking@g.o>.
Replace dict.has_key() calls with "in" and "not in" operators.
svn path=/main/trunk/; revision=10874
Diffstat (limited to 'bin/repoman')
-rwxr-xr-x | bin/repoman | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/repoman b/bin/repoman index a131eadc5..09042b1e2 100755 --- a/bin/repoman +++ b/bin/repoman @@ -662,7 +662,7 @@ if os.path.exists(descfile): if not os.path.isdir(portdir+"/profiles/"+arch[1]): print "Invalid "+arch[2]+" profile ("+arch[1]+") for arch "+arch[0] continue - if profiles.has_key(arch[0]): + if arch[0] in profiles: profiles[arch[0]]+= [[arch[1], arch[2]]] else: profiles[arch[0]] = [[arch[1], arch[2]]] @@ -670,7 +670,7 @@ if os.path.exists(descfile): for x in repoman_settings.archlist(): if x[0] == "~": continue - if not profiles.has_key(x): + if x not in profiles: print red("\""+x+"\" doesn't have a valid profile listed in profiles.desc.") print red("You need to either \"cvs update\" your profiles dir or follow this") print red("up with the "+x+" team.") @@ -1335,7 +1335,7 @@ for x in scanlist: # uselist checks - local mykey = portage.dep_getkey(catpkg) - if luselist.has_key(mykey): + if mykey in luselist: for mypos in range(len(myuse)-1,-1,-1): if myuse[mypos] and (myuse[mypos] in luselist[mykey]): del myuse[mypos] @@ -1380,7 +1380,7 @@ for x in scanlist: if myskey not in kwlist: stats["KEYWORDS.invalid"] += 1 fails["KEYWORDS.invalid"].append(x+"/"+y+".ebuild: %s" % mykey) - elif not profiles.has_key(myskey): + elif myskey not in profiles: stats["KEYWORDS.invalid"] += 1 fails["KEYWORDS.invalid"].append(x+"/"+y+".ebuild: %s (profile invalid)" % mykey) @@ -1420,7 +1420,7 @@ for x in scanlist: for keyword,arch,groups in arches: - if not profiles.has_key(arch): + if arch not in profiles: # A missing profile will create an error further down # during the KEYWORDS verification. continue @@ -1833,7 +1833,7 @@ else: if "PORTAGE_GPG_KEY" not in repoman_settings: raise portage.exception.MissingParameter("PORTAGE_GPG_KEY is unset!") if "PORTAGE_GPG_DIR" not in repoman_settings: - if os.environ.has_key("HOME"): + if "HOME" in os.environ: repoman_settings["PORTAGE_GPG_DIR"] = os.path.join(os.environ["HOME"], ".gnupg") logging.info("Automatically setting PORTAGE_GPG_DIR to %s" % repoman_settings["PORTAGE_GPG_DIR"]) else: @@ -1848,7 +1848,7 @@ else: repoman_settings["PORTAGE_GPG_DIR"]) gpgcmd = "gpg --sign --clearsign --yes " gpgcmd+= "--default-key "+repoman_settings["PORTAGE_GPG_KEY"] - if repoman_settings.has_key("PORTAGE_GPG_DIR"): + if "PORTAGE_GPG_DIR" in repoman_settings: gpgcmd += " --homedir "+repoman_settings["PORTAGE_GPG_DIR"] if options.pretend: print "("+gpgcmd+" "+filename+")" |