[gentoo-portage-dev] [PATCH] emerge: fix --use-ebuild-visibility to reject binary packages (bug 612960)

2017-03-17 Thread Zac Medico
Fix the --use-ebuild-visibility option to reject binary packages for
which ebuilds are either masked or unavailable. The included test case
fails with out this fix.

X-Gentoo-bug: 612960
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=612960
---
 pym/_emerge/depgraph.py| 32 +++-
 .../resolver/test_binary_pkg_ebuild_visibility.py  | 94 ++
 2 files changed, 123 insertions(+), 3 deletions(-)
 create mode 100644 
pym/portage/tests/resolver/test_binary_pkg_ebuild_visibility.py

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index e94b96c..3834983 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4889,6 +4889,9 @@ class depgraph(object):
vardb = self._frozen_config.roots[root].trees["vartree"].dbapi
bindb = self._frozen_config.roots[root].trees["bintree"].dbapi
dbs = self._dynamic_config._filtered_trees[root]["dbs"]
+   use_ebuild_visibility = self._frozen_config.myopts.get(
+   '--use-ebuild-visibility', 'n') != 'n'
+
for db, pkg_type, built, installed, db_keys in dbs:
if installed:
continue
@@ -4975,6 +4978,7 @@ class depgraph(object):
eapi=pkg.eapi):

