action="store_true",
help="enable rsync stat collision workaround " + \
"for bug 139134 (use with --update)")
+ parser.add_option("--tolerant",
+ action="store_true",
+ help="exit successfully if only minor errors occurred")
parser.add_option("--ignore-default-opts",
action="store_true",
help="do not use the EGENCACHE_DEFAULT_OPTS environment variable")
max_load=options.load_average,
rsync=options.rsync)
gen_cache.run()
+ if options.tolerant:
+ return os.EX_OK
return gen_cache.returncode
if __name__ == "__main__":
"sys-devel/bison",
"sys-devel/dev86",
"sys-devel/flex",
- "sys-devel/libtool",
"sys-devel/m4",
"sys-devel/pmake",
"x11-misc/bdftopcf",
(see \fBbug 139134\fR). It's not needed with \fBgit\fR(1) since that uses a
more thorough mechanism which allows it to detect changed inode numbers
(described in \fIracy-git.txt\fR in the git technical docs).
+.TP
+.BR "\-\-tolerant"
+Exit successfully if only minor errors occurred, such as skipped cache
+updates due to ebuilds that either fail to source or are not sourced
+due to invalid Manifest entries.
.SH "ENVIRONMENT OPTIONS"
.TP
\fBEGENCACHE_DEFAULT_OPTS\fR
.B RDEPEND.badmaskedindev
Masked ebuilds with RDEPEND settings (matched against *all* ebuilds) in developing arch
.TP
-.B RDEPEND.implicit
-RDEPEND is unset in the ebuild which triggers implicit RDEPEND=$DEPEND
-assignment
-.TP
.B RDEPEND.suspect
RDEPEND contains a package that usually only belongs in DEPEND
.TP
elif k in self._use_conditional_keys:
try:
use_reduce(paren_reduce(v), matchall=1)
- except portage.exception.InvalidDependString, e:
+ except portage.exception.InvalidDependString as e:
self._pkg._invalid_metadata(k + ".syntax", "%s: %s" % (k, e))
def _set_inherited(self, k, v):
reinstall_for_flags = None
if not pkg.installed or \
- (pkg.built and matched_packages and \
- not (avoid_update and pkg.installed)):
+ (matched_packages and not avoid_update):
# Only enforce visibility on installed packages
# if there is at least one other visible package
# available. By filtering installed masked packages
# with visible KEYWORDS when the installed
# version is masked by KEYWORDS, but never
# reinstall the same exact version only due
- # to a KEYWORDS mask.
- if built and matched_packages:
+ # to a KEYWORDS mask. See bug #252167.
+ if matched_packages:
different_version = None
for avail_pkg in matched_packages:
return None
return deplist
-_cpv_key_re = re.compile('^' + dep._cpv + '$', re.VERBOSE)
+_cpv_key_re = re.compile('^' + versions._cpv + '$', re.VERBOSE)
def cpv_getkey(mycpv):
"""Calls pkgsplit on a cpv and returns only the cp."""
m = _cpv_key_re.match(mycpv)
portage.proxy.lazyimport.lazyimport(globals(),
'portage.checksum:_perform_md5_merge@perform_md5',
'portage.dep:dep_getkey,isjustname,match_from_list,' + \
- 'use_reduce,paren_reduce',
+ 'use_reduce,paren_reduce,_slot_re',
'portage.elog:elog_process',
'portage.elog.filtering:filter_mergephases,filter_unmergephases',
'portage.locks:lockdir,unlockdir',
cache_data[aux_key] = mydata[aux_key]
self._aux_cache["packages"][mycpv] = (mydir_mtime, cache_data)
self._aux_cache["modified"].add(mycpv)
- if not mydata['SLOT']:
- # Empty slot triggers InvalidAtom exceptions when generating slot
- # atoms for packages, so translate it to '0' here.
+
+ if _slot_re.match(mydata['SLOT']) is None:
+ # Empty or invalid slot triggers InvalidAtom exceptions when
+ # generating slot atoms for packages, so translate it to '0' here.
mydata['SLOT'] = _unicode_decode('0')
+
return [mydata[x] for x in wants]
def _aux_get(self, mycpv, wants, st=None):
protected = self.isprotected(mydest)
if mydmode != None:
# destination file exists
- cfgprot = 0
+
if stat.S_ISDIR(mydmode):
# install of destination is blocked by an existing directory with the same name
- cfgprot = 1
- showMessage("!!! %s\n" % mydest,
- level=logging.ERROR, noiselevel=-1)
+ newdest = new_protect_filename(mydest, newmd5=mymd5)
+ msg = []
+ msg.append("")
+ msg.append("Installation of a regular file is blocked by a directory:")
+ msg.append(" '%s'" % mydest)
+ msg.append("This file will be merged with a different name:")
+ msg.append(" '%s'" % newdest)
+ msg.append("")
+ self._eerror("preinst", msg)
+ mydest = newdest
+
elif stat.S_ISREG(mydmode) or (stat.S_ISLNK(mydmode) and os.path.exists(mydest) and stat.S_ISREG(os.stat(mydest)[stat.ST_MODE])):
# install of destination is blocked by an existing regular file,
# or by a symlink to an existing regular file;
# we only need to tweak mydest if cfg file management is in play.
if protected:
# we have a protection path; enable config file management.
+ cfgprot = 0
destmd5 = perform_md5(mydest, calc_prelink=1)
if mymd5 == destmd5:
#file already in place; simply update mtimes of destination
"""A previously remembered update has been
accepted, so it is removed from confmem."""
del cfgfiledict[myrealdest]
- if cfgprot:
- mydest = new_protect_filename(mydest, newmd5=mymd5)
+
+ if cfgprot:
+ mydest = new_protect_filename(mydest, newmd5=mymd5)
# whether config protection or not, we merge the new file the
# same way. Unless moveme=0 (blocking directory)
from portage.exception import InvalidData, InvalidAtom
from portage.localization import _
from portage.versions import catpkgsplit, catsplit, \
- pkgcmp, pkgsplit, ververify, _version
+ pkgcmp, pkgsplit, ververify, _cp, _cpv
import portage.cache.mappings
if sys.hexversion >= 0x3000000:
# \w is [a-zA-Z0-9_]
-# 2.1.1 A category name may contain any of the characters [A-Za-z0-9+_.-].
-# It must not begin with a hyphen or a dot.
-_cat = r'[\w+][\w+.-]*'
-
-# 2.1.2 A package name may contain any of the characters [A-Za-z0-9+_-].
-# It must not begin with a hyphen,
-# and must not end in a hyphen followed by one or more digits.
-_pkg = r'[\w+][\w+-]*?'
-
# 2.1.3 A slot name may contain any of the characters [A-Za-z0-9+_.-].
# It must not begin with a hyphen or a dot.
-_slot = r':([\w+][\w+.-]*)'
+_slot = r'([\w+][\w+.-]*)'
+_slot_re = re.compile('^' + _slot + '$', re.VERBOSE)
_use = r'\[.*\]'
_op = r'([=~]|[><]=?)'
-_cp = '(' + _cat + '/' + _pkg + '(-' + _version + ')?)'
-_cpv = '(' + _cp + '-' + _version + ')'
_atom_re = re.compile('^(?P<without_use>(?:' +
'(?P<op>' + _op + _cpv + ')|' +
'(?P<star>=' + _cpv + r'\*)|' +
- '(?P<simple>' + _cp + '))(?:' + _slot + ')?)(' + _use + ')?$', re.VERBOSE)
+ '(?P<simple>' + _cp + '))(:' + _slot + ')?)(' + _use + ')?$', re.VERBOSE)
def isvalidatom(atom, allow_blockers=False):
"""
import re
+
+# \w is [a-zA-Z0-9_]
+
+# 2.1.1 A category name may contain any of the characters [A-Za-z0-9+_.-].
+# It must not begin with a hyphen or a dot.
+_cat = r'[\w+][\w+.-]*'
+
+# 2.1.2 A package name may contain any of the characters [A-Za-z0-9+_-].
+# It must not begin with a hyphen,
+# and must not end in a hyphen followed by one or more digits.
+_pkg = r'[\w+][\w+-]*?'
+
+_v = r'(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\d*)*)'
# PREFIX hack: -r(\d+) -> -r(\d+|0\d+\.\d+) (see below)
-_version = r'(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\d*)*)(-r(\d+|0\d+\.\d+))?'
+_rev = r'(\d+|0\d+\.\d+)'
+_vr = _v + '(-r(' + _rev + '))?'
-ver_regexp = re.compile("^" + _version + "$")
+_cp = '(' + _cat + '/' + _pkg + '(-' + _vr + ')?)'
+_cpv = '(' + _cp + '-' + _vr + ')'
+_pv = '(?P<pn>' + _pkg + '(?P<pn_inval>-' + _vr + ')?)' + '-(?P<ver>' + _v + ')(-r(?P<rev>' + _rev + '))?'
+
+ver_regexp = re.compile("^" + _vr + "$")
suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$")
suffix_value = {"pre": -2, "p": 0, "alpha": -4, "beta": -3, "rc": -1}
endversion_keys = ["pre", "p", "alpha", "beta", "rc"]
return None
return vercmp("-".join(pkg1[1:]), "-".join(pkg2[1:]))
-pkgcache={}
+_pv_re = re.compile('^' + _pv + '$', re.VERBOSE)
def pkgsplit(mypkg,silent=1):
- try:
- if not pkgcache[mypkg]:
- return None
- return pkgcache[mypkg]
- except KeyError:
- pass
- myparts=mypkg.split("-")
-
- if len(myparts)<2:
- if not silent:
- print(_("!!! Name error in %s: missing a version or name part.") % mypkg)
- pkgcache[mypkg]=None
+
+ m = _pv_re.match(mypkg)
+ if m is None:
return None
+<<<<<<< .working
#verify rev
revok=0
myrev=myparts[-1]
return myval
else:
pkgcache[mypkg]=None
+=======
+ if m.group('pn_inval') is not None:
+ # package name appears to have a version-like suffix
+>>>>>>> .merge-right.r14472
return None
+ rev = m.group('rev')
+ if rev is None:
+ rev = '0'
+ rev = 'r' + rev
+
+ return (m.group('pn'), m.group('ver'), rev)
+
catcache={}
def catpkgsplit(mydata,silent=1):
"""
if match:
return "Quoted \"${A}\" on line: %d"
-class ImplicitRuntimeDeps(LineCheck):
- """
- Detect the case where DEPEND is set and RDEPEND is unset in the ebuild,
- since this triggers implicit RDEPEND=$DEPEND assignment.
- """
-
- _assignment_re = re.compile(r'^\s*(R?DEPEND)=')
-
- def new(self, pkg):
- # RDEPEND=DEPEND is no longer available in EAPI=3
- if pkg.metadata['EAPI'] in ('0', '1', '2'):
- self.repoman_check_name = 'RDEPEND.implicit'
- else:
- self.repoman_check_name = 'EAPI.incompatible'
- self._rdepend = False
- self._depend = False
-
- def check(self, num, line):
- if not self._rdepend:
- m = self._assignment_re.match(line)
- if m is None:
- pass
- elif m.group(1) == "RDEPEND":
- self._rdepend = True
- elif m.group(1) == "DEPEND":
- self._depend = True
-
- def end(self):
- if self._depend and not self._rdepend:
- yield 'RDEPEND is not explicitly assigned'
-
class InheritAutotools(LineCheck):
"""
Make sure appropriate functions are called in
EbuildAssignment, EbuildUselessDodoc,
EbuildUselessCdS, EbuildNestedDie,
EbuildPatches, EbuildQuotedA, EapiDefinition,
- IUseUndefined, ImplicitRuntimeDeps, InheritAutotools,
+ IUseUndefined, InheritAutotools,
EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS,
DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue,
SrcCompileEconf, Eapi3IncompatibleFuncs, Eapi3GoneVars)))