Convert myoptions from a list to a dict. (trunk r7714)
authorZac Medico <zmedico@gentoo.org>
Thu, 6 Sep 2007 17:57:10 +0000 (17:57 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 6 Sep 2007 17:57:10 +0000 (17:57 -0000)
svn path=/main/branches/2.1.2/; revision=7743

bin/repoman

index f4a33f7c3177558549641062fa056228e808f3fc..d75822054ef3cc8eb3828cae288a95e13f58c8ec 100755 (executable)
@@ -348,7 +348,7 @@ def last():
        sys.exit(1)
 
 mymode=None
-myoptions=[]
+myoptions = {}
 if len(sys.argv)>1:
        x=1
        while x < len(sys.argv):
@@ -373,8 +373,8 @@ if len(sys.argv)>1:
                                verbose+=1
                        elif (optionx=="--quiet"):
                                quiet+=1
-                       elif optionx not in myoptions:
-                               myoptions.append(optionx)
+                       else:
+                               myoptions[optionx] = True
                else:
                        err_help("\""+sys.argv[x]+"\" is not a valid mode or option.")
                x=x+1
@@ -387,8 +387,7 @@ if ("--version" in myoptions):
 if mymode=="last" or (mymode=="lfull"):
        last()
 if mymode == "commit":
-       while "--ignore-masked" in myoptions:
-               myoptions.remove("--ignore-masked")
+       myoptions.pop("--ignore-masked", None)
 
 from portage import normalize_path
 isCvs=False
@@ -401,7 +400,7 @@ if mymode == "commit" and \
        "--pretend" not in myoptions:
        print
        print darkgreen("Not in a CVS repository; enabling pretend mode.")
-       myoptions.append("--pretend");
+       myoptions["--pretend"] = True
 
 
 def have_profile_dir(path, maxdepth=3):