[gentoo-commits] proj/portage:master commit in: pym/_emerge/, man/, pym/portage/tests/resolver/

2018-03-27 Thread Zac Medico
commit: 1879d3ca019ebe4b870c3ee8d80910a90a8e4408
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Mar 26 20:59:57 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Mar 28 05:51:50 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1879d3ca

emerge: add --changed-slot [ y | n ] option (bug 631358)

This is similar to --changed-deps, but for SLOT metadata.

Bug: https://bugs.gentoo.org/631358

 man/emerge.1  |  7 +++
 pym/_emerge/create_depgraph_params.py |  6 ++
 pym/_emerge/depgraph.py   | 11 +++
 pym/_emerge/main.py   | 13 +
 .../resolver/test_slot_change_without_revbump.py  | 19 +++
 5 files changed, 56 insertions(+)

diff --git a/man/emerge.1 b/man/emerge.1
index 27a1193fe..a3c8dd7cd 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -471,6 +471,13 @@ changed since the installed instance was built. Behavior 
with respect to
 changed build\-time dependencies is controlled by the
 \fB\-\-with\-bdeps\fR option.
 .TP
+.BR "\-\-changed\-slot [ y | n ]"
+Tells emerge to replace installed packages for which the corresponding
+ebuild SLOT metadata has changed since the packages were built. This
+option also implies the \fB\-\-selective\fR option. This may also result
+in rebuilds for any installed packages that have slot/sub\-slot :=
+operator dependencies that are sensitive to the relevant SLOT metadata.
+.TP
 .BR \-\-changed\-use ", " \-U
 Tells emerge to include installed packages where USE flags have
 changed since installation. This option also implies the

diff --git a/pym/_emerge/create_depgraph_params.py 
b/pym/_emerge/create_depgraph_params.py
index ff18f3acc..1fd1f5e36 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -30,6 +30,7 @@ def create_depgraph_params(myopts, myaction):
# with_test_deps: pull in test deps for packages matched by arguments
# changed_deps: rebuild installed packages with outdated deps
# changed_deps_report: report installed packages with outdated deps
+   # changed_slot: rebuild installed packages with outdated SLOT metadata
# binpkg_changed_deps: reject binary packages with outdated deps
myparams = {"recurse" : True}
 
@@ -64,12 +65,17 @@ def create_depgraph_params(myopts, myaction):
if rebuild_if_new_slot is not None:
myparams['rebuild_if_new_slot'] = rebuild_if_new_slot
 
+   changed_slot = myopts.get('--changed-slot') is True
+   if changed_slot:
+   myparams["changed_slot"] = True
+
if "--update" in myopts or \
"--newrepo" in myopts or \
"--newuse" in myopts or \
"--reinstall" in myopts or \
"--noreplace" in myopts or \
myopts.get("--changed-deps", "n") != "n" or \
+   changed_slot or \
myopts.get("--selective", "n") != "n":
myparams["selective"] = True
 

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ac7ec9d84..6af7d5714 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2667,6 +2667,10 @@ class depgraph(object):
 
return changed
 
+   def _changed_slot(self, pkg):
+   ebuild = self._equiv_ebuild(pkg)
+   return ebuild is not None and (ebuild.slot, ebuild.sub_slot) != 
(pkg.slot, pkg.sub_slot)
+
def _create_graph(self, allow_unsatisfied=False):
dep_stack = self._dynamic_config._dep_stack
dep_disjunctive_stack = 
self._dynamic_config._dep_disjunctive_stack
@@ -6474,6 +6478,13 @@ class depgraph(object):

modified_use=self._pkg_use_enabled(pkg))):
if myeb and "--newrepo" in 
self._frozen_config.myopts and myeb.repo != pkg.repo:
break
+   elif 
self._dynamic_config.myparams.get("changed_slot") and self._changed_slot(pkg):
+   if installed:
+   break
+   else:
+   # Continue 
searching for a binary package
+   # with the 
desired SLOT metadata.
+   continue
elif reinstall_use or (not 
installed and respect_use):
iuses = pkg.iuse.all
old_use = 
self._pkg_use_enabled(pkg)

diff --git 

[gentoo-commits] proj/portage:master commit in: pym/_emerge/, man/

2018-02-02 Thread Zac Medico
commit: 59d58d4c3074321d5ae7eb6c1feb2816b5f27775
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Feb  3 02:39:35 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Feb  3 03:09:43 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=59d58d4c

emerge: disable --changed-deps-report by default (bug 645780)

This option is too noisy to enable by default, since it reports
hundreds of packages for most users.

