Add REQUIRED_USE to metadata keys, caches, etc.
authorSebastian Luther <SebastianLuther@gmx.de>
Mon, 12 Apr 2010 19:38:06 +0000 (21:38 +0200)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Aug 2010 01:27:37 +0000 (18:27 -0700)
bin/ebuild.sh
pym/_emerge/Package.py
pym/portage/__init__.py
pym/portage/cache/flat_list.py
pym/portage/cache/metadata.py
pym/portage/dbapi/bintree.py
pym/portage/dbapi/porttree.py
pym/portage/dbapi/vartree.py
pym/portage/package/ebuild/config.py

index 2affc923a38b7afe37b35e803663c6645fb28303..4d117f65ed4caf954b10902ff952d61040b5efce 100755 (executable)
@@ -1086,7 +1086,7 @@ dyn_install() {
        set -f
        local f x
        IFS=$' \t\n\r'
-       for f in CATEGORY DEFINED_PHASES FEATURES INHERITED IUSE  \
+       for f in CATEGORY DEFINED_PHASES FEATURES INHERITED IUSE REQUIRED_USE \
                PF PKGUSE SLOT KEYWORDS HOMEPAGE DESCRIPTION ; do
                x=$(echo -n ${!f})
                [[ -n $x ]] && echo "$x" > $f
@@ -1260,6 +1260,7 @@ inherit() {
        local prev_export_funcs_var=$__export_funcs_var
 
        local B_IUSE
+       local B_REQUIRED_USE
        local B_DEPEND
        local B_RDEPEND
        local B_PDEPEND
@@ -1308,12 +1309,13 @@ inherit() {
                set -f
 
                # Retain the old data and restore it later.
-               unset B_IUSE B_DEPEND B_RDEPEND B_PDEPEND
+               unset B_IUSE B_REQUIRED_USE B_DEPEND B_RDEPEND B_PDEPEND
                [ "${IUSE+set}"       = set ] && B_IUSE="${IUSE}"
+               [ "${REQUIRED_USE+set}" = set ] && B_REQUIRED_USE="${REQUIRED_USE}"
                [ "${DEPEND+set}"     = set ] && B_DEPEND="${DEPEND}"
                [ "${RDEPEND+set}"    = set ] && B_RDEPEND="${RDEPEND}"
                [ "${PDEPEND+set}"    = set ] && B_PDEPEND="${PDEPEND}"
-               unset IUSE DEPEND RDEPEND PDEPEND
+               unset IUSE REQUIRED_USE DEPEND RDEPEND PDEPEND
                #turn on glob expansion
                set +f
 
@@ -1325,12 +1327,16 @@ inherit() {
                # If each var has a value, append it to the global variable E_* to
                # be applied after everything is finished. New incremental behavior.
                [ "${IUSE+set}"       = set ] && export E_IUSE="${E_IUSE} ${IUSE}"
+               [ "${REQUIRED_USE+set}"       = set ] && export E_REQUIRED_USE="${E_REQUIRED_USE} ${REQUIRED_USE}"
                [ "${DEPEND+set}"     = set ] && export E_DEPEND="${E_DEPEND} ${DEPEND}"
                [ "${RDEPEND+set}"    = set ] && export E_RDEPEND="${E_RDEPEND} ${RDEPEND}"
                [ "${PDEPEND+set}"    = set ] && export E_PDEPEND="${E_PDEPEND} ${PDEPEND}"
 
                [ "${B_IUSE+set}"     = set ] && IUSE="${B_IUSE}"
                [ "${B_IUSE+set}"     = set ] || unset IUSE
+               
+               [ "${B_REQUIRED_USE+set}"     = set ] && REQUIRED_USE="${B_REQUIRED_USE}"
+               [ "${B_REQUIRED_USE+set}"     = set ] || unset REQUIRED_USE
 
                [ "${B_DEPEND+set}"   = set ] && DEPEND="${B_DEPEND}"
                [ "${B_DEPEND+set}"   = set ] || unset DEPEND
@@ -1600,7 +1606,7 @@ source_all_bashrcs() {
 # when portage is upgrading itself.
 
 READONLY_EBUILD_METADATA="DEFINED_PHASES DEPEND DESCRIPTION
-       EAPI HOMEPAGE INHERITED IUSE KEYWORDS LICENSE
+       EAPI HOMEPAGE INHERITED IUSE REQUIRED_USE KEYWORDS LICENSE
        PDEPEND PROVIDE RDEPEND RESTRICT SLOT SRC_URI"
 
 READONLY_PORTAGE_VARS="D EBUILD EBUILD_PHASE \
@@ -1774,7 +1780,7 @@ preprocess_ebuild_env() {
 export SANDBOX_ON="1"
 export S=${WORKDIR}/${P}
 
-unset E_IUSE E_DEPEND E_RDEPEND E_PDEPEND
+unset E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND
 
 # Turn of extended glob matching so that g++ doesn't get incorrectly matched.
 shopt -u extglob
@@ -1878,7 +1884,7 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
                # In order to ensure correct interaction between ebuilds and
                # eclasses, they need to be unset before this process of
                # interaction begins.
-               unset DEPEND RDEPEND PDEPEND IUSE
+               unset DEPEND RDEPEND PDEPEND IUSE REQUIRED_USE
 
                if [[ $PORTAGE_DEBUG != 1 || ${-/x/} != $- ]] ; then
                        source "$EBUILD" || die "error sourcing ebuild"
@@ -1906,8 +1912,9 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
                DEPEND="${DEPEND} ${E_DEPEND}"
                RDEPEND="${RDEPEND} ${E_RDEPEND}"
                PDEPEND="${PDEPEND} ${E_PDEPEND}"
-
-               unset ECLASS E_IUSE E_DEPEND E_RDEPEND E_PDEPEND
+               REQUIRED_USE="${REQUIRED_USE} ${E_REQUIRED_USE}"
+               
+               unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND 
 
                # alphabetically ordered by $EBUILD_PHASE value
                case "$EAPI" in
@@ -2151,7 +2158,7 @@ ebuild_main() {
                fi
 
                auxdbkeys="DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE
-                       DESCRIPTION KEYWORDS INHERITED IUSE UNUSED_00 PDEPEND PROVIDE EAPI
+                       DESCRIPTION KEYWORDS INHERITED IUSE REQUIRED_USE PDEPEND PROVIDE EAPI
                        PROPERTIES DEFINED_PHASES UNUSED_05 UNUSED_04
                        UNUSED_03 UNUSED_02 UNUSED_01"
 
index bba55ca8efabe10fe8ece3ac9f8c37cf394792ba..e86eab334f7128b26981ec678b9fb68485ab4257 100644 (file)
@@ -30,7 +30,7 @@ class Package(Task):
                "INHERITED", "IUSE", "KEYWORDS",
                "LICENSE", "PDEPEND", "PROVIDE", "RDEPEND",
                "repository", "PROPERTIES", "RESTRICT", "SLOT", "USE",
-               "_mtime_", "DEFINED_PHASES"]
+               "_mtime_", "DEFINED_PHASES", "REQUIRED_USE"]
 
        def __init__(self, **kwargs):
                Task.__init__(self, **kwargs)
index acf151aeaa1ba32d5bb5a064013aefb4b40685d3..555dc2be80d980fcebca9f92ae2591bcf467d2d3 100644 (file)
@@ -480,7 +480,7 @@ def _movefile(src, dest, **kwargs):
 auxdbkeys = (
   'DEPEND',    'RDEPEND',   'SLOT',      'SRC_URI',
        'RESTRICT',  'HOMEPAGE',  'LICENSE',   'DESCRIPTION',
-       'KEYWORDS',  'INHERITED', 'IUSE', 'UNUSED_00',
+       'KEYWORDS',  'INHERITED', 'IUSE', 'REQUIRED_USE',
        'PDEPEND',   'PROVIDE', 'EAPI',
        'PROPERTIES', 'DEFINED_PHASES', 'UNUSED_05', 'UNUSED_04',
        'UNUSED_03', 'UNUSED_02', 'UNUSED_01',
index 1c4ec68defa82d0bfb00955f658c3b64ff8e716d..eb755839873b37d85b7664ac40dbb2292aa4b1d4 100644 (file)
@@ -19,7 +19,7 @@ class database(fs_template.FsBased):
        # do not screw with this ordering. _eclasses_ needs to be last
        auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI',
                'RESTRICT',  'HOMEPAGE',  'LICENSE', 'DESCRIPTION',
-               'KEYWORDS',  'IUSE', 'UNUSED_00',
+               'KEYWORDS',  'IUSE', 'REQUIRED_USE',
                'PDEPEND',   'PROVIDE', 'EAPI', 'PROPERTIES', 'DEFINED_PHASES')
 
        def __init__(self, *args, **config):
index 9da52ce14e35c2f62bdb75fbd987c12940322328..4c735d7e3a4a715fb30472f39353ecd0dc34a2a8 100644 (file)
@@ -26,7 +26,7 @@ class database(flat_hash.database):
        complete_eclass_entries = False
        auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI',
                'RESTRICT',  'HOMEPAGE',  'LICENSE', 'DESCRIPTION',
-               'KEYWORDS',  'INHERITED', 'IUSE', 'UNUSED_00',
+               'KEYWORDS',  'INHERITED', 'IUSE', 'REQUIRED_USE',
                'PDEPEND',   'PROVIDE', 'EAPI', 'PROPERTIES', 'DEFINED_PHASES')
 
        autocommits = True
index f3f7aff98d295d688b6b4482c55c16ad7c2ed9ae..31bb5f4abdea758fe97ae119e43f72ac503079ed 100644 (file)
@@ -54,7 +54,8 @@ class bindbapi(fakedbapi):
                self._aux_cache_keys = set(
                        ["BUILD_TIME", "CHOST", "DEPEND", "EAPI", "IUSE", "KEYWORDS",
                        "LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE",
-                       "RDEPEND", "repository", "RESTRICT", "SLOT", "USE", "DEFINED_PHASES"])
+                       "RDEPEND", "repository", "RESTRICT", "SLOT", "USE", "DEFINED_PHASES",
+                       "REQUIRED_USE"])
                self._aux_cache_slot_dict = slot_dict_class(self._aux_cache_keys)
                self._aux_cache = {}
 
@@ -224,7 +225,8 @@ class binarytree(object):
                        self._pkgindex_aux_keys = \
                                ["BUILD_TIME", "CHOST", "DEPEND", "DESCRIPTION", "EAPI",
                                "IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PROPERTIES",
-                               "PROVIDE", "RDEPEND", "repository", "SLOT", "USE", "DEFINED_PHASES"]
+                               "PROVIDE", "RDEPEND", "repository", "SLOT", "USE", "DEFINED_PHASES",
+                               "REQUIRED_USE"]
                        self._pkgindex_aux_keys = list(self._pkgindex_aux_keys)
                        self._pkgindex_use_evaluated_keys = \
                                ("LICENSE", "RDEPEND", "DEPEND",
@@ -249,7 +251,8 @@ class binarytree(object):
                                "RESTRICT": "",
                                "SLOT"    : "0",
                                "USE"     : "",
-                               "DEFINED_PHASES" : ""
+                               "DEFINED_PHASES" : "",
+                               "REQUIRED_USE" : ""
                        }
                        self._pkgindex_inherited_keys = ["CHOST", "repository"]
                        self._pkgindex_default_header_data = {
index 1db15da514cd6cc3ecc05c52a4aaa7049aac8d56..f0d891edf64dd83da57e6f3a7ad0ffd8f93cd384 100644 (file)
@@ -405,7 +405,7 @@ class portdbapi(dbapi):
                self._aux_cache_keys = set(
                        ["DEPEND", "EAPI", "INHERITED", "IUSE", "KEYWORDS", "LICENSE",
                        "PDEPEND", "PROPERTIES", "PROVIDE", "RDEPEND", "repository",
-                       "RESTRICT", "SLOT", "DEFINED_PHASES"])
+                       "RESTRICT", "SLOT", "DEFINED_PHASES", "REQUIRED_USE"])
 
                self._aux_cache = {}
                self._broken_ebuilds = set()
