Merged from trunk -r13595:13618
authorFabian Groffen <grobian@gentoo.org>
Sat, 9 May 2009 09:28:35 +0000 (09:28 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 9 May 2009 09:28:35 +0000 (09:28 -0000)
   | 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 <idl0r@g.o> for reporting.                |

   | 13618    | Fix digestcheck() to handle missing distfiles digests       |
   | zmedico  | correctly. Thanks to Petteri Räty <betelgeuse@g.o> for     |
   |          | reporting.                                                  |

svn path=/main/branches/prefix/; revision=13620

bin/ebuild.sh
man/ebuild.5
man/repoman.1
pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/dbapi/porttree.py
pym/repoman/checks.py

index d3cf54d475764c87706ff3733e3700dd0d98b532..621e408f318b3f5e0711e26a8f430445c8266104 100755 (executable)
@@ -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}"
index 55f334ce9f67e1ffb4b9bfc590730685cf582d99..621a51a43e13fb9dd96a0cb9ef809953cf2f2d70 100644 (file)
@@ -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}
index 59320ca0ba094b300b605195a1a911c777614d5d..555ff399540634f34627425d7c0056edfe3b56ac 100644 (file)
@@ -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
index 5ad4842a8bafa3e3459c04c928315b844f87720a..c2fe495c187e45e83135b62bd897944dff3f540a 100644 (file)
@@ -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
index c8cecfcd716bf02c4f7fa2bacadd8e1d15779b76..fbad5fe24b78dd35de4e6f0b2e9459bf59423eb4 100644 (file)
@@ -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)
index 2fc55ccc924801d1dbe9965837fa82994cc5b2b6..3b160a2c471388368045e41088cf97080e6fa953 100644 (file)
@@ -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
index 78875b4c08a072c52b8e4a1e83f840b2f09b511f..7dfbc8124c879b9aff80dd3700635370f182b2a1 100644 (file)
@@ -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')