required_use_unsatisfied.append(pkg)
continue
+
root_slot = (pkg.root, 
pkg.slot_atom)
if pkg.built and root_slot in 
self._rebuild.rebuild_list:
mreasons = ["need to 
rebuild from source"]
@@ -4988,6 +4992,19 @@ class depgraph(object):

self._dynamic_config.ignored_binaries.get(
pkg, 
{}).get("changed_deps")):
mreasons = ["changed 
deps"]
+   elif (pkg.built and 
use_ebuild_visibility and
+   not 
self._equiv_ebuild_visible(pkg)):
+   equiv_ebuild = 
self._equiv_ebuild(pkg)
+   if equiv_ebuild is None:
+   mreasons = 
["ebuild not unavailable"]
+   elif not mreasons:
+   metadata, 
mreasons = get_mask_info(
+   
root_config, equiv_ebuild.cpv, pkgsettings,
+   portdb, 
equiv_ebuild.pkg_type,
+   
equiv_ebuild.built, equiv_ebuild.installed,
+   
db_keys, myrepo=equiv_ebuild.repo,
+   
_pkg_use_enabled=self._pkg_use_enabled)
+
masked_packages.append(
(root_config, pkgsettings, cpv, 
repo, metadata, mreasons))
 
@@ -5548,6 +5565,14 @@ class depgraph(object):
"""
return depth + n if isinstance(depth, int) else depth
 
+   def _equiv_ebuild(self, pkg):
+   try:
+   return self._pkg(
+   pkg.cpv, "ebuild", pkg.root_config, 
myrepo=pkg.repo)
+   except portage.exception.PackageNotFound:
+   return next(self._iter_match_pkgs(pkg.root_config,
+   "ebuild", Atom("=%s" % (pkg.cpv,))), None)
+
def _equiv_ebuild_visible(self, pkg, autounmask_level=None):
try:
pkg_eb = self._pkg(
@@ -6021,11 +6046,11 @@ class depgraph(object):
# reinstall the same exact 
version only due
# to a KEYWORDS mask. See bug 
#252167.
 
+   identical_binary = False
if pkg.type_name != "ebuild" 
and matched_packages:
# Don't re-install a 
binary package that is
# identical to the 
currently installed package
# (see bug #354441).
-   identical_binary = False
   

Re: [gentoo-portage-dev] [PATCH] depgraph: avoid missed update with slot operator and circ dep (bug 612874)

2017-03-17 Thread Zac Medico
On Fri, Mar 17, 2017 at 8:37 AM, Brian Dolbec  wrote:
> On Fri, 17 Mar 2017 01:18:19 -0700
> Zac Medico  wrote:
>
>> Fix check_reverse_dependencies to ignore direct circular dependencies,
>> since these dependencies tend to prevent updates of packages. This
>> solves a missed update from llvm:0 to llvm:4 when clang is not in the
>> world file, as demonstrated by the included test case.
>>
>> X-Gentoo-bug: 612874
>> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=612874
>> ---
>>  pym/_emerge/depgraph.py| 31
>> - .../resolver/test_slot_operator_exclusive_slots.py
>> | 39 ++
>> pym/portage/util/digraph.py|  6  3 files
>> changed, 68 insertions(+), 8 deletions(-)
>
> Looks good
>
> --
> Brian Dolbec 
>

Thanks, pushed:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=35208d80a55228a50ea4ac64904465ce4651e381
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH] depgraph: avoid missed update with slot operator and circ dep (bug 612874)

2017-03-17 Thread Brian Dolbec
On Fri, 17 Mar 2017 01:18:19 -0700
Zac Medico  wrote:

> Fix check_reverse_dependencies to ignore direct circular dependencies,
> since these dependencies tend to prevent updates of packages. This
> solves a missed update from llvm:0 to llvm:4 when clang is not in the
> world file, as demonstrated by the included test case.
> 
> X-Gentoo-bug: 612874
> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=612874
> ---
>  pym/_emerge/depgraph.py| 31
> - .../resolver/test_slot_operator_exclusive_slots.py
> | 39 ++
> pym/portage/util/digraph.py|  6  3 files
> changed, 68 insertions(+), 8 deletions(-)
> 
> diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
> index f4145d0..e94b96c 100644
> --- a/pym/_emerge/depgraph.py
> +++ b/pym/_emerge/depgraph.py
> @@ -1844,14 +1844,29 @@ class depgraph(object):
>   if (not
> self._too_deep(parent.depth) and not
> self._frozen_config.excluded_pkgs. findAtomForPackage(parent,
> -
> modified_use=self._pkg_use_enabled(parent)) and
> -
> (self._upgrade_available(parent) or
> - (parent.installed
> and self._in_blocker_conflict(parent:
> - # This parent may be
> irrelevant, since an
> - # update is
> available (see bug 584626), or
> - # it could be
> uninstalled in order to solve
> - # a blocker conflict
> (bug 612772).
> - continue
> +
> modified_use=self._pkg_use_enabled(parent))):
> + # Check for common
> reasons that the parent's
> + # dependency might
> be irrelevant.
> + if
> self._upgrade_available(parent):
> + # This
> parent could be replaced by
> + # an upgrade
> (bug 584626).
> + continue
> + if parent.installed
> and self._in_blocker_conflict(parent):
> + # This
> parent could be uninstalled in order
> + # to solve a
> blocker conflict (bug 612772).
> + continue
> + if
> self._dynamic_config.digraph.has_edge(parent,
> +
> existing_pkg):
> + # There is a
> direct circular dependency between
> + # parent and
> existing_pkg. This type of
> + #
> relationship tends to prevent updates
> + # of
> packages (bug 612874). Since candidate_pkg
> + # is
> available, we risk a missed update if we
> + # don't try
> to eliminate this parent from the
> + # graph.
> Therefore, we give candidate_pkg a
> + # chance,
> and assume that it will be masked
> + # by
> backtracking if necessary.
> + continue
>  
>   atom_set =
> InternalPackageSet(initial_atoms=(atom,), allow_repo=True)
> diff --git
> a/pym/portage/tests/resolver/test_slot_operator_exclusive_slots.py
> b/pym/portage/tests/resolver/test_slot_operator_exclusive_slots.py
> index 2ab379c..689ed31 100644 ---
> a/pym/portage/tests/resolver/test_slot_operator_exclusive_slots.py
> +++
> b/pym/portage/tests/resolver/test_slot_operator_exclusive_slots.py @@
> -107,3 +107,42 @@ class SlotOperatorExclusiveSlotsTestCase(TestCase):
> test_case.fail_msg) finally: playground.cleanup() +
> +
> + world = ["media-libs/mesa"]
> +
> + test_cases = (
> +
> + # Test bug #612874, where a direct circular
> dependency
> + # between llvm-3.9.1 and clang-3.9.1-r100
> causes a
> + # missed update from llvm:0 to llvm:4. Since
> llvm:4 does
> + # not have a dependency on clang, the
> upgrade from llvm:0
> + # to llvm:4 makes the installed
> sys-devel/clang-3.9.1-r100
> + # instance eligible for removal by emerge
> --depclean, which
> + # explains why clang does not appear in the
> mergelist.
> +   

Re: [gentoo-portage-dev] OT: Screen bragging. Was: [PROPOSAL] Don't split user visible messages across multiple lines

2017-03-17 Thread Brian Dolbec
On Fri, 17 Mar 2017 06:58:23 + (UTC)
Duncan <1i5t5.dun...@cox.net> wrote:

> Brian Dolbec posted on Thu, 16 Mar 2017 01:08:30 -0700 as excerpted:
> 
> >> > We could also increase the max. line length to something like
> >> > 120 or 130.  
> >> 
> >> I think more people should chime in on that. I use vertical splits
> >> for the screen when coding, and 120 characters is too long for me,
> >> but if the preferred width ends up changing to 120 or 130 I can
> >> work with it.
> >> 
> >>   
> > You need to get some large 4K monitors... love them :D I treated
> > myself to two 28 inch ones during boxing week sales.
> > My aging eyes love them :)  They are so much better than my old 24
> > inch 1080p monitors.  Those were getting tired/starting to loos
> > clarity along with my eyes working at them all week long.  I now
> > work with larger fonts which are still physically smaller than my
> > old monitors, but so much clearer.  My eyes don't get nearly so
> > tired as they did with my other monitors.
> > 
> >  ;)  
> 
> Posting resistance failing...
> 
> Try a 65-inch 4K with a 48-inch 1080p (now the older monitor, often 
> running youtube full-screen) off to the side. =:^)
> 
> (They're actually TVs used as monitors via the HDMI input, no actual
> TV hooked up.  Above about 32-inch, TVs tend to be cheaper than
> stand-alone monitors and of course they're the same 4K high or
> full-hd lower resolution these days.)
> 
> Six 1280x1080 working windows three wide by two stacked on the 65"
> 4k, still set for 96 dpi standard, FreeMono Bold 9.0 in my konsole
> windows, yields:
> 
> $ echo $COLUMNS x $LINES
> 179 x 78
> 
> And that's six of those on the 65" 4K, PLUS the full-screen 1080p
> youtube or whatever window on the 48". =:^)
> 
> This is the first time I can honestly say I have enough screen space
> that most of the time I'm not actively using it all. =:^)
> 

Yeah, I've seen lots of those types of setups.

Just a few years ago when I was an A/C mechanic for my day job, I
serviced A/C systems at numerous business's trading floors, where many
stations ran 2 or 3 pc's mostly to house/power the video cards to
drive 4,6, sometimes 8 monitors in a dual high setups, then numerous big
screens overhead in various places around the floor... 

I don't think I could handle the large ones like you have, my eyes
haven't got the focal range for that anymore.  As it is, I recently had
to pull my monitors closer about 8 inches because my eyes were getting
too tired by the end of the week.  They were just too close to the
limits of my eyes and glasses.

I do need to get a decent video card to drive these new 4K's, then
maybe I'll think about re-connecting the old 24 inch 1080p's back up
to the old card too  ;)  But if I really needed more screen space, I'd
pick up 2 more of these 4k's, 2 video cards and spin them vertical ;)
 That could make for a great driving/flight simulator :D


-- 
Brian Dolbec 




[gentoo-portage-dev] OT: Screen bragging. Was: [PROPOSAL] Don't split user visible messages across multiple lines

2017-03-17 Thread Duncan
Brian Dolbec posted on Thu, 16 Mar 2017 01:08:30 -0700 as excerpted:

>> > We could also increase the max. line length to something like 120 or
>> > 130.
>> 
>> I think more people should chime in on that. I use vertical splits for
>> the screen when coding, and 120 characters is too long for me, but if
>> the preferred width ends up changing to 120 or 130 I can work with it.
>> 
>> 
> You need to get some large 4K monitors... love them :D I treated myself
> to two 28 inch ones during boxing week sales.
> My aging eyes love them :)  They are so much better than my old 24 inch
> 1080p monitors.  Those were getting tired/starting to loos clarity along
> with my eyes working at them all week long.  I now work with larger
> fonts which are still physically smaller than my old monitors, but
> so much clearer.  My eyes don't get nearly so tired as they did with
> my other monitors.
> 
>  ;)

Posting resistance failing...

Try a 65-inch 4K with a 48-inch 1080p (now the older monitor, often 
running youtube full-screen) off to the side. =:^)

(They're actually TVs used as monitors via the HDMI input, no actual TV 
hooked up.  Above about 32-inch, TVs tend to be cheaper than stand-alone 
monitors and of course they're the same 4K high or full-hd lower 
resolution these days.)

Six 1280x1080 working windows three wide by two stacked on the 65" 4k, 
still set for 96 dpi standard, FreeMono Bold 9.0 in my konsole windows, 
yields:

$ echo $COLUMNS x $LINES
179 x 78

And that's six of those on the 65" 4K, PLUS the full-screen 1080p youtube 
or whatever window on the 48". =:^)

This is the first time I can honestly say I have enough screen space that 
most of the time I'm not actively using it all. =:^)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman