Re: [gentoo-dev] Experimental binary package hosting

2021-09-23 Thread Matt Turner
On Thu, Sep 23, 2021 at 7:12 AM Andreas K. Huettel  wrote:
>
> Hi Vadim,
>
> > Finally it happened!
> > I already planned to try to ask infra/council about sponsoring few
> > servers for build farm for "official gentoo binhosts" when I had
> > enough time, but fortunately, you've already did that.
> > It's very good news.
>
> Thanks! Nice to see that this is appreciated :)
>
> So far I'm only using "spare time" on the machine that builds the
> releng stages (amd64, x86, m68k, riscv). So no need for a big server
> farm.
>
> > Btw, do you need any help with that?
> > I'd be very happy to help with that project.
>
> Sure! Feel free to add yourself to the Project:Binhost wiki page. I'll
> ask for an alias and a channel soon.
>
> The most useful steps now are only half related to actual building. I
> barely know any python and am not very familiar with portage
> internals... this is what in my opinion we'd need next:
>
> 1) a tool to manage and manipulate a binpkg/ directory tree
> The main functions that I see needed are
> * delete packages/versions that are not in the gentoo repository
> anymore (xpak and in index file), maybe with some grace time
> * merge xpak files built elsewhere into the directory (also in the
> index file)

eclean packages from gentoolkit does this exactly.



[gentoo-dev] Re: [PATCH 1/5] profiles/default/linux: remove busybox from @system

2021-09-09 Thread Matt Turner
I support this.



[gentoo-dev] Re: [PATCH 1/3] meson.eclass: introduce meson_install helper function

2021-08-27 Thread Matt Turner
Thanks, all three patches LGTM.



Re: [gentoo-dev] Stabilization Detached from Security Bugs

2021-08-26 Thread Matt Turner
\o/



Re: [gentoo-dev] [RFC] Decoupling stabilization from security bugs

2021-08-12 Thread Matt Turner
On Thu, Aug 12, 2021 at 5:53 AM Michał Górny  wrote:
>
> Hello, everyone.
>
> TL;DR: I'd like to propose that stabilizations are done via blockers of
> security bugs instead of security bugs themselves, i.e. as any other
> stabilizations.
>
>
> Right now we're often performing security-related stabilizations via
> security bugs. This has a few problems, that are:
>
> 1. Stabilization-related activity causes unnecessary mail to the widely
> subscribed security alias. That is, subscribed people get notified of
> package list changes, NATTkA results, every arch doing its work.
> However, in reality the security team only cares about stabilization
> being started, stalled or finished -- and for that, getting the usual
> 'dependent bug added/closed' mail should be sufficient.
>
> 2. NATTkA has no good way of distinguishing irrelevant security bugs
> from security bugs where something went wrong (and NATTkA doesn't use
> persistent state by design). The most important problem is that --
> unlike regular stablereqs -- security bugs aren't supposed to be closed
> after stabilization. It can't really distinguish a security bug 'left
> open' from a security bug with incorrect package list.
>
> 3. Proxied maintainers without editbugs can't actually CC arches on
> security bugs since the bugs are assigned to security@.
>
>
> To resolve these problems going forward and establish consistent
> behavior in the future, I'd like to propose to disable 'package list'
> fields on security bugs and instead expect regular stabilization bugs to
> be used (and made block the security bugs) for stabilizations. While I
> understand that filing additional bugs might be cumbersome for some
> people, I don't think it's such a herculean effort to outweigh
> the problems solved.
>
> In the end, consistency is a good thing and we've introduced a dedicated
> stabilization category to reduce the spread of stabilization bugs all
> around the place.

I love this.

It sounds (from IRC) like you're on board with the idea of having
nattka add kw:security to appropriate stabilization bugs.

Could nattka also do something to the security@-assigned but itself to
indicate that all security-supported architecture have been handled?
Something like leaving a comment or fiddling with the security
whiteboard.

It would be nice to be able to resolve the security@-assigned but
before non-security-supported architectures are handled.

To do that, I think we'd want to change what's required for the "clean
up" step. Since today the "clean up" step is dropping the vulnerable
package versions from the tree, it is dependent on
non-security-supported architectures completing the stabilization bug.
I think we'd like to break that dependence.

I suggest that we redefine the "clean up" step to be: drop
security-supported architectures' keywords from vulnerable versions.
That would allow the security@-assigned bug to be resolved before
non-security-supported architectures are finished with stabilization.



[gentoo-dev] Packages up for co-maintenance

2021-08-10 Thread Matt Turner
The GNOME team maintains these mobile broadband packages, but I don't
think anyone has hardware that uses them.

net-misc/modemmanager
net-libs/libqmi
net-libs/libmbim

If you use them, feel free to add yourself as the primary maintainer
and maintain them. They have regular releases and the version bump
work is simple.

My purpose here is to attempt to lighten my load of GNOME-related
bumps. Please don't add yourself as a maintainer if it means
additional work for me.



Re: [gentoo-dev] [PATCH] metadata/install-qa-check.d: add 60tmpfiles-path QA check

2021-08-06 Thread Matt Turner
On Wed, Aug 4, 2021 at 5:35 AM Thomas Deutschmann  wrote:
>
> On 2021-08-04 04:56, Sam James wrote:
> > Sure, thanks for the clarification. It's deprecated in the sense of
> > ebuilds installing to it though, right?
>
> Well, it triggered me because saying it's deprecated implies two things
> for me:
>
> 1) It was OK for packages to do that in the past
>
> 2) Something has changed upstream
>
> Regarding 1)
> It was never OK for packages to install in that location. That will
> break the override mechanism systemd introduced. I.e. packages were and
> are still only allowed to install below /usr (/lib), to allow local
> system administrators to override installed unit/tmpfiles spec by
> placing a file with the same name in the corresponding directory in /etc.
>
>
> Regarding 2)
> Nothing has changed upstream regarding these locations.

Maybe next time, just explain that the first time around?

Your first email provides no actionable information and requires the
other party to expend effort (and wait for a reply) to understand what
you mean.



Re: [gentoo-dev] [PATCH] profiles/default/linux: Add USE="bzip2 lzma zstd" to defaults

2021-07-08 Thread Matt Turner
On Thu, Jul 8, 2021 at 2:34 PM MSavoritias
 wrote:
> On July 8, 2021 8:50:39 PM UTC, Matt Turner  wrote:
> >On Thu, Jul 8, 2021 at 1:41 PM Peter Stuge  wrote:
> >>
> >> Matt Turner wrote:
> >> > If you can find a case where you wouldn't want to enable one of
> >these
> >> > USE flags, please let me know and I'll reconsider my position.
> >>
> >> My catalyst spec files all have  use: -* foo bar x y z
> >> specifically because the defaults are never what I want for any given
> >> system. I build desktops, servers, containers, VM appliance images
> >and
> >> embedded system, and I know what I want in each one. Especially the
> >> latter frequently have only very few USE flags set and I want zero
> >> extra dependencies.
> >
> >I think you're making a great argument that you'd be completely
> >unaffected by any of the suggestions in this thread.
> >
> >> I completely agree that the default USEs should rather be reduced,
> >> not increased. Isn't this what profile inheritance is for? It would
> >> be great if I didn't essentially have to create my own profile when I
> >> want a very minimal system.
> >>
> >>
> >> Matt Turner wrote:
> >> > I'd claim most of these packages' bzip2/lzma/zstd USE flags should
> >> > be removed in favor of statically enabling them
> >>
> >> That is the direct opposite of Gentoo's single most core value:
> >choice
> >
> >Choice makes sense when there's a legitimate trade-off to be made.
> >Choice isn't dogma.
>
> Well the legitimate trade-off is complexity as stated previously. Gentoo is 
> not supposed to be batteries included. It is supposed to be building blocks 
> for each persons own thing.
>
> Instead of adding the use flag what would ne more in Gentoo spirit would be 
> to add to handbook a guide for common use flags.
>
> Plus just because people disagree here with the proposal doesnt mean its 
> dogma. It may be just disagreement.

That's not my claim.

It's akin to defending what you said by saying "Well, we have free
speech so I can say whatever I want!". Of course you can, but that's
not the point. You're not defending the substance of the speech. It's
a lazy argument.

Similarly, people say "Well, Gentoo is about choice!" even when the
choice is absolutely meaningless. Of course Gentoo offers a lot of
choice, but that's not the point. You're not defending the value of
the choice. It's a lazy argument.

It's easy for people who don't respond to bug reports to discount the
overhead every configuration knob adds.



Re: [gentoo-dev] [PATCH] profiles/default/linux: Add USE="bzip2 lzma zstd" to defaults

2021-07-08 Thread Matt Turner
On Thu, Jul 8, 2021 at 1:41 PM Peter Stuge  wrote:
>
> Matt Turner wrote:
> > If you can find a case where you wouldn't want to enable one of these
> > USE flags, please let me know and I'll reconsider my position.
>
> My catalyst spec files all have  use: -* foo bar x y z
> specifically because the defaults are never what I want for any given
> system. I build desktops, servers, containers, VM appliance images and
> embedded system, and I know what I want in each one. Especially the
> latter frequently have only very few USE flags set and I want zero
> extra dependencies.

I think you're making a great argument that you'd be completely
unaffected by any of the suggestions in this thread.

> I completely agree that the default USEs should rather be reduced,
> not increased. Isn't this what profile inheritance is for? It would
> be great if I didn't essentially have to create my own profile when I
> want a very minimal system.
>
>
> Matt Turner wrote:
> > I'd claim most of these packages' bzip2/lzma/zstd USE flags should
> > be removed in favor of statically enabling them
>
> That is the direct opposite of Gentoo's single most core value: choice

Choice makes sense when there's a legitimate trade-off to be made.
Choice isn't dogma.

> Just don't do it. Kthx.

This kind of thing is nothing but irritating. Please don't do this.



Re: [gentoo-dev] [PATCH] profiles/default/linux: Add USE="bzip2 lzma zstd" to defaults

2021-07-08 Thread Matt Turner
On Thu, Jul 8, 2021 at 1:17 PM Matt Turner  wrote:
> On Thu, Jul 8, 2021 at 12:36 PM Michael Orlitzky  wrote:
> > If you have a good reason to do it for certain packages, setting per-
> > package defaults is the way to do it. The base profile defaults are
> > only there because we didn't always have per-package defaults.
>
> Yes, things are the way they are because of history.

Sorry, I shouldn't have been flippant here. You're making a legitimate point.



Re: [gentoo-dev] [PATCH] profiles/default/linux: Add USE="bzip2 lzma zstd" to defaults

2021-07-08 Thread Matt Turner
On Thu, Jul 8, 2021 at 12:36 PM Michael Orlitzky  wrote:
>
> On Thu, 2021-07-08 at 11:15 -0700, Matt Turner wrote:
> >
> > So, the thing about running a minimal system is... you already have
> > these dependencies installed. This doesn't change that...
> >
> > I could of course change the default of every bzip2/lzma/zstd in IUSE
> > (and might as well handle zlib too so we can remove it from
> > make.defaults!) but what practical advantage does that bring?
>
> There's more to being a dependency than just being installed. Not all
> of these packages have e.g. USE=zstd so that they can run
> /usr/bin/zstd. Some link against libzstd, which now bloats them to use
> a tiny bit more space and memory, as well as exposing you to any
> security problems in the library. Your dependency tree gets a little
> bit more complicated, and your package manager has to figure out how to
> do subslot rebuilds for everything when libzstd gets upgraded.
>
> Per-package defaults are easier to override, since I don't have to undo
> everything before setting the USE-flags that I wanted to enable in the
> first place.
>
> Per-package defaults are easier to revert if we change our collective
> minds later, since we don't have to test the entire tree for breakage
> first.
>
> Global flags have essentially undefined behaviour, since e.g. USE=bzip2
> does different things for each package. As an extreme example, global
> flags affect packages that aren't even in the tree yet and that may use
> USE=bzip2 in a way you don't expect. As a less extreme example,
> USE=bzip2 may open your crypto library up to compression attacks. It
> definitely makes your dev-lang/php more vulnerable. (The same goes for
> USE=zlib, which should be removed in favor of per-package defaults.)
>
> Global flag settings increase complexity because they all interact with
> each other, creating a combinatorial explosion of interaction points.
> Figuring out how to turn a global flag off for a subset of packages can
> be a nightmare. Do you change the file where it's enabled? Or the arch
> profile where the enabling is reverted? Or the arch/desktop profile
> where the disabling is disabled? Or the hardened profile where the
> disabled disabling is disabled? Any argument against global variables
> in a program is an argument against global profile changes.

I hear you, and I appreciate the theoretical concerns.

I could maybe even support this position if you were actively working
towards this new and glorious future, but the only time I hear
anything about it is when you're arguing that someone else should do
something the way you want.

> > I doubt there's a sensible reason to build without any of these USE
> > flags enabled. I think the claim that most people will want them
> > enabled is not really a question. So we should enable them by default.
> > I think that logic is pretty straightforward. If someone wants to
> > disable the flags for some reason, they of course still have that
> > option.
> >
> > If you can find a case where you wouldn't want to enable one of these
> > USE flags, please let me know and I'll reconsider my position.
> >
>
> I don't have them enabled for any packages where they're not IUSE-
> defaulted, and haven't noticed any problems. Not not having a reason to
> do something isn't a good justification to do it. If it ain't broke and
> all that. If anyone wants them set, it's as easy as USE="lzma bzip2
> zstd", and we are apparently all okay without them.

Well, you're okay without them until you need them: E.g., enable
CONFIG_MODULE_COMPRESS / MODULE_COMPRESS_XZ without knowing that you
need sys-apps/kmod[lzma] and your system becomes unbootable.

But you're of course right that some die-hards might rather accept
this risk and save the 8 KiB of disk space (424 KiB → 436 KiB) they'd
lose out on by enabling USE=lzma for the package. But the good news
is.. they still can!

> If you have a good reason to do it for certain packages, setting per-
> package defaults is the way to do it. The base profile defaults are
> only there because we didn't always have per-package defaults.

Yes, things are the way they are because of history.

> But, if you really look, I think you'll find that most of these flags
> do completely useless things. Do you REALLY need libpcre to build and
> install you a special executable called "pcregrep-libbz2" that just
> pipes bunzip2 to pcregrep? No, nobody does. And most other uses are
> comparably stupid.

I mean, you could make that argument for bzless or any other version
of these tools. I don't find that compelling.

But also, I have USE=bzip2 on libpcre and I don't have
pcregrep-libbz2. Regardless, I'm not going to lose any sleep over it
if it ap

Re: [gentoo-dev] Package up for grabs: sys-boot/woeusb

2021-07-08 Thread Matt Turner
On Thu, Jul 8, 2021 at 5:51 AM Pacho Ramos  wrote:
>
> No longer interested on it, pending a major version bump after upstream
> splitting:
> https://github.com/slacka/WoeUSB/issues/209
>
> Thanks a lot for taking it

Dang! I wish I'd known about this when I had to update my Thunderbolt
dock's firmware.



Re: [gentoo-dev] [PATCH] profiles/default/linux: Add USE="bzip2 lzma zstd" to defaults

2021-07-08 Thread Matt Turner
On Thu, Jul 8, 2021 at 4:54 AM Michael Orlitzky  wrote:
>
> On Wed, 2021-07-07 at 22:01 -0700, Matt Turner wrote:
> > Enable these flags by default, since they effectively add no additional
> > dependencies:
>
> Why? This list should be getting smaller, not larger.
>
> Polluting the base profiles makes running a minimal system that much
> harder, and only "adds no dependencies" because people omit the
> corresponding dependencies -- a situation that has to change
> eventually.
>
> If they're actually important to a particular package, you should
> change the defaults for that package.

Not the file I'm changing, but I think the sentiment of the comment is
correct: profiles/prefix/make.defaults says:

  # Some USE-flags that only die-hards don't want:

So, the thing about running a minimal system is... you already have
these dependencies installed. This doesn't change that...

I could of course change the default of every bzip2/lzma/zstd in IUSE
(and might as well handle zlib too so we can remove it from
make.defaults!) but what practical advantage does that bring?

I doubt there's a sensible reason to build without any of these USE
flags enabled. I think the claim that most people will want them
enabled is not really a question. So we should enable them by default.
I think that logic is pretty straightforward. If someone wants to
disable the flags for some reason, they of course still have that
option.

If you can find a case where you wouldn't want to enable one of these
USE flags, please let me know and I'll reconsider my position.



[gentoo-dev] Re: [PATCH] stardict.eclass: Rename IUSE=gzip->zlib

2021-07-07 Thread Matt Turner
I've included this in a larger PR that contains some other compression
flag simplifications: https://github.com/gentoo/gentoo/pull/21558

Wow, also noticed that this eclass says its maintainer is someone who
retired in 2007. Feel free to drop him from replies :)



[gentoo-dev] Re: [PATCH] profiles/default/linux: Add USE="bzip2 lzma zstd" to defaults

2021-07-07 Thread Matt Turner
I've included this in a larger PR that contains some other compression
flag simplifications: https://github.com/gentoo/gentoo/pull/21558



[gentoo-dev] [PATCH] stardict.eclass: Rename IUSE=gzip->zlib

2021-07-07 Thread Matt Turner
The flag actually controls a dependency on app-arch/gzip, but you
already have that too. Name the flag IUSE=zlib so it'll be enabled by
default.

Signed-off-by: Matt Turner 
---
 eclass/stardict.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/stardict.eclass b/eclass/stardict.eclass
index 0061353f4ab..4a012fb500a 100644
--- a/eclass/stardict.eclass
+++ b/eclass/stardict.eclass
@@ -39,7 +39,7 @@ S="${WORKDIR}"/${DICT_P}
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="gzip"
+IUSE="zlib"
 
 DEPEND="