Suggested-by: Michał Górny  gentoo.org>
Bug: https://bugs.gentoo.org/645780

 man/emerge.1  | 7 +--
 pym/_emerge/create_depgraph_params.py | 6 ++
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index f15532a1d..a17b65ed2 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -469,12 +469,7 @@ respect to changed build\-time dependencies is controlled 
by the
 Tells emerge to report ebuilds for which the ebuild dependencies have
 changed since the installed instance was built. Behavior with respect to
 changed build\-time dependencies is controlled by the
-\fB\-\-with\-bdeps\fR option. If the \fB\-\-update\fR and \fB\-\-deep\fR
-options are enabled then this option is enabled automatically for a
-dependency calculation if the cost of report generation is relatively
-insignificant (any calculation exclusively involving binary packages is
-exempt). The \fIEMERGE_DEFAULT_OPTS\fR variable may be used to disable
-this by default.
+\fB\-\-with\-bdeps\fR option.
 .TP
 .BR \-\-changed\-use ", " \-U
 Tells emerge to include installed packages where USE flags have

diff --git a/pym/_emerge/create_depgraph_params.py 
b/pym/_emerge/create_depgraph_params.py
index 2fc907d37..fc7fa60d7 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -127,10 +127,8 @@ def create_depgraph_params(myopts, myaction):
if changed_deps is not None:
myparams['changed_deps'] = changed_deps
 
-   changed_deps_report = myopts.get('--changed-deps-report')
-   if (changed_deps_report != 'n' and
-   not (myaction == 'remove' or '--usepkgonly' in myopts) and
-   deep is True and '--update' in myopts):
+   changed_deps_report = myopts.get('--changed-deps-report', 'n') == 'y'
+   if changed_deps_report:
myparams['changed_deps_report'] = True
 
if myopts.get("--selective") == "n":



[gentoo-commits] proj/portage:master commit in: pym/_emerge/, man/, pym/portage/tests/resolver/

2017-12-19 Thread Michał Górny
commit: 2905e1c2c28db495b74fde7d9b3bfdd4e7515dbd
Author: Michał Górny  gentoo  org>
AuthorDate: Fri Dec 15 22:48:33 2017 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Dec 19 22:45:16 2017 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=2905e1c2

Disable dynamic-deps by default

We have prepared for this for quite a while and it's time to pull
the plug. Disable dynamic-deps by default and restore the standard
PMS behavior. This will cause some one-time pain but eventually will
result in improvement of ebuild quality, especially when developers
start experiencing the need for revbumps first hand.

Acked-by: Alexander Berntsen  gentoo.org>
Reviewed-by: Zac Medico  gentoo.org>

 man/emerge.1| 2 +-
 pym/_emerge/FakeVartree.py  | 2 +-
 pym/_emerge/Scheduler.py| 2 +-
 pym/_emerge/depgraph.py | 4 ++--
 pym/portage/tests/resolver/test_changed_deps.py | 1 +
 pym/portage/tests/resolver/test_virtual_slot.py | 2 +-
 6 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index 3198ba028..b292954a3 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -547,7 +547,7 @@ In dependency calculations, substitute the dependencies of 
installed
 packages with the dependencies of corresponding unbuilt ebuilds from
 source repositories. This causes the effective dependencies of
 installed packages to vary dynamically when source ebuild dependencies
-are modified. This option is enabled by default.
+are modified. This option is disabled by default.
 
 \fBWARNING:\fR
 If you want to disable \-\-dynamic\-deps, then it may be necessary to

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index ebe07bba2..3f82e97e9 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -54,7 +54,7 @@ class FakeVartree(vartree):
is not a matching ebuild in the tree). Instances of this class are not
populated until the sync() method is called."""
def __init__(self, root_config, pkg_cache=None, pkg_root_config=None,
-   dynamic_deps=True, ignore_built_slot_operator_deps=False,
+   dynamic_deps=False, ignore_built_slot_operator_deps=False,
soname_deps=False):
self._root_config = root_config
self._dynamic_deps = dynamic_deps

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 3a38cbafd..9bbc48e0a 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -352,7 +352,7 @@ class Scheduler(PollScheduler):
"""
self._set_graph_config(graph_config)
self._blocker_db = {}
-   dynamic_deps = self.myopts.get("--dynamic-deps", "y") != "n"
+   dynamic_deps = self.myopts.get("--dynamic-deps", "n") != "n"
ignore_built_slot_operator_deps = self.myopts.get(
"--ignore-built-slot-operator-deps", "n") == "y"
for root in self.trees:

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 6e5ca6508..27bec3b32 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -137,7 +137,7 @@ class _frozen_depgraph_config(object):
self.soname_deps_enabled = (
("--usepkgonly" in myopts or "remove" in params) and
params.get("ignore_soname_deps") != "y")
-   dynamic_deps = myopts.get("--dynamic-deps", "y") != "n"
+   dynamic_deps = myopts.get("--dynamic-deps", "n") != "n"
ignore_built_slot_operator_deps = myopts.get(
"--ignore-built-slot-operator-deps", "n") == "y"
for myroot in trees:
@@ -627,7 +627,7 @@ class depgraph(object):
for myroot in self._frozen_config.trees:
 
