From d8911d990ec0585764d644316c16c808f590bf84 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Tue, 6 Nov 2007 18:25:11 +0000 Subject: [PATCH] Merged from trunk 8435:8447 | 8436 | Allow multislot packages to be added to the world file via | | zmedico | --noreplace. Having these atoms in the world file will | | | trigger recommendations to run emaint in some cases, like | | | when running `emerge -e world`. The atoms need to be in | | | the world file to prevent multislot packages from being | | | removed by --depclean though. | | 8437 | remove O and PPID from being readonly. O is set python | | WarnerBro | side (and we will hopefully stop being exported soon. PPID | | | is ro by bash, so no need to declare it twice | | 8438 | Bug #198129 - Prevent SLOT atoms like sys-devel/binutils:0 | | zmedico | from being inappropriately recorded in the world file when | | | USE=multislot is enabled. | | 8439 | Fix create_world_atom() logic some more for bug #198129. | | zmedico | | | 8442 | Go ahead and exempt selected profile-specific USE_EXPAND | | zmedico | flags from IUSE QA Notices since we are planning to make | | | these particular flags into implicit members of IUSE. We | | | can make this extensible later, but for now we just want | | | to eliminate some useless QA Notices (a subset of bug | | | #70648). We're not exempting any non profile- specific | | | USE_EXPAND flags here. For non profile-specific flags, we | | | intend to implement an IUSE syntax extension (bug | | | #133327). | | 8444 | Remove references to ${O} in dyn_spec() since antarus made | | zmedico | that variable mutable. | | 8445 | Simplify and fix bugs in is_valid_package_atom(). | | zmedico | | | 8447 | Remove the usage.obsolete "KEYWORDS contain -*" warning | | zmedico | since people are using -* to indicate that a package | | | should not be tried on archs other than those for which it | | | already has KEYWORDS. | svn path=/main/branches/prefix/; revision=8449 --- bin/ebuild.sh | 9 +++++-- bin/misc-functions.sh | 2 +- bin/repoman | 3 --- pym/_emerge/__init__.py | 53 +++++++++++++++++++++++++++-------------- 4 files changed, 43 insertions(+), 24 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 1df41a548..af347d757 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -165,7 +165,12 @@ useq() { fi # Make sure we have this USE flag in IUSE - if ! hasq "${u}" ${IUSE} ${E_IUSE} && ! hasq "${u}" ${PORTAGE_ARCHLIST} selinux; then + if ! hasq "${u}" ${IUSE} ${E_IUSE} && \ + ! hasq "${u}" ${PORTAGE_ARCHLIST} selinux && \ + [[ ${u} != arch_* ]] && \ + [[ ${u} != elibc_* ]] && \ + [[ ${u} != kernel_* ]] && \ + [[ ${u} != userland_* ]] ; then eqawarn "QA Notice: USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}" fi @@ -1442,7 +1447,7 @@ export S=${WORKDIR}/${P} unset E_IUSE E_DEPEND E_RDEPEND E_PDEPEND -for x in T P PN PV PVR PR CATEGORY A EBUILD EMERGE_FROM O PPID FILESDIR PORTAGE_TMPDIR; do +for x in T P PN PV PVR PR CATEGORY A EBUILD EMERGE_FROM FILESDIR PORTAGE_TMPDIR; do [[ ${!x-UNSET_VAR} != UNSET_VAR ]] && declare -r ${x} done # Need to be able to change D in dyn_preinst due to the IMAGE stuff diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 38b5c2734..3c03e18e1 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -615,7 +615,7 @@ dyn_package() { dyn_spec() { tar czf "/usr/src/rpm/SOURCES/${PF}.tar.gz" \ - "${O}/${PF}.ebuild" "${O}/files" || \ + "${EBUILD}" "${FILESDIR}" || \ die "Failed to create base rpm tarball." cat <<__END1__ > ${PF}.spec diff --git a/bin/repoman b/bin/repoman index 1eecd5b05..e2ec992b4 100755 --- a/bin/repoman +++ b/bin/repoman @@ -1239,9 +1239,6 @@ for x in scanlist: # KEYWORDS="-*" is a stupid replacement for package.mask and screws general KEYWORDS semantics if "-*" in keywords: - stats["usage.obsolete"] += 1 - fails["usage.obsolete"].append( - x+'/'+y+'.ebuild: KEYWORDS contain -*') haskeyword = False for kw in keywords: if kw[0] == "~": diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 4094b6b9f..12832820b 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -632,17 +632,40 @@ def create_world_atom(pkg_key, metadata, args_set, root_config): # If the user gave a specific atom, store it as a # slot atom in the world file. slot_atom = "%s:%s" % (cp, metadata["SLOT"]) - # First verify the slot is in the portage tree to avoid - # adding a bogus slot like that produced by multislot. - if portdb.match(slot_atom): - # Now verify that the argument is precise enough to identify a - # specific slot. - matches = portdb.match(arg_atom) + + # For USE=multislot, there are a couple of cases to + # handle here: + # + # 1) SLOT="0", but the real SLOT spontaneously changed to some + # unknown value, so just record an unslotted atom. + # + # 2) SLOT comes from an installed package and there is no + # matching SLOT in the portage tree. + # + # Make sure that the slot atom is available in either the + # portdb or the vardb, since otherwise the user certainly + # doesn't want the SLOT atom recorded in the world file + # (case 1 above). If it's only available in the vardb, + # the user may be trying to prevent a USE=multislot + # package from being removed by --depclean (case 2 above). + + mydb = portdb + if not portdb.match(slot_atom): + # SLOT seems to come from an installed multislot package + mydb = vardb + # If there is no installed package matching the SLOT atom, + # it probably changed SLOT spontaneously due to USE=multislot, + # so just record an unslotted atom. + if vardb.match(slot_atom): + # Now verify that the argument is precise + # enough to identify a specific slot. + matches = mydb.match(arg_atom) matched_slots = set() for cpv in matches: - matched_slots.add(portdb.aux_get(cpv, ["SLOT"])[0]) + matched_slots.add(mydb.aux_get(cpv, ["SLOT"])[0]) if len(matched_slots) == 1: new_world_atom = slot_atom + if new_world_atom == sets["world"].findAtomForPackage(pkg_key, metadata): # Both atoms would be identical, so there's nothing to add. return None @@ -4983,17 +5006,11 @@ def checkUpdatedNewsItems(portdb, vardb, NEWS_PATH, UNREAD_PATH, repo_id): return manager.getUnreadItems( repo_id, update=True ) def is_valid_package_atom(x): - try: - testkey = portage.dep_getkey(x) - except portage.exception.InvalidData: - return False - if testkey.startswith("null/"): - testatom = x.replace(testkey[5:], "cat/"+testkey[5:]) - elif "/" not in x: - testatom = "cat/"+x - else: - testatom = x - return portage.isvalidatom(testatom) + if "/" not in x: + alphanum = re.search(r'\w', x) + if alphanum: + x = x[:alphanum.start()] + "cat/" + x[alphanum.start():] + return portage.isvalidatom(x) def show_blocker_docs_link(): print -- 2.26.2