|| (
@@ -47,7 +47,7 @@ DEPEND="
app-text/sdcv
app-text/goldendict
)
-   gzip? (
+   zlib? (
app-arch/gzip
app-text/dictd
)"
-- 
2.31.1




[gentoo-dev] [PATCH] profiles/default/linux: Add USE="bzip2 lzma zstd" to defaults

2021-07-07 Thread Matt Turner
Enable these flags by default, since they effectively add no additional
dependencies:

USE=bzip2 only ever adds a dependency on:
app-arch/bzip2 - part of @system
dev-ml/camlbz2 - to dev-ml/dose3's RDEPEND
USE=lzma only ever adds a dependency on:
app-arch/xz-utils - part of @system
virtual/pkgconfig - to sys-apps/kmod's BDEPEND
USE=zstd only ever adds a dependency on:
app-arch/zstd - an unconditional RDEPEND of sys-apps/portage
virtual/pkgconfig - to kde-frameworks/karchive's BDEPEND

Signed-off-by: Matt Turner 
---
 profiles/default/linux/make.defaults | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/default/linux/make.defaults 
b/profiles/default/linux/make.defaults
index 168f895eaf7..cbc5092cb2b 100644
--- a/profiles/default/linux/make.defaults
+++ b/profiles/default/linux/make.defaults
@@ -11,7 +11,7 @@
 
 
 # Default starting set of USE flags for all default/linux profiles.
-USE="crypt ipv6 ncurses nls pam readline ssl tcpd zlib"
+USE="bzip2 crypt ipv6 lzma ncurses nls pam readline ssl tcpd zlib zstd"
 
 # make sure toolchain has sane defaults 
 USE="${USE} fortran openmp"
-- 
2.31.1




Re: [gentoo-dev] 'pax_kernel' USE flag

2021-07-06 Thread Matt Turner
On Tue, Jul 6, 2021 at 7:41 PM Thomas Deutschmann  wrote:
> As you probably know, I am not a Linux desktop user (yet). My complete
> experience with that PaX stuff is limited to servers.

Maybe I've misunderstood what you meant. You don't use Linux on the desktop?

But, you maintain Firefox? I'm definitely confused :)



Re: [gentoo-dev] 'pax_kernel' USE flag

2021-07-06 Thread Matt Turner
On Tue, Jun 22, 2021 at 11:43 PM Matt Turner  wrote:
>
> On Tue, Jun 22, 2021 at 3:19 PM Thomas Deutschmann  wrote:
> > The PaX community in Gentoo is still big and active.
> >
> > Many Gentoo users received free access to upstream sources or became
> > paying customers.
> >
> > It's just not available for everyone for free/without registration
> > anymore. But it is still a thing in Gentoo.
>
> Can you substantiate that claim?
>
> There was a pax-kernel USE flag on Mesa and I don't recall anyone
> saying a word when I removed it.
>
> If there are paying customers that have PaX kernels, perhaps they'd be
> interested in providing some support for Gentoo if we're being asked
> to retain support for something we cannot test.

I'd still like an answer to any of this.



[gentoo-dev] Last Rites: app-eselect/eselect-xvmc

2021-07-04 Thread Matt Turner

# Matt Turner  (2021-07-04)
# Not used by any package. Has not worked for a very long time
# as far as I can tell.
# Removal on 2021-08-04
app-eselect/eselect-xvmc


signature.asc
Description: PGP signature


Re: [gentoo-dev] Packages up to co-maintenance

2021-07-04 Thread Matt Turner
On Fri, Jul 2, 2021 at 2:12 AM Sergei Trofimovich  wrote:
> As it became apparent I'm not a great maintainer.

Huh? What is this about?



[gentoo-dev] Last Rites: media-gfx/ufraw

2021-06-25 Thread Matt Turner

# Matt Turner  (2021-06-25)
# Last release in 2015. Many open bugs. No reverse dependencies.
# Bugs #312935, #341923, #629050, #739984, #775761, #777534
# Removal on 2021-07-25
media-gfx/ufraw


signature.asc
Description: PGP signature


Re: [gentoo-dev] 'pax_kernel' USE flag

2021-06-23 Thread Matt Turner
On Tue, Jun 22, 2021 at 3:19 PM Thomas Deutschmann  wrote:
> The PaX community in Gentoo is still big and active.
>
> Many Gentoo users received free access to upstream sources or became
> paying customers.
>
> It's just not available for everyone for free/without registration
> anymore. But it is still a thing in Gentoo.

Can you substantiate that claim?

There was a pax-kernel USE flag on Mesa and I don't recall anyone
saying a word when I removed it.

If there are paying customers that have PaX kernels, perhaps they'd be
interested in providing some support for Gentoo if we're being asked
to retain support for something we cannot test.



Re: [gentoo-dev] EAPI 8 is here!

2021-06-16 Thread Matt Turner
On Wed, Jun 16, 2021 at 7:28 PM Peter Stuge  wrote:
>
> Sam James wrote:
> > * Brings IDEPEND, usev enhancements, --disable-static by default, and more!
>
> How to undo that --disable-static ?

You add --enable-static to econf's arguments.



[gentoo-dev] [PATCH 2/2] meson-multilib.eclass: Add new eclass

2021-06-01 Thread Matt Turner
Signed-off-by: Matt Turner 
---
 eclass/meson-multilib.eclass | 126 +++
 1 file changed, 126 insertions(+)
 create mode 100644 eclass/meson-multilib.eclass

diff --git a/eclass/meson-multilib.eclass b/eclass/meson-multilib.eclass
new file mode 100644
index 000..4a46661d695
--- /dev/null
+++ b/eclass/meson-multilib.eclass
@@ -0,0 +1,126 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: meson-multilib.eclass
+# @MAINTAINER:
+# gx86-multilib team 
+# @AUTHOR:
+# Author: Michał Górny 
+# Author: Matt Turner 
+# @SUPPORTED_EAPIS: 7
+# @BLURB: meson wrapper for multilib builds
+# @DESCRIPTION:
+# The meson-multilib.eclass provides a glue between meson.eclass(5)
+# and multilib-minimal.eclass(5), aiming to provide a convenient way
+# to build packages using meson for multiple ABIs.
+#
+# Inheriting this eclass sets IUSE and exports default multilib_src_*()
+# sub-phases that call meson phase functions for each ABI enabled.
+# The multilib_src_*() functions can be defined in ebuild just like
+# in multilib-minimal, yet they ought to call appropriate meson
+# phase rather than 'default'.
+
+case ${EAPI:-0} in
+   7) ;;
+   *) die "EAPI=${EAPI} is not supported" ;;
+esac
+
+inherit meson multilib-minimal
+
+EXPORT_FUNCTIONS src_configure src_compile src_test src_install
+
+# @FUNCTION: meson_native_bool
+# @USAGE:  [option name]
+# @DESCRIPTION:
+# Given a USE flag and a meson project option, output a string like:
+#
+#   -Doption=true
+#   -Doption=false
+#
+# if building for the native ABI (multilib_is_native_abi is true). Otherwise,
+# output -Doption=false. If the project option is unspecified, it defaults
+# to the USE flag.
+meson_native_bool() {
+   multilib_native_usex "${1}" "-D${2-${1}}=true" "-D${2-${1}}=false"
+}
+
+# @FUNCTION: meson_native_feature
+# @USAGE:  [option name]
+# @DESCRIPTION:
+# Given a USE flag and a meson project option, output a string like:
+#
+#   -Doption=enabled
+#   -Doption=disabled
+#
+# if building for the native ABI (multilib_is_native_abi is true). Otherwise,
+# output -Doption=disabled. If the project option is unspecified, it defaults
+# to the USE flag.
+meson_native_feature() {
+   multilib_native_usex "${1}" "-D${2-${1}}=enabled" "-D${2-${1}}=disabled"
+}
+
+# @FUNCTION: meson_native_enabled
+# @USAGE: 
+# @DESCRIPTION:
+# Output -Doption=enabled option if executables are being built
+# (multilib_is_native_abi is true). Otherwise, output -Doption=disabled option.
+meson_native_enabled() {
+   if multilib_is_native_abi; then
+   echo "-D${1}=enabled"
+   else
+   echo "-D${1}=disabled"
+   fi
+}
+
+# @FUNCTION: meson_native_true
+# @USAGE: 
+# @DESCRIPTION:
+# Output -Doption=true option if executables are being built
+# (multilib_is_native_abi is true). Otherwise, output -Doption=false option.
+meson_native_true() {
+   if multilib_is_native_abi; then
+   echo "-D${1}=true"
+   else
+   echo "-D${1}=false"
+   fi
+}
+
+meson-multilib_src_configure() {
+   local _meson_args=( "${@}" )
+
+   multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+   meson_src_configure "${_meson_args[@]}"
+}
+
+meson-multilib_src_compile() {
+   local _meson_args=( "${@}" )
+
+   multilib-minimal_src_compile
+}
+
+multilib_src_compile() {
+   meson_src_compile "${_meson_args[@]}"
+}
+
+meson-multilib_src_test() {
+   local _meson_args=( "${@}" )
+
+   multilib-minimal_src_test
+}
+
+multilib_src_test() {
+   meson_src_test "${_meson_args[@]}"
+}
+
+meson-multilib_src_install() {
+   local _meson_args=( "${@}" )
+
+   multilib-minimal_src_install
+}
+
+multilib_src_install() {
+   meson_src_install "${_meson_args[@]}"
+}
-- 
2.26.3




[gentoo-dev] [PATCH 1/2] meson.eclass: Run einstalldocs from ${S}

2021-06-01 Thread Matt Turner
This is how cmake.eclass works.

Signed-off-by: Matt Turner 
---
 eclass/meson.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 0acc490452f..c9a5e0b5956 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -420,7 +420,10 @@ meson_src_install() {
debug-print-function ${FUNCNAME} "$@"
 
DESTDIR="${D}" eninja -C "${BUILD_DIR}" install "$@"
+
+   pushd "${S}" > /dev/null || die
einstalldocs
+   popd > /dev/null || die
 }
 
 fi
-- 
2.26.3




[gentoo-dev] [PATCH 0/2] New meson-multilib eclass

2021-06-01 Thread Matt Turner
Please review my proposed meson-multlib.eclass. It's modeled on
cmake-multilib.eclass and is useful for cutting large amounts of
boilerplate from ebuilds of multilib packages using meson.

The diff stat of the 50 commits to switch the tree over (available in
[1]) is

 90 files changed, 307 insertions(+), 1296 deletions(-)

[1] https://github.com/gentoo/gentoo/pull/20986





[gentoo-dev] Last Rites: net-nntp/pan

2021-04-19 Thread Matt Turner

# Matt Turner  (2021-04-18)
# Pretty dead. Needs GTK+3 port. Doesn't build with glib-2.68.
# Removal on 2021-05-19.  Bug #784266.
net-nntp/pan


signature.asc
Description: PGP signature


[gentoo-dev] [PATCH] xorg-3.eclass: strip -fno-plt from *FLAGS

2021-03-28 Thread Matt Turner
From: Niklāvs Koļesņikovs <89q1r1...@relay.firefox.com>

As discussed in #778494, the GCC flag -fno-plt will break lazy
binding, which appears to still be necessary for Xorg. Stripping the
offending flag out is the next best solution for reliable user
experience on Gentoo.

Closes: https://bugs.gentoo.org/778494
Closes: https://github.com/gentoo/gentoo/pull/20166
Signed-off-by: Niklāvs Koļesņikovs <89q1r1...@relay.firefox.com>
Signed-off-by: Matt Turner 
---
 eclass/xorg-3.eclass | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index 811168ead98..6835c6617c5 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: xorg-3.eclass
