public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r14473 - in main/branches/prefix: bin man pym/_emerge pym/portage pym/portage/dbapi pym/repoman
@ 2009-10-02 20:40 Fabian Groffen (grobian)
  0 siblings, 0 replies; only message in thread
From: Fabian Groffen (grobian) @ 2009-10-02 20:40 UTC (permalink / raw
  To: gentoo-commits

Author: grobian
Date: 2009-10-02 20:40:28 +0000 (Fri, 02 Oct 2009)
New Revision: 14473

Modified:
   main/branches/prefix/bin/egencache
   main/branches/prefix/bin/repoman
   main/branches/prefix/man/egencache.1
   main/branches/prefix/man/repoman.1
   main/branches/prefix/pym/_emerge/Package.py
   main/branches/prefix/pym/_emerge/depgraph.py
   main/branches/prefix/pym/portage/__init__.py
   main/branches/prefix/pym/portage/dbapi/vartree.py
   main/branches/prefix/pym/portage/dep.py
   main/branches/prefix/pym/portage/versions.py
   main/branches/prefix/pym/repoman/checks.py
Log:
   Merged from trunk -r14463:14472

   | 14465    | Fix SyntaxError with Python 3 added in r14462.              |
   | arfrever |                                                             |
   
   | 14466    | Take regular expressions from portage.dep and use them to   |
   | zmedico  | reimplement portage.versions.pkgsplit(). This simplifies    |
   |          | the code and helps guarantee consistency package            |
   |          | name/version validation.                                    |
   
   | 14467    | Use a regular expression for SLOT validation inside         |
   | zmedico  | vardbapi.aux_get().                                         |
   
   | 14468    | Bug #286895 - Generate an eerror message when a directory   |
   | zmedico  | blocks merge of a regular file and the file is merged using |
   |          | a 'config protect' filename even though the path may not be |
   |          | among those covered by CONFIG_PROTECT.                      |
   
   | 14469    | Add --tolerant option (already in use on master rsync       |
   | zmedico  | mirror), requested by robbat2.                              |
   
   | 14470    | Remove libtool from RDEPEND.suspect list, since libltdl.so  |
   | zmedico  | is validly used by some packages at runtime. Thanks to      |
   |          | Samuli Suominen <ssuominen@g.o> for reporting.              |
   
   | 14471    | Bug #285191 - Remove the RDEPEND.implicit check because it  |
   | zmedico  | is invalid.                                                 |
   
   | 14472    | Bug #287333 - Fix the code from bug #252167 so it behaves   |
   | zmedico  | consistently regardless of the package (ebuild or binpkg)   |
   |          | being masked.                                               |


Modified: main/branches/prefix/bin/egencache
===================================================================
--- main/branches/prefix/bin/egencache	2009-10-02 19:24:44 UTC (rev 14472)
+++ main/branches/prefix/bin/egencache	2009-10-02 20:40:28 UTC (rev 14473)
@@ -67,6 +67,9 @@
 		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")
@@ -343,6 +346,8 @@
 		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__":

Modified: main/branches/prefix/bin/repoman
===================================================================
--- main/branches/prefix/bin/repoman	2009-10-02 19:24:44 UTC (rev 14472)
+++ main/branches/prefix/bin/repoman	2009-10-02 20:40:28 UTC (rev 14473)
@@ -426,7 +426,6 @@
 	"sys-devel/bison",
 	"sys-devel/dev86",
 	"sys-devel/flex",
-	"sys-devel/libtool",
 	"sys-devel/m4",
 	"sys-devel/pmake",
 	"x11-misc/bdftopcf",

Modified: main/branches/prefix/man/egencache.1
===================================================================
--- main/branches/prefix/man/egencache.1	2009-10-02 19:24:44 UTC (rev 14472)
+++ main/branches/prefix/man/egencache.1	2009-10-02 20:40:28 UTC (rev 14473)
@@ -54,6 +54,11 @@
 (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

Modified: main/branches/prefix/man/repoman.1
===================================================================
--- main/branches/prefix/man/repoman.1	2009-10-02 19:24:44 UTC (rev 14472)
+++ main/branches/prefix/man/repoman.1	2009-10-02 20:40:28 UTC (rev 14473)
@@ -186,10 +186,6 @@
 .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

Modified: main/branches/prefix/pym/_emerge/Package.py
===================================================================
--- main/branches/prefix/pym/_emerge/Package.py	2009-10-02 19:24:44 UTC (rev 14472)
+++ main/branches/prefix/pym/_emerge/Package.py	2009-10-02 20:40:28 UTC (rev 14473)
@@ -212,7 +212,7 @@
 		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):

Modified: main/branches/prefix/pym/_emerge/depgraph.py
===================================================================
--- main/branches/prefix/pym/_emerge/depgraph.py	2009-10-02 19:24:44 UTC (rev 14472)
+++ main/branches/prefix/pym/_emerge/depgraph.py	2009-10-02 20:40:28 UTC (rev 14473)
@@ -2304,8 +2304,7 @@
 					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
@@ -2323,8 +2322,8 @@
 						# 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:

Modified: main/branches/prefix/pym/portage/__init__.py
===================================================================
--- main/branches/prefix/pym/portage/__init__.py	2009-10-02 19:24:44 UTC (rev 14472)
+++ main/branches/prefix/pym/portage/__init__.py	2009-10-02 20:40:28 UTC (rev 14473)
@@ -8183,7 +8183,7 @@
 					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)