index db76e0454adc0a28df4d60b03c93fa95486462df..28a03ad2c4162f1a784d1f61c274276b04131d12 100644 (file)
@@ -850,7 +850,8 @@ class vardbapi(dbapi):
                        ["BUILD_TIME", "CHOST", "COUNTER", "DEPEND", "DESCRIPTION",
                        "EAPI", "HOMEPAGE", "IUSE", "KEYWORDS",
                        "LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE", "RDEPEND",
-                       "repository", "RESTRICT" , "SLOT", "USE", "DEFINED_PHASES"])
+                       "repository", "RESTRICT" , "SLOT", "USE", "DEFINED_PHASES",
+                       "REQUIRED_USE"])
                self._aux_cache_obj = None
                self._aux_cache_filename = os.path.join(self.root,
                        CACHE_PATH, "vdb_metadata.pickle")
index 23d7f219da3dc3f05e3ff0cf83b1bf95ac9fb015..f4f05179bfcfb89dba3e716865ffdd59d83826e9 100644 (file)
@@ -140,7 +140,7 @@ class config(object):
        """
 
        _setcpv_aux_keys = ('DEFINED_PHASES', 'DEPEND', 'EAPI',
-               'INHERITED', 'IUSE', 'KEYWORDS', 'LICENSE', 'PDEPEND',
+               'INHERITED', 'IUSE', 'REQUIRED_USE', 'KEYWORDS', 'LICENSE', 'PDEPEND',
                'PROPERTIES', 'PROVIDE', 'RDEPEND', 'SLOT',
                'repository', 'RESTRICT', 'LICENSE',)