dynamic_deps = self._dynamic_config.myparams.get(
-   "dynamic_deps", "y") != "n"
+   "dynamic_deps", "n") != "n"
preload_installed_pkgs = \
"--nodeps" not in self._frozen_config.myopts
 

diff --git a/pym/portage/tests/resolver/test_changed_deps.py 
b/pym/portage/tests/resolver/test_changed_deps.py
index 2421c531f..420a00172 100644
--- a/pym/portage/tests/resolver/test_changed_deps.py
+++ b/pym/portage/tests/resolver/test_changed_deps.py
@@ -52,6 +52,7 @@ class ChangedDepsTestCase(TestCase):
options = {
"--update": True,
"--deep": True,
+   "--dynamic-deps": "y",
"--usepkg": True,
},
mergelist = ["app-misc/B-0"]

diff --git a/pym/portage/tests/resolver/test_virtual_slot.py 

[gentoo-commits] proj/portage:master commit in: pym/_emerge/, man/, pym/portage/package/ebuild/_config/, pym/portage/util/, ...

2017-07-29 Thread Manuel Rüger
commit: cff2c0149142843316e1851c2e73bcec30f08471
Author: Manuel Rüger  gentoo  org>
AuthorDate: Thu Jun 15 15:11:04 2017 +
Commit: Manuel Rüger  gentoo  org>
CommitDate: Sun Jul 30 00:52:53 2017 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=cff2c014

Support different compressors for binary packages

This patch allows to set the compressor for binary packages via a
BINPKG_COMPRESSION variable. BINPKG_COMPRESSION_ARGS allows to specify
command-line arguments for the chosen compressor.

Reviewed-By: Zac Medico  gentoo.org>

 bin/misc-functions.sh  |  6 ++-
 bin/quickpkg   | 62 --
 man/make.conf.5| 25 +
 pym/_emerge/BinpkgExtractorAsync.py| 43 +--
 pym/portage/dbapi/bintree.py   |  8 +--
 .../package/ebuild/_config/special_env_vars.py |  2 +-
 pym/portage/package/ebuild/doebuild.py | 34 ++--
 pym/portage/util/compression_probe.py  | 45 +---
 8 files changed, 186 insertions(+), 39 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 58755a1e1..079369313 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -453,7 +453,7 @@ __dyn_package() {
# Make sure $PWD is not ${D} so that we don't leave gmon.out files
# in there in case any tools were built with -pg in CFLAGS.
 
-   cd "${T}"
+   cd "${T}" || die
 
if [[ -n ${PKG_INSTALL_MASK} ]] ; then
PROOT=${T}/packaging/
@@ -478,8 +478,10 @@ __dyn_package() {
[ -z "${PORTAGE_BINPKG_TMPFILE}" ] && \
die "PORTAGE_BINPKG_TMPFILE is unset"
mkdir -p "${PORTAGE_BINPKG_TMPFILE%/*}" || die "mkdir failed"
+   [ -z "${PORTAGE_COMPRESSION_COMMAND}" ] && \
+die "PORTAGE_COMPRESSION_COMMAND is unset"
tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${PROOT}" . | \
-   $PORTAGE_BZIP2_COMMAND -c > "$PORTAGE_BINPKG_TMPFILE"
+   $PORTAGE_COMPRESSION_COMMAND -c > "$PORTAGE_BINPKG_TMPFILE"
assert "failed to pack binary package: '$PORTAGE_BINPKG_TMPFILE'"
PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \
"${PORTAGE_PYTHON:-/usr/bin/python}" 
"$PORTAGE_BIN_PATH"/xpak-helper.py recompose \

diff --git a/bin/quickpkg b/bin/quickpkg
index 4f26ee912..750400592 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -8,6 +8,7 @@ import argparse
 import errno
 import math
 import signal
+import subprocess
 import sys
 import tarfile
 
@@ -22,11 +23,13 @@ from portage.dbapi.dep_expand import dep_expand
 from portage.dep import Atom, use_reduce
 from portage.exception import (AmbiguousPackageName, InvalidAtom, InvalidData,
InvalidDependString, PackageSetNotFound, PermissionDenied)
-from portage.util import ConfigProtect, ensure_dirs, shlex_split, _xattr
+from portage.util import ConfigProtect, ensure_dirs, shlex_split, varexpand, 
_xattr
 xattr = _xattr.xattr
 from portage.dbapi.vartree import dblink, tar_contents
 from portage.checksum import perform_md5
 from portage._sets import load_default_config, SETPREFIX
+from portage.process import find_binary
+from portage.util.compression_probe import _compressors
 
 def quickpkg_atom(options, infos, arg, eout):
settings = portage.settings
@@ -50,16 +53,16 @@ def quickpkg_atom(options, infos, arg, eout):
" ".join(e.args[0]))
del e
infos["missing"].append(arg)
-   return
+   return 1
except (InvalidAtom, InvalidData):
eout.eerror("Invalid atom: %s" % (arg,))
infos["missing"].append(arg)
-   return
+   return 1
if atom[:1] == '=' and arg[:1] != '=':
# dep_expand() allows missing '=' but it's really invalid
eout.eerror("Invalid atom: %s" % (arg,))
infos["missing"].append(arg)
-   return
+   return 1
 
matches = vardb.match(atom)
pkgs_for_arg = 0
@@ -108,16 +111,16 @@ def quickpkg_atom(options, infos, arg, eout):
in settings.features))
def protect(filename):
if not confprot.isprotected(filename):
-   return False
+   return 1
if include_unmodified_config:
file_data = contents[filename]
if file_data[0] == "obj":
orig_md5 = 
file_data[2].lower()
cur_md5 = 
perform_md5(filename, calc_prelink=1)
  

[gentoo-commits] proj/portage:master commit in: pym/_emerge/, man/, pym/portage/tests/resolver/

2017-05-14 Thread Zac Medico
commit: 40505ceeadc769f4f01c66e52a19ce0bf2f59761
Author: Zac Medico  gentoo  org>
AuthorDate: Wed May 10 03:44:56 2017 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun May 14 18:11:45 2017 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=40505cee

emerge: terminate backtracking early for autounmask changes (bug 615680)

Since autounmask changes are a strong indicator that backtracking
will ultimately fail to produce a solution, terminate early for
autounmask changes, and add a --autounmask-backtrack= option
to modify this behavior. The --autounmask-continue option implies
--autounmask-backtrack=y behavior, for backward compatibility.

When backtracking terminates early, the following warning message
is displayed after the autounmask change(s):

 * In order to avoid wasting time, backtracking has terminated early
 * due to the above autounmask change(s). The --autounmask-backtrack=y
 * option can be used to force further backtracking, but there is no
 * guarantee that it will produce a solution.

With this change, five of the existing cases fail unless
--autounmask-backtrack=y is added to the options. For each of
these cases, comments below the test case document how it behaves
with and without --autounmask-backtrack=y enabled.

X-Gentoo-bug: 615680
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=615680
Acked-by: Brian Dolbec  gentoo.org>

 man/emerge.1   | 10 ++-
 pym/_emerge/depgraph.py| 80 ++
 pym/_emerge/main.py|  6 ++
 pym/portage/tests/resolver/test_autounmask.py  | 57 ++-
 .../tests/resolver/test_autounmask_use_breakage.py | 40 +++
 .../test_slot_conflict_unsatisfied_deep_deps.py| 61 +
 6 files changed, 237 insertions(+), 17 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index f1a9d4f3f..94edc9095 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -363,12 +363,20 @@ the specified configuration file(s), or enable the
 \fBEMERGE_DEFAULT_OPTS\fR variable may be used to
 disable this option by default in \fBmake.conf\fR(5).
 .TP
+.BR "\-\-autounmask\-backtrack < y | n >"
+Allow backtracking after autounmask has detected that
+configuration changes are necessary. This option is not
+recommended, since it can cause a large amount of time to
+be wasted by backtracking calculations, even though there
+is no guarantee that it will produce a solution. This
+option is disabled by default.
+.TP
 .BR "\-\-autounmask\-continue [ y | n ]"
 Automatically apply autounmask changes to configuration
 files, and continue to execute the specified command. If
 the dependency calculation is not entirely successful, then
 emerge will simply abort without modifying any configuration
-files.
+files. This option implies \fB\-\-autounmask\-backtrack=y\fR.
 \fBWARNING:\fR
 This option is intended to be used only with great caution,
 since it is possible for it to make nonsensical configuration

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index e1119af3c..53910dd25 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -444,6 +444,7 @@ class _dynamic_depgraph_config(object):
self._autounmask = 
depgraph._frozen_config.myopts.get('--autounmask') != 'n'
self._displayed_autounmask = False
self._success_without_autounmask = False
+   self._autounmask_backtrack_disabled = False
self._required_use_unsatisfied = False
self._traverse_ignored_deps = False
self._complete_mode = False
@@ -1129,7 +1130,8 @@ class depgraph(object):
 
self._show_merge_list()
 
-   self._dynamic_config._slot_conflict_handler = 
slot_conflict_handler(self)
+   if self._dynamic_config._slot_conflict_handler is None:
+   self._dynamic_config._slot_conflict_handler = 
slot_conflict_handler(self)
handler = self._dynamic_config._slot_conflict_handler
 
