Remove all dependence on the portage.features global variable.
authorZac Medico <zmedico@gentoo.org>
Tue, 25 Apr 2006 10:55:31 +0000 (10:55 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 25 Apr 2006 10:55:31 +0000 (10:55 -0000)
svn path=/main/trunk/; revision=3233

bin/emerge
bin/repoman
pym/portage.py

index 5f7e047bb51b400bece25fd065f0c06e7aa3b29f..7a73fede64eb0c35ee38a529a5aecbfc178b61fe 100755 (executable)
@@ -166,8 +166,8 @@ if portage.settings.has_key("PORTAGE_NICENESS"):
 portage.portdb.freeze()
 
 # Kill noauto as it will break merges otherwise.
-while 'noauto' in portage.features:
-       del portage.features[portage.features.index('noauto')]
+while 'noauto' in portage.settings.features:
+       portage.settings.features.remove('noauto')
 
 #number of ebuilds merged
 merged=0
@@ -332,7 +332,7 @@ if ("--quiet" in myopts):
 
 # Always create packages if FEATURES=buildpkg
 # Imply --buildpkg if --buildpkgonly
-if ("buildpkg" in portage.features) or ("--buildpkgonly" in myopts):
+if ("buildpkg" in portage.settings.features) or ("--buildpkgonly" in myopts):
        if "--buildpkg" not in myopts:
                myopts.append("--buildpkg")
 
@@ -350,7 +350,7 @@ if ("--searchdesc" in myopts):
        myaction = "search"
 
 # Always try and fetch binary packages if FEATURES=getbinpkg
-if ("getbinpkg" in portage.features):
+if ("getbinpkg" in portage.settings.features):
        myopts.append("--getbinpkg")
 
 if "--skipfirst" in myopts and "--resume" not in myopts:
@@ -403,7 +403,7 @@ if ("--debug" in myopts):
        portage.settings.backup_changes("PORTAGE_DEBUG")
        portage.debug=1
        portage.settings.lock()
-       if "python-trace" in portage.features:
+       if "python-trace" in portage.settings.features:
                import portage_debug
                portage_debug.set_trace(True)
 
@@ -434,7 +434,7 @@ if portage.settings["EMERGE_WARNING_DELAY"]:
        EMERGE_WARNING_DELAY = string.atoi("0"+portage.settings["EMERGE_WARNING_DELAY"])
 
 def emergelog(mystr,short_msg=None):
-       if "notitles" not in portage.features:
+       if "notitles" not in portage.settings.features:
                if short_msg:
                        xtermTitle(short_msg)
                else:
@@ -465,7 +465,7 @@ def emergeexit():
        """This gets out final log message in before we quit."""
        if "--pretend" not in myopts:
                emergelog(" *** terminating.")
-       if "notitles" not in portage.features:
+       if "notitles" not in portage.settings.features:
                xtermTitleReset()
 portage.atexit_register(emergeexit)
 
@@ -2094,7 +2094,7 @@ class depgraph:
                                                                os.execv(mynewargv[0], mynewargv)
 
                        if ("--pretend" not in myopts) and ("--fetchonly" not in myopts) and ("--fetch-all-uri" not in myopts):
-                               if "noclean" not in portage.features:
+                               if "noclean" not in portage.settings.features:
                                        short_msg = "emerge: (%s of %s) %s Clean Post" % \
                                                (mergecount, len(mymergelist), x[pkgindex])
                                        emergelog(" === (%s of %s) Post-Build Cleaning (%s::%s)" % \
@@ -3041,7 +3041,7 @@ elif "info"==myaction:
        output=commands.getstatusoutput("distcc --version")
        if not output[0]:
                print str(string.split(output[1],"\n",1)[0]),
-               if "distcc" in portage.features:
+               if "distcc" in portage.settings.features:
                        print "[enabled]"
                else:
                        print "[disabled]"
@@ -3049,7 +3049,7 @@ elif "info"==myaction:
        output=commands.getstatusoutput("ccache -V")
        if not output[0]:
                print str(string.split(output[1],"\n",1)[0]),
-               if "ccache" in portage.features:
+               if "ccache" in portage.settings.features:
                        print "[enabled]"
                else:
                        print "[disabled]"
index 129e05720b900f3096e2797f773ff76af4dff224..5c3b1319369e00b8304146292bc83f36f6201a4d 100755 (executable)
@@ -383,7 +383,7 @@ isCvs=False
 myreporoot=None
 if os.path.isdir("CVS"):
        repoman_settings["PORTDIR_OVERLAY"]=""
-       if "cvs" not in portage.features:
+       if "cvs" not in repoman_settings.features:
                print
                print
                print red('!!! You do not have ')+bold('FEATURES="cvs" ')+red("enabled...")
@@ -859,7 +859,7 @@ for x in scanlist:
                                                        else:
                                                                stats["digest.partial"] += 1
                                                                fails["digest.partial"].append(y+"::"+myf)
-                                               elif "assume-digests" not in portage.features:
+                                               elif "assume-digests" not in repoman_settings.features:
                                                        if os.path.exists(myff):
                                                                if not portage_checksum.verify_all(myff, mydigests[myf]):
                                                                        stats["digest.fail"] += 1
@@ -1632,7 +1632,7 @@ else:
                        sys.exit(1)
 
                # Force an unsigned commit when more than one Manifest needs to be signed.
-               if repolevel < 3 and "sign" in portage.features:
+               if repolevel < 3 and "sign" in repoman_settings.features:
                        if "--pretend" in myoptions:
                                print "(/usr/bin/cvs -q commit -F "+commitmessagefile+")"
                        else:
@@ -1648,7 +1648,7 @@ else:
                        need_commit = True
 
        signed = False
-       if "sign" in portage.features:
+       if "sign" in repoman_settings.features:
                signed = True
                try:
                        if repolevel==3:   # In a package dir
index b493f7e1a949a8591674e4feb539abe8eda44d31..b1816530ae0af9d9d9c4a37aec0fa49e306d3fd7 100644 (file)
@@ -308,7 +308,6 @@ def listdir(mypath, recursive=False, filesonly=False, ignorecvs=False, ignorelis
        return rlist
 
 starttime=long(time.time())
-features=[]
 
 def tokenize(mystring):
        """breaks a string like 'foo? (bar) oni? (blah (blah))'
@@ -1736,6 +1735,7 @@ def spawn(mystring,mysettings,debug=0,free=0,droppriv=0,sesandbox=0,fd_pipes=Non
                env=mysettings.environ()
                keywords["opt_name"]="[%s]" % mysettings["PF"]
 
+       features = mysettings.features
        # XXX: Negative RESTRICT word
        droppriv=(droppriv and ("userpriv" in features) and not \
                (("nouserpriv" in string.split(mysettings["RESTRICT"])) or \
@@ -1770,6 +1770,7 @@ def spawn(mystring,mysettings,debug=0,free=0,droppriv=0,sesandbox=0,fd_pipes=Non
 def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",use_locks=1, try_mirrors=1):
        "fetch files.  Will use digest file if available."
 
+       features = mysettings.features
        # 'nomirror' is bad/negative logic. You Restrict mirroring, not no-mirroring.
        if ("mirror" in mysettings["RESTRICT"].split()) or \
           ("nomirror" in mysettings["RESTRICT"].split()):
@@ -2256,7 +2257,7 @@ def digestcheck(myfiles, mysettings, strict=0, justmanifest=0):
 
 # parse actionmap to spawn ebuild with the appropriate args
 def spawnebuild(mydo,actionmap,mysettings,debug,alwaysdep=0,logfile=None):
-       if alwaysdep or ("noauto" not in features):
+       if alwaysdep or "noauto" not in mysettings.features:
                # process dependency first
                if "dep" in actionmap[mydo].keys():
                        retval=spawnebuild(actionmap[mydo]["dep"],actionmap,mysettings,debug,alwaysdep=alwaysdep,logfile=logfile)
@@ -2474,7 +2475,7 @@ def prepare_build_dirs(myroot, mysettings, cleanup):
        filemode =   060
        modemask =    02
        for myfeature, kwargs in features_dirs.iteritems():
-               if myfeature in features:
+               if myfeature in mysettings.features:
                        basedir = mysettings[kwargs["basedir_var"]]
                        if basedir == "":
                                basedir = kwargs["default_dir"]
@@ -2502,8 +2503,8 @@ def prepare_build_dirs(myroot, mysettings, cleanup):
                                                        raise portage_exception.OperationNotPermitted(
                                                                "Failed to apply recursive permissions for the portage group.")
                        except portage_exception.PortageException, e:
-                               features.remove(myfeature)
-                               mysettings["FEATURES"] = " ".join(features)
+                               mysettings.features.remove(myfeature)
+                               mysettings["FEATURES"] = " ".join(mysettings.features)
                                writemsg("!!! %s\n" % str(e))
                                writemsg("!!! Failed resetting perms on %s='%s'\n" % (kwargs["basedir_var"], basedir))
                                writemsg("!!! Disabled FEATURES='%s'\n" % myfeature)
@@ -2567,7 +2568,7 @@ def prepare_build_dirs(myroot, mysettings, cleanup):
 
 def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None,use_cache=1,fetchall=0,tree=None):
        global db, actionmap_deps
-
+       features = mysettings.features
        if not tree:
                dump_traceback("Warning: tree not specified to doebuild")
                tree = "porttree"
@@ -5845,7 +5846,7 @@ class dblink:
                        otherversions.append(v.split("/")[1])
 
                # check for package collisions
-               if "collision-protect" in features:
+               if "collision-protect" in self.settings.features:
                        myfilelist = listdir(srcroot, recursive=1, filesonly=1, followSymlinks=False)
 
                        # the linkcheck only works if we are in srcroot
@@ -6719,7 +6720,7 @@ def global_updates():
 
                # We gotta do the brute force updates for these now.
                if settings["PORTAGE_CALLER"] == "fixpackages" or \
-               "fixpackages" in features:
+               "fixpackages" in settings.features:
                        db["/"]["bintree"].update_ents(myupd)
                else:
                        do_upgrade_packagesmessage = 1
@@ -6848,7 +6849,6 @@ try:
 except (IOError, OSError):
        mtimedb = {"updates":{}, "version":"", "starttime":0}
 
-features=settings["FEATURES"].split()
 
 db["/"].addLazySingleton("porttree", portagetree, "/")
 db["/"].addLazyItem("bintree", LazyBintreeItem("/"))
@@ -6863,6 +6863,7 @@ pkglines = settings.packages
 
 groups = settings["ACCEPT_KEYWORDS"].split() # DEPRECATED (no longer used)
 archlist = settings.archlist() # DEPRECATED (no longer used)
+features = settings.features # DEPRECATED (no longer used)
 
 # Clear the cache
 dircache={}