From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BBEA41386EE for ; Sun, 27 Jan 2013 21:41:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3DEA121C003; Sun, 27 Jan 2013 21:41:35 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A347121C003 for ; Sun, 27 Jan 2013 21:41:34 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8CE94335E33 for ; Sun, 27 Jan 2013 21:41:33 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 1FE34E4073 for ; Sun, 27 Jan 2013 21:41:32 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1359322783.b052d83f4455ae8585daf34ec090539ca612d31c.grobian@gentoo> Subject: [gentoo-commits] proj/portage:prefix commit in: / X-VCS-Repository: proj/portage X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: b052d83f4455ae8585daf34ec090539ca612d31c X-VCS-Branch: prefix Date: Sun, 27 Jan 2013 21:41:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: fbc8e776-3926-42b5-9d05-4e0cfaaa24c5 X-Archives-Hash: 023129a4a26f099410b9e43da4916de7 commit: b052d83f4455ae8585daf34ec090539ca612d31c Author: Fabian Groffen gentoo org> AuthorDate: Sun Jan 27 21:39:43 2013 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Jan 27 21:39:43 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b052d83f Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Conflicts: bin/ebuild.sh pym/portage/const.py pym/portage/data.py Makefile | 17 +- bin/ebuild | 2 +- bin/ebuild.sh | 11 +- bin/egencache | 30 +- bin/glsa-check | 107 ++++--- bin/isolated-functions.sh | 3 +- bin/portageq | 10 +- bin/repoman | 4 +- cnf/make.conf | 15 +- man/ebuild.1 | 12 +- man/make.conf.5 | 15 +- man/portage.5 | 6 +- man/ru/ebuild.1 | 245 ++++++++++++++++ man/ru/env-update.1 | 35 +++ man/ru/etc-update.1 | 63 ++++ man/ru/fixpackages.1 | 22 ++ pym/_emerge/DependencyArg.py | 10 +- pym/_emerge/EbuildMetadataPhase.py | 5 +- pym/_emerge/EbuildPhase.py | 9 +- pym/_emerge/EbuildProcess.py | 12 +- pym/_emerge/EbuildSpawnProcess.py | 10 +- pym/_emerge/FakeVartree.py | 4 +- pym/_emerge/JobStatusDisplay.py | 41 ++-- pym/_emerge/MiscFunctionsProcess.py | 7 +- pym/_emerge/Package.py | 92 ++++--- pym/_emerge/Scheduler.py | 8 +- pym/_emerge/SpawnProcess.py | 17 +- pym/_emerge/SubProcess.py | 9 +- pym/_emerge/UseFlagDisplay.py | 10 +- pym/_emerge/actions.py | 36 ++- pym/_emerge/depgraph.py | 56 ++-- pym/_emerge/emergelog.py | 12 +- pym/_emerge/resolver/circular_dependency.py | 4 +- pym/_emerge/resolver/output.py | 13 +- pym/_emerge/resolver/output_helpers.py | 5 +- pym/_emerge/resolver/slot_collision.py | 75 ++++-- pym/portage/__init__.py | 15 + pym/portage/_selinux.py | 53 ++-- pym/portage/_sets/__init__.py | 4 + pym/portage/cache/ebuild_xattr.py | 2 +- pym/portage/cache/flat_hash.py | 14 +- pym/portage/cache/sqlite.py | 7 +- pym/portage/const.py | 3 +- pym/portage/data.py | 38 ++- pym/portage/dbapi/__init__.py | 24 ++- pym/portage/dbapi/_expand_new_virt.py | 4 +- pym/portage/dbapi/bintree.py | 12 +- pym/portage/dbapi/cpv_expand.py | 4 +- pym/portage/dbapi/dep_expand.py | 4 +- pym/portage/dbapi/porttree.py | 6 +- pym/portage/dbapi/vartree.py | 128 ++++----- pym/portage/dbapi/virtual.py | 3 +- pym/portage/dep/__init__.py | 10 +- pym/portage/dep/_slot_operator.py | 4 +- pym/portage/dep/dep_check.py | 11 +- pym/portage/elog/mod_save_summary.py | 21 +- pym/portage/getbinpkg.py | 4 +- pym/portage/glsa.py | 301 +++++++++++--------- pym/portage/localization.py | 12 +- pym/portage/manifest.py | 2 + pym/portage/news.py | 10 +- .../package/ebuild/_config/KeywordsManager.py | 32 ++- .../package/ebuild/_config/LocationsManager.py | 31 ++- pym/portage/package/ebuild/_config/UseManager.py | 36 ++- .../package/ebuild/_config/special_env_vars.py | 8 +- pym/portage/package/ebuild/_ipc/QueryCommand.py | 7 +- pym/portage/package/ebuild/config.py | 32 ++- pym/portage/package/ebuild/doebuild.py | 95 +++---- pym/portage/package/ebuild/prepare_build_dirs.py | 8 +- pym/portage/process.py | 70 ++++- pym/portage/repository/config.py | 21 +- .../{_emirrordist => tests/glsa}/__init__.py | 0 pym/portage/tests/{bin => glsa}/__test__ | 0 pym/portage/tests/glsa/test_security_set.py | 144 ++++++++++ pym/portage/tests/repoman/test_simple.py | 15 + pym/portage/tests/unicode/test_string_format.py | 51 ++-- pym/portage/update.py | 4 +- pym/portage/util/_get_vm_info.py | 80 ++++++ pym/portage/util/_path.py | 27 ++ pym/portage/util/digraph.py | 12 +- pym/portage/util/movefile.py | 12 +- pym/portage/versions.py | 11 +- pym/portage/xml/metadata.py | 8 +- pym/repoman/checks.py | 7 +- pym/repoman/errors.py | 4 +- pym/repoman/herdbase.py | 6 +- pym/repoman/utilities.py | 62 +++-- 87 files changed, 1762 insertions(+), 749 deletions(-) diff --cc bin/ebuild.sh index 95c95bb,2293938..5ee2dca --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@@ -1,9 -1,9 +1,9 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2012 Gentoo Foundation + # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}" -PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}" +PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}" +PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-@PORTAGE_BASE@/pym}" # Prevent aliases from causing portage to act inappropriately. # Make sure it's before everything so we don't mess aliases that follow. diff --cc pym/_emerge/emergelog.py index 3b6b595,aea94f7..9397aca --- a/pym/_emerge/emergelog.py +++ b/pym/_emerge/emergelog.py @@@ -19,12 -18,8 +19,8 @@@ from portage.const import EPREFI # dblink.merge() and we don't want that to trigger log writes # unless it's really called via emerge. _disable = True -_emerge_log_dir = '/var/log' +_emerge_log_dir = EPREFIX + '/var/log' - # Coerce to unicode, in order to prevent TypeError when writing - # raw bytes to TextIOWrapper with python2. - _log_fmt = _unicode_decode("%.0f: %s\n") - def emergelog(xterm_titles, mystr, short_msg=None): if _disable: diff --cc pym/portage/const.py index 527478f,3859a16..057f9e2 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@@ -1,11 -1,8 +1,12 @@@ # portage: Constants - # Copyright 1998-2012 Gentoo Foundation + # Copyright 1998-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +# =========================================================================== +# autotool supplied constants. +# =========================================================================== +from portage.const_autotool import * + from __future__ import unicode_literals import os diff --cc pym/portage/data.py index df87b5c,29292f5..324a4cb --- a/pym/portage/data.py +++ b/pym/portage/data.py @@@ -90,40 -86,37 +90,42 @@@ def _get_global(k) elif portage.const.EPREFIX: secpass = 2 #Discover the uid and gid of the portage user/group + keyerror = False try: - _portage_grpname = _get_global('_portage_grpname') - if platform.python_implementation() == 'PyPy': - # Somehow this prevents "TypeError: expected string" errors - # from grp.getgrnam() with PyPy 1.7 - _portage_grpname = str(_portage_grpname) - portage_gid = grp.getgrnam(_portage_grpname).gr_gid + portage_uid = pwd.getpwnam(_get_global('_portage_username')).pw_uid except KeyError: - keyerror = True + # PREFIX LOCAL: some sysadmins are insane, bug #344307 + if _portage_grpname.isdigit(): + portage_gid = int(_portage_grpname) + else: - portage_gid = None ++ keyerror = True + # END PREFIX LOCAL + portage_uid = 0 + try: - portage_uid = pwd.getpwnam(_get_global('_portage_username')).pw_uid - if secpass < 1 and portage_gid in os.getgroups(): - secpass = 1 + portage_gid = grp.getgrnam(_get_global('_portage_grpname')).gr_gid except KeyError: - portage_uid = None - - if portage_uid is None or portage_gid is None: - portage_uid = 0 + keyerror = True portage_gid = 0 + + if secpass < 1 and portage_gid in os.getgroups(): + secpass = 1 + + # Suppress this error message if both PORTAGE_GRPNAME and + # PORTAGE_USERNAME are set to "root", for things like + # Android (see bug #454060). + if keyerror and not (_get_global('_portage_username') == "root" and + _get_global('_portage_grpname') == "root"): + # PREFIX LOCAL: we need to fix this one day to distinguish prefix vs non-prefix + writemsg(colorize("BAD", + _("portage: '%s' user or '%s' group missing." % (_get_global('_portage_username'), _get_global('_portage_grpname')))) + "\n", noiselevel=-1) writemsg(colorize("BAD", - _("portage: 'portage' user or group missing.")) + "\n", noiselevel=-1) - writemsg(_( - " For the defaults, line 1 goes into passwd, " - "and 2 into group.\n"), noiselevel=-1) - writemsg(colorize("GOOD", - " portage:x:250:250:portage:/var/tmp/portage:/bin/false") \ - + "\n", noiselevel=-1) - writemsg(colorize("GOOD", " portage::250:portage") + "\n", - noiselevel=-1) + _(" In Prefix Portage this is quite dramatic")) + "\n", noiselevel=-1) + writemsg(colorize("BAD", + _(" since it means you have thrown away yourself.")) + "\n", noiselevel=-1) + writemsg(colorize("BAD", + _(" Re-add yourself or re-bootstrap Gentoo Prefix.")) + "\n", noiselevel=-1) + # END PREFIX LOCAL portage_group_warning() _initialized_globals.add('portage_gid') @@@ -244,14 -232,18 +246,22 @@@ def _init(settings) if '_portage_grpname' not in _initialized_globals and \ '_portage_username' not in _initialized_globals: + # Prevents "TypeError: expected string" errors + # from grp.getgrnam() with PyPy + native_string = platform.python_implementation() == 'PyPy' + - v = settings.get('PORTAGE_GRPNAME', 'portage') + # PREFIX LOCAL: use var iso hardwired 'portage' + v = settings.get('PORTAGE_GRPNAME', PORTAGE_GROUPNAME) + # END PREFIX LOCAL + if native_string: + v = portage._native_string(v) globals()['_portage_grpname'] = v _initialized_globals.add('_portage_grpname') - v = settings.get('PORTAGE_USERNAME', 'portage') + # PREFIX LOCAL: use var iso hardwired 'portage' + v = settings.get('PORTAGE_USERNAME', PORTAGE_USERNAME) + # END PREFIX LOCAL + if native_string: + v = portage._native_string(v) globals()['_portage_username'] = v _initialized_globals.add('_portage_username')