Merged from trunk 7918:7951
authorFabian Groffen <grobian@gentoo.org>
Fri, 5 Oct 2007 20:23:50 +0000 (20:23 -0000)
committerFabian Groffen <grobian@gentoo.org>
Fri, 5 Oct 2007 20:23:50 +0000 (20:23 -0000)
   | 7919    | In portdbapi.aux_get(), simplify code by using string        |
   | zmedico | manipulation instead of int conversion to manipulate         |
   |         | negative EAPI when deciding whether or not regen is          |
   |         | necessary.                                                   |

   | 7942    | Make the EbuildQuote check ignore lines beginning with local |
   | zmedico | or export builtins since unquoted assignments are okay       |
   |         | there.                                                       |

   | 7944    | Bug #194764 - All the match* functions can raise a           |
   | zmedico | ValueError if cpv_expand() receives an ambiguous atom.       |
   |         | Therefore, move the ValueError handling code out of match()  |
   |         | and use it to handle all such errors when appropriate.       |

   | 7946    | copy of gentoolkit r451                                      |
   | genone  |                                                              |

   | 7947    | add TODO list for portage-2.2                                |
   | genone  |                                                              |

   | 7948    | ignore missing files                                         |
   | genone  |                                                              |

   | 7949    | Document the EAPI variable.                                  |
   | zmedico |                                                              |

   | 7950    | Fix spelling of backward.                                    |
   | zmedico |                                                              |

   | 7951    | Documnet EAPI in the MASKED PACKAGES section.                |
   | zmedico |                                                              |

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

TODO [new file with mode: 0644]
bin/portageq
man/ebuild.5
man/emerge.1
pym/portage/dbapi/porttree.py
pym/portage/env/loaders.py
pym/portage/glsa.py
pym/repoman/checks.py

diff --git a/TODO b/TODO
new file mode 100644 (file)
index 0000000..ab35be7
--- /dev/null
+++ b/TODO
@@ -0,0 +1,4 @@
+TODO for portage-2.2 release:
+=============================
+- package set integration in emerge (genone)
+- user interface for preserve-libs FEATURE (genone, fuzzyray?)
index 936324c36c8e8a9a0b1a5c9bdffb1fdbbe432c4d..7b0281e579d6a0e915e53d78e4b582a120adeb02 100755 (executable)
@@ -183,8 +183,6 @@ def match(argv):
                sys.exit(2)
        try:
                print "\n".join(portage.db[argv[0]]["vartree"].dbapi.match(argv[1]))
-       except KeyError:
-               sys.exit(1)
 match.uses_root = True
 
 
@@ -379,6 +377,19 @@ def main():
        except portage.exception.PermissionDenied, e:
                sys.stderr.write("Permission denied: '%s'\n" % str(e))
                sys.exit(e.errno)
+       except ValueError, e:
+               if not e.args or \
+                       not hasattr(e.args[0], "__len__") or \
+                       len(e.args[0]) < 2:
+                       raise
+               # Multiple matches thrown from cpv_expand
+               pkgs = e.args[0]
+               # An error has occurred so we writemsg to stderr and exit nonzero.
+               portage.writemsg("The following packages available:\n", noiselevel=-1)
+               for pkg in pkgs:
+                       portage.writemsg("* %s\n" % pkg, noiselevel=-1)
+               portage.writemsg("\nPlease use a more specific atom.\n", noiselevel=-1)
+               sys.exit(1)
 
 main()
 
index 86d1be700adce03e53eea775ff154719b93e2829..0eb1b32d9ef36b82eb022743fa7008aea6b79d84 100644 (file)
@@ -126,6 +126,17 @@ the tree prefixed by ${ROOT}.  Do not modify this variable.
 \fBDESCRIPTION\fR = \fI"A happy little package"\fR
 Should contain a short description of the package.
 .TP
+\fBEAPI\fR = \fI"0"\fR
+Defines the ebuild API version to which this package conforms. If not
+defined then it defaults to "0". If portage does not recognize the
+EAPI value then it will mask the package and refuse to perform any
+operations with it since this means that a newer version of portage
+needs to be installed first. For maximum backward compatiblity, a
+package should conform to the lowest possible EAPI. Note that anyone
+who uses the \fBebuild\fR(1) and \fBrepoman\fR(1) commands with this
+package will be required to have a version of portage that recognizes
+the EAPI to which this package conforms.
+.TP
 \fBSRC_URI\fR = \fI"http://happy.com/little/${P}.tar.gz"\fR
 Contains a list of URI's for the required source files.  It can contain
 multiple URI's for a single source file.  The list is processed in order
index 9642c9efa04f0d38a5bab6d60b8ada674a74d901..c86d1f5f6728cbc90eb71d05612b53661ff9fc71 100644 (file)
@@ -543,6 +543,11 @@ The \fBpackage.mask\fR file primarily blocks the use of packages that cause
 problems or are known to have issues on different systems.  It resides in
 \fI/usr/portage/profiles\fR.
 .TP
+.BR EAPI
+The \fBEAPI\fR variable in an \fBebuild\fR(5) file is used to mask packages
+that are not supported by the current version of portage. Packages masked by
+\fBEAPI\fR can only be installed after portage has been upgraded.
+.TP
 .BR KEYWORDS
 The \fBKEYWORDS\fR variable in an \fBebuild\fR file is also used for masking 
 a package still in testing.  There are architecture\-specific keywords for 
index 824d1afc437f5201071e741223b18409074c9320..03550033ab2d09b198c3439e7db76568c5920d34 100644 (file)
@@ -284,15 +284,8 @@ class portdbapi(dbapi):
                        mydata = self.auxdb[mylocation][mycpv]
                        eapi = mydata.get("EAPI","").strip()
                        if not eapi:
-                               eapi = 0
-                       try:
-                               eapi = int(eapi)
-                       except ValueError:
-                               # Non-integer EAPI isn't supported. In case it's supported in
-                               # the future, assume that it's valid (rather than trigger a
-                               # regen).
-                               eapi = None
-                       if eapi is not None and eapi < 0 and eapi_is_supported(-eapi):
+                               eapi = "0"
+                       if eapi.startswith("-") and eapi_is_supported(eapi[1:]):
                                doregen = True
                        elif emtime != long(mydata.get("_mtime_", 0)):
                                doregen = True
index 1d0ca01aac4bba924601e32222feabb7e6724ad3..61bb6912661cfca1e297efe3257bfd9b99a17b4f 100644 (file)
@@ -36,8 +36,9 @@ def RecursiveFileLoader(filename):
        @rtype: list
        @returns: List of files to process
        """
-
-       if os.path.isdir(filename):
+       if not os.path.exists(filename):
+               return
+       elif os.path.isdir(filename):
                for root, dirs, files in os.walk(filename):
                        if 'CVS' in dirs:
                                dirs.remove('CVS')
index 5e2d5f08171a3db7b2f1ba658e8692e470721b7c..7e205d63a791d201db510c28834a282779a65ae9 100644 (file)
@@ -177,7 +177,7 @@ def getText(node, format):
        if format == "strip":
                rValue = rValue.strip(" \n\t")
                rValue = re.sub("[\s]{2,}", " ", rValue)
-       return str(rValue)
+       return rValue.encode("utf_8")
 
 def getMultiTagsText(rootnode, tagname, format):
        """
index d30785aed3e48a1f2d7033170c0b34b2d1714734..d956b83f8f3a0e7488d614bfc8fbc39322e1cbc2 100644 (file)
@@ -118,7 +118,7 @@ class EbuildQuote(ContentCheck):
        """Ensure ebuilds have valid quoting around things like D,FILESDIR, etc..."""
 
        repoman_check_name = 'ebuild.minorsyn'
-       ignore_line = re.compile(r'(^$)|(^\s*#.*)|(^\s*\w+=.*)')
+       ignore_line = re.compile(r'(^$)|(^\s*#.*)|(^\s*\w+=.*)|(^\s*(local|export)\s+)')
        var_names = r'(D|S|T|ROOT|FILESDIR|WORKDIR)'
        var_reference = re.compile(r'\$({'+var_names+'}|' + \
                r'\$' + var_names + '\W)')