Modified: main/branches/prefix/pym/portage/dbapi/vartree.py
===================================================================
--- main/branches/prefix/pym/portage/dbapi/vartree.py	2009-10-02 19:24:44 UTC (rev 14472)
+++ main/branches/prefix/pym/portage/dbapi/vartree.py	2009-10-02 20:40:28 UTC (rev 14473)
@@ -13,7 +13,7 @@
 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',
@@ -1967,10 +1967,12 @@
 					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):
@@ -4890,12 +4892,20 @@
 				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;
@@ -4903,6 +4913,7 @@
 						# 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
@@ -4927,9 +4938,10 @@
 								"""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)
 				if moveme:

Modified: main/branches/prefix/pym/portage/dep.py
===================================================================
--- main/branches/prefix/pym/portage/dep.py	2009-10-02 19:24:44 UTC (rev 14472)
+++ main/branches/prefix/pym/portage/dep.py	2009-10-02 20:40:28 UTC (rev 14473)
@@ -24,7 +24,7 @@
 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:
@@ -806,28 +806,18 @@
 
 # \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):
 	"""

Modified: main/branches/prefix/pym/portage/versions.py
===================================================================
--- main/branches/prefix/pym/portage/versions.py	2009-10-02 19:24:44 UTC (rev 14472)
+++ main/branches/prefix/pym/portage/versions.py	2009-10-02 20:40:28 UTC (rev 14473)
@@ -5,10 +5,28 @@
 
 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"]
@@ -231,23 +249,15 @@
 		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]
@@ -275,8 +285,19 @@
 			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):
 	"""

Modified: main/branches/prefix/pym/repoman/checks.py
===================================================================
--- main/branches/prefix/pym/repoman/checks.py	2009-10-02 19:24:44 UTC (rev 14472)
+++ main/branches/prefix/pym/repoman/checks.py	2009-10-02 20:40:28 UTC (rev 14473)
@@ -268,37 +268,6 @@
 		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
@@ -493,7 +462,7 @@
 	EbuildAssignment, EbuildUselessDodoc,
 	EbuildUselessCdS, EbuildNestedDie,
 	EbuildPatches, EbuildQuotedA, EapiDefinition,
-	IUseUndefined, ImplicitRuntimeDeps, InheritAutotools,
+	IUseUndefined, InheritAutotools,
 	EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS,
 	DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue,
 	SrcCompileEconf, Eapi3IncompatibleFuncs, Eapi3GoneVars)))




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-02 20:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-02 20:40 [gentoo-commits] portage r14473 - in main/branches/prefix: bin man pym/_emerge pym/portage pym/portage/dbapi pym/repoman Fabian Groffen (grobian)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox