Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix
authorFabian Groffen <grobian@gentoo.org>
Fri, 6 Jul 2012 07:02:23 +0000 (09:02 +0200)
committerFabian Groffen <grobian@gentoo.org>
Fri, 6 Jul 2012 07:02:23 +0000 (09:02 +0200)
Conflicts:
bin/dohtml.py
bin/ebuild
bin/ebuild-helpers/ecompressdir
bin/ebuild-helpers/prepstrip
bin/ebuild-ipc.py
bin/egencache
bin/emaint
bin/emerge
bin/misc-functions.sh
bin/quickpkg
pym/_emerge/actions.py
pym/portage/dbapi/vartree.py
pym/portage/dispatch_conf.py

36 files changed:
1  2 
bin/dohtml.py
bin/ebuild
bin/ebuild-helpers/ecompressdir
bin/ebuild-helpers/prepstrip
bin/ebuild-ipc.py
bin/ebuild.sh
bin/egencache
bin/emaint
bin/emerge
bin/isolated-functions.sh
bin/misc-functions.sh
bin/quickpkg
bin/repoman
bin/save-ebuild-env.sh
cnf/make.globals
man/emerge.1
man/make.conf.5
pym/_emerge/Package.py
pym/_emerge/actions.py
pym/_emerge/depgraph.py
pym/_emerge/main.py
pym/portage/__init__.py
pym/portage/_sets/files.py
pym/portage/const.py
pym/portage/dbapi/bintree.py
pym/portage/dbapi/vartree.py
pym/portage/dispatch_conf.py
pym/portage/getbinpkg.py
pym/portage/package/ebuild/_config/special_env_vars.py
pym/portage/package/ebuild/config.py
pym/portage/package/ebuild/doebuild.py
pym/portage/package/ebuild/fetch.py
pym/portage/tests/runTests
pym/portage/util/__init__.py
pym/portage/versions.py
runtests.sh

diff --cc bin/dohtml.py
index 18095bdb7df1658db7410f5e0c884f43d80a93f9,3e80ef5f6f4d3b29f067dafdfc5f6ae0ec53cc14..59d388b10548ee7619890eeac31d4f3d14f0f252
@@@ -1,5 -1,5 +1,5 @@@
 -#!/usr/bin/python
 +#!@PREFIX_PORTAGE_PYTHON@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2012 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  #
diff --cc bin/ebuild
index 599cc6cdef748ca4d6f665718e188bafa18fe2cb,65e5bef630ca052014b8884f80111d8182c73146..04cb4c608bf783e76dd8f6ed3c556b18a8553ebd
@@@ -1,5 -1,5 +1,5 @@@
 -#!/usr/bin/python -O
 +#!@PREFIX_PORTAGE_PYTHON@ -O
- # Copyright 1999-2011 Gentoo Foundation
+ # Copyright 1999-2012 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  from __future__ import print_function
index 58c410ec7acd5024138b156ce1ccfed514f58823,6801a07d4b9d834d144a809769dd378f96c36c9d..bf76b1f1a6de31f1ed80367236bb5e07e80b5f8c
@@@ -2,7 -2,7 +2,7 @@@
  # Copyright 1999-2011 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
- source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh
++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/helper-functions.sh
  
  if [[ -z $1 ]] ; then
        helpers_die "${0##*/}: at least one argument needed"
index 0042abe34a0f0b6a38b36cca5f7c9135905411e7,85d5d6a866756b7bf33f82312b6b3b9204596c43..22cb72e0094bc14878c5d816d92bb931e17c5754
@@@ -1,8 -1,8 +1,8 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2011 Gentoo Foundation
+ # Copyright 1999-2012 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
- source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh
++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/helper-functions.sh
  
  # avoid multiple calls to `has`.  this creates things like:
  #   FEATURES_foo=false
index f95bac80fde1c2b549a98ff90be4a3f738792798,3caf2d185693b467a4fb5fba1eaf19746d22d3fb..7533c8cdc4d2891ae1262ea9e2cb6a48a1450581
@@@ -1,5 -1,5 +1,5 @@@
 -#!/usr/bin/python
 +#!@PREFIX_PORTAGE_PYTHON@
- # Copyright 2010-2011 Gentoo Foundation
+ # Copyright 2010-2012 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  #
  # This is a helper which ebuild processes can use
diff --cc bin/ebuild.sh
Simple merge
diff --cc bin/egencache
index 01f8e1d048a4e96bda604e0977237e5fb3a243e6,a75a34172cecdcd29ba166ddc1bbef7c987e117d..5edb180dd6fe9393ef15c6ff91e83995e4f212dd
@@@ -1,5 -1,5 +1,5 @@@
 -#!/usr/bin/python
 +#!@PREFIX_PORTAGE_PYTHON@
- # Copyright 2009-2011 Gentoo Foundation
+ # Copyright 2009-2012 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  from __future__ import print_function
@@@ -42,8 -42,7 +42,8 @@@ from portage.manifest import guessManif
  from portage.util import cmp_sort_key, writemsg_level
  from portage import cpv_getkey
  from portage.dep import Atom, isjustname
- from portage.versions import pkgcmp, pkgsplit, vercmp
+ from portage.versions import pkgsplit, vercmp
 +from portage.const import EPREFIX
  
  try:
        from xml.etree import ElementTree
diff --cc bin/emaint
index 91d68d5775ddfe85ae59afd11be9d05a1e53ea1e,cf2ccb8ec61771a81f9b075889e8807f5753de72..4d8b4f345d3f322162062b33c44fd0038e58ea12
@@@ -1,5 -1,6 +1,6 @@@
 -#!/usr/bin/python -O
 +#!@PREFIX_PORTAGE_PYTHON@ -O
- # vim: noet :
+ # Copyright 2005-2012 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
  
  from __future__ import print_function
  
diff --cc bin/emerge
index 324f67382246abdde5353ca7ef8a61c8e63f89fd,a9a56432c2360903af2f1f023ab62fa606369644..85154fbf1aba6a89cd7098984708da7c5d6f3f40
@@@ -1,5 -1,5 +1,5 @@@
 -#!/usr/bin/python
 +#!@PREFIX_PORTAGE_PYTHON@
- # Copyright 2006-2011 Gentoo Foundation
+ # Copyright 2006-2012 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  from __future__ import print_function
@@@ -26,16 -27,21 +27,22 @@@ except KeyboardInterrupt
  def debug_signal(signum, frame):
        import pdb
        pdb.set_trace()
- signal.signal(signal.SIGUSR1, debug_signal)
+ if platform.python_implementation() == 'Jython':
+       debug_signum = signal.SIGUSR2 # bug #424259
+ else:
+       debug_signum = signal.SIGUSR1
+ signal.signal(debug_signum, debug_signal)
  
 -try:
 -      from _emerge.main import emerge_main
 -except ImportError:
 -      from os import path as osp
 -      import sys
 -      sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 -      from _emerge.main import emerge_main
 +# for an explanation on this logic, see pym/_emerge/__init__.py
 +from os import environ as ose
 +from os import path as osp
 +if ose.__contains__("PORTAGE_PYTHONPATH"):
 +    sys.path.insert(0, ose["PORTAGE_PYTHONPATH"])
 +else:
 +    sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.                    realpath(__file__))), "pym"))
 +from _emerge.main import emerge_main
  
  if __name__ == "__main__":
        import sys
Simple merge
index a7a18e23f0be0d8ef7174677dfa708194ee9d1a5,9eec8bb691fb8ae2668bac6ea1d1a2993f10b544..496c2d741d15f0f6d0a9edf1438c51f5f6107d3f
mode 100644,100755..100644
@@@ -153,11 -150,9 +153,11 @@@ prepcompress() 
  install_qa_check() {
        local f i qa_var x
        [[ " ${FEATURES} " == *" force-prefix "* ]] || \
-               case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+               case "$EAPI" in 0|1|2) local EPREFIX= ED=${D} ;; esac
  
 -      cd "${ED}" || die "cd failed"
 +      # PREFIX LOCAL: ED needs not to exist, whereas D does
 +      cd "${D}" || die "cd failed"
 +      # END PREFIX LOCAL
  
        # Merge QA_FLAGS_IGNORED and QA_DT_HASH into a single array, since
        # QA_DT_HASH is deprecated.
        fi
  
        # Now we look for all world writable files.
--      local unsafe_files=$(find "${ED}" -type f -perm -2 | sed -e "s:^${ED}:- :")
++      # PREFIX LOCAL: keep offset in the paths
++      local unsafe_files=$(find "${ED}" -type f -perm -2 | sed -e "s:^${D}:- :")
++      # END PREFIX LOCAL
        if [[ -n ${unsafe_files} ]] ; then
                vecho "QA Security Notice: world writable file(s):"
                vecho "${unsafe_files}"
@@@ -586,12 -509,36 +551,40 @@@ install_qa_check_elf() 
  
                PORTAGE_QUIET=${tmp_quiet}
        fi
+       # Create NEEDED.ELF.2 regardless of RESTRICT=binchecks, since this info is
+       # too useful not to have (it's required for things like preserve-libs), and
+       # it's tempting for ebuild authors to set RESTRICT=binchecks for packages
+       # containing pre-built binaries.
+       if type -P scanelf > /dev/null ; then
+               # Save NEEDED information after removing self-contained providers
+               rm -f "$PORTAGE_BUILDDIR"/build-info/NEEDED{,.ELF.2}
+               scanelf -qyRF '%a;%p;%S;%r;%n' "${D}" | { while IFS= read -r l; do
+                       arch=${l%%;*}; l=${l#*;}
+                       obj="/${l%%;*}"; l=${l#*;}
+                       soname=${l%%;*}; l=${l#*;}
+                       rpath=${l%%;*}; l=${l#*;}; [ "${rpath}" = "  -  " ] && rpath=""
+                       needed=${l%%;*}; l=${l#*;}
+                       echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
+                       echo "${arch:3};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
+               done }
+               [ -n "${QA_SONAME_NO_SYMLINK}" ] && \
+                       echo "${QA_SONAME_NO_SYMLINK}" > \
+                       "${PORTAGE_BUILDDIR}"/build-info/QA_SONAME_NO_SYMLINK
+               if has binchecks ${RESTRICT} && \
+                       [ -s "${PORTAGE_BUILDDIR}/build-info/NEEDED.ELF.2" ] ; then
+                       eqawarn "QA Notice: RESTRICT=binchecks prevented checks on these ELF files:"
+                       eqawarn "$(while read -r x; do x=${x#*;} ; x=${x%%;*} ; echo "${x#${EPREFIX}}" ; done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2)"
+               fi
+       fi
 +}
  
 -      local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${ED}:/:")
 +install_qa_check_misc() {
 +      # PREFIX LOCAL: keep offset prefix in the reported files
 +      local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${D}:/:")
 +      # END PREFIX LOCAL
        if [[ -n ${unsafe_files} ]] ; then
                eqawarn "QA Notice: Unsafe files detected (set*id and world writable)"
                eqawarn "${unsafe_files}"
diff --cc bin/quickpkg
index fb7f874661a729cd6211928d008161d065940fc5,a6bd4d4bd5413e91e67a29d1aa1e36ae59c3a04e..83c0d7b921d33cf79134931a792220768bc0b8cc
@@@ -1,5 -1,5 +1,5 @@@
 -#!/usr/bin/python
 +#!@PREFIX_PORTAGE_PYTHON@
- # Copyright 1999-2010 Gentoo Foundation
+ # Copyright 1999-2012 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  from __future__ import print_function
diff --cc bin/repoman
Simple merge
Simple merge
index 2e2171d3250e17acea4c0b0456181c6a80980628,db97d8b5a0b6d1218eef2611a528b8811912cc0a..7e61325751d1370ae275d9782ad2a8751adffd59
@@@ -141,12 -123,12 +146,12 @@@ PORTAGE_WORKDIR_MODE="0700
  PORTAGE_ELOG_CLASSES="log warn error"
  PORTAGE_ELOG_SYSTEM="save_summary echo"
  
 -PORTAGE_ELOG_MAILURI="root"
 +PORTAGE_ELOG_MAILURI="@rootuser@"
  PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}"
 -PORTAGE_ELOG_MAILFROM="portage@localhost"
 +PORTAGE_ELOG_MAILFROM="@portageuser@@localhost"
  
  # Signing command used by repoman
- PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --clearsign --yes --default-key \"\${PORTAGE_GPG_KEY}\" --homedir \"\${PORTAGE_GPG_DIR}\" \"\${FILE}\""
+ PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --digest-algo SHA512 --clearsign --yes --default-key \"\${PORTAGE_GPG_KEY}\" --homedir \"\${PORTAGE_GPG_DIR}\" \"\${FILE}\""
  
  #            *****************************
  #            **  DO NOT EDIT THIS FILE  **
diff --cc man/emerge.1
Simple merge
diff --cc man/make.conf.5
Simple merge
index f81895189b070f6e4609346a9bc65bd094aa359f,14d069449782d3baa9f87567cc48bdeef04ebb14..228cd965db54fa76b05d23e70111b56a4dba3922
@@@ -8,12 -8,11 +8,12 @@@ from portage import _encodings, _unicod
  from portage.cache.mappings import slot_dict_class
  from portage.const import EBUILD_PHASES
  from portage.dep import Atom, check_required_use, use_reduce, \
-       paren_enclose, _slot_re, _slot_separator, _repo_separator
- from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use
+       paren_enclose, _slot_separator, _repo_separator
+ from portage.versions import _pkg_str, _unknown_repo
+ from portage.eapi import _get_eapi_attrs
  from portage.exception import InvalidDependString
- from portage.repository.config import _gen_valid_repo
  from _emerge.Task import Task
 +from portage.const import EPREFIX
  
  if sys.hexversion >= 0x3000000:
        basestring = str
index eb7408592d9edea73cb7a662e6af2ffc7931de27,af42828d149b5b803cd7d836d1965ae5a0710479..2135f09ce6513f8eacaf91ae4c55fa9d455b8653
@@@ -28,10 -28,10 +28,11 @@@ portage.proxy.lazyimport.lazyimport(glo
  from portage.localization import _
  from portage import os
  from portage import shutil
- from portage import _unicode_decode
+ from portage import eapi_is_supported, _unicode_decode
  from portage.cache.cache_errors import CacheError
- from portage.const import GLOBAL_CONFIG_PATH, EPREFIX
- from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG
++from portage.const import EPREFIX
+ from portage.const import GLOBAL_CONFIG_PATH
+ from portage.const import _ENABLE_DYN_LINK_MAP
  from portage.dbapi.dep_expand import dep_expand
  from portage.dbapi._expand_new_virt import expand_new_virt
  from portage.dep import Atom, extended_cp_match
Simple merge
Simple merge
Simple merge
index 7992b82d00e9e0887b15b446cfb3916fb1940753,b891ea4f44a3b06dcc5f252418125a0aa61ca685..69bdc0d7783ecc84abc78b8dba04cb80bdf8988a
@@@ -1,6 -1,7 +1,6 @@@
- # Copyright 2007-2011 Gentoo Foundation
+ # Copyright 2007-2012 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -import errno
  import re
  from itertools import chain
  
index cd8ecfb30370977badafd1a2fa7bca5306766485,ceef5c56b4f350553dfcea547709a37e372f16e2..267798c6c08369c63f20d87ff86fdbb3c30b62c5
@@@ -1,12 -1,7 +1,12 @@@
  # portage: Constants
- # Copyright 1998-2011 Gentoo Foundation
+ # Copyright 1998-2012 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 +# ===========================================================================
 +# autotool supplied constants.
 +# ===========================================================================
 +from portage.const_autotool import *
 +
  import os
  
  # ===========================================================================
@@@ -125,10 -90,10 +125,11 @@@ SUPPORTED_FEATURES       = frozenset(
                             "ccache", "chflags", "clean-logs",
                             "collision-protect", "compress-build-logs", "compressdebug",
                             "config-protect-if-modified",
-                            "digest", "distcc", "distcc-pump", "distlocks", "ebuild-locks", "fakeroot",
+                            "digest", "distcc", "distcc-pump", "distlocks",
+                            "downgrade-backup", "ebuild-locks", "fakeroot",
                             "fail-clean", "force-mirror", "force-prefix", "getbinpkg",
                             "installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror",
 +                            "macossandbox", "macosprefixsandbox", "macosusersandbox",
                             "metadata-transfer", "mirror", "multilib-strict", "news",
                             "noauto", "noclean", "nodoc", "noinfo", "noman",
                             "nostrip", "notitles", "parallel-fetch", "parallel-install",
index 77ab4dfd2df9ab1ab6919d6a542796491f8ed4fe,1048cc108f222793b7d4ca60649de644f0a2eb9a..170ed18ab3d30080dda7058baed7d7813d833889
@@@ -23,9 -23,8 +23,9 @@@ from portage.cache.mappings import slot
  from portage.const import CACHE_PATH
  from portage.dbapi.virtual import fakedbapi
  from portage.dep import Atom, use_reduce, paren_enclose
- from portage.exception import AlarmSignal, InvalidPackageName, \
+ from portage.exception import AlarmSignal, InvalidData, InvalidPackageName, \
        PermissionDenied, PortageException
 +from portage.const import EAPI
  from portage.localization import _
  from portage import _movefile
  from portage import os
index 340de4c68b4393c20c5d08f98a6a32cca9b4fcab,fbf2e747c8bdf62e50811ff8bda1b45eb8fa321b..109545ad50f884d1ccd2ecc6d42dde4df0ccbbee
@@@ -30,11 -32,8 +32,11 @@@ portage.proxy.lazyimport.lazyimport(glo
        'portage.util.movefile:movefile',
        'portage.util._dyn_libs.PreservedLibsRegistry:PreservedLibsRegistry',
        'portage.util._dyn_libs.LinkageMapELF:LinkageMapELF@LinkageMap',
-       'portage.versions:best,catpkgsplit,catsplit,cpv_getkey,pkgcmp,' + \
-               '_pkgsplit@pkgsplit',
 +      'portage.util._dyn_libs.LinkageMapMachO:LinkageMapMachO',
 +      'portage.util._dyn_libs.LinkageMapPeCoff:LinkageMapPeCoff',
 +      'portage.util._dyn_libs.LinkageMapXCoff:LinkageMapXCoff',
+       'portage.versions:best,catpkgsplit,catsplit,cpv_getkey,vercmp,' + \
+               '_pkgsplit@pkgsplit,_pkg_str',
        'subprocess',
        'tarfile',
  )
@@@ -89,8 -90,10 +93,11 @@@ except ImportError
  if sys.hexversion >= 0x3000000:
        basestring = str
        long = int
+       _unicode = str
+ else:
+       _unicode = unicode
  
 +
  class vardbapi(dbapi):
  
        _excluded_dirs = ["CVS", "lost+found"]
index 2ab7301d6d489e551b7c6b0eb8d82b85b9d7bbb6,4c68dfc7b8df23649f652e17a15f3fae4effe4c1..77291958fbcac008df3708f89b3f1c0b927fd82c
@@@ -13,8 -13,7 +13,8 @@@ import os, shutil, subprocess, sy
  import portage
  from portage.env.loaders import KeyValuePairFileLoader
  from portage.localization import _
- from portage.util import varexpand
+ from portage.util import shlex_split, varexpand
 +from portage.const import EPREFIX
  
  RCS_BRANCH = '1.1.1'
  RCS_LOCK = 'rcs -ko -M -l'
Simple merge
Simple merge
index f35777a006f685c52531071b384bb391d15c8fce,09062f9f30bdb340129fc4fb529e70e23473a563..2322746f74631cb0421eda5f3c606476e7bd63a7
@@@ -32,11 -33,10 +34,11 @@@ portage.proxy.lazyimport.lazyimport(glo
  
  from portage import auxdbkeys, bsd_chflags, \
        eapi_is_supported, merge, os, selinux, shutil, \
-       unmerge, _encodings, _parse_eapi_ebuild_head, _os_merge, \
+       unmerge, _encodings, _os_merge, \
        _shell_quote, _unicode_decode, _unicode_encode
  from portage.const import EBUILD_SH_ENV_FILE, EBUILD_SH_ENV_DIR, \
 -      EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY
 +      EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY, \
 +      EPREFIX, MACOSSANDBOX_PROFILE
  from portage.data import portage_gid, portage_uid, secpass, \
        uid, userpriv_groups
  from portage.dbapi.porttree import _parse_uri_map
Simple merge
index 223a8ccd49436397945818a30830d2a49b27acde,91984a3a3f9b462971b92e01709f030e86c5662f..afb967cb3b51bb2655074bf98f09aa5bad52dd2b
@@@ -1,6 -1,6 +1,6 @@@
 -#!/usr/bin/python -Wd
 +#!/usr/bin/env python
  # runTests.py -- Portage Unit Test Functionality
- # Copyright 2006 Gentoo Foundation
+ # Copyright 2006-2012 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  import os, sys
Simple merge
index f0619be9f5d965fe48bece891e3bf65a03a12c52,5893096d18b7017d7d36d2fa9c449406d6e3de95..81f7559b30ca57be9763ea35ac84d1955f9e030a
@@@ -26,16 -39,27 +39,28 @@@ _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+-]*?'
+ _pkg = {
+       "dots_disallowed_in_PN": r'[\w+][\w+-]*?',
+       "dots_allowed_in_PN":    r'[\w+][\w+.-]*?',
+ }
  
  _v = r'(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\d*)*)'
 -_rev = r'\d+'
 +# PREFIX hack: -r(\d+) -> -r(\d+|0\d+\.\d+) (see below)
 +_rev = r'(\d+|0\d+\.\d+)'
  _vr = _v + '(-r(' + _rev + '))?'
  
- _cp = '(' + _cat + '/' + _pkg + '(-' + _vr + ')?)'
- _cpv = '(' + _cp + '-' + _vr + ')'
- _pv = '(?P<pn>' + _pkg + '(?P<pn_inval>-' + _vr + ')?)' + '-(?P<ver>' + _v + ')(-r(?P<rev>' + _rev + '))?'
+ _cp = {
+       "dots_disallowed_in_PN": '(' + _cat + '/' + _pkg['dots_disallowed_in_PN'] + '(-' + _vr + ')?)',
+       "dots_allowed_in_PN":    '(' + _cat + '/' + _pkg['dots_allowed_in_PN']    + '(-' + _vr + ')?)',
+ }
+ _cpv = {
+       "dots_disallowed_in_PN": '(' + _cp['dots_disallowed_in_PN'] + '-' + _vr + ')',
+       "dots_allowed_in_PN":    '(' + _cp['dots_allowed_in_PN']    + '-' + _vr + ')',
+ }
+ _pv = {
+       "dots_disallowed_in_PN": '(?P<pn>' + _pkg['dots_disallowed_in_PN'] + '(?P<pn_inval>-' + _vr + ')?)' + '-(?P<ver>' + _v + ')(-r(?P<rev>' + _rev + '))?',
+       "dots_allowed_in_PN":    '(?P<pn>' + _pkg['dots_allowed_in_PN']    + '(?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*)$")
@@@ -199,44 -230,18 +231,42 @@@ def vercmp(ver1, ver2, silent=1)
                                r2 = 0
                        rval = (r1 > r2) - (r1 < r2)
                        if rval:
-                               vercmp_cache[mykey] = rval
                                return rval
  
 -      # the suffix part is equal to, so finally check the revision
 +      # The suffix part is equal too, so finally check the revision
 +      # PREFIX hack: a revision starting with 0 is an 'inter-revision',
 +      # which means that it is possible to create revisions on revisions.
 +      # An example is -r01.1 which is the first revision of -r1.  Note
 +      # that a period (.) is used to separate the real revision and the
 +      # secondary revision number.  This trick is in use to allow revision
 +      # bumps in ebuilds synced from the main tree for Prefix changes,
 +      # while still staying in the main tree versioning scheme.
        if match1.group(10):
 -              r1 = int(match1.group(10))
 +              if match1.group(10)[0] == '0' and '.' in match1.group(10):
 +                      t = match1.group(10)[1:].split(".")
 +                      r1 = int(t[0])
 +                      r3 = int(t[1])
 +              else:
 +                      r1 = int(match1.group(10))
 +                      r3 = 0
        else:
                r1 = 0
 +              r3 = 0
        if match2.group(10):
 -              r2 = int(match2.group(10))
 +              if match2.group(10)[0] == '0' and '.' in match2.group(10):
 +                      t = match2.group(10)[1:].split(".")
 +                      r2 = int(t[0])
 +                      r4 = int(t[1])
 +              else:
 +                      r2 = int(match2.group(10))
 +                      r4 = 0
        else:
                r2 = 0
 +              r4 = 0
 +      if r1 == r2 and (r3 != 0 or r4 != 0):
 +              r1 = r3
 +              r2 = r4
        rval = (r1 > r2) - (r1 < r2)
-       vercmp_cache[mykey] = rval
        return rval
        
  def pkgcmp(pkg1, pkg2):
diff --cc runtests.sh
Simple merge