@@ -326,8 +326,10 @@ xorg-3_flags_setup() {
# Win32 require special define
[[ ${CHOST} == *-winnt* ]] && append-cppflags -DWIN32 -D__STDC__
# hardened ldflags
-   [[ ${PN} == xorg-server || ${PN} == xf86-video-* || ${PN} == 
xf86-input-* ]] \
-   && append-ldflags -Wl,-z,lazy
+   if [[ ${PN} == xorg-server || ${PN} == xf86-video-* || ${PN} == 
xf86-input-* ]]; then
+   filter-flags -fno-plt
+   append-ldflags -Wl,-z,lazy
+   fi
 
# Quite few libraries fail on runtime without these:
if has static-libs ${IUSE//+}; then
-- 
2.26.2




Re: [gentoo-dev] [PATCH] autotools.eclass: eclassdoc, cosmetic changes, drop old EAPIs

2021-03-27 Thread Matt Turner
Looks good to me.



[gentoo-dev] Re: [PATCH] xorg-2.eclass: Mark @DEAD for removal

2021-03-27 Thread Matt Turner
Per Sam's suggestion, I'll also add

# @DEPRECATED: Use xorg-3.eclass



[gentoo-dev] [PATCH] xorg-2.eclass: Mark @DEAD for removal

2021-03-27 Thread Matt Turner
Signed-off-by: Matt Turner 
---
 eclass/xorg-2.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/xorg-2.eclass b/eclass/xorg-2.eclass
index 99b1f891b99..31c8600b640 100644
--- a/eclass/xorg-2.eclass
+++ b/eclass/xorg-2.eclass
@@ -1,6 +1,7 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# @DEAD
 # @ECLASS: xorg-2.eclass
 # @MAINTAINER:
 # x...@gentoo.org
-- 
2.26.2




[gentoo-portage-dev] [PATCH] Mark EAPIs "4-python" and "5-progress" as deprecated

2021-03-04 Thread Matt Turner
Signed-off-by: Matt Turner 
---
I've asked Arfrever multiple times if these are still used anywhere, and
he seemingly has not responded intentionally.

According to https://bugs.gentoo.org/174536#c27 these EAPIs were only
used in Arfrever's personal overlay, and even in 2012 there were
questions about why they were supported in portage.

The "Progress Overlay" does contain ebuilds using these EAPIs but it has
not been updated since 2018 and doesn't look like it is useful at this
point.

 lib/portage/__init__.py | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py
index 24c9d8b89..184db6ae2 100644
--- a/lib/portage/__init__.py
+++ b/lib/portage/__init__.py
@@ -465,16 +465,16 @@ def abssymlink(symlink, target=None):
 _doebuild_manifest_exempt_depend = 0
 
 _testing_eapis = frozenset([
-   "4-python",
-   "5-progress",
 ])
 _deprecated_eapis = frozenset([
+   "3_pre1",
+   "3_pre2",
"4_pre1",
+   "4-python",
"4-slot-abi",
-   "3_pre2",
-   "3_pre1",
"5_pre1",
"5_pre2",
+   "5-progress",
"6_pre1",
"7_pre1",
 ])
-- 
2.26.2




[gentoo-portage-dev] [PATCH] Use asyncio.subprocess.Process directly

2021-03-04 Thread Matt Turner
With no need to support Python 2, we can remove our private
implementation.

Signed-off-by: Matt Turner 
---
I don't know how to test this. I intentionally broke the return value of
create_subprocess_exec and didn't see any bad results.

 lib/portage/util/futures/_asyncio/__init__.py |   8 +-
 lib/portage/util/futures/_asyncio/process.py  | 116 --
 2 files changed, 4 insertions(+), 120 deletions(-)
 delete mode 100644 lib/portage/util/futures/_asyncio/process.py

diff --git a/lib/portage/util/futures/_asyncio/__init__.py 
b/lib/portage/util/futures/_asyncio/__init__.py
index 5590963f1..207e7205d 100644
--- a/lib/portage/util/futures/_asyncio/__init__.py
+++ b/lib/portage/util/futures/_asyncio/__init__.py
@@ -25,6 +25,7 @@ import types
 import weakref
 
 import asyncio as _real_asyncio
+from asyncio.subprocess import Process
 
 try:
import threading
@@ -45,7 +46,6 @@ from portage.util.futures.futures import (
TimeoutError,
 )
 # pylint: enable=redefined-builtin
-from portage.util.futures._asyncio.process import _Process
 from portage.util.futures._asyncio.tasks import (
ALL_COMPLETED,
FIRST_COMPLETED,
@@ -124,8 +124,8 @@ def create_subprocess_exec(*args, **kwargs):
@type loop: event loop
@type kwargs: varies
@param kwargs: subprocess.Popen parameters
-   @rtype: asyncio.Future (or compatible)
-   @return: subset of asyncio.subprocess.Process interface
+   @rtype: asyncio.subprocess.Process (or compatible)
+   @return: asyncio.subprocess.Process interface
"""
loop = _wrap_loop(kwargs.pop('loop', None))
# Python 3.4 and later implement PEP 446, which makes newly
@@ -138,7 +138,7 @@ def create_subprocess_exec(*args, **kwargs):
 
result = loop.create_future()
 
-   result.set_result(_Process(subprocess.Popen(
+   result.set_result(Process(subprocess.Popen(
args,
stdin=kwargs.pop('stdin', None),
stdout=kwargs.pop('stdout', None),
diff --git a/lib/portage/util/futures/_asyncio/process.py 
b/lib/portage/util/futures/_asyncio/process.py
deleted file mode 100644
index 275c9031a..0
--- a/lib/portage/util/futures/_asyncio/process.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# Copyright 2018-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-import os
-
-import portage
-portage.proxy.lazyimport.lazyimport(globals(),
-   'portage.util.futures:asyncio',
-   'portage.util.futures.unix_events:_set_nonblocking',
-)
-from portage.util.futures._asyncio.streams import _reader, _writer
-from portage.util.futures.compat_coroutine import coroutine, coroutine_return
-
-
-class _Process:
-   """
-   Emulate a subset of the asyncio.subprocess.Process interface,
-   for python2.
-   """
-   def __init__(self, proc, loop):
-   """
-   @param proc: process instance
-   @type proc: subprocess.Popen
-   @param loop: asyncio.AbstractEventLoop (or compatible)
-   @type loop: event loop
-   """
-   self._proc = proc
-   self._loop = loop
-   self.terminate = proc.terminate
-   self.kill = proc.kill
-   self.send_signal = proc.send_signal
-   self.pid = proc.pid
-   self._waiters = []
-   loop._asyncio_child_watcher.\
-   add_child_handler(self.pid, self._proc_exit)
-
-   @property
-   def returncode(self):
-   return self._proc.returncode
-
-   @coroutine
-   def communicate(self, input=None, loop=None): # pylint: 
disable=redefined-builtin
-   """
-   Read data from stdout and stderr, until end-of-file is reached.
-   Wait for process to terminate.
-
-   @param input: stdin content to write
-   @type input: bytes
-   @return: tuple (stdout_data, stderr_data)
-   @rtype: asyncio.Future (or compatible)
-   """
-   loop = asyncio._wrap_loop(loop or self._loop)
-   futures = []
-   for input_file in (self._proc.stdout, self._proc.stderr):
-   if input_file is None:
-   future = loop.create_future()
-   future.set_result(None)
-   else:
-   future = _reader(input_file, loop=loop)
-   futures.append(future)
-
-   writer = None
-   if input is not None:
-   if self._proc.stdin is None:
-   raise TypeError('communicate: expected file or 
int, got {}'.format(type(self._proc.stdin)))
-   stdin = self._p

[gentoo-portage-dev] [PATCH 3/3] lib: Remove outdated Python 2 comments

2021-03-04 Thread Matt Turner
Fixes: 788c0e8bb ("Remove from __future__ import unicode_literals")
Signed-off-by: Matt Turner 
---
 bin/egencache   | 2 --
 lib/_emerge/Package.py  | 9 -
 lib/_emerge/Scheduler.py| 2 --
 lib/_emerge/UseFlagDisplay.py   | 2 --
 lib/_emerge/resolver/output.py  | 2 --
 lib/portage/cache/flat_hash.py  | 3 ---
 lib/portage/tests/unicode/test_string_format.py | 9 -
 lib/portage/util/digraph.py | 3 ---
 8 files changed, 32 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 9b6df2e7d..fc18b892f 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -2,8 +2,6 @@
 # Copyright 2009-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-# unicode_literals for compat with TextIOWrapper in Python 2
-
 import argparse
 import platform
 import signal
diff --git a/lib/_emerge/Package.py b/lib/_emerge/Package.py
index 995af6311..0ee25b90a 100644
--- a/lib/_emerge/Package.py
+++ b/lib/_emerge/Package.py
@@ -453,15 +453,6 @@ class Package(Task):
else:
qacat = k + ".syntax"
 
-   # For unicode safety with python-2.x we need to avoid
-   # using the string format operator with a non-unicode
-   # format string, since that will result in the
-   # PortageException.__str__() method being invoked,
-   # followed by unsafe decoding that may result in a
-   # UnicodeDecodeError. Therefore, use unicode_literals
-   # to ensure that format strings are unicode, so that
-   # PortageException.__unicode__() is used when necessary
-   # in python-2.x.
if not self.installed:
categorized_error = False
if e.errors:
diff --git a/lib/_emerge/Scheduler.py b/lib/_emerge/Scheduler.py
index 465f928a0..0ed2ee530 100644
--- a/lib/_emerge/Scheduler.py
+++ b/lib/_emerge/Scheduler.py
@@ -1188,8 +1188,6 @@ class Scheduler(PollScheduler):
printer.eerror(line)
printer.eerror("")
for failed_pkg in self._failed_pkgs_all:
-   # Use unicode_literals to force unicode format 
string so
-   # that Package.__unicode__() is called in 
python2.
msg = " %s" % (failed_pkg.pkg,)
if failed_pkg.postinst_failure:
msg += " (postinst failed)"
diff --git a/lib/_emerge/UseFlagDisplay.py b/lib/_emerge/UseFlagDisplay.py
index 5e3ba400d..fffc8144a 100644
--- a/lib/_emerge/UseFlagDisplay.py
+++ b/lib/_emerge/UseFlagDisplay.py
@@ -111,8 +111,6 @@ def pkg_use_display(pkg, opts, modified_use=None):
flags.sort(key=UseFlagDisplay.sort_combined)
else:
flags.sort(key=UseFlagDisplay.sort_separated)
-   # Use unicode_literals to force unicode format string so
-   # that UseFlagDisplay.__unicode__() is called in python2.
flag_displays.append('%s="%s"' % (varname,
' '.join("%s" % (f,) for f in flags)))
 
diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py
index 0c90abefb..dea8a4be8 100644
--- a/lib/_emerge/resolver/output.py
+++ b/lib/_emerge/resolver/output.py
@@ -554,8 +554,6 @@ class Display:
"""
writemsg_stdout('\n%s\n' % (self.counters,), noiselevel=-1)
if show_repos:
-   # Use unicode_literals to force unicode format string so
-   # that RepoDisplay.__unicode__() is called in python2.
writemsg_stdout("%s" % (self.conf.repo_display,),
noiselevel=-1)
 
diff --git a/lib/portage/cache/flat_hash.py b/lib/portage/cache/flat_hash.py
index 7d48bae81..25930f0a4 100644
--- a/lib/portage/cache/flat_hash.py
+++ b/lib/portage/cache/flat_hash.py
@@ -73,9 +73,6 @@ class database(fs_template.FsBased):
v = values.get(k)
if not v:
continue
-   # NOTE: This format string requires 
unicode_literals, so that
-   # k and v are coerced to unicode, in order to 
prevent TypeError
-   # when writing raw bytes to TextIOWrapper with 
Python 2.
myf.write("%s=%s\n" % (k, v))
 
self._ensure_access(fp)
diff --git a/lib/portage/tests/unicode/test_string_format.py 
b/lib/portage/tests/unicode/test_string_format.py
index 3b994d62

[gentoo-portage-dev] [PATCH 2/3] Remove outdated mention of Python 2 from comment

2021-03-04 Thread Matt Turner
Fixes: 5e9fe0f2a ("Eliminate basestring/long/_unicode py3 compat")
Signed-off-by: Matt Turner 
---
 lib/portage/versions.py | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/portage/versions.py b/lib/portage/versions.py
index 317683b17..1dc942124 100644
--- a/lib/portage/versions.py
+++ b/lib/portage/versions.py
@@ -341,11 +341,11 @@ def catpkgsplit(mydata, silent=1, eapi=None):
 
 class _pkg_str(str):
"""
-   This class represents a cpv. It inherits from str (unicode in python2) 
and
-   has attributes that cache results for use by functions like catpkgsplit 
and
-   cpv_getkey which are called frequently (especially in match_from_list).
-   Instances are typically created in dbapi.cp_list() or the Atom 
contructor,
-   and propagate from there. Generally, code that pickles these objects 
will
+   This class represents a cpv. It inherits from str and has attributes
+   that cache results for use by functions like catpkgsplit and cpv_getkey
+   which are called frequently (especially in match_from_list).  Instances
+   are typically created in dbapi.cp_list() or the Atom contructor, and
+   propagate from there. Generally, code that pickles these objects will
manually convert them to a plain unicode object first.
 
Instances of this class will have missing attributes for metadata that
-- 
2.26.2




[gentoo-portage-dev] [PATCH 1/3] Remove Python 2 workaround

2021-03-04 Thread Matt Turner
Signed-off-by: Matt Turner 
---
 lib/portage/__init__.py | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py
index 184db6ae2..1d202f557 100644
--- a/lib/portage/__init__.py
+++ b/lib/portage/__init__.py
@@ -484,11 +484,7 @@ def _eapi_is_deprecated(eapi):
return eapi in _deprecated_eapis
 
 def eapi_is_supported(eapi):
-   if not isinstance(eapi, str):
-   # Only call str() when necessary since with python2 it
-   # can trigger UnicodeEncodeError if EAPI is corrupt.
-   eapi = str(eapi)
-   eapi = eapi.strip()
+   eapi = str(eapi).strip()
 
return eapi in _supported_eapis
 
-- 
2.26.2




Re: [gentoo-dev] New tool: merge-driver-ekeyword automatically resolves git merge conflicts involving KEYWORDS=...

2021-03-02 Thread Matt Turner
On Tue, Mar 2, 2021 at 3:12 PM Michael Orlitzky  wrote:
>
> On Tue, 2021-03-02 at 14:02 -0500, Matt Turner wrote:
> > On Tue, Mar 2, 2021 at 12:11 AM Michael Orlitzky  wrote:
> > > why don't we just enforce putting each
> > > keyword on a separate line instead, so that we don't have this problem
> > > in the first place?
> >
> > Why don't we change 30 thousand ebuilds rather than use this script?
> >
>
> If we're going to enforce a format, it makes more sense to sed things
> into the easy format once than it does to leave things in the hard
> format forever and maintain a custom tool that makes the hard format
> more like the easy format.

Sorry, I'm not interested in engaging on this topic. Please start a new thread.



Re: [gentoo-dev] New tool: merge-driver-ekeyword automatically resolves git merge conflicts involving KEYWORDS=...

2021-03-02 Thread Matt Turner
On Tue, Mar 2, 2021 at 2:36 PM Alessandro Barbieri
 wrote:
>
> Il Mar 2 Mar 2021, 20:03 Matt Turner  ha scritto:
>>
>> On Tue, Mar 2, 2021 at 12:11 AM Michael Orlitzky  wrote:
>> > why don't we just enforce putting each
>> > keyword on a separate line instead, so that we don't have this problem
>> > in the first place?
>>
>> Why don't we change 30 thousand ebuilds rather than use this script?
>
>
> IMO before this the keyword mechanism should be reworked to be three-state:
> 1 Arch known working
> 2 Arch known not working
> 3 Arch untested/status unknown
>
> And let the user choose to use packages from 3 or not

Are you actually replying to me? I was restating mjo's question to
demonstrate the absurdity, not suggesting a different course of
action.



Re: [gentoo-dev] New tool: merge-driver-ekeyword automatically resolves git merge conflicts involving KEYWORDS=...

2021-03-02 Thread Matt Turner
On Tue, Mar 2, 2021 at 12:11 AM Michael Orlitzky  wrote:
> why don't we just enforce putting each
> keyword on a separate line instead, so that we don't have this problem
> in the first place?

Why don't we change 30 thousand ebuilds rather than use this script?



Re: [gentoo-dev] New tool: merge-driver-ekeyword automatically resolves git merge conflicts involving KEYWORDS=...

2021-03-02 Thread Matt Turner
On Tue, Mar 2, 2021 at 6:11 AM Wolfgang E. Sanyer
 wrote:
> Git diff has --color-word, doesn't this suggest that it has the capability of 
> identifying these word-by-word changes?

No, git diff has that feature. That doesn't imply that the default
merge driver has that feature.

> Is there perhaps a merge option that is being overlooked?

At least not one the upstream git developers know about. (I asked)



[gentoo-dev] New tool: merge-driver-ekeyword automatically resolves git merge conflicts involving KEYWORDS=...

2021-03-01 Thread Matt Turner

tl;dr: In app-portage/gentoolkit-0.5.1 there's a new tool I wrote,
called merge-driver-ekeyword that can automatically resolve git merge
conflicts involving the KEYWORDS=... line in ebuilds.

Since the KEYWORDS=... assignment is a single line, git struggles to
handle conflicts. When rebasing a series of commits that modify the
KEYWORDS=... it's usually easier to throw them away and reapply on the
new tree than it is to manually handle conflicts during the rebase.

git allows a 'merge driver' program to handle conflicts; this program
handles conflicts in the KEYWORDS=... assignment. E.g., given an ebuild
with these keywords:

KEYWORDS="~alpha amd64 arm arm64 ~hppa ppc ppc64 x86"

One developer drops the ~alpha keyword and pushes to gentoo.git, and
another developer stabilizes hppa. Without this merge driver, git
requires the second developer to manually resolve the conflict which is
tedious and prone to mistakes when rebasing a long series of patches.
With the custom merge driver, it automatically resolves the conflict.

To use the merge driver, configure your gentoo.git as such:

gentoo.git/.git/config:

[merge "keywords"]
name = KEYWORDS merge driver
driver = merge-driver-ekeyword %O %A %B %P

gentoo.git/.git/info/attributes:

*.ebuild merge=keywords

With that configured, git merge conflicts on the KEYWORDS=... line will
be resolved automatically (e.g. during git pull --rebase).

Enjoy!


signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH] Add @changed-subslot package set

2021-01-15 Thread Matt Turner
This set is the upgradable packages for which the highest visible
version has a different subslot than the currently installed version.

The primary purpose of this feature is for use in catalyst builds. We
update the "seed" stage3 before using it to build a new stage1.

Updating the entire stage is expensive and unnecessary (since we're
going to build the latest packages in stage1 and then rebuild everything
in stage3).

What we definitely do need to update in the original stage3 however, is
any package that would trigger a subslot rebuild.

For example: gcc links with libmpfr.so from dev-libs/mpfr. mpfr's SONAME
changes from libmpfr.so.4 (SLOT="0/4") to libmpfr.so.6 (SLOT="0/6"). If
the seed stage's dev-libs/mpfr is not updated before emerging gcc, gcc
will link with libmpfr.so.4, but the latest version of dev-libs/mpfr
will be built and libmpfr.so.6 included into the stage1. Since the old
libmpfr.so.4 is not included in the stage1, gcc will not work, breaking
subsequent stage builds.

Our current options to update the seed are too large a hammer (e.g.,
"--update --deep --newuse @world" or "--update --deep --newuse
--complete-graph --rebuild-if-new-ver gcc") and spend too much time
updating seed stages for no gain beyond updating only packages for whom
the subslot has changed.

With this set, catalyst will likely use

emerge @changed-subslot --ignore-built-slot-operator-deps y

to update the seed stage.

Thank you to Zac Medico for showing me how to do this.

Bug: https://bugs.gentoo.org/739004
Signed-off-by: Matt Turner 
---
 cnf/sets/portage.conf  |  5 +
 lib/portage/_sets/dbapi.py | 39 +-
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf
index 22f0fa3a5..5651a9c53 100644
--- a/cnf/sets/portage.conf
+++ b/cnf/sets/portage.conf
@@ -84,6 +84,11 @@ exclude-files = /usr/bin/Xorg
 [rebuilt-binaries]
 class = portage.sets.dbapi.RebuiltBinaries
 
+# Installed packages for which the subslot of the highest visible ebuild
+# version is different than the currently installed version.
+[changed-subslot]
+class = portage.sets.dbapi.SubslotChangedSet
+
 # Installed packages for which the highest visible ebuild
 # version is lower than the currently installed version.
 [downgrade]
diff --git a/lib/portage/_sets/dbapi.py b/lib/portage/_sets/dbapi.py
index 52367c4a6..46ba5c17d 100644
--- a/lib/portage/_sets/dbapi.py
+++ b/lib/portage/_sets/dbapi.py
@@ -15,7 +15,7 @@ from portage._sets import SetConfigError, get_boolean
 import portage
 
 __all__ = ["CategorySet", "ChangedDepsSet", "DowngradeSet",
-   "EverythingSet", "OwnerSet", "VariableSet"]
+   "EverythingSet", "OwnerSet", "SubslotChangedSet", "VariableSet"]
 
 class EverythingSet(PackageSet):
_operations = ["merge"]
@@ -167,6 +167,43 @@ class VariableSet(EverythingSet):
 
singleBuilder = classmethod(singleBuilder)
 
+class SubslotChangedSet(PackageSet):
+
+   _operations = ["merge", "unmerge"]
+
+   description = "Package set which contains all packages " + \
+   "for which the subslot of the highest visible ebuild is " + \
+   "different than the currently installed version."
+
+   def __init__(self, portdb=None, vardb=None):
+   super(SubslotChangedSet, self).__init__()
+   self._portdb = portdb
+   self._vardb = vardb
+
+   def load(self):
+   atoms = []
+   xmatch = self._portdb.xmatch
+   xmatch_level = "bestmatch-visible"
+   cp_list = self._vardb.cp_list
+   pkg_str = self._vardb._pkg_str
+   for cp in self._vardb.cp_all():
+   for cpv in cp_list(cp):
+   pkg = pkg_str(cpv, None)
+   slot_atom = "%s:%s" % (pkg.cp, pkg.slot)
+   ebuild = xmatch(xmatch_level, slot_atom)
+   if not ebuild:
+   continue
+   if pkg.sub_slot != ebuild.sub_slot:
+   atoms.append(slot_atom)
+
+   self._setAtoms(atoms)
+
+   def singleBuilder(cls, options, settings, trees):
+   return cls(portdb=trees["porttree"].dbapi,
+   vardb=trees["vartree"].dbapi)
+
+   singleBuilder = classmethod(singleBuilder)
+
 class DowngradeSet(PackageSet):
 
_operations = ["merge", "unmerge"]
-- 
2.26.2




[gentoo-dev] [PATCH 2/2] xorg-2.eclass: Remove XORG_STATIC

2021-01-08 Thread Matt Turner
Statically linking X libraries into your program is an extremely bad
idea.

Signed-off-by: Matt Turner 
---
 eclass/xorg-2.eclass | 23 +--
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/eclass/xorg-2.eclass b/eclass/xorg-2.eclass
index f3b282e1a11..f9a18b8ec26 100644
--- a/eclass/xorg-2.eclass
+++ b/eclass/xorg-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: xorg-2.eclass
@@ -168,27 +168,6 @@ fi
 # If we're a driver package, then enable DRIVER case
 [[ ${PN} == xf86-video-* || ${PN} == xf86-input-* ]] && DRIVER="yes"
 
-# @ECLASS-VARIABLE: XORG_STATIC
-# @DESCRIPTION:
-# Enables static-libs useflag. Set to no, if your package gets:
-#
-# QA: configure: WARNING: unrecognized options: --disable-static
-: ${XORG_STATIC:="yes"}
-
-# Add static-libs useflag where useful.
-if [[ ${XORG_STATIC} == yes \
-   && ${FONT} != yes \
-   && ${CATEGORY} != app-doc \
-   && ${CATEGORY} != x11-apps \
-   && ${CATEGORY} != x11-drivers \
-   && ${CATEGORY} != media-fonts \
-   && ${PN} != util-macros \
-   && ${PN} != xbitmaps \
-   && ${PN} != xorg-cf-files \
-   && ${PN/xcursor} = ${PN} ]]; then
-   IUSE+=" static-libs"
-fi
-
 DEPEND+=" virtual/pkgconfig"
 
 # @ECLASS-VARIABLE: XORG_DRI
-- 
2.26.2




[gentoo-dev] [PATCH 1/2] xorg-3.eclass: Remove XORG_STATIC

2021-01-08 Thread Matt Turner
Statically linking X libraries into your program is an extremely bad
idea.

Signed-off-by: Matt Turner 
---
 eclass/xorg-3.eclass | 22 --
 1 file changed, 22 deletions(-)

diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index ece4d97b433..399fc8661f4 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -169,28 +169,6 @@ if [[ ${FONT} == yes ]]; then
FONT_DIR=${FONT_DIR/type1/Type1}
FONT_DIR=${FONT_DIR/speedo/Speedo}
 fi
-
-# @ECLASS-VARIABLE: XORG_STATIC
-# @DESCRIPTION:
-# Enables static-libs useflag. Set to no, if your package gets:
-#
-# QA: configure: WARNING: unrecognized options: --disable-static
-: ${XORG_STATIC:="yes"}
-
-# Add static-libs useflag where useful.
-if [[ ${XORG_STATIC} == yes \
-   && ${FONT} != yes \
-   && ${CATEGORY} != app-doc \
-   && ${CATEGORY} != x11-apps \
-   && ${CATEGORY} != x11-drivers \
-   && ${CATEGORY} != media-fonts \
-   && ${PN} != util-macros \
-   && ${PN} != xbitmaps \
-   && ${PN} != xorg-cf-files \
-   && ${PN/xcursor} = ${PN} ]]; then
-   IUSE+=" static-libs"
-fi
-
 BDEPEND+=" virtual/pkgconfig"
 
 # @ECLASS-VARIABLE: XORG_DRI
-- 
2.26.2




Re: [gentoo-dev] Suggestion: Trying to locate and remove unused dev- & media-libs?

2021-01-08 Thread Matt Turner
On Fri, Jan 8, 2021 at 7:27 AM Joonas Niilola  wrote:
> dev-libs/clhpp

We want to keep this, though I admit I don't recall why nothing depends on it.



[gentoo-dev] [PATCH] vala.eclass: make has_version aware of ROOT for EAPI 7

2021-01-06 Thread Matt Turner
From: David Michael 

The vala dependencies are declared in BDEPEND since EAPI 7 so that
the valac command is natively executable.  With no arguments, the
has_version function would look for a cross-compiled vala package
in the target ROOT and always fail.

Signed-off-by: David Michael 
Signed-off-by: Matt Turner 
---
 eclass/vala.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/vala.eclass b/eclass/vala.eclass
index 52899f163dc..88c5231286a 100644
--- a/eclass/vala.eclass
+++ b/eclass/vala.eclass
@@ -102,7 +102,7 @@ vala_best_api_version() {
u=$(_vala_use_depend)
 
for v in $(vala_api_versions); do
-   has_version "dev-lang/vala:${v}${u}" && echo "${v}" && return
+   has_version $([[ $EAPI == [1-6] ]] || echo -b) 
"dev-lang/vala:${v}${u}" && echo "${v}" && return
done
 }
 
@@ -136,7 +136,7 @@ vala_src_prepare() {
fi
 
if [[ ${version} ]]; then
-   has_version "dev-lang/vala:${version}" || die "No installed 
vala:${version}"
+   has_version $([[ $EAPI == [1-6] ]] || echo -b) 
"dev-lang/vala:${version}" || die "No installed vala:${version}"
else
version=$(vala_best_api_version)
[[ ${version} ]] || die "No installed vala in $(vala_depend)"
-- 
2.26.2




[gentoo-portage-dev] [PATCH gentoolkit] equery: Remove 'changes' subcommand

2021-01-04 Thread Matt Turner
ChangeLogs have been gone from gentoo.git since the beginning, and
Council agreed in 2016 to allow Infra to decide whether to distribute
them through rsync, which they have decided not to do [1].

[1] https://projects.gentoo.org/council/meeting-logs/20160410-summary.txt

Signed-off-by: Matt Turner 
---
 pym/gentoolkit/equery/__init__.py   |   1 -
 pym/gentoolkit/equery/changes.py| 184 
 pym/gentoolkit/helpers.py   | 173 --
 pym/gentoolkit/test/equery/test_init.py |   1 -
 pym/gentoolkit/test/test_helpers.py |  47 --
 5 files changed, 406 deletions(-)
 delete mode 100644 pym/gentoolkit/equery/changes.py

diff --git a/pym/gentoolkit/equery/__init__.py 
b/pym/gentoolkit/equery/__init__.py
index 4640086..677f534 100644
--- a/pym/gentoolkit/equery/__init__.py
+++ b/pym/gentoolkit/equery/__init__.py
@@ -42,7 +42,6 @@ __authors__ = (
 
 NAME_MAP = {
'b': 'belongs',
-   'c': 'changes',
'k': 'check',
'd': 'depends',
'g': 'depgraph',
diff --git a/pym/gentoolkit/equery/changes.py b/pym/gentoolkit/equery/changes.py
deleted file mode 100644
index f234ecb..000
--- a/pym/gentoolkit/equery/changes.py
+++ /dev/null
@@ -1,184 +0,0 @@
-# Copyright(c) 2009, Gentoo Foundation
-#
-# Licensed under the GNU General Public License, v2 or higher
-
-"""Displays the ChangeLog entry for the latest installable version of an 
atom"""
-
-__docformat__ = 'epytext'
-
-# ===
-# Imports
-# ===
-
-import sys
-import os
-from getopt import gnu_getopt, GetoptError
-
-import gentoolkit.pprinter as pp
-from gentoolkit.atom import Atom
-from gentoolkit.equery import format_options, mod_usage
-from gentoolkit.helpers import ChangeLog
-from gentoolkit.query import Query
-
-# ===
-# Globals
-# ===
-
-QUERY_OPTS = {
-   'only_latest': False,
-   'show_full_log': False,
-   'limit': None,
-   'from': None,
-   'to': None
-}
-
-# =
-# Functions
-# =
-
-def print_help(with_description=True):
-   """Print description, usage and a detailed help message.
-
-   @type with_description: bool
-   @param with_description: if true, print module's __doc__ string
-   """
-
-   if with_description:
-   print(__doc__.strip())
-   print()
-   print(mod_usage(mod_name="changes"))
-   print()
-   print(pp.emph("examples"))
-   print (" c portage# show latest visible 
"
-  "version's entry")
-   print(" c portage --full --limit=3   # show 3 latest 
entries")
-   print(" c '=sys-apps/portage-2.1.6*' # use atom syntax")
-   print(" c portage --from=2.2_rc60 --to=2.2_rc70  # use version ranges")
-   print()
-   print(pp.command("options"))
-   print(format_options((
-   (" -h, --help", "display this help message"),
-   (" -l, --latest", "display only the latest ChangeLog entry"),
-   (" -f, --full", "display the full ChangeLog"),
-   (" --limit=NUM",
-   "limit the number of entries displayed (with --full)"),
-   (" --from=VER", "set which version to display from"),
-   (" --to=VER", "set which version to display to"),
-   )))
-
-
-def parse_module_options(module_opts):
-   """Parse module options and update QUERY_OPTS"""
-
-   opts = (x[0] for x in module_opts)
-   posargs = (x[1] for x in module_opts)
-   for opt, posarg in zip(opts, posargs):
-   if opt in ('-h', '--help'):
-   print_help()
-   sys.exit(0)
-   elif opt in ('-f', '--full'):
-   QUERY_OPTS['show_full_log'] = True
-   elif opt in ('-l', '--latest'):
-   QUERY_OPTS['only_latest'] = True
-   elif opt in ('--limit',):
-   set_limit(posarg)
-   elif opt in ('--from',):
-   QUERY_OPTS['from'] = posarg
-   elif opt in ('--to',):
-   QUERY_OPTS['to'] = posarg
-
-
-def print_entries(entries):
-   """Print entries and strip trailing whitespace from the last entry."""
-
-   len_entries = len(entries)
-   for i, entry in enumerate(entries, start=1):
-   if i < len_entries:
-   pp.uprint(entry)
-   else:
-   pp.uprint(entry.strip())
-
-
-def set_limit(posarg):
-   """Set a limit in QUERY_OPTS on how many ChangeLog entries to display.
-
-   Die if

[gentoo-portage-dev] [PATCH gentoolkit] gentoolkit: Remove gentoolkit.test.cmp

2021-01-04 Thread Matt Turner
Signed-off-by: Matt Turner 
---
Seems to only be used by duplicated unit tests? I guess this might have
been useful when Python 2 was still supported?

 pym/gentoolkit/test/__init__.py  | 23 ---
 pym/gentoolkit/test/test_atom.py | 15 ---
 pym/gentoolkit/test/test_cpv.py  | 15 ---
 3 files changed, 53 deletions(-)

diff --git a/pym/gentoolkit/test/__init__.py b/pym/gentoolkit/test/__init__.py
index 9e41686..e69de29 100644
--- a/pym/gentoolkit/test/__init__.py
+++ b/pym/gentoolkit/test/__init__.py
@@ -1,23 +0,0 @@
-#!/usr/bin/python
-# Copyright 2009 Gentoo Foundation
-#
-# Distributed under the terms of the GNU General Public License v2
-
-__all__ = ['cmp']
-
-# py3k doesn't have cmp emulate it in order to keep testing cmp
-# in python-2.x
-#XXX: not sure if this is the best place for this
-try:
-   cmp = cmp
-except NameError:
-   def cmp(a, b):
-   if a == b:
-   return 0
-   elif a < b:
-   return -1
-   elif a > b:
-   return 1
-   # just to be safe, __lt__/ __gt__ above should have thrown
-   # something like this already
-   raise TypeError("Comparison between unorderable types")
diff --git a/pym/gentoolkit/test/test_atom.py b/pym/gentoolkit/test/test_atom.py
index 664bf40..6df52a9 100644
--- a/pym/gentoolkit/test/test_atom.py
+++ b/pym/gentoolkit/test/test_atom.py
@@ -7,7 +7,6 @@ import unittest
 
 from gentoolkit.atom import Atom
 from gentoolkit.cpv import CPV
-from gentoolkit.test import cmp
 
 """Atom test suite (verbatim) from pkgcore."""
 
@@ -17,26 +16,12 @@ class TestGentoolkitAtom(unittest.TestCase):
# logic bugs hidden behind short circuiting comparisons for 
metadata
# is why we test the comparison *both* ways.
self.assertEqual(o1, o2)
-   c = cmp(o1, o2)
-   self.assertEqual(c, 0,
-   msg="checking cmp for %r, %r, aren't equal: got %i" % 
(o1, o2, c))
self.assertEqual(o2, o1)
-   c = cmp(o2, o1)
-   self.assertEqual(c, 0,
-   msg="checking cmp for %r, %r,aren't equal: got %i" % 
(o2, o1, c))
 
def assertNotEqual2(self, o1, o2):
# is why we test the comparison *both* ways.
self.assertNotEqual(o1, o2)
-   c = cmp(o1, o2)
-   self.assertNotEqual(c, 0,
-   msg="checking cmp for %r, %r, not supposed to be equal, 
got %i"
-   % (o1, o2, c))
self.assertNotEqual(o2, o1)
-   c = cmp(o2, o1)
-   self.assertNotEqual(c, 0,
-   msg="checking cmp for %r, %r, not supposed to be equal, 
got %i"
-   % (o2, o1, c))
 
def test_comparison(self):
self.assertEqual2(Atom('cat/pkg'), Atom('cat/pkg'))
diff --git a/pym/gentoolkit/test/test_cpv.py b/pym/gentoolkit/test/test_cpv.py
index 3817e9f..92ffba5 100644
--- a/pym/gentoolkit/test/test_cpv.py
+++ b/pym/gentoolkit/test/test_cpv.py
@@ -7,7 +7,6 @@
 import unittest
 
 from gentoolkit.cpv import CPV, compare_strs
-from gentoolkit.test import cmp
 
 class TestGentoolkitCPV(unittest.TestCase):
 
@@ -15,26 +14,12 @@ class TestGentoolkitCPV(unittest.TestCase):
# logic bugs hidden behind short circuiting comparisons for 
metadata
# is why we test the comparison *both* ways.
self.assertEqual(o1, o2)
-   c = cmp(o1, o2)
-   self.assertEqual(c, 0,
-   msg="checking cmp for %r, %r, aren't equal: got %i" % 
(o1, o2, c))
self.assertEqual(o2, o1)
-   c = cmp(o2, o1)
-   self.assertEqual(c, 0,
-   msg="checking cmp for %r, %r,aren't equal: got %i" % 
(o2, o1, c))
 
def assertNotEqual2(self, o1, o2):
# is why we test the comparison *both* ways.
self.assertNotEqual(o1, o2)
-   c = cmp(o1, o2)
-   self.assertNotEqual(c, 0,
-   msg="checking cmp for %r, %r, not supposed to be equal, 
got %i"
-   % (o1, o2, c))
self.assertNotEqual(o2, o1)
-   c = cmp(o2, o1)
-   self.assertNotEqual(c, 0,
-   msg="checking cmp for %r, %r, not supposed to be equal, 
got %i"
-   % (o2, o1, c))
 
def test_comparison(self):
self.assertEqual2(CPV('pkg'), CPV('pkg'))
-- 
2.26.2




[gentoo-portage-dev] [PATCH gentoolkit] eclean: Add --changed-iuse flag

2021-01-02 Thread Matt Turner
Allows binpkgs to be deleted if they are not usable due to IUSE changes.
---
Just kind of spitballing. I'm not sure about what USE flags we should
ignore or whether it should be configurable, etc. On one hand, deleting
binpkgs that don't have a newly added PYTHON_TARGET option might make
sense if your binhost is configured to rebuild the package. On the
other, you probably don't want to throw out amd64 binpkgs because
abi_riscv_* was added.

 pym/gentoolkit/eclean/cli.py|  8 -
 pym/gentoolkit/eclean/search.py | 62 +
 2 files changed, 54 insertions(+), 16 deletions(-)

diff --git a/pym/gentoolkit/eclean/cli.py b/pym/gentoolkit/eclean/cli.py
index e31fde9..910296b 100644
--- a/pym/gentoolkit/eclean/cli.py
+++ b/pym/gentoolkit/eclean/cli.py
@@ -146,6 +146,8 @@ def printUsage(_error=None, help=None):
green("packages"),"action:", file=out)
print( yellow(" --changed-deps")+
"   - delete packages for which ebuild 
dependencies have changed", file=out)
+   print( yellow(" --changed-iuse")+
+   "   - delete packages for which IUSE have 
changed", file=out)
print( yellow(" -i, --ignore-failure")+
" - ignore failure to locate PKGDIR", 
file=out)
print( file=out)
@@ -264,6 +266,8 @@ def parseArgs(options={}):
options['verbose'] = True
elif o in ("--changed-deps"):
options['changed-deps'] = True
+   elif o in ("--changed-iuse"):
+   options['changed-iuse'] = True
elif o in ("-i", "--ignore-failure"):
options['ignore-failure'] = True
else:
@@ -291,7 +295,8 @@ def parseArgs(options={}):
getopt_options['short']['distfiles'] = "fs:"
getopt_options['long']['distfiles'] = ["fetch-restricted", 
"size-limit="]
getopt_options['short']['packages'] = "i"
-   getopt_options['long']['packages'] = ["ignore-failure", "changed-deps"]
+   getopt_options['long']['packages'] = ["ignore-failure", "changed-deps",
+ "changed-iuse"]
# set default options, except 'nocolor', which is set in main()
options['interactive'] = False
options['pretend'] = False
@@ -305,6 +310,7 @@ def parseArgs(options={}):
options['size-limit'] = 0
options['verbose'] = False
options['changed-deps'] = False
+   options['changed-iuse'] = False
options['ignore-failure'] = False
# if called by a well-named symlink, set the action accordingly:
action = None
diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py
index 8f6e52f..8344e15 100644
--- a/pym/gentoolkit/eclean/search.py
+++ b/pym/gentoolkit/eclean/search.py
@@ -498,6 +498,47 @@ def _deps_equal(deps_a, eapi_a, deps_b, eapi_b, 
uselist=None):
return deps_a == deps_b
 
 
+def _changed_deps(cpv, options, port_dbapi, bin_dbapi):
+   if not options['changed-deps']:
+   return False
+
+   dep_keys = ('RDEPEND', 'PDEPEND')
+   keys = ('EAPI', 'USE') + dep_keys
+   binpkg_metadata = dict(zip(keys, bin_dbapi.aux_get(cpv, keys)))
+   ebuild_metadata = dict(zip(keys, port_dbapi.aux_get(cpv, keys)))
+
+   return _deps_equal(' '.join(binpkg_metadata[key] for key in dep_keys),
+  binpkg_metadata['EAPI'], ' 
'.join(ebuild_metadata[key] for key in dep_keys),
+  ebuild_metadata['EAPI'],
+  
frozenset(binpkg_metadata['USE'].split()))
+
+
+# IUSE flags to be ignored for purposes of invalidating binpkgs
+def ignore(iuse):
+   return iuse.startswith('abi_')
+
+
+# Prune the + characters from USE flags (e.g. '+cxx' -> 'cxx')
+def prune_plus(iuse):
+   if iuse.startswith('+'):
+   return iuse[1:]
+   return iuse
+
+
+def _changed_iuse(cpv, options, port_dbapi, bin_dbapi):
+   if not options['changed-iuse']:
+   return False
+
+   keys = ('IUSE',)
+   binpkg_metadata = [prune_plus(x) for x in  bin_dbapi.aux_get(cpv, 
keys)[0].split(' ') if not ignore(x)]
+   ebuild_metadata = [prune_plus(x) for x in port_dbapi.aux_get(cpv, 
keys)[0].split(' ') if not ignore(x)]
+
+   if binpkg_metadata == ['']: binpkg_metadata = []
+   if ebuild_metadata == ['']: ebuild_metadata = []
+
+   return binpkg_metadata != ebuild_metadata
+
+
 def findPackages(
options,
exclude=None,
@@ -570,21 +611,6 @@ def findPackages(
if mtime >= time_limit:
continue
 
-   # Exclude if binpkg exists in the porttree and 

Re: [gentoo-portage-dev] [PATCH gentoolkit] bin: Add merge-driver-ekeyword

2020-12-31 Thread Matt Turner
On Mon, Dec 28, 2020 at 8:09 PM Zac Medico  wrote:
>
> On 12/28/20 3:15 PM, Matt Turner wrote:
> > +def apply_keyword_changes(ebuild: str, pathname: str,
> > +  changes: List[Tuple[Optional[str],
> > +  Optional[str]]]) -> int:
> > +result: int = 0
> > +
> > +# ekeyword will only modify files named *.ebuild, so make a symlink
> > +ebuild_symlink: str = os.path.basename(pathname)
> > +os.symlink(ebuild, ebuild_symlink)
>
> Are we sure that the current working directory is an entirely safe place
> to create this symlink? A simple fix would be to use
> tempfile.TemporaryDirectory to create a temporary directory to hold the
> symlink. Or, we could change ekeyword to assume that an argument is an
> ebuild if os.path.isfile(arg) succeeds.

Thanks, this is a good question. I've sent a v3 patch using
tempfile.TemporaryDirectory. I think that's better than passing
".merge_file_SEd3R8" to ekeyword since the filename is printed and
it's nice to see what file is being modified during the rebase.



[gentoo-portage-dev] [PATCH gentoolkit] bin: Add merge-driver-ekeyword

2020-12-31 Thread Matt Turner
Since the KEYWORDS=... assignment is a single line, git struggles to
handle conflicts. When rebasing a series of commits that modify the
KEYWORDS=... it's usually easier to throw them away and reapply on the
new tree than it is to manually handle conflicts during the rebase.

git allows a 'merge driver' program to handle conflicts; this program
handles conflicts in the KEYWORDS=... assignment. E.g., given an ebuild
with these keywords:

KEYWORDS="~alpha amd64 arm arm64 ~hppa ppc ppc64 x86"

One developer drops the ~alpha keyword and pushes to gentoo.git, and
another developer stabilizes hppa. Without this merge driver, git
requires the second developer to manually resolve the conflict which is
tedious and prone to mistakes when rebasing a long series of patches.
With the custom merge driver, it automatically resolves the conflict.

To use the merge driver, configure your gentoo.git as such:

gentoo.git/.git/config:

[merge "keywords"]
name = KEYWORDS merge driver
driver = merge-driver-ekeyword %O %A %B %P

gentoo.git/.git/info/attributes:

*.ebuild merge=keywords

Signed-off-by: Matt Turner 
---
v3: Address Zac's feedback: use tempfile.TemporaryDirectory

Since ekeyword prints the name of the file modified, I think using a
symlink with the name of the original file is better than having it
print .merge_file_SEd3R8.

 bin/merge-driver-ekeyword | 132 ++
 1 file changed, 132 insertions(+)
 create mode 100755 bin/merge-driver-ekeyword

diff --git a/bin/merge-driver-ekeyword b/bin/merge-driver-ekeyword
new file mode 100755
index 000..2df83fc
--- /dev/null
+++ b/bin/merge-driver-ekeyword
@@ -0,0 +1,132 @@
+#!/usr/bin/python
+#
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2 or later
+
+"""
+Custom git merge driver for handling conflicts in KEYWORDS assignments
+
+See https://git-scm.com/docs/gitattributes#_defining_a_custom_merge_driver
+"""
+
+import difflib
+import os
+import sys
+import tempfile
+
+from typing import List, Optional, Tuple
+
+from gentoolkit.ekeyword import ekeyword
+
+
+def keyword_array(keyword_line: str) -> List[str]:
+# Find indices of string inside the double-quotes
+i1: int = keyword_line.find('"') + 1
+i2: int = keyword_line.rfind('"')
+
+# Split into array of KEYWORDS
+return keyword_line[i1:i2].split(' ')
+
+
+def keyword_line_changes(old: str, new: str) -> List[Tuple[Optional[str],
+   Optional[str]]]:
+a: List[str] = keyword_array(old)
+b: List[str] = keyword_array(new)
+
+s = difflib.SequenceMatcher(a=a, b=b)
+
+changes = []
+for tag, i1, i2, j1, j2 in s.get_opcodes():
+if tag == 'replace':
+changes.append((a[i1:i2], b[j1:j2]),)
+elif tag == 'delete':
+changes.append((a[i1:i2], None),)
+elif tag == 'insert':
+changes.append((None, b[j1:j2]),)
+else:
+assert tag == 'equal'
+return changes
+
+
+def keyword_changes(ebuild1: str, ebuild2: str) -> List[Tuple[Optional[str],
+  Optional[str]]]:
+with open(ebuild1) as e1, open(ebuild2) as e2:
+lines1 = e1.readlines()
+lines2 = e2.readlines()
+
+diff = difflib.unified_diff(lines1, lines2, n=0)
+assert next(diff) == '--- \n'
+assert next(diff) == '+++ \n'
+
+hunk: int = 0
+old: str = ''
+new: str = ''
+
+for line in diff:
+if line.startswith('@@ '):
+if hunk > 0:
+break
+hunk += 1
+elif line.startswith('-'):
+if old or new:
+break
+old = line
+elif line.startswith('+'):
+if not old or new:
+break
+new = line
+else:
+if 'KEYWORDS=' in old and 'KEYWORDS=' in new:
+return keyword_line_changes(old, new)
+return None
+
+
+def apply_keyword_changes(ebuild: str, pathname: str,
+  changes: List[Tuple[Optional[str],
+  Optional[str]]]) -> int:
+result: int = 0
+
+with tempfile.TemporaryDirectory() as tmpdir:
+# ekeyword will only modify files named *.ebuild, so make a symlink
+ebuild_symlink: str = os.path.join(tmpdir, os.path.basename(pathname))
+os.symlink(os.path.join(os.getcwd(), ebuild), ebuild_symlink)
+
+for removals, additions in changes:
+args = []
+for rem in removals:
+# Drop leading '~' and '-' characters and prepend '^'
+i = 1 if rem[0] in ('~', '-') else 0
+args.append('^' + rem[i:])
+if 

Re: [gentoo-dev] [RFC] Discontinuing LibreSSL support?

2020-12-29 Thread Matt Turner
On Tue, Dec 29, 2020 at 2:47 PM Peter Stuge  wrote:
>
> Andreas K. Huettel wrote:
> > > I agree completely that it's unreasonable for Gentoo (worse, 1 person!)
> > > to continuosly patch the entire world for libressel.
> > >
> > > I'm asking to stop doing that, yet still enable the choice between
> > > openssl and libressl where that is possible without patches, even
> > > if that's only openntpd and one other package.
> >
> > a) The two cannot be installed concurrently. To fix that would require even
> > more hacks.
>
> As we've discussed in another part of the thread, that's not really true.
> Both can for sure be installed, just not in the same place and/or
> with same names.
>
>
> > -> all relevant ssl consumers on the user's system must be linked against
> > the one selected
>
> Also not the case. Considering the two installed in different paths
> with same names it's still easy for consumers to use one or the other
> with -rpath at link time.
>
>
> I do agree that the two are not always 1:1 replacements for each other.
> If they are API incompatible somewhere then for sure not.
>
> I think many mails in this thread suffer from some tunnel vision, expecting
> that a libressl ebuild in the tree must continue to work exactly like the
> openssl ebuild - I'm saying to stop that but do keep a libressl ebuild.

If they suffer from tunnel vision, it's because the intersection of
"people who care about libressl" and "people who have patches in
gentoo.git" is the empty set.

I think we all understand your points: libressl could be kept in-tree
and allow people to play with it. Unfortunately that requires much
more work than removing it, and I haven't seen evidence that you're
prepared to contribute to the required effort.

I don't think you're going to convince a bunch of people with little
interest in libressl per se to continue allowing the extra burden
unless you do the work that's needed to keep it in-tree (e.g., to
allow it to be installed beside openssl). They're not interested.



[gentoo-portage-dev] [PATCH gentoolkit] bin: Add merge-driver-ekeyword

2020-12-28 Thread Matt Turner
Since the KEYWORDS=... assignment is a single line, git struggles to
handle conflicts. When rebasing a series of commits that modify the
KEYWORDS=... it's usually easier to throw them away and reapply on the
new tree than it is to manually handle conflicts during the rebase.

git allows a 'merge driver' program to handle conflicts; this program
handles conflicts in the KEYWORDS=... assignment. E.g., given an ebuild
with these keywords:

KEYWORDS="~alpha amd64 arm arm64 ~hppa ppc ppc64 x86"

One developer drops the ~alpha keyword and pushes to gentoo.git, and
another developer stabilizes hppa. Without this merge driver, git
requires the second developer to manually resolve the conflict which is
tedious and prone to mistakes when rebasing a long series of patches.
With the custom merge driver, it automatically resolves the conflict.

To use the merge driver, configure your gentoo.git as such:

gentoo.git/.git/config:

[merge "keywords"]
name = KEYWORDS merge driver
driver = merge-driver-ekeyword %O %A %B %P

gentoo.git/.git/info/attributes:

*.ebuild merge=keywords

Signed-off-by: Matt Turner 
---
 bin/merge-driver-ekeyword | 131 ++
 1 file changed, 131 insertions(+)
 create mode 100755 bin/merge-driver-ekeyword

diff --git a/bin/merge-driver-ekeyword b/bin/merge-driver-ekeyword
new file mode 100755
index 000..2142dc8
--- /dev/null
+++ b/bin/merge-driver-ekeyword
@@ -0,0 +1,131 @@
+#!/usr/bin/python
+#
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2 or later
+
+"""
+Custom git merge driver for handling conflicts in KEYWORDS assignments
+
+See https://git-scm.com/docs/gitattributes#_defining_a_custom_merge_driver
+"""
+
+import difflib
+import os
+import sys
+
+from typing import List, Optional, Tuple
+
+from gentoolkit.ekeyword import ekeyword
+
+
+def keyword_array(keyword_line: str) -> List[str]:
+# Find indices of string inside the double-quotes
+i1: int = keyword_line.find('"') + 1
+i2: int = keyword_line.rfind('"')
+
+# Split into array of KEYWORDS
+return keyword_line[i1:i2].split(' ')
+
+
+def keyword_line_changes(old: str, new: str) -> List[Tuple[Optional[str],
+   Optional[str]]]:
+a: List[str] = keyword_array(old)
+b: List[str] = keyword_array(new)
+
+s = difflib.SequenceMatcher(a=a, b=b)
+
+changes = []
+for tag, i1, i2, j1, j2 in s.get_opcodes():
+if tag == 'replace':
+changes.append((a[i1:i2], b[j1:j2]),)
+elif tag == 'delete':
+changes.append((a[i1:i2], None),)
+elif tag == 'insert':
+changes.append((None, b[j1:j2]),)
+else:
+assert tag == 'equal'
+return changes
+
+
+def keyword_changes(ebuild1: str, ebuild2: str) -> List[Tuple[Optional[str],
+  Optional[str]]]:
+with open(ebuild1) as e1, open(ebuild2) as e2:
+lines1 = e1.readlines()
+lines2 = e2.readlines()
+
+diff = difflib.unified_diff(lines1, lines2, n=0)
+assert next(diff) == '--- \n'
+assert next(diff) == '+++ \n'
+
+hunk: int = 0
+old: str = ''
+new: str = ''
+
+for line in diff:
+if line.startswith('@@ '):
+if hunk > 0:
+break
+hunk += 1
+elif line.startswith('-'):
+if old or new:
+break
+old = line
+elif line.startswith('+'):
+if not old or new:
+break
+new = line
+else:
+if 'KEYWORDS=' in old and 'KEYWORDS=' in new:
+return keyword_line_changes(old, new)
+return None
+
+
+def apply_keyword_changes(ebuild: str, pathname: str,
+  changes: List[Tuple[Optional[str],
+  Optional[str]]]) -> int:
+result: int = 0
+
+# ekeyword will only modify files named *.ebuild, so make a symlink
+ebuild_symlink: str = os.path.basename(pathname)
+os.symlink(ebuild, ebuild_symlink)
+
+for removals, additions in changes:
+args = []
+for rem in removals:
+# Drop leading '~' and '-' characters and prepend '^'
+i = 1 if rem[0] in ('~', '-') else 0
+args.append('^' + rem[i:])
+if additions:
+args.extend(additions)
+args.append(ebuild_symlink)
+
+result = ekeyword.main(args)
+if result != 0:
+break
+
+os.remove(ebuild_symlink)
+return result
+
+
+def main(argv):
+if len(argv) != 5:
+sys.exit(-1)
+
+O = argv[1] # %O - filename of original
+A = argv[2] # %A - filename of our current ve

Re: [gentoo-portage-dev] [PATCH] Drop Python 2 comatibility in extension modules

2020-12-24 Thread Matt Turner
Typo in commit title: comatibility



[gentoo-portage-dev] Re: [RFC PATCH gentoolkit] bin: Add merge-driver-ekeyword

2020-12-23 Thread Matt Turner
On Wed, Dec 23, 2020 at 2:46 PM Junio C Hamano  wrote:
>
> Matt Turner  writes:
>
> > I want to handle conflicts automatically on lines like
> >
> >> KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv 
> >> ~s390 ~sparc ~x86"
> >
> > where conflicts frequently happen by adding/removing ~ before the
> > architecture names or adding/removing whole architectures. I don't
> > know if I should use a custom git merge driver or a custom git merge
> > strategy.
>
> A merge strategy is about how the changes at the tree level are
> handled.  A merge driver is given three blobs (original, your
> version, and their version) and comes up with a merged blob.
>
> In your case, you'd want a custom merge driver if you want to handle
> word changes on a single line, because the default text merge driver
> is pretty much line oriented.

Thanks, that makes sense. The merge driver I've written seems to work
great for handling the KEYWORDS=... line.

If users could more simply opt into using it (e.g., on the command
line rather than enabling it via ~/.gitattributes) I think it would be
fine to use. Better yet, is there a way git can be configured to
fallback to another merge driver if the first returns a non-zero
status due to unresolved conflicts? For example, if there are changes
to other lines, how can I fall back to another merge driver?

Thank you for your advice!



[gentoo-dev] [RFC] News item: Most stable hppa keywords removed

2020-12-23 Thread Matt Turner
Title: Most stable hppa keywords removed
Author: Matt Turner 
Posted: 2020-12-26
Revision: 1
News-Item-Format: 2.0
Display-If-Keyword: hppa

The Gentoo/HPPA team no longer thinks that the time invested in
package stabilization is warranted for the small number of users on
HPPA. As a result, we will drop most "hppa" keywords to "~hppa" on
2020-12-31. Around 850 packages will retain their stable keywords.

Users need not make any changes to their systems—other than perhaps
adding some entries to their package.accept_keywords file. The
Gentoo/HPPA team has no plans to remove support for the architecture.





Here's the GitHub PR I've made for stable masking a bunch of flags and
dropping keywords: https://github.com/gentoo/gentoo/pull/18798



[gentoo-portage-dev] Re: [RFC PATCH gentoolkit] bin: Add merge-driver-ekeyword

2020-12-22 Thread Matt Turner
tl;dr:

I want to handle conflicts automatically on lines like

> KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv 
> ~s390 ~sparc ~x86"

where conflicts frequently happen by adding/removing ~ before the
architecture names or adding/removing whole architectures. I don't
know if I should use a custom git merge driver or a custom git merge
strategy.


So the program in the patch below works, but it's not ideal, because
it rejects any hunks that don't touch the KEYWORDS=... assignment.

As I understand it, a custom git merge driver is intended to be used
to merge whole file formats, like JSON. As a result, you configure it
via gitattributes on a per-extension basis.

I really just want to make the default recursive git merge handle
KEYWORDS=... conflicts automatically, and I don't expect to be able to
make a git merge driver that can handle arbitrary conflicts in
*.ebuild files. If the merge driver returns non-zero if it was unable
to resolve the conflicts, but when it does so git evidently doesn't
fallback and insert the typical <<< HEAD ... === ... >>> markers.
Maybe I could make my merge driver insert those like git normally
does? Seems like git's  logic is probably a bit better about handling
some conflicts than my tool would be.

So... is a git merge strategy the thing I want? I don't know. There
doesn't seem to really be any documentation on writing git merge
strategies. I've only found [1] and [2].

Cc'ing g...@vger.kernel.org, since I expect that's where the experts
are. Hopefully they have suggestions.


[1] 
https://stackoverflow.com/questions/23140240/git-how-do-i-add-a-custom-merge-strategy
[2] 
https://stackoverflow.com/questions/54528824/any-documentation-for-writing-a-custom-git-merge-strategy


On Sun, Dec 20, 2020 at 10:44 PM Matt Turner  wrote:
>
> Since the KEYWORDS=... assignment is a single line, git struggles to
> handle conflicts. When rebasing a series of commits that modify the
> KEYWORDS=... it's usually easier to throw them away and reapply on the
> new tree than it is to manually handle conflicts during the rebase.
>
> git allows a 'merge driver' program to handle conflicts; this program
> handles conflicts in the KEYWORDS=... assignment. E.g., given an ebuild
> with these keywords:
>
> KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv 
> ~s390 ~sparc ~x86"
>
> One developer drops the ~alpha keyword and pushes to gentoo.git, and
> another developer stabilizes hppa. Without this merge driver, git
> requires the second developer to manually resolve the conflict.  With
> the custom merge driver, it automatically resolves the conflict.
>
> gentoo.git/.git/config:
>
> [core]
> ...
> attributesfile = ~/.gitattributes
> [merge "keywords"]
> name = KEYWORDS merge driver
>         driver = merge-driver-ekeyword %O %A %B
>
>  ~/.gitattributes:
>
> *.ebuild merge=keywords
>
> Signed-off-by: Matt Turner 
> ---
> One annoying wart in the program is due to the fact that ekeyword
> won't work on any file not named *.ebuild. I make a symlink (and set up
> an atexit handler to remove it) to work around this. I'm not sure we
> could make ekeyword handle arbitrary filenames given its complex multi-
> argument parameter support. git merge files are named .merge_file_X
> according to git-unpack-file(1), so we could allow those. Thoughts?
>
>  bin/merge-driver-ekeyword | 125 ++
>  1 file changed, 125 insertions(+)
>  create mode 100755 bin/merge-driver-ekeyword
>
> diff --git a/bin/merge-driver-ekeyword b/bin/merge-driver-ekeyword
> new file mode 100755
> index 000..6e645a9
> --- /dev/null
> +++ b/bin/merge-driver-ekeyword
> @@ -0,0 +1,125 @@
> +#!/usr/bin/python
> +#
> +# Copyright 2020 Gentoo Authors
> +# Distributed under the terms of the GNU General Public License v2 or later
> +
> +"""
> +Custom git merge driver for handling conflicts in KEYWORDS assignments
> +
> +See https://git-scm.com/docs/gitattributes#_defining_a_custom_merge_driver
> +"""
> +
> +import atexit
> +import difflib
> +import os
> +import shutil
> +import sys
> +
> +from typing import List, Optional, Tuple
> +
> +from gentoolkit.ekeyword import ekeyword
> +
> +
> +def keyword_array(keyword_line: str) -> List[str]:
> +# Find indices of string inside the double-quotes
> +i1: int = keyword_line.find('"') + 1
> +i2: int = keyword_line.rfind('"')
> +
> +# Split into array of KEYWORDS
> +return keyword_line[i1:i2].split(' ')
> +
> +
> +def keyword_line_changes(old: str, new: str) -> List[Tuple[Optional[st

[gentoo-portage-dev] [RFC PATCH gentoolkit] bin: Add merge-driver-ekeyword

2020-12-20 Thread Matt Turner
Since the KEYWORDS=... assignment is a single line, git struggles to
handle conflicts. When rebasing a series of commits that modify the
KEYWORDS=... it's usually easier to throw them away and reapply on the
new tree than it is to manually handle conflicts during the rebase.

git allows a 'merge driver' program to handle conflicts; this program
handles conflicts in the KEYWORDS=... assignment. E.g., given an ebuild
with these keywords:

KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 
~sparc ~x86"

One developer drops the ~alpha keyword and pushes to gentoo.git, and
another developer stabilizes hppa. Without this merge driver, git
requires the second developer to manually resolve the conflict.  With
the custom merge driver, it automatically resolves the conflict.

gentoo.git/.git/config:

[core]
...
attributesfile = ~/.gitattributes
[merge "keywords"]
name = KEYWORDS merge driver
driver = merge-driver-ekeyword %O %A %B

 ~/.gitattributes:

*.ebuild merge=keywords

Signed-off-by: Matt Turner 
---
One annoying wart in the program is due to the fact that ekeyword
won't work on any file not named *.ebuild. I make a symlink (and set up
an atexit handler to remove it) to work around this. I'm not sure we
could make ekeyword handle arbitrary filenames given its complex multi-
argument parameter support. git merge files are named .merge_file_X
according to git-unpack-file(1), so we could allow those. Thoughts?

 bin/merge-driver-ekeyword | 125 ++
 1 file changed, 125 insertions(+)
 create mode 100755 bin/merge-driver-ekeyword

diff --git a/bin/merge-driver-ekeyword b/bin/merge-driver-ekeyword
new file mode 100755
index 000..6e645a9
--- /dev/null
+++ b/bin/merge-driver-ekeyword
@@ -0,0 +1,125 @@
+#!/usr/bin/python
+#
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2 or later
+
+"""
+Custom git merge driver for handling conflicts in KEYWORDS assignments
+
+See https://git-scm.com/docs/gitattributes#_defining_a_custom_merge_driver
+"""
+
+import atexit
+import difflib
+import os
+import shutil
+import sys
+
+from typing import List, Optional, Tuple
+
+from gentoolkit.ekeyword import ekeyword
+
+
+def keyword_array(keyword_line: str) -> List[str]:
+# Find indices of string inside the double-quotes
+i1: int = keyword_line.find('"') + 1
+i2: int = keyword_line.rfind('"')
+
+# Split into array of KEYWORDS
+return keyword_line[i1:i2].split(' ')
+
+
+def keyword_line_changes(old: str, new: str) -> List[Tuple[Optional[str],
+   Optional[str]]]:
+a: List[str] = keyword_array(old)
+b: List[str] = keyword_array(new)
+
+s = difflib.SequenceMatcher(a=a, b=b)
+
+changes = []
+for tag, i1, i2, j1, j2 in s.opcodes():
+if tag == 'replace':
+changes.append((a[i1:i2], b[j1:j2]),)
+elif tag == 'delete':
+changes.append((a[i1:i2], None),)
+elif tag == 'insert':
+changes.append((None, b[j1:j2]),)
+else:
+assert tag == 'equal'
+return changes
+
+
+def keyword_changes(ebuild1: str, ebuild2: str) -> List[Tuple[Optional[str],
+  Optional[str]]]:
+with open(ebuild1) as e1, open(ebuild2) as e2:
+lines1 = e1.readlines()
+lines2 = e2.readlines()
+
+diff = difflib.unified_diff(lines1, lines2, n=0)
+assert next(diff) == '--- \n'
+assert next(diff) == '+++ \n'
+
+hunk: int = 0
+old: str = ''
+new: str = ''
+
+for line in diff:
+if line.startswith('@@ '):
+if hunk > 0: break
+hunk += 1
+elif line.startswith('-'):
+if old or new: break
+old = line
+elif line.startswith('+'):
+if not old or new: break
+new = line
+else:
+if 'KEYWORDS=' in old and 'KEYWORDS=' in new:
+return keyword_line_changes(old, new)
+return None
+
+
+def apply_keyword_changes(ebuild: str,
+  changes: List[Tuple[Optional[str],
+  Optional[str]]]) -> int:
+# ekeyword will only modify files named *.ebuild, so make a symlink
+ebuild_symlink = ebuild + '.ebuild'
+os.symlink(ebuild, ebuild_symlink)
+atexit.register(lambda: os.remove(ebuild_symlink))
+
+for removals, additions in changes:
+args = []
+for rem in removals:
+# Drop leading '~' and '-' characters and prepend '^'
+i = 1 if rem[0] in ('~', '-') else 0
+args.append('^' + rem[i:])
+if additions:
+ar

[gentoo-portage-dev] [PATCH gentoolkit 3/3] eclean: Remove unneeded __init__ to enable pytest

2020-12-20 Thread Matt Turner
Prevented the unit test from running:

pym/gentoolkit/test/eclean/distsupport.py:435: PytestCollectionWarning:
cannot collect test class 'TestDisfiles' because it has a __init__
constructor (from: pym/gentoolkit/test/eclean/test_search.py)

Signed-off-by: Matt Turner 
---
 pym/gentoolkit/test/eclean/distsupport.py | 6 --
 1 file changed, 6 deletions(-)

diff --git a/pym/gentoolkit/test/eclean/distsupport.py 
b/pym/gentoolkit/test/eclean/distsupport.py
index 0fc2db8..da7cdbb 100644
--- a/pym/gentoolkit/test/eclean/distsupport.py
+++ b/pym/gentoolkit/test/eclean/distsupport.py
@@ -434,12 +434,6 @@ class OutputSimulator:
 
 class TestDisfiles:
 
-   def __init__(self):
-   self.workdir = None
-   self.target_file = None
-   self.target_symlink = None
-   self.test_filepaths = None
-
def setUp(self):
# create the dist dir
self.tmpdir = mkdtemp()
-- 
2.26.2




[gentoo-portage-dev] [PATCH gentoolkit 2/3] ekeyword: Fix unit test

2020-12-20 Thread Matt Turner
arch_status changed from a Dict[str] to Dict[Tuple[str, str]], but these
bits of test data were not updated. Update the examples while we're here
(e.g. arm64 is stable with stable profiles now).

Fixes: 459cfba47d25 (ekeyword: Use now-common load_profile_data() from eshowkw)
Signed-off-by: Matt Turner 
---
 pym/gentoolkit/ekeyword/test_ekeyword.py | 38 +++-
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/pym/gentoolkit/ekeyword/test_ekeyword.py 
b/pym/gentoolkit/ekeyword/test_ekeyword.py
index 3d23585..12a0b54 100755
--- a/pym/gentoolkit/ekeyword/test_ekeyword.py
+++ b/pym/gentoolkit/ekeyword/test_ekeyword.py
@@ -165,28 +165,26 @@ class TestProcessKeywords(unittest.TestCase):
ekeyword.Op(None, 'all', None),
)
arch_status = {
-   'alpha': None,
-   'arm': 'stable',
-   'arm64': 'exp',
-   'm68k': 'dev',
+   'alpha': ('stable', '~arch'),
+   'arm':   ('stable', 'arch'),
+   'm68k':  ('exp', '~arch'),
+   's390':  ('exp', 'arch'),
}
-   self._test('* ~alpha ~arm ~arm64 ~m68k ~mips ~arm-linux', ops,
-  '* ~alpha arm ~arm64 ~m68k ~mips ~arm-linux', 
arch_status)
+   self._test('* ~alpha ~arm ~m68k ~mips ~s390 ~arm-linux', ops,
+  '* ~alpha arm ~m68k ~mips s390 ~arm-linux', 
arch_status)
 
def testAllUnstable(self):
ops = (
ekeyword.Op('~', 'all', None),
)
arch_status = {
-   'alpha': None,
-   'arm': 'stable',
-   'arm64': 'exp',
-   'm68k': 'dev',
-   's390': 'dev',
-   'sh': 'dev',
+   'alpha': ('stable', '~arch'),
+   'arm':   ('stable', 'arch'),
+   'm68k':  ('exp', '~arch'),
+   's390':  ('exp', 'arch'),
}
-   self._test('-* ~* * alpha arm arm64 m68k arm-linux', ops,
-  '-* ~* * ~alpha ~arm ~arm64 ~m68k ~arm-linux', 
arch_status)
+   self._test('-* ~* * alpha arm m68k s390 arm-linux', ops,
+  '-* ~* * ~alpha ~arm ~m68k ~s390 ~arm-linux', 
arch_status)
 
def testAllMultiUnstableStable(self):
ops = (
@@ -194,13 +192,13 @@ class TestProcessKeywords(unittest.TestCase):
ekeyword.Op(None, 'all', None),
)
arch_status = {
-   'alpha': None,
-   'arm': 'stable',
-   'arm64': 'exp',
-   'm68k': 'dev',
+   'alpha': ('stable', '~arch'),
+   'arm':   ('stable', 'arch'),
+   'm68k':  ('exp', '~arch'),
+   's390':  ('exp', 'arch'),
}
-   self._test('-* ~* * alpha arm arm64 m68k', ops,
-  '-* ~* * ~alpha arm ~arm64 ~m68k', arch_status)
+   self._test('-* ~* * alpha arm m68k s390', ops,
+  '-* ~* * ~alpha arm ~m68k s390', arch_status)
 
def testAllDisabled(self):
"""Make sure ~all does not change -arch to ~arch"""
-- 
2.26.2




[gentoo-portage-dev] [PATCH gentoolkit 1/3] ekeyword: Rename unit test so that it runs

2020-12-20 Thread Matt Turner
unittests should be named test_*.py so that they are discoverable.

Signed-off-by: Matt Turner 
---
 pym/gentoolkit/ekeyword/pytest.ini  | 2 +-
 .../ekeyword/{ekeyword_unittest.py => test_ekeyword.py} | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename pym/gentoolkit/ekeyword/{ekeyword_unittest.py => test_ekeyword.py} (99%)

diff --git a/pym/gentoolkit/ekeyword/pytest.ini 
b/pym/gentoolkit/ekeyword/pytest.ini
index 622c9d8..7e21bec 100644
--- a/pym/gentoolkit/ekeyword/pytest.ini
+++ b/pym/gentoolkit/ekeyword/pytest.ini
@@ -1,3 +1,3 @@
 [pytest]
 addopts = --cov
-python_files = *_unittest.py
+python_files = test_*.py
diff --git a/pym/gentoolkit/ekeyword/ekeyword_unittest.py 
b/pym/gentoolkit/ekeyword/test_ekeyword.py
similarity index 99%
rename from pym/gentoolkit/ekeyword/ekeyword_unittest.py
rename to pym/gentoolkit/ekeyword/test_ekeyword.py
index ef2e256..3d23585 100755
--- a/pym/gentoolkit/ekeyword/ekeyword_unittest.py
+++ b/pym/gentoolkit/ekeyword/test_ekeyword.py
@@ -12,7 +12,7 @@ import unittest
 
 import mock
 
-import ekeyword
+from gentoolkit.ekeyword import ekeyword
 
 
 TESTDIR = os.path.join(os.path.dirname(__file__), 'tests')
-- 
2.26.2




[gentoo-portage-dev] [PATCH gentoolkit 5/4] Remove unused sys imports

2020-12-20 Thread Matt Turner
Reported by flake8.

Signed-off-by: Matt Turner 
---
 pym/gentoolkit/eclean/exclude.py | 1 -
 pym/gentoolkit/enalyze/rebuild.py| 1 -
 pym/gentoolkit/helpers.py| 1 -
 pym/gentoolkit/revdep_rebuild/analyse.py | 1 -
 pym/gentoolkit/revdep_rebuild/cache.py   | 1 -
 pym/gentoolkit/revdep_rebuild/collect.py | 1 -
 pym/gentoolkit/test/test_keyword.py  | 1 -
 7 files changed, 7 deletions(-)

diff --git a/pym/gentoolkit/eclean/exclude.py b/pym/gentoolkit/eclean/exclude.py
index 45ecd52..1da9523 100644
--- a/pym/gentoolkit/eclean/exclude.py
+++ b/pym/gentoolkit/eclean/exclude.py
@@ -5,7 +5,6 @@
 
 
 import os
-import sys
 import re
 import portage
 from portage import _encodings, _unicode_encode
diff --git a/pym/gentoolkit/enalyze/rebuild.py 
b/pym/gentoolkit/enalyze/rebuild.py
index 3f3f4fd..c0ac8cb 100644
--- a/pym/gentoolkit/enalyze/rebuild.py
+++ b/pym/gentoolkit/enalyze/rebuild.py
@@ -11,7 +11,6 @@ what packages according to the Installed package database"""
 
 
 import os
-import sys
 
 import gentoolkit
 from gentoolkit.module_base import ModuleBase
diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index a979ca7..e7185c3 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -24,7 +24,6 @@ __docformat__ = 'epytext'
 # ===
 
 import os
-import sys
 import re
 from functools import partial
 from itertools import chain
diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py 
b/pym/gentoolkit/revdep_rebuild/analyse.py
index 3e46a51..bdd8306 100644
--- a/pym/gentoolkit/revdep_rebuild/analyse.py
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py
@@ -5,7 +5,6 @@
 import os
 import re
 import time
-import sys
 
 from portage import _encodings, _unicode_encode
 from portage.output import bold, blue, yellow, green
diff --git a/pym/gentoolkit/revdep_rebuild/cache.py 
b/pym/gentoolkit/revdep_rebuild/cache.py
index f8b7841..ab0b7d7 100644
--- a/pym/gentoolkit/revdep_rebuild/cache.py
+++ b/pym/gentoolkit/revdep_rebuild/cache.py
@@ -5,7 +5,6 @@ Functions for reading, saving and verifying the data caches
 
 from portage import os
 import time
-import sys
 
 from portage import _encodings, _unicode_encode
 from portage.output import red
diff --git a/pym/gentoolkit/revdep_rebuild/collect.py 
b/pym/gentoolkit/revdep_rebuild/collect.py
index 74a44f7..38ff48e 100644
--- a/pym/gentoolkit/revdep_rebuild/collect.py
+++ b/pym/gentoolkit/revdep_rebuild/collect.py
@@ -6,7 +6,6 @@ import re
 from portage import os
 import glob
 import stat
-import sys
 
 import portage
 from portage import _encodings, _unicode_encode
diff --git a/pym/gentoolkit/test/test_keyword.py 
b/pym/gentoolkit/test/test_keyword.py
index 99a79b5..8ba5e30 100644
--- a/pym/gentoolkit/test/test_keyword.py
+++ b/pym/gentoolkit/test/test_keyword.py
@@ -1,4 +1,3 @@
-import sys
 import unittest
 
 from gentoolkit import keyword
-- 
2.26.2




[gentoo-portage-dev] [PATCH gentoolkit 4/4] Remove inherits from object

2020-12-20 Thread Matt Turner
Signed-off-by: Matt Turner 
---
 pym/gentoolkit/cpv.py | 2 +-
 pym/gentoolkit/eclean/clean.py| 2 +-
 pym/gentoolkit/eclean/output.py   | 2 +-
 pym/gentoolkit/eclean/pkgindex.py | 2 +-
 pym/gentoolkit/eclean/search.py   | 2 +-
 pym/gentoolkit/enalyze/lib.py | 4 ++--
 pym/gentoolkit/equery/belongs.py  | 2 +-
 pym/gentoolkit/equery/check.py| 2 +-
 pym/gentoolkit/equery/depends.py  | 2 +-
 pym/gentoolkit/formatters.py  | 2 +-
 pym/gentoolkit/helpers.py | 4 ++--
 pym/gentoolkit/keyword.py | 2 +-
 pym/gentoolkit/metadata.py| 8 
 pym/gentoolkit/module_base.py | 2 +-
 pym/gentoolkit/package.py | 2 +-
 pym/gentoolkit/revdep_rebuild/analyse.py  | 2 +-
 pym/gentoolkit/revdep_rebuild/assign.py   | 2 +-
 pym/gentoolkit/test/eclean/creator.py | 2 +-
 pym/gentoolkit/test/eclean/distsupport.py | 6 +++---
 pym/gentoolkit/test/eclean/test_clean.py  | 2 +-
 pym/gentoolkit/versionmatch.py| 2 +-
 21 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/pym/gentoolkit/cpv.py b/pym/gentoolkit/cpv.py
index 563dab8..5238e24 100644
--- a/pym/gentoolkit/cpv.py
+++ b/pym/gentoolkit/cpv.py
@@ -37,7 +37,7 @@ isvalid_rev_re = re.compile(r'(\d+|0\d+\.\d+)')
 # Classes
 # ===
 
-class CPV(object):
+class CPV:
"""Provides methods on a category/package-version string.
 
Will also correctly split just a package or package-version string.
diff --git a/pym/gentoolkit/eclean/clean.py b/pym/gentoolkit/eclean/clean.py
index 2b750e3..3f6fe45 100644
--- a/pym/gentoolkit/eclean/clean.py
+++ b/pym/gentoolkit/eclean/clean.py
@@ -11,7 +11,7 @@ import gentoolkit.pprinter as pp
 from gentoolkit.eclean.pkgindex import PkgIndex
 
 
-class CleanUp(object):
+class CleanUp:
"""Performs all cleaning actions to distfiles or package directories.
 
@param controller: a progress output/user interaction controller 
function
diff --git a/pym/gentoolkit/eclean/output.py b/pym/gentoolkit/eclean/output.py
index 122d550..e2ed221 100644
--- a/pym/gentoolkit/eclean/output.py
+++ b/pym/gentoolkit/eclean/output.py
@@ -9,7 +9,7 @@ from portage.output import blue, yellow, teal, green, red
 from gentoolkit.pprinter import cpv, number
 
 
-class OutputControl(object):
+class OutputControl:
"""Outputs data according to predetermined options and handles any user
interaction.
 
diff --git a/pym/gentoolkit/eclean/pkgindex.py 
b/pym/gentoolkit/eclean/pkgindex.py
index 6cf9000..46c734d 100644
--- a/pym/gentoolkit/eclean/pkgindex.py
+++ b/pym/gentoolkit/eclean/pkgindex.py
@@ -13,7 +13,7 @@ from gentoolkit.eprefix import EPREFIX
 import portage
 
 
-class PkgIndex(object):
+class PkgIndex:
"""Handle the cleaning of the binpkg Package
Index file
 
diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py
index 992949c..8f6e52f 100644
--- a/pym/gentoolkit/eclean/search.py
+++ b/pym/gentoolkit/eclean/search.py
@@ -50,7 +50,7 @@ def get_distdir():
 distdir = get_distdir()
 
 
-class DistfilesSearch(object):
+class DistfilesSearch:
"""
 
@param output: verbose output method or (lambda x: None) to 
turn off
diff --git a/pym/gentoolkit/enalyze/lib.py b/pym/gentoolkit/enalyze/lib.py
index 8580bb7..50c7d11 100644
--- a/pym/gentoolkit/enalyze/lib.py
+++ b/pym/gentoolkit/enalyze/lib.py
@@ -17,7 +17,7 @@ from gentoolkit.flag import (reduce_flags, get_flags, 
get_all_cpv_use,
 import portage
 
 
-class FlagAnalyzer(object):
+class FlagAnalyzer:
"""Specialty functions for analysing an installed package's
USE flags.  Can be used for single or mulitple use without
needing to be reset unless the system USE flags are changed.
@@ -142,7 +142,7 @@ class FlagAnalyzer(object):
return _flags
 
 
-class KeywordAnalyser(object):
+class KeywordAnalyser:
"""Specialty functions for analysing the installed package db for
keyword useage and the packages that used them.
 
diff --git a/pym/gentoolkit/equery/belongs.py b/pym/gentoolkit/equery/belongs.py
index 8289366..1c9ab13 100644
--- a/pym/gentoolkit/equery/belongs.py
+++ b/pym/gentoolkit/equery/belongs.py
@@ -36,7 +36,7 @@ QUERY_OPTS = {
 # Classes
 # ===
 
-class BelongsPrinter(object):
+class BelongsPrinter:
"""Outputs a formatted list of packages that claim to own a files."""
 
def __init__(self, verbose=True, name_only=False):
diff --git a/pym/gentoolkit/equery/check.py b/pym/gentoolkit/equery/check.py
index e965164..47eba98 100644
--- a/pym/gentoolkit/equery/check.py
+++ b/pym/gentoolkit/equery/check.py
@@ -41,7 +41,7 @@ QUERY_OPTS = {
 # Classes
 # ===
 
-class VerifyContents(object):
+class VerifyContents:
&q

[gentoo-portage-dev] [PATCH gentoolkit 3/4] Remove Python < 3 version checks

2020-12-20 Thread Matt Turner
Signed-off-by: Matt Turner 
---
 pym/gentoolkit/eclean/exclude.py  |  2 --
 pym/gentoolkit/enalyze/rebuild.py |  2 --
 pym/gentoolkit/equery/uses.py |  2 --
 pym/gentoolkit/equery/which.py|  2 --
 pym/gentoolkit/helpers.py |  2 --
 pym/gentoolkit/profile.py |  3 ---
 pym/gentoolkit/revdep_rebuild/analyse.py  |  2 --
 pym/gentoolkit/revdep_rebuild/assign.py   |  6 --
 pym/gentoolkit/revdep_rebuild/cache.py|  7 +--
 pym/gentoolkit/revdep_rebuild/collect.py  | 10 +-
 pym/gentoolkit/revdep_rebuild/settings.py |  9 +
 pym/gentoolkit/test/eclean/creator.py |  2 --
 pym/gentoolkit/test/test_keyword.py   |  2 --
 13 files changed, 3 insertions(+), 48 deletions(-)

diff --git a/pym/gentoolkit/eclean/exclude.py b/pym/gentoolkit/eclean/exclude.py
index ee5e1e1..45ecd52 100644
--- a/pym/gentoolkit/eclean/exclude.py
+++ b/pym/gentoolkit/eclean/exclude.py
@@ -6,8 +6,6 @@
 
 import os
 import sys
-if sys.hexversion < 0x300:
-   from io import open
 import re
 import portage
 from portage import _encodings, _unicode_encode
diff --git a/pym/gentoolkit/enalyze/rebuild.py 
b/pym/gentoolkit/enalyze/rebuild.py
index 4ad571f..3f3f4fd 100644
--- a/pym/gentoolkit/enalyze/rebuild.py
+++ b/pym/gentoolkit/enalyze/rebuild.py
@@ -12,8 +12,6 @@ what packages according to the Installed package database"""
 
 import os
 import sys
-if sys.hexversion < 0x300:
-   from io import open
 
 import gentoolkit
 from gentoolkit.module_base import ModuleBase
diff --git a/pym/gentoolkit/equery/uses.py b/pym/gentoolkit/equery/uses.py
index 1260f56..dfb6f31 100644
--- a/pym/gentoolkit/equery/uses.py
+++ b/pym/gentoolkit/equery/uses.py
@@ -12,8 +12,6 @@ __docformat__ = 'epytext'
 
 import os
 import sys
-if sys.hexversion < 0x300:
-   from io import open
 
 from functools import partial
 from getopt import gnu_getopt, GetoptError
diff --git a/pym/gentoolkit/equery/which.py b/pym/gentoolkit/equery/which.py
index 326e692..c7fabd7 100644
--- a/pym/gentoolkit/equery/which.py
+++ b/pym/gentoolkit/equery/which.py
@@ -14,8 +14,6 @@ __docformat__ = 'epytext'
 
 import os
 import sys
-if sys.hexversion < 0x300:
-   from io import open
 from getopt import gnu_getopt, GetoptError
 
 
diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index b4cc795..02ac20e 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -25,8 +25,6 @@ __docformat__ = 'epytext'
 
 import os
 import sys
-if sys.hexversion < 0x300:
-   from io import open
 import re
 from functools import partial
 from itertools import chain
diff --git a/pym/gentoolkit/profile.py b/pym/gentoolkit/profile.py
index 01f823a..dcd02cc 100644
--- a/pym/gentoolkit/profile.py
+++ b/pym/gentoolkit/profile.py
@@ -15,9 +15,6 @@ import os.path
 import portage
 import sys
 
-if sys.hexversion < 0x300:
-   from io import open
-
 from portage import _encodings, _unicode_encode
 
 
diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py 
b/pym/gentoolkit/revdep_rebuild/analyse.py
index 4269ade..6ce1568 100644
--- a/pym/gentoolkit/revdep_rebuild/analyse.py
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py
@@ -6,8 +6,6 @@ import os
 import re
 import time
 import sys
-if sys.hexversion < 0x300:
-   from io import open
 
 from portage import _encodings, _unicode_encode
 from portage.output import bold, blue, yellow, green
diff --git a/pym/gentoolkit/revdep_rebuild/assign.py 
b/pym/gentoolkit/revdep_rebuild/assign.py
index 1e5f3e9..3fa9299 100644
--- a/pym/gentoolkit/revdep_rebuild/assign.py
+++ b/pym/gentoolkit/revdep_rebuild/assign.py
@@ -15,12 +15,6 @@ import portage
 from portage import portdb
 from portage.output import bold, red, yellow, green
 
-# Make all str conversions unicode
-try:
-   str = unicode
-except NameError:
-   pass
-
 
 class _file_matcher(object):
"""
diff --git a/pym/gentoolkit/revdep_rebuild/cache.py 
b/pym/gentoolkit/revdep_rebuild/cache.py
index 66fbd9d..f8b7841 100644
--- a/pym/gentoolkit/revdep_rebuild/cache.py
+++ b/pym/gentoolkit/revdep_rebuild/cache.py
@@ -6,11 +6,6 @@ Functions for reading, saving and verifying the data caches
 from portage import os
 import time
 import sys
-if sys.hexversion < 0x300:
-   from io import open
-   _unicode = unicode  # noqa
-else:
-   _unicode = str
 
 from portage import _encodings, _unicode_encode
 from portage.output import red
@@ -59,7 +54,7 @@ def save_cache(logger, to_save={}, 
temp_path=DEFAULTS['DEFAULT_TMP_DIR']):
try:
_file = open(_unicode_encode(os.path.join(temp_path, 
'timestamp'),
encoding=_encodings['fs']), mode='w', 
encoding=_encodings['content'])
-   _file.write(_unicode(int(time.time(
+   _file.write(str(int(time.time(
_file.close()
 
for key,val in to_sa

[gentoo-portage-dev] [PATCH gentoolkit 2/4] Remove $Header$

2020-12-20 Thread Matt Turner
Signed-off-by: Matt Turner 
---
 bin/ekeyword  | 2 --
 bin/enalyze   | 2 --
 bin/epkginfo  | 2 --
 bin/equery| 2 --
 bin/euse  | 2 --
 bin/imlate| 2 --
 bin/revdep-rebuild| 2 --
 pym/gentoolkit/__init__.py| 2 --
 pym/gentoolkit/atom.py| 2 --
 pym/gentoolkit/base.py| 2 --
 pym/gentoolkit/cpv.py | 2 --
 pym/gentoolkit/dbapi.py   | 2 --
 pym/gentoolkit/dependencies.py| 2 --
 pym/gentoolkit/ekeyword/Makefile  | 2 --
 pym/gentoolkit/enalyze/__init__.py| 2 --
 pym/gentoolkit/equery/__init__.py | 2 --
 pym/gentoolkit/equery/belongs.py  | 2 --
 pym/gentoolkit/equery/changes.py  | 2 --
 pym/gentoolkit/equery/check.py| 2 --
 pym/gentoolkit/equery/depends.py  | 2 --
 pym/gentoolkit/equery/depgraph.py | 2 --
 pym/gentoolkit/equery/files.py| 2 --
 pym/gentoolkit/equery/has.py  | 2 --
 pym/gentoolkit/equery/hasuse.py   | 2 --
 pym/gentoolkit/equery/list_.py| 2 --
 pym/gentoolkit/equery/meta.py | 2 --
 pym/gentoolkit/equery/size.py | 2 --
 pym/gentoolkit/equery/uses.py | 2 --
 pym/gentoolkit/equery/which.py| 2 --
 pym/gentoolkit/formatters.py  | 2 --
 pym/gentoolkit/helpers.py | 2 --
 pym/gentoolkit/keyword.py | 2 --
 pym/gentoolkit/metadata.py| 2 --
 pym/gentoolkit/module_base.py | 2 --
 pym/gentoolkit/package.py | 2 --
 pym/gentoolkit/pprinter.py| 2 --
 pym/gentoolkit/query.py   | 2 --
 pym/gentoolkit/sets.py| 2 --
 pym/gentoolkit/test/__init__.py   | 2 --
 pym/gentoolkit/test/eclean/__init__.py| 2 --
 pym/gentoolkit/test/eclean/creator.py | 2 --
 pym/gentoolkit/test/eclean/distsupport.py | 2 --
 pym/gentoolkit/test/eclean/test_clean.py  | 2 --
 pym/gentoolkit/test/eclean/test_search.py | 2 --
 pym/gentoolkit/test/equery/__init__.py| 2 --
 pym/gentoolkit/test/test_atom.py  | 2 --
 pym/gentoolkit/test/test_cpv.py   | 2 --
 pym/gentoolkit/versionmatch.py| 2 --
 48 files changed, 96 deletions(-)

diff --git a/bin/ekeyword b/bin/ekeyword
index 2e3c78e..8767fe3 100755
--- a/bin/ekeyword
+++ b/bin/ekeyword
@@ -2,8 +2,6 @@
 #
 # Copyright 2002-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2 or later
-#
-# $Header$
 
 """Manage KEYWORDS in ebuilds easily.
 
diff --git a/bin/enalyze b/bin/enalyze
index a0bb29a..9e27bed 100755
--- a/bin/enalyze
+++ b/bin/enalyze
@@ -3,8 +3,6 @@
 # Copyright 2010 Brian Dolbec 
 # Copyright 2002-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2 or later
-#
-# $Header$
 
 """'enalyze' is a flexible utility for Gentoo linux which can display various
 information about installed packages, such as the USE flags used and the
diff --git a/bin/epkginfo b/bin/epkginfo
index 4f87176..5d3aab2 100755
--- a/bin/epkginfo
+++ b/bin/epkginfo
@@ -2,8 +2,6 @@
 #
 # Copyright 2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2 or later
-#
-# $Header$
 
 """Shortcut to equery meta"""
 
diff --git a/bin/equery b/bin/equery
index 77371d1..386194d 100755
--- a/bin/equery
+++ b/bin/equery
@@ -2,8 +2,6 @@
 #
 # Copyright 2002-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2 or later
-#
-# $Header$
 
 """equery is a flexible utility for Gentoo linux which can display various
 information about packages, such as the files they own, their USE flags,
diff --git a/bin/euse b/bin/euse
index 263d0f2..c3b6638 100755
--- a/bin/euse
+++ b/bin/euse
@@ -2,8 +2,6 @@
 # Disable globbing because "-*" and such is valid as a use flag.
 set -f
 
-# $Header$
-
 # bash replacement for the original euse by Arun Bhanu
 # Author: Marius Mauch 
 # Jared Hancock (Signigicant rewrite for package.use support)
diff --git a/bin/imlate b/bin/imlate
index 040d19e..cd4f7ab 100755
--- a/bin/imlate
+++ b/bin/imlate
@@ -2,8 +2,6 @@
 #
 # Copyright 2002-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2 or later
-#
-# $Header$
 
 """Manage KEYWORDS in ebuilds easily.
 
diff --git a/bin/revdep-rebuild b/bin/revdep-rebuild
index 24d349e..51783c5 100755
--- a/bin/revdep-rebuild
+++ b/bin/revdep-rebuild
@@ -3,8 +3,6 @@
 # Copyright 2010 Brian Dolbec 
 # Copyright 2002-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2 or later
-#
-# $Header$
 
 """'r

[gentoo-portage-dev] [PATCH gentoolkit 1/4] Remove imports from __future__

2020-12-20 Thread Matt Turner
gentoolkit supports only Python 3.6+ now, so these are not used.

Signed-off-by: Matt Turner 
---
 bin/eclean   | 3 ---
 bin/eclean-dist  | 3 ---
 bin/eclean-pkg   | 3 ---
 bin/ekeyword | 2 --
 bin/enalyze  | 2 --
 bin/epkginfo | 2 --
 bin/equery   | 2 --
 bin/euse | 8 
 bin/imlate   | 2 --
 bin/revdep-rebuild   | 2 --
 pym/gentoolkit/base.py   | 2 --
 pym/gentoolkit/dbapi.py  | 2 --
 pym/gentoolkit/eclean/clean.py   | 3 ---
 pym/gentoolkit/eclean/cli.py | 3 ---
 pym/gentoolkit/eclean/exclude.py | 3 ---
 pym/gentoolkit/eclean/output.py  | 3 ---
 pym/gentoolkit/eclean/pkgindex.py| 3 ---
 pym/gentoolkit/eclean/search.py  | 3 ---
 pym/gentoolkit/ekeyword/ekeyword.py  | 2 --
 pym/gentoolkit/ekeyword/ekeyword_unittest.py | 2 --
 pym/gentoolkit/enalyze/analyze.py| 2 --
 pym/gentoolkit/enalyze/output.py | 2 --
 pym/gentoolkit/enalyze/rebuild.py| 3 ---
 pym/gentoolkit/eprefix.py| 2 --
 pym/gentoolkit/equery/__init__.py| 2 --
 pym/gentoolkit/equery/belongs.py | 2 --
 pym/gentoolkit/equery/changes.py | 2 --
 pym/gentoolkit/equery/check.py   | 2 --
 pym/gentoolkit/equery/depends.py | 2 --
 pym/gentoolkit/equery/depgraph.py| 2 --
 pym/gentoolkit/equery/files.py   | 2 --
 pym/gentoolkit/equery/has.py | 2 --
 pym/gentoolkit/equery/hasuse.py  | 2 --
 pym/gentoolkit/equery/list_.py   | 2 --
 pym/gentoolkit/equery/meta.py| 2 --
 pym/gentoolkit/equery/size.py| 2 --
 pym/gentoolkit/equery/uses.py| 2 --
 pym/gentoolkit/equery/which.py   | 2 --
 pym/gentoolkit/eshowkw/keywords_header.py| 2 --
 pym/gentoolkit/imlate/imlate.py  | 3 ---
 pym/gentoolkit/module_base.py| 2 --
 pym/gentoolkit/revdep_rebuild/analyse.py | 2 --
 pym/gentoolkit/revdep_rebuild/assign.py  | 2 --
 pym/gentoolkit/revdep_rebuild/cache.py   | 2 --
 pym/gentoolkit/revdep_rebuild/collect.py | 2 --
 pym/gentoolkit/revdep_rebuild/rebuild.py | 2 --
 pym/gentoolkit/revdep_rebuild/settings.py| 2 --
 pym/gentoolkit/revdep_rebuild/stuff.py   | 2 --
 pym/gentoolkit/test/eclean/creator.py| 3 ---
 pym/gentoolkit/test/eclean/distsupport.py| 2 --
 pym/gentoolkit/test/eclean/test_clean.py | 2 --
 pym/gentoolkit/test/eclean/test_search.py| 3 ---
 setup.py | 3 ---
 53 files changed, 4 insertions(+), 122 deletions(-)

diff --git a/bin/eclean b/bin/eclean
index 715787b..90f9e55 100755
--- a/bin/eclean
+++ b/bin/eclean
@@ -4,9 +4,6 @@
 Distributed under the terms of the GNU General Public License v2
 """
 
-from __future__ import print_function
-
-
 # Meta:
 __author__ = "Thomas de Grenier de Latour (tgl), " + \
"modular re-write by: Brian Dolbec (dol-sen)"
diff --git a/bin/eclean-dist b/bin/eclean-dist
index 715787b..90f9e55 100755
--- a/bin/eclean-dist
+++ b/bin/eclean-dist
@@ -4,9 +4,6 @@
 Distributed under the terms of the GNU General Public License v2
 """
 
-from __future__ import print_function
-
-
 # Meta:
 __author__ = "Thomas de Grenier de Latour (tgl), " + \
"modular re-write by: Brian Dolbec (dol-sen)"
diff --git a/bin/eclean-pkg b/bin/eclean-pkg
index 715787b..90f9e55 100755
--- a/bin/eclean-pkg
+++ b/bin/eclean-pkg
@@ -4,9 +4,6 @@
 Distributed under the terms of the GNU General Public License v2
 """
 
-from __future__ import print_function
-
-
 # Meta:
 __author__ = "Thomas de Grenier de Latour (tgl), " + \
"modular re-write by: Brian Dolbec (dol-sen)"
diff --git a/bin/ekeyword b/bin/ekeyword
index 72b3f95..2e3c78e 100755
--- a/bin/ekeyword
+++ b/bin/ekeyword
@@ -13,8 +13,6 @@ the current list as they appear, and ebuilds are processed as 
they appear.
 
 """
 
-from __future__ import print_function
-
 import os
 import sys
 # This block ensures that ^C interrupts are handled quietly.
diff --git a/bin/enalyze b/bin/enalyze
index 5991f60..a0bb29a 100755
--- a/bin/enalyze
+++ b/bin/enalyze
@@ -12,8 +12,6 @@ packages that use them.  It can also be used to help rebuild 
/etc/portage/packag
 files in the event of corruption, and possibly more.
 """
 
-from __future__ import print_function
-
 import sys
 # This block ensures that ^C interrupts are handled quietly.
 try:
diff --git a/bin/epkginfo b/bin/epkginfo
index 75a2f3f..4f87176

[gentoo-dev] [PATCH] gnome2.eclass: Add EAPI=7 support

2020-12-06 Thread Matt Turner
Closes: https://bugs.gentoo.org/658638
Closes: https://bugs.gentoo.org/717100
Signed-off-by: Matt Turner 
---
leio noted that banning GNOME2_LA_PUNT from EAPI 7 would mean adding

src_install() { gnome2_src_install }

to a bunch of ebuilds, which we don't want to do. Implement
GNOME2_LA_PUNT with find ... -delete in EAPI 7.

 eclass/gnome2.eclass | 29 ++---
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 341802f8c80..27ea9f96c0d 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: gnome2.eclass
 # @MAINTAINER:
 # gn...@gentoo.org
-# @SUPPORTED_EAPIS: 5 6
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Provides phases for Gnome/Gtk+ based packages.
 # @DESCRIPTION:
 # Exports portage base functions used by ebuilds written for packages using the
@@ -17,13 +17,14 @@
 GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
 
 [[ ${GNOME2_EAUTORECONF} == 'yes' ]] && inherit autotools
-inherit eutils libtool ltprune gnome.org gnome2-utils xdg
+[[ ${EAPI} == [56] ]] && inherit eutils ltprune
+inherit libtool gnome.org gnome2-utils xdg
 
 case ${EAPI:-0} in
5)
EXPORT_FUNCTIONS src_unpack src_prepare src_configure 
src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
-   6)
+   6|7)
EXPORT_FUNCTIONS src_prepare src_configure src_compile 
src_install pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
@@ -70,8 +71,8 @@ fi
 
 # @ECLASS-VARIABLE: GNOME2_LA_PUNT
 # @DESCRIPTION:
-# It relies on prune_libtool_files (from ltprune.eclass)
-# for this. Available values for GNOME2_LA_PUNT:
+# In EAPIs 5 and 6, it relies on prune_libtool_files (from ltprune.eclass) for
+# this. Later EAPIs use find ... -delete. Available values for GNOME2_LA_PUNT:
 # - "no": will not clean any .la files
 # - "yes": will run prune_libtool_files --modules
 # - If it is not set, it will run prune_libtool_files
@@ -85,7 +86,7 @@ gnome2_src_unpack() {
unpack ${A}
cd "${S}"
else
-   die "gnome2_src_unpack is banned from eapi6"
+   die "gnome2_src_unpack is banned since eapi6"
fi
 }
 
@@ -264,11 +265,17 @@ gnome2_src_install() {
rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
 
# Delete all .la files
-   case "${GNOME2_LA_PUNT}" in
-   yes)prune_libtool_files --modules;;
-   no) ;;
-   *)  prune_libtool_files;;
-   esac
+   if has ${EAPI} 5 6; then
+   case "${GNOME2_LA_PUNT}" in
+   yes)prune_libtool_files --modules;;
+   no) ;;
+   *)  prune_libtool_files;;
+   esac
+   else
+   if [[ ${GNOME2_LA_PUNT} != 'no' ]]; then
+   find "${ED}" -name '*.la' -delete || die
+   fi
+   fi
 }
 
 # @FUNCTION: gnome2_pkg_preinst
-- 
2.26.2




[gentoo-dev] [PATCH] gnome2.eclass: Add EAPI=7 support

2020-12-06 Thread Matt Turner
Closes: https://bugs.gentoo.org/717100
Signed-off-by: Matt Turner 
---
leio noted that the previous patch would potentially change the
installed .la files in EAPI 5 and 6 ebuilds. So just continue using
ltprune in those EAPIs and ban GNOME2_LA_PUNT in EAPI 7.

 eclass/gnome2.eclass | 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 341802f8c80..546438f289c 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: gnome2.eclass
 # @MAINTAINER:
 # gn...@gentoo.org
-# @SUPPORTED_EAPIS: 5 6
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Provides phases for Gnome/Gtk+ based packages.
 # @DESCRIPTION:
 # Exports portage base functions used by ebuilds written for packages using the
@@ -17,13 +17,14 @@
 GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
 
 [[ ${GNOME2_EAUTORECONF} == 'yes' ]] && inherit autotools
-inherit eutils libtool ltprune gnome.org gnome2-utils xdg
+[[ ${EAPI} == [56] ]] && inherit eutils ltprune
+inherit libtool gnome.org gnome2-utils xdg
 
 case ${EAPI:-0} in
5)
EXPORT_FUNCTIONS src_unpack src_prepare src_configure 
src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
-   6)
+   6|7)
EXPORT_FUNCTIONS src_prepare src_configure src_compile 
src_install pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
@@ -75,7 +76,14 @@ fi
 # - "no": will not clean any .la files
 # - "yes": will run prune_libtool_files --modules
 # - If it is not set, it will run prune_libtool_files
-GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
+# Banned since eapi7.
+if has ${EAPI} 5 6; then
+   GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
+elif [[ -n $GNOME_LA_PUNT ]]; then
+   die "GNOME2_LA_PUNT is banned since eapi7"
+else
+   GNOME2_LA_PUNT="no"
+fi
 
 # @FUNCTION: gnome2_src_unpack
 # @DESCRIPTION:
@@ -85,7 +93,7 @@ gnome2_src_unpack() {
unpack ${A}
cd "${S}"
else
-   die "gnome2_src_unpack is banned from eapi6"
+   die "gnome2_src_unpack is banned since eapi6"
fi
 }
 
-- 
2.26.2




[gentoo-dev] [PATCH] gnome2.eclass: Add EAPI=7 support

2020-12-06 Thread Matt Turner
Mostly by porting away from ltprune.eclass.

Signed-off-by: Matt Turner 
---
 eclass/gnome2.eclass | 19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 341802f8c80..4d8dc6c08d6 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: gnome2.eclass
 # @MAINTAINER:
 # gn...@gentoo.org
-# @SUPPORTED_EAPIS: 5 6
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Provides phases for Gnome/Gtk+ based packages.
 # @DESCRIPTION:
 # Exports portage base functions used by ebuilds written for packages using the
@@ -17,13 +17,14 @@
 GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
 
 [[ ${GNOME2_EAUTORECONF} == 'yes' ]] && inherit autotools
-inherit eutils libtool ltprune gnome.org gnome2-utils xdg
+[[ ${EAPI} == [56] ]] && inherit eutils
+inherit libtool gnome.org gnome2-utils xdg
 
 case ${EAPI:-0} in
5)
EXPORT_FUNCTIONS src_unpack src_prepare src_configure 
src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
-   6)
+   6|7)
EXPORT_FUNCTIONS src_prepare src_configure src_compile 
src_install pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
@@ -70,12 +71,11 @@ fi
 
 # @ECLASS-VARIABLE: GNOME2_LA_PUNT
 # @DESCRIPTION:
-# It relies on prune_libtool_files (from ltprune.eclass)
-# for this. Available values for GNOME2_LA_PUNT:
+# Available values for GNOME2_LA_PUNT:
 # - "no": will not clean any .la files
-# - "yes": will run prune_libtool_files --modules
-# - If it is not set, it will run prune_libtool_files
-GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
+# - "yes": will run "find "${ED}" -name '*.la' -delete"
+# - If it is not set, it will prune libtool files
+GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"yes"}
 
 # @FUNCTION: gnome2_src_unpack
 # @DESCRIPTION:
@@ -265,9 +265,8 @@ gnome2_src_install() {
 
# Delete all .la files
case "${GNOME2_LA_PUNT}" in
-   yes)prune_libtool_files --modules;;
no) ;;
-   *)  prune_libtool_files;;
+   *)  find "${ED}" -name '*.la' -delete || die;;
esac
 }
 
-- 
2.26.2




[gentoo-dev] [PATCH] gnome2-utils.eclass: Drop EAPI < 5 support

2020-12-06 Thread Matt Turner
Closes: https://bugs.gentoo.org/566728
Signed-off-by: Matt Turner 
---
 eclass/gnome2-utils.eclass | 25 +++--
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 06643db0f60..bc1f8f20777 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: gnome2-utils.eclass
 # @MAINTAINER:
 # gn...@gentoo.org
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Auxiliary functions commonly used by Gnome packages.
 # @DESCRIPTION:
 # This eclass provides a set of auxiliary functions needed by most Gnome
@@ -14,13 +14,13 @@
 #  * GConf schemas management
 #  * scrollkeeper (old Gnome help system) management
 
-[[ ${EAPI:-0} == [012345] ]] && inherit multilib
+[[ ${EAPI} == 5 ]] && inherit multilib
 # eutils.eclass: emktemp
 # xdg-utils.eclass: xdg_environment_reset, xdg_icon_cache_update
 inherit eutils xdg-utils
 
-case "${EAPI:-0}" in
-   0|1|2|3|4|5|6|7) ;;
+case ${EAPI} in
+   5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -95,7 +95,7 @@ gnome2_environment_reset() {
# Ensure we don't rely on dconf/gconf while building, bug #511946
export GSETTINGS_BACKEND="memory"
 
-   if has ${EAPI:-0} 6 7; then
+   if has ${EAPI} 6 7; then
# Try to cover the packages honoring this variable, bug #508124
export GST_INSPECT="$(type -P true)"
 
@@ -110,7 +110,6 @@ gnome2_environment_reset() {
 # in the GNOME2_ECLASS_SCHEMAS environment variable.
 # This function should be called from pkg_preinst.
 gnome2_gconf_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_SCHEMAS=$(find 'etc/gconf/schemas/' -name 
'*.schemas' 2> /dev/null)
popd > /dev/null || die
@@ -122,7 +121,6 @@ gnome2_gconf_savelist() {
 # using gconftool-2.
 # This function should be called from pkg_postinst.
 gnome2_gconf_install() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
@@ -163,7 +161,6 @@ gnome2_gconf_install() {
 # Removes schema files previously installed by the current ebuild from Gconf's
 # database.
 gnome2_gconf_uninstall() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
@@ -255,7 +252,6 @@ gnome2_omf_fix() {
 # in the GNOME2_ECLASS_SCROLLS environment variable.
 # This function should be called from pkg_preinst.
 gnome2_scrollkeeper_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_SCROLLS=$(find 'usr/share/omf' -type f -name 
"*.omf" 2> /dev/null)
popd > /dev/null || die
@@ -266,7 +262,6 @@ gnome2_scrollkeeper_savelist() {
 # Updates the global scrollkeeper database.
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_scrollkeeper_update() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
 
if [[ ! -x "${updater}" ]] ; then
@@ -291,7 +286,6 @@ gnome2_scrollkeeper_update() {
 # implementations that call gnome2_schemas_update conditionally.
 # This function should be called from pkg_preinst.
 gnome2_schemas_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_GLIB_SCHEMAS=$(find 'usr/share/glib-2.0/schemas' 
-name '*.gschema.xml' 2>/dev/null)
popd > /dev/null || die
@@ -302,7 +296,6 @@ gnome2_schemas_savelist() {
 # Updates GSettings schemas.
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_schemas_update() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
 
if [[ ! -x ${updater} ]]; then
@@ -321,7 +314,6 @@ gnome2_schemas_update() {
 # GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
 # This function should be called from pkg_preinst.
 gnome2_gdk_pixbuf_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find usr/lib*/gdk-pixbuf-2.0 
-type f 2>/dev/null)
popd > /dev/null || die
@@ -332,7 +324,6 @@ gnome2_gdk_pixbuf_savelist() {
 # Updates gdk-pixbuf loader

[gentoo-dev] [PATCH] gnome2-utils: Drop EAPI < 5 support

2020-12-05 Thread Matt Turner
Closes: https://bugs.gentoo.org/566728
Signed-off-by: Matt Turner 
---
 eclass/gnome2-utils.eclass | 21 +
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 06643db0f60..e32449890dd 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: gnome2-utils.eclass
 # @MAINTAINER:
 # gn...@gentoo.org
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Auxiliary functions commonly used by Gnome packages.
 # @DESCRIPTION:
 # This eclass provides a set of auxiliary functions needed by most Gnome
@@ -14,14 +14,14 @@
 #  * GConf schemas management
 #  * scrollkeeper (old Gnome help system) management
 
-[[ ${EAPI:-0} == [012345] ]] && inherit multilib
+[[ ${EAPI:-0} == [5] ]] && inherit multilib
 # eutils.eclass: emktemp
 # xdg-utils.eclass: xdg_environment_reset, xdg_icon_cache_update
 inherit eutils xdg-utils
 
 case "${EAPI:-0}" in
-   0|1|2|3|4|5|6|7) ;;
-   *) die "EAPI=${EAPI} is not supported" ;;
+   5|6|7) ;;
+   0|1|2|3|4) die "EAPI=${EAPI} is not supported" ;;
 esac
 
 # @ECLASS-VARIABLE: GCONFTOOL_BIN
@@ -110,7 +110,6 @@ gnome2_environment_reset() {
 # in the GNOME2_ECLASS_SCHEMAS environment variable.
 # This function should be called from pkg_preinst.
 gnome2_gconf_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_SCHEMAS=$(find 'etc/gconf/schemas/' -name 
'*.schemas' 2> /dev/null)
popd > /dev/null || die
@@ -122,7 +121,6 @@ gnome2_gconf_savelist() {
 # using gconftool-2.
 # This function should be called from pkg_postinst.
 gnome2_gconf_install() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
@@ -163,7 +161,6 @@ gnome2_gconf_install() {
 # Removes schema files previously installed by the current ebuild from Gconf's
 # database.
 gnome2_gconf_uninstall() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
@@ -255,7 +252,6 @@ gnome2_omf_fix() {
 # in the GNOME2_ECLASS_SCROLLS environment variable.
 # This function should be called from pkg_preinst.
 gnome2_scrollkeeper_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_SCROLLS=$(find 'usr/share/omf' -type f -name 
"*.omf" 2> /dev/null)
popd > /dev/null || die
@@ -266,7 +262,6 @@ gnome2_scrollkeeper_savelist() {
 # Updates the global scrollkeeper database.
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_scrollkeeper_update() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
 
if [[ ! -x "${updater}" ]] ; then
@@ -291,7 +286,6 @@ gnome2_scrollkeeper_update() {
 # implementations that call gnome2_schemas_update conditionally.
 # This function should be called from pkg_preinst.
 gnome2_schemas_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_GLIB_SCHEMAS=$(find 'usr/share/glib-2.0/schemas' 
-name '*.gschema.xml' 2>/dev/null)
popd > /dev/null || die
@@ -302,7 +296,6 @@ gnome2_schemas_savelist() {
 # Updates GSettings schemas.
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_schemas_update() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
 
if [[ ! -x ${updater} ]]; then
@@ -321,7 +314,6 @@ gnome2_schemas_update() {
 # GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
 # This function should be called from pkg_preinst.
 gnome2_gdk_pixbuf_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find usr/lib*/gdk-pixbuf-2.0 
-type f 2>/dev/null)
popd > /dev/null || die
@@ -332,7 +324,6 @@ gnome2_gdk_pixbuf_savelist() {
 # Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_gdk_pixbuf_update() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}/usr/bin/${CHOST}-gdk-pixb

[gentoo-dev] [PATCH] gnome2.eclass: Drop EAPI=4 support

2020-12-05 Thread Matt Turner
Closes: https://bugs.gentoo.org/596674
Signed-off-by: Matt Turner 
---
 eclass/gnome2.eclass | 82 
 1 file changed, 22 insertions(+), 60 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 1a4ff451df3..9c2428532a9 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: gnome2.eclass
 # @MAINTAINER:
 # gn...@gentoo.org
-# @SUPPORTED_EAPIS: 4 5 6
+# @SUPPORTED_EAPIS: 5 6
 # @BLURB: Provides phases for Gnome/Gtk+ based packages.
 # @DESCRIPTION:
 # Exports portage base functions used by ebuilds written for packages using the
@@ -20,7 +20,7 @@ GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
 inherit eutils libtool ltprune gnome.org gnome2-utils xdg
 
 case "${EAPI:-0}" in
-   4|5)
+   5)
EXPORT_FUNCTIONS src_unpack src_prepare src_configure 
src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
6)
@@ -29,13 +29,6 @@ case "${EAPI:-0}" in
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
-# @ECLASS-VARIABLE: DOCS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# String containing documents passed to dodoc command for eapi4.
-# In eapi5 we rely on einstalldocs (from eutils.eclass) and for newer EAPIs we
-# follow PMS spec.
-
 # @ECLASS-VARIABLE: ELTCONF
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -48,7 +41,7 @@ ELTCONF=${ELTCONF:-""}
 # Extra configure opts passed to econf.
 # Deprecated, pass extra arguments to gnome2_src_configure.
 # Banned in eapi6 and newer.
-if has ${EAPI:-0} 4 5; then
+if has ${EAPI:-0} 5; then
G2CONF=${G2CONF:-""}
 fi
 
@@ -64,7 +57,7 @@ fi
 #
 # Banned since eapi6 as upstream is moving away from this obsolete macro in 
favor
 # of autoconf-archive macros, that do not expose this issue (bug #270919)
-if has ${EAPI:-0} 4 5; then
+if has ${EAPI:-0} 5; then
if [[ ${GCONF_DEBUG} != "no" ]]; then
IUSE="debug"
fi
@@ -77,23 +70,18 @@ fi
 
 # @ECLASS-VARIABLE: GNOME2_LA_PUNT
 # @DESCRIPTION:
-# For eapi4 it sets if we should delete ALL or none of the .la files
-# For eapi5 and newer it relies on prune_libtool_files (from eutils.eclass)
+# It relies on prune_libtool_files (from ltprune.eclass)
 # for this. Available values for GNOME2_LA_PUNT:
 # - "no": will not clean any .la files
 # - "yes": will run prune_libtool_files --modules
 # - If it is not set, it will run prune_libtool_files
-if has ${EAPI:-0} 4; then
-   GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"}
-else
-   GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
-fi
+GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
 
 # @FUNCTION: gnome2_src_unpack
 # @DESCRIPTION:
 # Stub function for old EAPI.
 gnome2_src_unpack() {
-   if has ${EAPI:-0} 4 5; then
+   if has ${EAPI:-0} 5; then
unpack ${A}
cd "${S}"
else
@@ -115,7 +103,7 @@ gnome2_src_prepare() {
# We stop to run it from eapi6 as scrollkeeper helpers from
# rarian are not running anything and, then, access violations
# shouldn't occur.
-   has ${EAPI:-0} 4 5 && gnome2_omf_fix
+   has ${EAPI:-0} 5 && gnome2_omf_fix
 
# Disable all deprecation warnings
gnome2_disable_deprecation_warning
@@ -135,7 +123,7 @@ gnome2_src_prepare() {
 gnome2_src_configure() {
# Deprecated for a long time now and banned since eapi6, see Gnome team 
policies
if [[ -n ${G2CONF} ]] ; then
-   if has ${EAPI:-0} 4 5; then
+   if has ${EAPI:-0} 5; then
eqawarn "G2CONF set, please review documentation at 
https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure;
else
die "G2CONF set, please review documentation at 
https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure;
@@ -144,7 +132,7 @@ gnome2_src_configure() {
 
local g2conf=()
 
-   if has ${EAPI:-0} 4 5; then
+   if has ${EAPI:-0} 5; then
if [[ ${GCONF_DEBUG} != 'no' ]] ; then
if use debug ; then
g2conf+=( --enable-debug=yes )
@@ -164,11 +152,7 @@ gnome2_src_configure() {
# rebuild docs.
# Preserve old behavior for older EAPI.
if grep -q "enable-gtk-doc" "${ECONF_SOURCE:-.}"/configure ; then
-   if has ${EAPI:-0} 4 && in_iuse doc ; then
-   g2conf+=( $(use_enable doc gtk-doc) )
-   else
-   g2conf+=( --disable-gtk-doc )
-   fi
+   g2conf+=( --disable-gtk-doc )
fi
 
# Pass --disable-maintainer-mode when needed
@@ -182,13 +166,6 @@ gnome2_src_configure() {
g2conf+=( --disable-scrollkeeper )
fi
 
-   # Pa

[gentoo-dev] Last Rites: sys-apps/hwsetup, sys-apps/hwdata-gentoo, sys-libs/libkudzu

2020-11-19 Thread Matt Turner

# Matt Turner  (2020-11-19)
# Ancient packages long since deprecated in the age of udev.
# Removal in 30 days. Bug #755617
sys-apps/hwdata-gentoo
sys-apps/hwsetup
sys-libs/libkudzu


signature.asc
Description: PGP signature


[gentoo-dev] Last Rites: media-fonts/mathematica-fonts

2020-11-08 Thread Matt Turner

# Matt Turner  (2020-11-08)
# Uninstallable because of fetch restriction and dead download link.
# Removal in 30 days.  Bug #725646.
media-fonts/mathematica-fonts


signature.asc
Description: PGP signature


Re: [gentoo-dev] LiveCD Project disbanding: packages up for grabs

2020-11-06 Thread Matt Turner
On Fri, Nov 6, 2020 at 7:24 PM Patrick McLean  wrote:
>
> On Wed, 4 Nov 2020 16:09:37 -0500
> Matt Turner  wrote:
>
> > The LiveCD project is only me now, which isn't much of a project, so
> > I'm putting these packages up for grabs. livecd@ is co-maintainer on a
> > few others that aren't listed.
> >
> > app-misc/livecd-tools
> >
> >   - Releng@ will take this
> >
> > sys-libs/libkudzu
> > sys-apps/hwdata-gentoo
> > sys-apps/hwsetup
> >
> >   - These are used on the Live CDs, but I don't know if they actually
> > do anything useful.
> >   - Releng@ will take them with the understanding that I might remove
> > them from the tree.
> >
> > dev-python/pyparted
> > dev-util/dialog
> > sys-block/parted
> > sys-fs/squashfs-tools
> > x11-themes/gentoo-artwork-livecd
>
> Please do not remove pyparted, parted or squashfs-tools these are most
> certainly useful. I will maintain them if RelEng does not want them.

I'm not planning to...?

The comment about "I might remove them from the tree" was in reference
to the packages above it: libkudzu, hwdata-gentoo, and hwsetup.



Re: [gentoo-dev] New QA policy suggestion: Disallow "live-only" packages

2020-11-04 Thread Matt Turner
On Tue, Nov 3, 2020 at 12:13 AM Joonas Niilola  wrote:
> I'm suggesting a new QA policy to disallow any "live-ebuild-only
> packages" being hosted in ::gentoo.

Is there value in making snapshots of app-portage/no-distcc-env?

I don't really think so, and that's why I didn't do it. Should I reconsider?



[gentoo-dev] LiveCD Project disbanding: packages up for grabs

2020-11-04 Thread Matt Turner
The LiveCD project is only me now, which isn't much of a project, so
I'm putting these packages up for grabs. livecd@ is co-maintainer on a
few others that aren't listed.

app-misc/livecd-tools

  - Releng@ will take this

sys-libs/libkudzu
sys-apps/hwdata-gentoo
sys-apps/hwsetup

  - These are used on the Live CDs, but I don't know if they actually
do anything useful.
  - Releng@ will take them with the understanding that I might remove
them from the tree.

dev-python/pyparted
dev-util/dialog
sys-block/parted
sys-fs/squashfs-tools
x11-themes/gentoo-artwork-livecd



[gentoo-dev] [PATCH 1/2] xorg-3.eclass: Drop font IUSE=nls handling

2020-10-01 Thread Matt Turner
The previous logic incorrectly added IUSE=nls for font-bitstream-100dpi,
font-bitstream-75dpi, font-cronyx-cyrillic, font-misc-cyrillic,
font-screen-cyrillic, and font-winitzki-cyrillic. This caused
"QA Notice: Unrecognized configure options: ..." with USE=-nls.

Instead, we'll simply have IUSE="nls" in the packages' ebuilds that need
it.

Closes: https://bugs.gentoo.org/745756
Signed-off-by: Matt Turner 
---
 eclass/xorg-3.eclass | 2 --
 1 file changed, 2 deletions(-)

diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index 78c843401cc..af28f6fa30d 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -168,8 +168,6 @@ if [[ ${FONT} == yes ]]; then
FONT_DIR=${FONT_DIR/otf/OTF}
FONT_DIR=${FONT_DIR/type1/Type1}
FONT_DIR=${FONT_DIR/speedo/Speedo}
-
-   [[ ${PN} = font-misc-misc || ${PN} = font-schumacher-misc || ${PN##*-} 
= 75dpi || ${PN##*-} = 100dpi || ${PN##*-} = cyrillic ]] && IUSE+=" nls"
 fi
 
 # @ECLASS-VARIABLE: XORG_STATIC
-- 
2.26.2




Re: [gentoo-dev] [PATCH 1/2] xorg-3.eclass: Fix font IUSE=nls handling

2020-10-01 Thread Matt Turner
On Thu, Oct 1, 2020 at 1:07 AM Ulrich Mueller  wrote:
>
> >>>>> On Thu, 01 Oct 2020, Matt Turner wrote:
>
> > - [[ ${PN} = font-misc-misc || ${PN} = font-schumacher-misc || 
> > ${PN##*-} = 75dpi || ${PN##*-} = 100dpi || ${PN##*-} = cyrillic ]] && 
> > IUSE+=" nls"
> > + case ${PN#font-} in
> > + 
> > adobe-100dpi|adobe-utopia-100dpi|bh-100dpi|bh-lucidatypewriter-100dpi|\
> > + adobe-75dpi |adobe-utopia-75dpi |bh-75dpi |bh-lucidatypewriter-75dpi|\
> > + misc-misc|schumacher-misc)
> > + IUSE+=" nls"
> > + ;;
> > + esac
>
> This looks like the kind of logic that would better be moved to ebuilds.
> Especially when it has just proven to be error prone.

Yeah, that seems like a good idea. In fact, that seems easier since
it's actually xorg-3_font_configure() that uses the presence of nls to
choose configure arguments. I think I can simply add IUSE="nls" to the
relevant packages and remove this code from the eclass.

Thanks for making me think through that again!



[gentoo-dev] [PATCH 2/2] xorg-3.eclass: Require --disable-all-encodings for fonts

2020-09-30 Thread Matt Turner
Presumably in the distant past all font packages did not support this
option. They do today, so we can simplify our logic.

Signed-off-by: Matt Turner 
---
 eclass/xorg-3.eclass | 28 +---
 1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index 515c1aeea2e..543021af46e 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -338,30 +338,12 @@ xorg-3_font_configure() {
debug-print-function ${FUNCNAME} "$@"
 
if has nls ${IUSE//+} && ! use nls; then
-   if grep -q -s "disable-all-encodings" 
${ECONF_SOURCE:-.}/configure; then
-   FONT_OPTIONS+="
-   --disable-all-encodings
-   --enable-iso8859-1"
-   else
-   FONT_OPTIONS+="
-   --disable-iso8859-2
-   --disable-iso8859-3
-   --disable-iso8859-4
-   --disable-iso8859-5
-   --disable-iso8859-6
-   --disable-iso8859-7
-   --disable-iso8859-8
-   --disable-iso8859-9
-   --disable-iso8859-10
-   --disable-iso8859-11
-   --disable-iso8859-12
-   --disable-iso8859-13
-   --disable-iso8859-14
-   --disable-iso8859-15
-   --disable-iso8859-16
-   --disable-jisx0201
-   --disable-koi8-r"
+   if ! grep -q -s "disable-all-encodings" 
${ECONF_SOURCE:-.}/configure; then
+   die "--disable-all-encodings option not available in 
configure"
fi
+   FONT_OPTIONS+="
+   --disable-all-encodings
+   --enable-iso8859-1"
fi
 }
 
-- 
2.26.2




[gentoo-dev] [PATCH 1/2] xorg-3.eclass: Fix font IUSE=nls handling

2020-09-30 Thread Matt Turner
The previous logic incorrectly added IUSE=nls for font-bitstream-100dpi,
font-bitstream-75dpi, font-cronyx-cyrillic, font-misc-cyrillic,
font-screen-cyrillic, and font-winitzki-cyrillic. This caused
"QA Notice: Unrecognized configure options: ..." with USE=-nls.

Closes: https://bugs.gentoo.org/745756
Signed-off-by: Matt Turner 
---
 eclass/xorg-3.eclass | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index 78c843401cc..515c1aeea2e 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -169,7 +169,13 @@ if [[ ${FONT} == yes ]]; then
FONT_DIR=${FONT_DIR/type1/Type1}
FONT_DIR=${FONT_DIR/speedo/Speedo}
 
-   [[ ${PN} = font-misc-misc || ${PN} = font-schumacher-misc || ${PN##*-} 
= 75dpi || ${PN##*-} = 100dpi || ${PN##*-} = cyrillic ]] && IUSE+=" nls"
+   case ${PN#font-} in
+   adobe-100dpi|adobe-utopia-100dpi|bh-100dpi|bh-lucidatypewriter-100dpi|\
+   adobe-75dpi |adobe-utopia-75dpi |bh-75dpi |bh-lucidatypewriter-75dpi|\
+   misc-misc|schumacher-misc)
+   IUSE+=" nls"
+   ;;
+   esac
 fi
 
 # @ECLASS-VARIABLE: XORG_STATIC
-- 
2.26.2




Re: [gentoo-portage-dev] [PATCH 0/2] emerge: Add short -l option for --load-average (bug 699256)

2020-08-15 Thread Matt Turner
On Sat, Aug 15, 2020 at 12:27 PM Zac Medico  wrote:
>
> Add a short -l option for --load-average just like make(1) has.

That's awesome, thank you. That'll make some catalyst work easier for me.



Re: [gentoo-dev] Last Rites: app-eselect/eselect-opengl

2020-08-11 Thread Matt Turner
On Tue, Aug 11, 2020 at 8:00 PM Philip Webb  wrote:
>
> 200811 Matt Turner wrote:
> > # Matt Turner  (2020-08-11)
> > # Replaced by media-libs/libglvnd.
> > # Masked for removal in 30 days. Bug #728286
> > app-eselect/eselect-opengl
>
> root:552 ~> emerge -cpv eselect-opengl
> Calculating dependencies... done!
>   app-eselect/eselect-opengl-1.3.1-r4 pulled in by:
> media-libs/mesa-20.0.8 requires >=app-eselect/eselect-opengl-1.3.0
> x11-base/xorg-server-1.20.8-r1 requires >=app-eselect/eselect-opengl-1.3.0
>
> 'mesa' is installed with USE="egl", which perhaps needs changing :
>
> root:554 ~> eixe mesa
> [I] media-libs/mesa
>  Available versions:  20.0.8^t ~20.1.4^t ~20.1.5^t ***l^t {+X 
> +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +libglvnd +llvm 
> lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan 
> vulkan-overlay wayland xa xvmc +zstd ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 
> lp64d" ABI_S390="32 64" ABI_X86="32 64 x32" KERNEL="linux" 
> VIDEO_CARDS="freedreno i915 i965 intel iris lima nouveau panfrost r100 r200 
> r300 r600 radeon radeonsi vc4 virgl vivante vmware"}
>  Installed versions:  20.0.8^t([2020-06-20 09:13:08])(X egl gallium gbm 
> wayland -classic -d3d9 -debug -dri3 -gles1 -gles2 -libglvnd -llvm -lm-sensors 
> -opencl -osmesa -selinux -test -unwind -vaapi -valgrind -vdpau -vulkan 
> -vulkan-overlay -xa -xvmc -zstd ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 
> -lp64d" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" KERNEL="linux" 
> VIDEO_CARDS="nouveau -freedreno -i915 -i965 -intel -iris -lima -panfrost 
> -r100 -r200 -r300 -r600 -radeon -radeonsi -vc4 -virgl -vivante -vmware")
>
> but there is no similar flag on 'xorg-server' :
>
> root:553 ~> eix xorg-server
> [I] x11-base/xorg-server
>  Available versions:  1.20.8(0/1.20.8) 1.20.8-r1(0/1.20.8) 
> **(0/)*l {debug dmx doc (+)elogind ipv6 kdrive +libglvnd libressl 
> minimal selinux static-libs (+)suid systemd +udev unwind wayland xcsecurity 
> xephyr xnest xorg xvfb}
>  Installed versions:  1.20.8-r1(0/1.20.8)([2020-08-09 20:16:16])(elogind 
> udev xorg -debug -dmx -doc -ipv6 -kdrive -libglvnd -libressl -minimal 
> -selinux -static-libs -suid -systemd -unwind -wayland -xcsecurity -xephyr 
> -xnest -xvfb)
>
> Before I do anything damaging, can you advise how to handle the above ?

The eix output indicates that you have both mesa and xorg-server built
with USE=-libglvnd. Rebuild both with USE=libglvnd, and then neither
will depend on eselect-opengl. In the same series of commits as I
added this mask, I added 'libglvnd' to use.force, so no local
configuration changes should be necessary, although you appear to have
USE=-libglvnd set somewhere, so you probably will want to clean that
up.



[gentoo-dev] Last Rites: app-eselect/eselect-opengl

2020-08-11 Thread Matt Turner
# Matt Turner  (2020-08-11)
# Replaced by media-libs/libglvnd.
# Masked for removal in 30 days. Bug #728286
app-eselect/eselect-opengl


signature.asc
Description: PGP signature


[gentoo-dev] Last Rites: app-eselect/eselect-opencl

2020-08-11 Thread Matt Turner
# Matt Turner  (2020-08-11)
# No longer needed with virtual/opencl-3
# Masked for removal in 30 days. Bug #728284
app-eselect/eselect-opencl


signature.asc
Description: PGP signature


[gentoo-dev] Last Rites: x11-drivers/nvidia-drivers:0/340

2020-08-11 Thread Matt Turner
# Matt Turner  (2020-08-11)
# NVIDIA declared this branch to have reached end of life about six months ago.
# Blocks removal of app-eselect/eselect-opengl and app-eselect/eselect-opencl.
# Masked for removal in 30 days. Bug #728290
x11-drivers/nvidia-drivers:0/340


signature.asc
Description: PGP signature


Re: [gentoo-dev] Python 2.7 cleanup: plan B

2020-08-11 Thread Matt Turner
On Tue, Aug 11, 2020 at 9:31 AM Michał Górny  wrote:
> TL;DR: we might keep Python 2.7 supported as a build-time dependency
> of a few packages as necessary, while removing the eclass support for
> installing packages for py2.7.

I think this is the right plan (and is along the lines of what I
suggested in the context of removing offlineimap, which didn't need
anything except the Python 2.7 interpreter).



Re: [gentoo-dev] xorg-x11 RDEPEND changes without revisions

2020-08-07 Thread Matt Turner
On Fri, Aug 7, 2020 at 11:25 AM Michael Orlitzky  wrote:
> I have too many other things to do to waste time reverse-engineering
> these fuck-ups. Get it together.

You're fucking welcome for all the X11 maintenance.



[gentoo-dev] Last Rites: dev-util/cmdtest

2020-08-03 Thread Matt Turner

# Matt Turner  (2020-08-03)
# Package is dead and upstream maintainer asked that it be removed.
# Removal in 30 days. Bug #735314
dev-util/cmdtest


signature.asc
Description: PGP signature


Re: [gentoo-dev] Last rites: */*: More Py2 stuff

2020-07-29 Thread Matt Turner
On Tue, Jul 28, 2020 at 7:32 PM Aaron Bauman  wrote:
> On July 28, 2020 9:57:44 PM EDT, Gordon Pettey  wrote:
> >That dependency is only if USE="-gnuefi". sys-boot/gnu-efi has no
> >Python
> >dependency. Instead of masking/removing refind, remove the USE flag and
> >force the gnu-efi dependency, or reverse the condition, add
> >IUSE="tianocore", and mask that USE flag.
> >
> >On Tue, Jul 28, 2020 at 7:06 PM Aaron Bauman  wrote:
> >
> >> On Tue, Jul 28, 2020 at 04:55:57PM -0700, Matt Turner wrote:
> >> > On Tue, Jul 28, 2020 at 4:17 PM Aaron Bauman 
> >wrote:
> >> > > sys-boot/refind
> >> >
> >> > How did you conclude that this package depends on Python at all?
> >> >
> >>
> >> Hi, Matt. It has a dependency on sys-boot/udk which was masked due to
> >> using py2.7 only. Hope that helps.
> >>
> >> --
> >> Cheers,
> >> Aaron
> >>
>
> That is for the maintainer to decide. Hence, all the previous discussions 
> surrounding this topic. It is a massive undertaking to remove py2.7 from the 
> tree.

You've made a very strong case for filing bugs and asking maintainers
to figure out what to do before masking packages for removal.



Re: [gentoo-dev] Last rites: */*: More Py2 stuff

2020-07-28 Thread Matt Turner
On Tue, Jul 28, 2020 at 4:17 PM Aaron Bauman  wrote:
> sys-boot/refind

How did you conclude that this package depends on Python at all?



Re: [gentoo-dev] */*: Mask Py2 only packages

2020-06-25 Thread Matt Turner
On Thu, Jun 25, 2020 at 8:14 PM Aaron Bauman  wrote:
>
> On Wed, Jun 24, 2020 at 10:12:18AM -0700, Matt Turner wrote:
> > offlineimap is widely used and blocks no further work. It can easily
> > remain in the tree after all other python2_7 support is gone.
> >
> > This is not a hill worth dying on.
> >
>
> I am confused here... are you saying that due to usage of the package
> that it should stay until dev-lang/python:2 is gone?
>
> More importantly, I simply responded to Thomas' mention that the package
> has alternatives, but apparently, I don't understand how the package is
> used :)

Two reasons: because it's widely used *and* because its python:2.7
dependency is on only the interpreter itself.

The second reason means that its removal doesn't enable any further clean ups.



Re: [gentoo-dev] */*: Mask Py2 only packages

2020-06-24 Thread Matt Turner
On Wed, Jun 24, 2020 at 2:52 AM Thomas Deutschmann  wrote:
> On 2020-06-20 21:24, Aaron Bauman wrote:
> > Thomas, unfortunately, I am shocked at your choice of words here. I
> > think it is reasonable that any developer would understand a lack
> > of forward momentum in removing Py2 only packages only drives
> > stagnation.
> >
> > If you have a more effective method to doing so, I am open to
> > suggestions.
>
> Like I am shocked about your recent actions:

I'm shocked that you're shocked that he's shocked!

Let's stop the theatrics.



Re: [gentoo-dev] */*: Mask Py2 only packages

2020-06-24 Thread Matt Turner
On Sat, Jun 20, 2020 at 12:24 PM Aaron Bauman  wrote:
>
> On Sat, Jun 20, 2020 at 01:29:46PM +0200, Thomas Deutschmann wrote:
> > On 2020-06-20 12:07, Michał Górny wrote:
> > >> Al least, python2  is not on your list.
> > >>
> > >> Be first into the future by masking this stuff and
> > >> Last out of the past by leaving up to users to decide.
> > >> It could stay in the tree, masked, as long as python2.
> > >>
> > >
> > > Do you really think it'd be better to last rite a 1000 packages
> > > simultaneously?
> >
> > What's the purpose of this at all?
> >
> > dev-lang/python:2.7 won't go away that soon.
> >
> > Removing perfectly working and up-to-date software which is in
> > maintenance-only mode like net-mail/offlineimap is just not user-friendly.
> >
> > It doesn't even has deps on other Python packages blocking your cleanup
> > delusion.
> >
>
> Thomas, unfortunately, I am shocked at your choice of words here. I
> think it is reasonable that any developer would understand a lack
> of forward momentum in removing Py2 only packages only drives
> stagnation.
>
> If you have a more effective method to doing so, I am open to
> suggestions.

Between the disagreements about whether a package should be masked,
the length of time the last rites period should be, and the steps
required to disband a project, I think there's been enough pushback
that it's necessary to change how you approach these projects.

Please start by using the standard 30-day last rites period. It's a
simple thing and whether the packages are in tree for an additional 16
days should not affect any of your work.

> re: net-mail/offlineimap... there are alternatives.

Removing python2_7 support from the tree is a valuable goal, but
offlineimap is widely used and blocks no further work. It can easily
remain in the tree after all other python2_7 support is gone.

This is not a hill worth dying on.



Re: [gentoo-dev] Re: News item: xorg-server dropping default suid

2020-06-21 Thread Matt Turner
On Sun, Jun 21, 2020 at 4:53 PM Philip Webb  wrote:
>
> 200621 Piotr Karbowski wrote:
> > Title: xorg-server dropping default suid
> ...
> > The Gentoo X11 Team is announcing that starting with 15th of July,
> > the x11-base/xorg-server will no longer default to suid
> > and will default to using logind interface instead.  This change
> > makes xorg-server run as regular user rather than root by default,
> > however those who do not have any logind interface provider
> > -- either systemd or elogind -- will need to enable either
> > to make it possible to run X session as unprivileged user.
> > No action is required from systemd and desktop profile users,
> > since systemd provides logind interface
> > and desktop profile already enables 'elogind' USE flag globally.
> > Rest of the non-systemd users is required to globally enable
> > 'elogind' USE flag and apply it by 'emerge --newuse @world',
> > after which, re-login is required so that PAM can allocate seat.
> > One can confirm that a seat has been assigned upon login by running:
> > $ loginctl user-status
> > Those who for whatever reason want to preserve current state,
> > while heavily discouraged,
> > can still use x11-base/xorg-server with 'suid -elogind'.
>
> Gentoo Wiki says :
>
>   elogind is the systemd project's logind, extracted to a standalone package.
>   It's designed for users who prefer a non-systemd init system,
>   but still want to use popular software such as KDE/Wayland or GNOME
>   that otherwise hard-depends on systemd.
>
>   startx integration : To have an elogind session created
>   when using startx to start the X server (instead of a display manager),
>   add the following to the user's ~/.xinitrc file : FILE ~/.xinitrc
>exec dbus-launch --exit-with-session 
>   WINDOW_MANAGER in the above example needs to be replaced
>   by a window manager or a single application.
>
> I want to use 'startx' to start X , because I don't want to be trapped
> if some problem arises with X or KDE or the login manager
> & I need to change config files or remerge pkgs (etc) to rescue myself.
> With 'startx' I can do all that work from raw TTYs with no problems,
> as I am not forced to go into an X session if I don't want to.

Thank you for actually participating in the discussion, unlike the
last thread about this topic.

> I don't want to use 'systemd', as I want to run a traditional UNIX version
> of Linux + KDE (or Fluxbox) for a simple single-user desktop system.
>
> Why is running 'xorg-server' as root "heavily discouraged" ?
> -- I've been doing that with Gentoo for  > 16 yr  without any problems.
> AFAIK there are no problems re exploits via I/net browsers,
> which are started by my user as all such user software always is.
> What might go wrong, if I continue to 'startx'
> with 'xorg-server' merged with 'suid -elogind'
> & without the '.xinitrc' line show above in the Wiki ?

For the majority of users (those that use a graphics driver with
kernel modesetting support), X only needs root access for a small set
of things: accessing the DRM device node, accessing the input device
nodes, and some stuff around VTs. The rest of the time, X doesn't need
root access but still must run as root for those cases I mention.

With elogind, those bits are handled in a small daemon, and X no
longer needs to run as root. Most people find that to be valuable,
especially with the knowledge that there have been a number of
security vulnerabilities found that would allow arbitrary code
execution in the xserver over the years [1].

Our current default of USE=suid installs /usr/bin/Xorg with the setuid
bit set, allowing it to be run *as root* by any user. This enables
non-root users to execute startx, for example.

I appreciate that Gentoo users are a diverse bunch, to say the least.
This news item is about *defaults*. I'm happy to explain the value of
the new default to people who are genuinely curious but I have no
interest in trying to convince you or anyone else of anything.

You're free to keep the status quo with a single line in
/etc/portage/package.use. The people building and maintaining the
distro think that the new defaults are better defaults for the vast
majority of users, but again they're just defaults.

[1] 
https://www.cvedetails.com/vulnerability-list/vendor_id-88/product_id-8600/X.org-Xorg-server.html



Re: [gentoo-dev] Last rites: app-cdr/sync2d

2020-06-05 Thread Matt Turner
On Fri, Jun 5, 2020 at 9:55 AM Jonas Stein  wrote:
>
> On 04/06/2020 01.39, Aaron Bauman wrote:
> > # Aaron Bauman  (2020-06-03)
> > # py2 only. dead upstream. m-n.
> > # Masked for removal in 15 days
> > app-cdr/sync2cd
> >
>
> is there a good reason to reduce the time to 15 days?
>
> https://devmanual.gentoo.org/ebuild-maintenance/removal/index.html
> "Wait 30 days (or more)"

I think we all agree that Python 2-only packages are going to have to
be removed.

This package is Python 2-only, and it was last released more than 13
years ago, and the website even says that the project is dead
(http://c-space.org/).

With that in mind, I don't expect it to gain Python 3 support, nor do
I expect an additional 15 days of waiting time to change that fact. 15
vs 30 days doesn't seem worth squabbling over.



Re: [gentoo-dev] Value of Continuous integration vs Code Review / Pull Requests

2020-05-27 Thread Matt Turner
On Wed, May 27, 2020 at 1:14 AM Alec Warner  wrote:
> On Tue, May 26, 2020, 23:08 Michał Górny  wrote:
>>
>> On Tue, 2020-05-26 at 20:24 -0700, Alec Warner wrote:
>> > The TL;DR is that a crack team of infra-folks[0] have been putting together
>> > demos of CI services and things like gitlab / gitea / gerrit and so on.
>> >
>> > Some of these come in combined (e.g. gitlab offers repo hosting, code
>> > review / pull reqs, CI services, and deploy services.) Some of these are
>> > piecemeal (e.g. gerrit has code review, zuul has CI) and gitea offers
>> > repo-hosting but CI is separate (e.g. drone.)
>> >
>> > On the infra-side, I think we are pretty happy with repo-hosting (gitolite)
>> > and repo-serving (gitweb). We are missing a CI piece and a pull-request
>> > piece. Most of the users using PRs use either a gitlab or github mirror.
>> >
>> > I think the value of CI is pretty obvious to me (and I see tons of use
>> > cases in Infra.) We could easily build CI into our current repository
>> > solution (e.g. gitolite.) However gitolite doesn't really support PRs in a
>> > uniform way and so CI is mostly for submitted code; similar to the existing
>> > ::gentoo repo CI offered by mgorny.
>> >
>> > If we build a code review solution (like gitea / gerrit) would people use
>> > it? Would you use it if you couldn't merge (because the code review
>> > solution can't gpg sign your commits or merges) so a tool like the existing
>> > pram tool would be needed to merge?
>> >
>>
>> Does GitLab count?  Gerrit is just PITA.  I think we had some concerns
>> about Gitea, so I'd like to test it before deciding.  GitLab OTOH works
>> just fine for a lot of projects, and seems the next best thing after
>> GitHub
>
>
> Gitlab does count (we deployed and tested an onprem version.) I think there 
> are some major issues with it though.
>  - Licensing. Gitlab-CE is available, gitlab-EE is not OSS nor OSI approved 
> and many of the features we need are EE only and are not available in CE.

It's very surprising to me that CE wouldn't work for our purposes.
Debian, GNOME, KDE, XFCE, and FreeDesktop have all switched to GitLab
and are using CE. It's hard to believe that Gentoo's usage or
requirements would be so different as to make GitLab a non-viable
option.

What features of EE do you think we need?



Re: [gentoo-dev] New USE=-native-symlinks for gcc-config and binutils-config

2020-05-24 Thread Matt Turner
On Sat, May 23, 2020 at 10:21 PM Joonas Niilola  wrote:
>
>
> On 5/24/20 5:41 AM, Mike Gilbert wrote:
> > Also, people are likely to disable this accidentally via USE="-*".
>
> Counts as
>
> > if they want to break their system intentionally.

Yes, but unfortunately catalyst's stage1 build does exactly this.

Suggestions how to avoid doing this would be appreciated, but until
that's resolved we don't have carte blanche to break USE="-*".



Re: [gentoo-dev] [PATCH 0/1] remove EGO_VENDOR support from go-module.eclass

2020-05-11 Thread Matt Turner
On Mon, May 11, 2020 at 4:00 PM William Hubbs  wrote:
>
> On Tue, May 12, 2020 at 01:45:45AM +0300, Andreas K. Hüttel wrote:
> > > This patch makes migrating mandatory by forcing ebuilds to die if they
> > > have EGO_VENDOR set and are using go-module.eclass.
> >
> > You can't commit this as long as there is a single such ebuild in the tree.
>
> Sure, and I'm working on migrating them.

I think all the replies to this thread could have been avoided by just
saying that in your initial email. :)



  1   2   3   4   5   6   >