auxdbkeys="DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE
DESCRIPTION KEYWORDS INHERITED IUSE CDEPEND PDEPEND PROVIDE EAPI
- PROPERTIES UNUSED_06 UNUSED_05 UNUSED_04
+ PROPERTIES DEFINED_PHASES UNUSED_05 UNUSED_04
UNUSED_03 UNUSED_02 UNUSED_01"
#the extra $(echo) commands remove newlines
unset CDEPEND
# PREFIX HACK: ignore prefix, and then respect it again
[[ -n ${EAPI/prefix/} ]] || EAPI="${EAPI}${EAPI:+ }0"
+ local eapi=$EAPI
+
+ # alphabetically ordered by $EBUILD_PHASE value
+ local valid_phases
+ case $eapi in
+ 0|1)
+ valid_phases="src_compile pkg_config pkg_info src_install
+ pkg_nofetch pkg_postinst pkg_postrm pkg_preinst pkg_prerm
+ pkg_setup src_test src_unpack"
+ ;;
+ *)
+ valid_phases="src_compile pkg_config src_configure pkg_info
+ src_install pkg_nofetch pkg_postinst pkg_postrm pkg_preinst
+ src_prepare pkg_prerm pkg_setup src_test src_unpack"
+ ;;
+ esac
+
+ DEFINED_PHASES=
+ for f in $valid_phases ; do
+ if [[ $(type -t $f) = function ]] ; then
+ f=${f#pkg_}
+ DEFINED_PHASES+=" ${f#src_}"
+ fi
+ done
+ [[ -n $DEFINED_PHASES ]] || DEFINED_PHASES=-
+
if [ -n "${dbkey}" ] ; then
> "${dbkey}"
for f in ${auxdbkeys} ; do
self.root_config = root_config
def __str__(self):
- return self.arg
+ return str(self.arg)
class AtomArg(DependencyArg):
def __init__(self, atom=None, **kwargs):
def add(self, task):
self._queue.add(task)
- def run(self):
- self._scheduler.schedule()
-
class JobStatusDisplay(object):
_bound_properties = ("curval", "failed", "running")
if myslot not in slotmap:
slotmap[myslot] = {}
slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)] = mypkg
-
+
+ for mypkg in vartree.dbapi.cp_list(
+ portage.dep_getkey(mymatch[0])):
+ myslot = vartree.getslot(mypkg)
+ if myslot not in slotmap:
+ slotmap[myslot] = {}
+ slotmap[myslot][vartree.dbapi.cpv_counter(mypkg)] = mypkg
+
for myslot in slotmap:
counterkeys = slotmap[myslot].keys()
if not counterkeys:
pkgmap[mykey]["protected"].add(
slotmap[myslot][counterkeys[-1]])
del counterkeys[-1]
+
+ for counter in counterkeys[:]:
+ mypkg = slotmap[myslot][counter]
+ if mypkg not in mymatch:
+ counterkeys.remove(counter)
+ pkgmap[mykey]["protected"].add(
+ slotmap[myslot][counter])
+
#be pretty and get them in order of merge:
for ckey in counterkeys:
mypkg = slotmap[myslot][ckey]
else:
search_for_owners = set()
for cpv in plibdata:
- pkg_dblink = vardbapi._dblink(cpv)
+ internal_plib_keys = set(linkmap._obj_key(f) \
+ for f in plibdata[cpv])
for f in plibdata[cpv]:
if f in consumer_map:
continue
consumers = []
for c in linkmap.findConsumers(f):
- # Filter out any consumers that belong
- # to the same package as the provider.
- if not pkg_dblink.isowner(c, pkg_dblink.myroot):
+ # Filter out any consumers that are also preserved libs
+ # belonging to the same package as the provider.
+ if linkmap._obj_key(c) not in internal_plib_keys:
consumers.append(c)
consumers.sort()
consumer_map[f] = consumers
msg.append(" %s" % (parent,))
msg.append("")
msg.append("Have you forgotten to run " + \
- good("`emerge --update --newuse --deep world`") + " prior to")
- msg.append(("%s? It may be necessary to manually " + \
+ good("`emerge --update --newuse --deep @system @world`") + " prior")
+ msg.append(("to %s? It may be necessary to manually " + \
"uninstall packages that no longer") % action)
msg.append("exist in the portage tree since " + \
"it may not be possible to satisfy their")
self.regenerate(use_cache=use_cache)
def load_infodir(self,infodir):
- self.modifying()
- backup_pkg_metadata = dict(self.configdict["pkg"].iteritems())
- if "pkg" in self.configdict and \
- "CATEGORY" in self.configdict["pkg"]:
- self.configdict["pkg"].clear()
- self.configdict["pkg"]["CATEGORY"] = \
- backup_pkg_metadata["CATEGORY"]
- else:
- raise portage.exception.PortageException(
- "No pkg setup for settings instance?")
-
- retval = 0
- found_category_file = False
- if os.path.isdir(infodir):
- if os.path.exists(infodir+"/environment"):
- self.configdict["pkg"]["PORT_ENV_FILE"] = infodir+"/environment"
-
- myre = re.compile('^[A-Z]+$')
- null_byte = "\0"
- for filename in listdir(infodir,filesonly=1,EmptyOnError=1):
- if filename == "FEATURES":
- # FEATURES from the build host shouldn't be interpreted as
- # FEATURES on the client system.
- continue
- if filename == "CATEGORY":
- found_category_file = True
- continue
- if myre.match(filename):
- try:
- file_path = os.path.join(infodir, filename)
- mydata = open(file_path).read().strip()
- if len(mydata) < 2048 or filename == "USE":
- if null_byte in mydata:
- writemsg("!!! Null byte found in metadata " + \
- "file: '%s'\n" % file_path, noiselevel=-1)
- continue
- if filename == "USE":
- binpkg_flags = "-* " + mydata
- self.configdict["pkg"][filename] = binpkg_flags
- self.configdict["env"][filename] = mydata
- else:
- self.configdict["pkg"][filename] = mydata
- self.configdict["env"][filename] = mydata
- except (OSError, IOError):
- writemsg("!!! Unable to read file: %s\n" % infodir+"/"+filename,
- noiselevel=-1)
- pass
- retval = 1
-
- # Missing or corrupt CATEGORY will cause problems for
- # doebuild(), which uses it to infer the cpv. We already
- # know the category, so there's no need to trust this
- # file. Show a warning if the file is missing though,
- # because it's required (especially for binary packages).
- if not found_category_file:
- writemsg("!!! CATEGORY file is missing: %s\n" % \
- os.path.join(infodir, "CATEGORY"), noiselevel=-1)
- self.configdict["pkg"].update(backup_pkg_metadata)
- retval = 0
-
- # Always set known good values for these variables, since
- # corruption of these can cause problems:
- cat, pf = catsplit(self.mycpv)
- self.configdict["pkg"]["CATEGORY"] = cat
- self.configdict["pkg"]["PF"] = pf
-
- return retval
+ warnings.warn("portage.config.load_infodir() is deprecated",
+ DeprecationWarning)
+ return 1
def setcpv(self, mycpv, use_cache=1, mydb=None):
"""
configure_opts_warn = []
configure_opts_warn_re = re.compile(
- r'^configure: WARNING: Unrecognized options: .*')
- am_maintainer_mode_re = re.compile(r'.*/missing --run .*')
+ r'^configure: WARNING: Unrecognized options: ')
+ am_maintainer_mode_re = re.compile(r'/missing --run ')
am_maintainer_mode_exclude_re = \
- re.compile(r'.*/missing --run (autoheader|makeinfo)')
+ re.compile(r'/missing --run (autoheader|makeinfo)')
make_jobserver_re = \
re.compile(r'g?make\[\d+\]: warning: jobserver unavailable:')
'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION',
'KEYWORDS', 'INHERITED', 'IUSE', 'CDEPEND',
'PDEPEND', 'PROVIDE', 'EAPI',
- 'PROPERTIES', 'UNUSED_06', 'UNUSED_05', 'UNUSED_04',
+ 'PROPERTIES', 'DEFINED_PHASES', 'UNUSED_05', 'UNUSED_04',
'UNUSED_03', 'UNUSED_02', 'UNUSED_01',
]
auxdbkeylen=len(auxdbkeys)
auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI',
'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION',
'KEYWORDS', 'IUSE', 'CDEPEND',
- 'PDEPEND', 'PROVIDE', 'EAPI', 'PROPERTIES')
+ 'PDEPEND', 'PROVIDE', 'EAPI', 'PROPERTIES', 'DEFINED_PHASES')
def __init__(self, label, auxdbkeys, **config):
super(database,self).__init__(label, auxdbkeys, **config)
auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI',
'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION',
'KEYWORDS', 'INHERITED', 'IUSE', 'CDEPEND',
- 'PDEPEND', 'PROVIDE', 'EAPI', 'PROPERTIES')
+ 'PDEPEND', 'PROVIDE', 'EAPI', 'PROPERTIES', 'DEFINED_PHASES')
autocommits = True
"""Check ebuild for nested die statements (die statements in subshells"""
repoman_check_name = 'ebuild.nesteddie'
- nesteddie_re = re.compile(r'^[^#]*\([^)]*\bdie\b')
+ nesteddie_re = re.compile(r'^[^#]*\s\(\s[^)]*\bdie\b')
def check(self, num, line):
if self.nesteddie_re.match(line):
_autotools_funcs = (
"eaclocal", "eautoconf", "eautoheader",
"eautomake", "eautoreconf", "_elibtoolize")
- _autotools_func_re = re.compile(r'(^|\s)(' + \
- "|".join(_autotools_funcs) + ')(\s|$)')
+ _autotools_func_re = re.compile(r'\b(' + \
+ "|".join(_autotools_funcs) + r')\b')
# Exempt eclasses:
# git - An EGIT_BOOTSTRAP variable may be used to call one of
# the autotools functions.