From 4cde382bd75b09216e8499b5a8b6b7cbb2f2076a Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 9 May 2009 09:28:35 +0000 Subject: [PATCH] Merged from trunk -r13595:13618 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit | 13596 | Fix inverted logic in superuser logic for bug #267104. | | zmedico | | | 13597 | Skip useq() IUSE QA Notices during the "depend" phase | | zmedico | because lots of ebuilds/eclasses have stuff in global scope | | | that really belongs somewhere like pkg_setup or | | | src_configure. Thanks to Arfrever for reporting. | | 13598 | Make useq() die if called during the "depend" phase in | | zmedico | newer EAPIs. | | 13599 | Simplify DepPriority.__int__() and make it consistent with | | zmedico | __str__(). | | 13600 | Bug #268398 - Document econf's automatic die behavior. | | zmedico | | | 13608 | Fix "arguments" spelling. | | zmedico | | | 13612 | Fix misleading/outdated info in the DESCRIPTION section. | | zmedico | | | 13613 | Make portdbapi.getfetchlist() return an equal number of | | zmedico | uris/file names so that no information is lost. | | 13615 | When generating ACCEPT_LICENSE for the ebuild environment, | | zmedico | do not expand *, since that would make it appear to the | | | check_license() function as if the user has accepted | | | licenses which have not really been explicitly accepted. | | 13616 | tweak output when diff access rights are needed | | SpankMan | | | 13617 | Fix SrcUnpackPatches to ignore comment lines. Thanks to | | zmedico | Christian Ruppert for reporting. | | 13618 | Fix digestcheck() to handle missing distfiles digests | | zmedico | correctly. Thanks to Petteri Räty for | | | reporting. | svn path=/main/branches/prefix/; revision=13620 --- bin/ebuild.sh | 10 ++++++++- man/ebuild.5 | 5 +++-- man/repoman.1 | 5 ++--- pym/_emerge/__init__.py | 40 ++++++++++++----------------------- pym/portage/__init__.py | 15 ++++++++----- pym/portage/dbapi/porttree.py | 13 ++++++++---- pym/repoman/checks.py | 1 + 7 files changed, 48 insertions(+), 41 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index d3cf54d47..621e408f3 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -143,8 +143,16 @@ useq() { found=1 fi + if [[ $EBUILD_PHASE = depend ]] ; then + # Skip this for older EAPIs since lots of ebuilds/eclasses + # have stuff in global scope that really belongs somewhere + # like pkg_setup or src_configure. + if [[ -n $EAPI ]] && ! hasq "$EAPI" 0 1 2 ; then + die "use() called during invalid phase: $EBUILD_PHASE" + fi + # Make sure we have this USE flag in IUSE - if [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE ]] ; then + elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE ]] ; then [[ $u =~ $PORTAGE_IUSE ]] || \ eqawarn "QA Notice: USE Flag '${u}' not" \ "in IUSE for ${CATEGORY}/${PF}" diff --git a/man/ebuild.5 b/man/ebuild.5 index 55f334ce9..621a51a43 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -754,11 +754,12 @@ ${\fIECONF_SOURCE\fR:-.}/configure \\ \-\-sysconfdir="${EPREFIX}"/etc \\ \-\-localstatedir="${EPREFIX}"/var/lib \\ \fI${EXTRA_ECONF}\fR \\ - \fIconfigure options\fR + \fIconfigure options\fR || die "econf failed" .fi Note that the \fIEXTRA_ECONF\fR is for users only, not for ebuild writers. If you wish to pass more options to configure, just pass the -extra arguements to \fBeconf\fR. +extra arguments to \fBeconf\fR. Also note that \fBeconf\fR automatically +calls \fBdie\fR if the configure script fails. .TP \fBemake\fR \fI[make options]\fR This is used as a replacement for make. Performs 'make ${MAKEOPTS} diff --git a/man/repoman.1 b/man/repoman.1 index 59320ca0b..555ff3995 100644 --- a/man/repoman.1 +++ b/man/repoman.1 @@ -7,10 +7,9 @@ repoman \- Gentoo's program to enforce a minimal level of quality assurance in p .BR "Quality is job zero." .BR repoman -is meant for Gentoo developers only due to the fact it does not work on a per-ebuild basis. -It checks the quality of CVS repositories. +checks the quality of ebuild repositories. -Note: \fBrepoman commit\fR only works \fIinside local\fR CVS repositories. +Note: \fBrepoman commit\fR only works \fIinside local\fR cvs, git, or subversion repositories. .SH OPTIONS .TP \fB--force\fR diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 5ad4842a8..c2fe495c1 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -960,35 +960,23 @@ class DepPriority(AbstractDepPriority): Attributes Hardness - not satisfied and buildtime 8 - not satisfied and runtime 7 - not satisfied and runtime_post 6 - satisfied and buildtime and rebuild 5 - satisfied and buildtime 4 - satisfied and runtime 3 - satisfied and runtime_post 2 - optional 1 - (none of the above) 0 + buildtime 0 + runtime -1 + runtime_post -2 + optional -3 + (none of the above) -4 """ - if not self.satisfied: - if self.buildtime: - return 8 - if self.runtime: - return 7 - if self.runtime_post: - return 6 + if self.buildtime: - if self.rebuild: - return 5 - return 4 + return 0 if self.runtime: - return 3 + return -1 if self.runtime_post: - return 2 + return -2 if self.optional: - return 1 - return 0 + return -3 + return -4 def __str__(self): if self.optional: @@ -16253,12 +16241,12 @@ def emerge_main(): myopts["--pretend"] = True del myopts["--ask"] print ("%s access is required... " + \ - "adding --pretend to options.\n") % access_desc + "adding --pretend to options\n") % access_desc if portage.secpass < 1 and not need_superuser: portage_group_warning() else: - sys.stderr.write(("emerge: %s access is " + \ - "required.\n\n") % access_desc) + sys.stderr.write(("emerge: %s access is required\n") \ + % access_desc) if portage.secpass < 1 and not need_superuser: portage_group_warning() return 1 diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index c8cecfcd7..fbad5fe24 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -2127,8 +2127,10 @@ class config(object): except exception.InvalidDependString: licenses = set() licenses.discard('||') - if '*' not in settings._accept_license: - licenses.intersection_update(settings._accept_license) + # Do not expand * here, since that would make it appear to the + # check_license() function as if the user has accepted licenses + # which have not really been explicitly accepted. + licenses.intersection_update(settings._accept_license) return ' '.join(sorted(licenses)) def _restrict(self, use, settings): @@ -4018,7 +4020,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", myfile_path = os.path.join(mysettings["DISTDIR"], myfile) has_space = True - has_space_superuser = False + has_space_superuser = True file_lock = None if listonly: writemsg_stdout("\n", noiselevel=-1) @@ -4039,7 +4041,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", if (size - mysize + vfs_stat.f_bsize) >= \ (vfs_stat.f_bsize * vfs_stat.f_bfree): - has_space_superuser = True + has_space_superuser = False if not has_space_superuser: has_space = False @@ -4842,7 +4844,10 @@ def digestcheck(myfiles, mysettings, strict=0, justmanifest=0): eout.eend(0) for f in myfiles: eout.ebegin("checking %s ;-)" % f) - mf.checkFileHashes(mf.findFile(f), f) + ftype = mf.findFile(f) + if ftype is None: + raise KeyError(f) + mf.checkFileHashes(ftype, f) eout.eend(0) except KeyError, e: eout.eend(1) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 2fc55ccc9..3b160a2c4 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -719,10 +719,15 @@ class portdbapi(dbapi): mysettings.setcpv(mypkg, mydb=self) useflags = mysettings["PORTAGE_USE"].split() uri_map = self.getFetchMap(mypkg, useflags=useflags, mytree=mytree) - uris = set() - for uri_set in uri_map.itervalues(): - uris.update(uri_set) - return [list(uris), uri_map.keys()] + + all_uris = [] + all_files = [] + for filename, uris in uri_map.iteritems(): + for uri in uris: + all_uris.append(uri) + all_files.append(filename) + + return [all_uris, all_files] def getfetchsizes(self, mypkg, useflags=None, debug=0): # returns a filename:size dictionnary of remaining downloads diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 78875b4c0..7dfbc8124 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -232,6 +232,7 @@ class EapiDefinition(LineCheck): class SrcUnpackPatches(LineCheck): repoman_check_name = 'ebuild.minorsyn' + ignore_line = re.compile(r'(^\s*#)') src_unpack_re = re.compile(r'^src_unpack\(\)') func_end_re = re.compile(r'^\}$') src_prepare_tools_re = re.compile(r'\s(e?patch|sed)\s') -- 2.26.2