conflict = handler.get_conflict()
@@ -4243,17 +4245,7 @@ class depgraph(object):
# set below is reserved for cases where there are *zero* other
# problems. For reference, see backtrack_depgraph, where it 
skips the
# get_best_run() call when success_without_autounmask is True.
-
-   digraph_nodes = self._dynamic_config.digraph.nodes
-
-   if any(x in digraph_nodes for x in
-   self._dynamic_config._needed_unstable_keywords) or \
-   any(x in digraph_nodes for x in
-   self._dynamic_config._needed_p_mask_changes) or \
-   any(x in digraph_nodes for x in
-   self._dynamic_config._needed_use_config_changes) or \
-   any(x in digraph_nodes for x in
-   

[gentoo-commits] proj/portage:master commit in: pym/_emerge/, man/

2016-02-02 Thread Alexander Berntsen
commit: fbbe76199b897828f26aed828eb7ad476bc33264
Author: Alexander Berntsen  gentoo  org>
AuthorDate: Tue Feb  2 20:48:58 2016 +
Commit: Alexander Berntsen  gentoo  org>
CommitDate: Tue Feb  2 20:48:58 2016 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=fbbe7619

Update copyright headers

Update copyright headers to reflect the changes made in the following
commits:

* 8c9b1d6a7c115344cdc5bd8e7d122ab721aeb53a
  Clarify no binary packages error (bug 573070)
* 3ff375e832d469f03dc922f7a30651726f86d3e0
  Make config update tools stand out (bug 543706)
* 4369d1aca89eaecd589af4aa7a387ce36e5c42e7
  Be extra clear on INSTALL_MASK & dirs (bug 527004)

Signed-off-by: Alexander Berntsen  gentoo.org>

 man/emerge.1 | 2 +-
 man/make.conf.5  | 2 +-
 pym/_emerge/chk_updated_cfg_files.py | 2 +-
 pym/_emerge/depgraph.py  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index 0f5782e..bfa2f73 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1,4 +1,4 @@
-.TH "EMERGE" "1" "Jan 2015" "Portage VERSION" "Portage"
+.TH "EMERGE" "1" "Feb 2016" "Portage VERSION" "Portage"
 .SH "NAME"
 emerge \- Command\-line interface to the Portage system
 .SH "SYNOPSIS"

diff --git a/man/make.conf.5 b/man/make.conf.5
index 49c88ce..26bbf06 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Jan 2015" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Feb 2016" "Portage VERSION" "Portage"
 .SH "NAME"
 make.conf \- custom settings for Portage
 .SH "SYNOPSIS"

diff --git a/pym/_emerge/chk_updated_cfg_files.py 
b/pym/_emerge/chk_updated_cfg_files.py
index 6903df9..e5e0907 100644
--- a/pym/_emerge/chk_updated_cfg_files.py
+++ b/pym/_emerge/chk_updated_cfg_files.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2012, 2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 05d1da5..b58fbda 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import division, print_function, unicode_literals



[gentoo-commits] proj/portage:master commit in: pym/_emerge/, man/

2016-02-02 Thread Alexander Berntsen
commit: 3ff375e832d469f03dc922f7a30651726f86d3e0
Author: Alexander Berntsen  gentoo  org>
AuthorDate: Mon Feb  1 16:37:48 2016 +
Commit: Alexander Berntsen  gentoo  org>
CommitDate: Tue Feb  2 10:08:47 2016 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3ff375e8

Make config update tools stand out (bug 543706)

Add a CONFIGURATION FILES UPDATE TOOLS header to the manpage, to make
the tools discussion stand out from the configuration files discussion
in general.

Refer to the new section in emerge's configuration file updates output.

X-Gentoo-Bug: 543706
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=543706

Suggested-by:  Julian Ospald   gentoo.org>
Signed-off-by: Alexander Berntsen  gentoo.org>

 man/emerge.1 | 1 +
 pym/_emerge/chk_updated_cfg_files.py | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index 05b2a01..0f5782e 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1237,6 +1237,7 @@ add this to \fBmake.conf\fR(5):
 .LP
 .I CONFIG_PROTECT_MASK="/etc/wget /etc/rc.d"
 .LP
+.SH "CONFIGURATION FILES UPDATE TOOLS"
 Tools such as dispatch\-conf, cfg\-update, and etc\-update are also available
 to aid in the merging of these files. They provide interactive merging and can
 auto\-merge trivial changes.

diff --git a/pym/_emerge/chk_updated_cfg_files.py 
b/pym/_emerge/chk_updated_cfg_files.py
index 9f2ab6f..6903df9 100644
--- a/pym/_emerge/chk_updated_cfg_files.py
+++ b/pym/_emerge/chk_updated_cfg_files.py
@@ -36,7 +36,7 @@ def chk_updated_cfg_files(eroot, config_protect):
 
if result:
print(" " + yellow("*") + " See the " +
-   colorize("INFORM", _("CONFIGURATION FILES")) +
-   " " + _("section of the") + " " + bold("emerge"))
-   print(" " + yellow("*") + " " +
+   colorize("INFORM", _("CONFIGURATION FILES")) + " and " +
+   colorize("INFORM", _("CONFIGURATION FILES UPDATE 
TOOLS")))
+   print(" " + yellow("*") + " sections of the " + bold("emerge") 
+ " " +
_("man page to learn how to update config files."))



[gentoo-commits] proj/portage:master commit in: pym/_emerge/, man/

2016-01-04 Thread Alexander Berntsen
commit: 51f100e42753d6ffd3a24dfcb2ff8af0aa34966e
Author: Lucian Poston  gmail  com>
AuthorDate: Sat Jan  2 23:05:28 2016 +
Commit: Alexander Berntsen  gentoo  org>
CommitDate: Mon Jan  4 10:34:55 2016 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=51f100e4

emerge: Add --autounmask-only parameter (bug 570672)

The --autounmask-only parameter will display autounmask messages,
perform autounmasking (in accordance with the other --autounmask-*
parameters), and exit with success (return value 0).

X-Gentoo-Bug: 570672
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=570672

 man/emerge.1   |  6 ++
 pym/_emerge/actions.py |  4 
 pym/_emerge/main.py| 11 +++
 3 files changed, 21 insertions(+)

diff --git a/man/emerge.1 b/man/emerge.1
index c03f044..05b2a01 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -361,6 +361,12 @@ the specified configuration file(s), or enable the
 \fBEMERGE_DEFAULT_OPTS\fR variable may be used to
 disable this option by default in \fBmake.conf\fR(5).
 .TP
+.BR "\-\-autounmask\-only [ y | n ]"
+Instead of doing any package building, just unmask
+packages and generate package.use settings as necessary
+to satisfy dependencies. This option is disabled by
+default.
+.TP
 .BR "\-\-autounmask\-unrestricted\-atoms [ y | n ]"
 If \-\-autounmask is enabled, keyword and mask changes
 using the \'=\' operator will be written. With this

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index c3b0b98..59626ad 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -327,6 +327,10 @@ def action_build(settings, trees, mtimedb,
display_missing_pkg_set(root_config, e.value)
return 1
 
+   if "--autounmask-only" in myopts:
+   mydepgraph.display_problems()
+   return 0
+
if not success:
mydepgraph.display_problems()
return 1

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 5a8b93c..5dbafee 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -127,6 +127,7 @@ def insert_optional_args(args):
'--alert': y_or_n,
'--ask'  : y_or_n,
'--autounmask'   : y_or_n,
+   '--autounmask-only'  : y_or_n,
'--autounmask-keep-masks': y_or_n,
'--autounmask-unrestricted-atoms' : y_or_n,
'--autounmask-write' : y_or_n,
@@ -323,6 +324,11 @@ def parse_opts(tmpcmdline, silent=False):
"choices" : true_y_or_n
},
 
+   "--autounmask-only": {
+   "help": "only perform --autounmask",
+   "choices" : true_y_or_n
+   },
+
"--autounmask-unrestricted-atoms": {
"help": "write autounmask changes with >= atoms if 
possible",
"choices" : true_y_or_n
@@ -745,6 +751,11 @@ def parse_opts(tmpcmdline, silent=False):
if myoptions.autounmask in true_y:
myoptions.autounmask = True
 
+   if myoptions.autounmask_only in true_y:
+   myoptions.autounmask_only = True
+   else:
+   myoptions.autounmask_only = None
+
if myoptions.autounmask_unrestricted_atoms in true_y:
myoptions.autounmask_unrestricted_atoms = True
 



[gentoo-commits] proj/portage:master commit in: pym/_emerge/, /, man/

2014-10-22 Thread Alexander Berntsen
commit: 1f4cfaff9b6b6d340d3a8e495043b540a6d40e8d
Author: Alexander Berntsen bernalex AT gentoo DOT org
AuthorDate: Wed Oct 22 08:13:52 2014 +
Commit: Alexander Berntsen bernalex AT gentoo DOT org
CommitDate: Wed Oct 22 12:41:00 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1f4cfaff

Implement --rage-clean

Implement --rage-clean which lets you --unmerge really furiously. Works
like --unmerge but without a delay.

Signed-off-by: Alexander Berntsen bernalex AT gentoo.org
Acked-by:  Zac Medico zmedico AT gentoo.org

---
 RELEASE-NOTES  |  4 
 man/emerge.1   | 15 ++-
 pym/_emerge/actions.py | 14 +++---
 pym/_emerge/main.py|  2 +-
 pym/_emerge/unmerge.py | 35 +--
 5 files changed, 43 insertions(+), 27 deletions(-)

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 899b48a..7912398 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -1,6 +1,10 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+portage-2.2.15
+==
+* New option --rage-clean that does --unmerge without delay.
+
 portage-2.2.14
 ==
 * Bug Fixes:

diff --git a/man/emerge.1 b/man/emerge.1
index 12e8b45..bbe71ac 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -258,11 +258,12 @@ portage tree as a tarball, which is much faster than 
emerge
 .TP
 .BR \-\-unmerge  (\fB\-C\fR)
 \fBWARNING: This action can remove important packages!\fR Removes
-all matching packages.  This does no checking of dependencies, so
-it may remove packages necessary for the proper operation of your
-system.  Its arguments can be \fIatoms\fR or
-\fIebuilds\fR. For a dependency aware version of \fB\-\-unmerge\fR,
-use \fB\-\-depclean\fR or \fB\-\-prune\fR.
+all matching packages following a counter governed by \fBCLEAN_DELAY\fR.
+This does no checking of dependencies, so it may remove packages necessary
+for the proper operation of your system.  Its arguments can be \fIatoms\fR
+or \fIebuilds\fR. For a dependency aware version of \fB\-\-unmerge\fR, use
+\fB\-\-depclean\fR or \fB\-\-prune\fR.  For a version with
+\fBCLEAN_DELAY=0\fR, use \fB\-\-rage\-clean\fR.
 .TP
 .BR \-\-version  (\fB\-V\fR)
 Displays the version number of \fBemerge\fR.
@@ -716,6 +717,10 @@ Disable the warning message that's shown prior to
 to be set in the \fBmake.conf\fR(5)
 \fBEMERGE_DEFAULT_OPTS\fR variable.
 .TP
+.BR \-\-rage\-clean
+\fBWARNING: This action can remove important packages!\fR
+\fB\-\-rage\-clean\fR does \fB\-\-unmerge\fR with \fBCLEAN_DELAY=0\fR.
+.TP
 .BR \-\-read\-news [ y | n ]
 Offer to read news via eselect if there are unread news. This option
 has no effect unless \fB\-\-ask\fR is enabled.

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index ee57cec..48b0826 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2701,7 +2701,7 @@ def _sync_repo(emerge_config, repo):
 def action_uninstall(settings, trees, ldpath_mtimes,
opts, action, files, spinner):
# For backward compat, some actions do not require leading '='.
-   ignore_missing_eq = action in ('clean', 'unmerge')
+   ignore_missing_eq = action in ('clean', 'rage-clean', 'unmerge')
root = settings['ROOT']
eroot = settings['EROOT']
vardb = trees[settings['EROOT']]['vartree'].dbapi
@@ -2857,10 +2857,10 @@ def action_uninstall(settings, trees, ldpath_mtimes,
settings.backup_changes(PORTAGE_BACKGROUND)
settings.lock()
 
-   if action in ('clean', 'unmerge') or \
+   if action in ('clean', 'rage-clean', 'unmerge') or \
(action == 'prune' and --nodeps in opts):
# When given a list of atoms, unmerge them in the order given.
-   ordered = action == 'unmerge'
+   ordered = action in ('rage-clean', 'unmerge')
rval = unmerge(trees[settings['EROOT']]['root_config'], opts, 
action,
valid_atoms, ldpath_mtimes, ordered=ordered,
scheduler=sched_iface)
@@ -3490,7 +3490,7 @@ def expand_set_arguments(myfiles, myaction, root_config):
for e in setconfig.errors:
print(colorize(BAD, Error during set creation: %s % e))
 
-   unmerge_actions = (unmerge, prune, clean, depclean)
+   unmerge_actions = (unmerge, prune, clean, depclean, 
rage-clean)
 
for a in myfiles:
if a.startswith(SETPREFIX):
@@ -3750,7 +3750,7 @@ def run_action(emerge_config):
# only expand sets for actions taking package arguments
oldargs = emerge_config.args[:]
if emerge_config.action in (clean, config, depclean,
-   info, prune, unmerge, None):
+   info, prune, unmerge, rage-clean, None):
newargs, retval = expand_set_arguments(
emerge_config.args, emerge_config.action,
   

[gentoo-commits] proj/portage:master commit in: pym/_emerge/, man/

2014-10-21 Thread Zac Medico
commit: 8a9f865ae433d8b7609bd1754e0328d88d2a2bda
Author: Zac Medico zmedico AT gentoo DOT org
AuthorDate: Mon Oct 20 20:04:28 2014 +
Commit: Zac Medico zmedico AT gentoo DOT org
CommitDate: Tue Oct 21 23:21:14 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8a9f865a

emerge --read-news: prompt only if --ask

This fixes any conditional logic that applies to --ask so that it
also applies to --read-news. For example, emerge will bail out
automatically if --ask is enabled and stdin is not a tty.

X-Gentoo-Bug: 517310
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=517310

---
 man/emerge.1   | 5 +++--
 pym/_emerge/actions.py | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index 9873ba9..12e8b45 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -716,8 +716,9 @@ Disable the warning message that's shown prior to
 to be set in the \fBmake.conf\fR(5)
 \fBEMERGE_DEFAULT_OPTS\fR variable.
 .TP
-.BR \-\-read-news [ y | n ]
-Offer to read news via eselect if there are unread news.
+.BR \-\-read\-news [ y | n ]
+Offer to read news via eselect if there are unread news. This option
+has no effect unless \fB\-\-ask\fR is enabled.
 .TP
 .BR \-\-rebuild\-if\-new\-slot [ y | n ]
 Automatically rebuild or reinstall packages when slot/sub\-slot :=

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 4e8b83b..ee57cec 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -4064,6 +4064,7 @@ def run_action(emerge_config):
uq = UserQuery(emerge_config.opts)
if 
display_news_notification(emerge_config.target_config,

emerge_config.opts) \
+   and --ask in emerge_config.opts \
and --read-news in emerge_config.opts \
and uq.query(Would you like to read the news 
items while  \
calculating dependencies?,



[gentoo-commits] proj/portage:master commit in: pym/_emerge/, man/

2014-09-29 Thread Alexander Berntsen
commit: 7d605312d48ae5f7755f640ef78c97b424399bd0
Author: Alexander Berntsen bernalex AT gentoo DOT org
AuthorDate: Mon Sep 29 10:20:03 2014 +
Commit: Alexander Berntsen bernalex AT gentoo DOT org
CommitDate: Mon Sep 29 22:12:09 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7d605312

Implement --read-news (off by default)

Turn off news-reading by default when --ask, and instead make it an
option --read-news.

Apparently making --ask a bit more interactive was goddamn stupid and
ruined the lives of several Gentoo developers. Props to Michał who
predicted this all along.

ACKed-by:  Brian Dolbec   dolsen AT gentoo.org
Signed-off-by: Alexander Berntsen bernalex AT gentoo.org

---
 man/emerge.1   |  3 +++
 pym/_emerge/actions.py |  2 +-
 pym/_emerge/main.py| 13 +
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/man/emerge.1 b/man/emerge.1
index a2cb3f6..2264b58 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -716,6 +716,9 @@ Disable the warning message that's shown prior to
 to be set in the \fBmake.conf\fR(5)
 \fBEMERGE_DEFAULT_OPTS\fR variable.
 .TP
+.BR \-\-read-news [ y | n ]
+Offer to read news via eselect if there are unread news.
+.TP
 .BR \-\-rebuild\-if\-new\-slot [ y | n ]
 Automatically rebuild or reinstall packages when slot/sub\-slot :=
 operator dependencies can be satisfied by a newer slot, so that

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 9036810..4e8b83b 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -4064,7 +4064,7 @@ def run_action(emerge_config):
uq = UserQuery(emerge_config.opts)
if 
display_news_notification(emerge_config.target_config,

emerge_config.opts) \
-   and --ask in emerge_config.opts \
+   and --read-news in emerge_config.opts \
and uq.query(Would you like to read the news 
items while  \
calculating dependencies?,
'--ask-enter-invalid' in 
emerge_config.opts) == Yes:

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 52aa9c5..3883f72 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -146,6 +146,7 @@ def insert_optional_args(args):
'--quiet': y_or_n,
'--quiet-build'  : y_or_n,
'--quiet-fail'   : y_or_n,
+   '--read-news': y_or_n,
'--rebuild-if-new-slot': y_or_n,
'--rebuild-if-new-rev'   : y_or_n,
'--rebuild-if-new-ver'   : y_or_n,
@@ -557,6 +558,12 @@ def parse_opts(tmpcmdline, silent=False):
choices  : true_y_or_n,
},
 
+   --read-news: {
+   help: offer to read unread news via eselect,
+   choices : true_y_or_n
+   },
+
+
--rebuild-if-new-slot: {
help : (Automatically rebuild or reinstall 
packages when slot/sub-slot := 
operator dependencies can be satisfied by a 
newer slot, so that 
@@ -803,6 +810,12 @@ def parse_opts(tmpcmdline, silent=False):
if myoptions.quiet_fail in true_y:
myoptions.quiet_fail = 'y'
 
+   if myoptions.read_news in true_y:
+   myoptions.read_news = True
+   else:
+   myoptions.read_news = None
+
+
if myoptions.rebuild_if_new_slot in true_y:
myoptions.rebuild_if_new_slot = 'y'