[gentoo-dev]

2018-01-03 Thread Fredrik Frodlund



[gentoo-dev]

2018-01-03 Thread fredrik




[gentoo-dev]

2018-01-03 Thread fredrik



[gentoo-dev] [PATCH 2/2] eutils.eclass: Inline remaining uses of _eutils_eprefix_init.

2018-01-03 Thread Ulrich Müller
Inline the remaining two uses of the function. This shortens the code,
and also allows to declare the variables as local.
---
 eclass/eutils.eclass | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 91d329e99c9e..63f73db290f4 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -164,14 +164,6 @@ strip-linguas() {
export LINGUAS=${newls:1}
 }
 
-# @FUNCTION: _eutils_eprefix_init
-# @INTERNAL
-# @DESCRIPTION:
-# Initialized prefix variables for EAPI<3.
-_eutils_eprefix_init() {
-   has "${EAPI:-0}" 0 1 2 && : ${ED:=${D}} ${EPREFIX:=} ${EROOT:=${ROOT}}
-}
-
 # @FUNCTION: built_with_use
 # @USAGE: [--hidden] [--missing ] [-a|-o]  
 # @DESCRIPTION:
@@ -194,7 +186,6 @@ _eutils_eprefix_init() {
 # Remember that this function isn't terribly intelligent so order of optional
 # flags matter.
 built_with_use() {
-   _eutils_eprefix_init
local hidden="no"
if [[ $1 == "--hidden" ]] ; then
hidden="yes"
@@ -218,6 +209,7 @@ built_with_use() {
[[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package"
shift
 
+   has "${EAPI:-0}" 0 1 2 && local EROOT=${ROOT}
local USEFILE=${EROOT}/var/db/pkg/${PKG}/USE
local IUSEFILE=${EROOT}/var/db/pkg/${PKG}/IUSE
 
@@ -272,9 +264,9 @@ built_with_use() {
 # first optionally setting LD_LIBRARY_PATH to the colon-delimited
 # libpaths followed by optionally changing directory to chdir.
 make_wrapper() {
-   _eutils_eprefix_init
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
local tmpwrapper=$(emktemp)
+   has "${EAPI:-0}" 0 1 2 && local EPREFIX=""
 
(
echo '#!/bin/sh'
-- 
2.15.1


pgp_09nAaDsQk.pgp
Description: PGP signature


[gentoo-dev] [PATCH 1/2] preserve-libs.eclass: Split off preserve_old_lib from eutils.

2018-01-03 Thread Ulrich Müller
Split off functions preserve_old_lib and preserve_old_lib_notify from
eutils.eclass into a dedicated preserve-libs.eclass. These functions
are rarely used and are independent of the rest of eutils, therefore
moving them into their own eclass will help clarifying eclass
inheritance in ebuilds.

For backwards compatibility, eutils inherits the new eclass in
existing EAPIs.
---
 eclass/eutils.eclass| 65 ++-
 eclass/preserve-libs.eclass | 74 +
 2 files changed, 76 insertions(+), 63 deletions(-)
 create mode 100644 eclass/preserve-libs.eclass

diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 7d4193e76b51..91d329e99c9e 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: eutils.eclass
@@ -20,7 +20,7 @@ _EUTILS_ECLASS=1
 # implicitly inherited (now split) eclasses
 case ${EAPI:-0} in
 0|1|2|3|4|5|6)
-   inherit desktop epatch estack ltprune multilib toolchain-funcs
+   inherit desktop epatch estack ltprune multilib preserve-libs 
toolchain-funcs
;;
 esac
 
@@ -172,67 +172,6 @@ _eutils_eprefix_init() {
has "${EAPI:-0}" 0 1 2 && : ${ED:=${D}} ${EPREFIX:=} ${EROOT:=${ROOT}}
 }
 
-# @FUNCTION: preserve_old_lib
-# @USAGE:  [more libs]
-# @DESCRIPTION:
-# These functions are useful when a lib in your package changes ABI SONAME.
-# An example might be from libogg.so.0 to libogg.so.1.  Removing libogg.so.0
-# would break packages that link against it.  Most people get around this
-# by using the portage SLOT mechanism, but that is not always a relevant
-# solution, so instead you can call this from pkg_preinst.  See also the
-# preserve_old_lib_notify function.
-preserve_old_lib() {
-   _eutils_eprefix_init
-   if [[ ${EBUILD_PHASE} != "preinst" ]] ; then
-   eerror "preserve_old_lib() must be called from pkg_preinst() 
only"
-   die "Invalid preserve_old_lib() usage"
-   fi
-   [[ -z $1 ]] && die "Usage: preserve_old_lib  [more 
libraries to preserve]"
-
-   # let portage worry about it
-   has preserve-libs ${FEATURES} && return 0
-
-   local lib dir
-   for lib in "$@" ; do
-   [[ -e ${EROOT}/${lib} ]] || continue
-   dir=${lib%/*}
-   dodir ${dir} || die "dodir ${dir} failed"
-   cp "${EROOT}"/${lib} "${ED}"/${lib} || die "cp ${lib} failed"
-   touch "${ED}"/${lib}
-   done
-}
-
-# @FUNCTION: preserve_old_lib_notify
-# @USAGE:  [more libs]
-# @DESCRIPTION:
-# Spit helpful messages about the libraries preserved by preserve_old_lib.
-preserve_old_lib_notify() {
-   if [[ ${EBUILD_PHASE} != "postinst" ]] ; then
-   eerror "preserve_old_lib_notify() must be called from 
pkg_postinst() only"
-   die "Invalid preserve_old_lib_notify() usage"
-   fi
-
-   # let portage worry about it
-   has preserve-libs ${FEATURES} && return 0
-
-   _eutils_eprefix_init
-
-   local lib notice=0
-   for lib in "$@" ; do
-   [[ -e ${EROOT}/${lib} ]] || continue
-   if [[ ${notice} -eq 0 ]] ; then
-   notice=1
-   ewarn "Old versions of installed libraries were 
detected on your system."
-   ewarn "In order to avoid breaking packages that depend 
on these old libs,"
-   ewarn "the libraries are not being removed.  You need 
to run revdep-rebuild"
-   ewarn "in order to remove these old dependencies.  If 
you do not have this"
-   ewarn "helper program, simply emerge the 'gentoolkit' 
package."
-   ewarn
-   fi
-   ewarn "  # revdep-rebuild --library '${lib}' && rm '${lib}'"
-   done
-}
-
 # @FUNCTION: built_with_use
 # @USAGE: [--hidden] [--missing ] [-a|-o]  
 # @DESCRIPTION:
diff --git a/eclass/preserve-libs.eclass b/eclass/preserve-libs.eclass
new file mode 100644
index ..548c6411fcf0
--- /dev/null
+++ b/eclass/preserve-libs.eclass
@@ -0,0 +1,74 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: preserve-libs.eclass
+# @MAINTAINER:
+# base-sys...@gentoo.org
+# @BLURB: preserve libraries after SONAME changes
+
+if [[ -z ${_PRESERVE_LIBS_ECLASS} ]]; then
+_PRESERVE_LIBS_ECLASS=1
+
+# @FUNCTION: preserve_old_lib
+# @USAGE:  [more libs]
+# @DESCRIPTION:
+# These functions are useful when a lib in your package changes ABI SONAME.
+# An example might be from libogg.so.0 to libogg.so.1.  Removing libogg.so.0
+# would break packages that link against it.  Most people get around this
+# by using the portage SLOT mechanism, but that is not always a relevant
+# solution, so instead you can call 

Re: [gentoo-dev] Deleting old news items

2018-01-03 Thread Alec Warner
On Wed, Jan 3, 2018 at 6:07 AM, Ulrich Mueller  wrote:

> > On Tue, 2 Jan 2018, Alec Warner wrote:
>
> > Problem:
> > New stages have numerous news items listed that are likely not
> > relevant, but are shown due to limitations in the filtering in NEWS
> > items. E.g. on a recent stage3:
>
> > [...]
>
> We could add an "Expires:" header to the news item format, and the
> package manager (or eselect news) could mask old items based on it.
>

Ok, I'll submit a patch to the GLEP for this. Stay tuned.

-A


>
> Ulrich
>


Re: [gentoo-dev] Deleting old news items

2018-01-03 Thread Kristian Fiskerstrand
On 01/03/2018 03:13 PM, Kristian Fiskerstrand wrote:
> On 01/03/2018 02:45 PM, Ciaran McCreesh wrote:
>> On Wed, 3 Jan 2018 12:23:33 +0100
>> Kristian Fiskerstrand  wrote:
>>> Do we necessarily need to do even that? A package manager could have a
>>> feature to mask based on other heuristics without changing the format,
>>> e.g all messages from before X, presumably with a switch to show
>> Package manglers having to use heuristics when explicit information
>> could easily be provided by developers but isn't is the source of at
>> least 27.4% of Gentoo's problems.
> 
> I'd say it is easier to have flexibility for user to decide than a
> developer trying to estimate the value of the information for setting an
> expiration date, as that is context dependent.
> 

That said, I'd prefer either option over deleting news items, deleting
info shouldn't be necessary to begin with, it'd be more interesting to
have an "active" boolean or something, but still keep the info (but I'd
still say a PM filter based on date is better)

-- 
Kristian Fiskerstrand
OpenPGP keyblock reachable at hkp://pool.sks-keyservers.net
fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] Deleting old news items

2018-01-03 Thread Kristian Fiskerstrand
On 01/03/2018 02:45 PM, Ciaran McCreesh wrote:
> On Wed, 3 Jan 2018 12:23:33 +0100
> Kristian Fiskerstrand  wrote:
>> Do we necessarily need to do even that? A package manager could have a
>> feature to mask based on other heuristics without changing the format,
>> e.g all messages from before X, presumably with a switch to show
> Package manglers having to use heuristics when explicit information
> could easily be provided by developers but isn't is the source of at
> least 27.4% of Gentoo's problems.

I'd say it is easier to have flexibility for user to decide than a
developer trying to estimate the value of the information for setting an
expiration date, as that is context dependent.

-- 
Kristian Fiskerstrand
OpenPGP keyblock reachable at hkp://pool.sks-keyservers.net
fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] Deleting old news items

2018-01-03 Thread Ciaran McCreesh
On Wed, 3 Jan 2018 12:23:33 +0100
Kristian Fiskerstrand  wrote:
> Do we necessarily need to do even that? A package manager could have a
> feature to mask based on other heuristics without changing the format,
> e.g all messages from before X, presumably with a switch to show

Package manglers having to use heuristics when explicit information
could easily be provided by developers but isn't is the source of at
least 27.4% of Gentoo's problems.

-- 
Ciaran McCreesh



Re: [gentoo-dev] Deleting old news items

2018-01-03 Thread Kristian Fiskerstrand
On 01/03/2018 12:07 PM, Ulrich Mueller wrote:
>> On Tue, 2 Jan 2018, Alec Warner wrote:
> 
>> Problem:
>> New stages have numerous news items listed that are likely not
>> relevant, but are shown due to limitations in the filtering in NEWS
>> items. E.g. on a recent stage3:
> 
>> [...]
> 
> We could add an "Expires:" header to the news item format, and the
> package manager (or eselect news) could mask old items based on it.

Do we necessarily need to do even that? A package manager could have a
feature to mask based on other heuristics without changing the format,
e.g all messages from before X, presumably with a switch to show older.

I'm thinking along the lines of only show those published within last 12
months by default, configurable by make.conf variable.

-- 
Kristian Fiskerstrand
OpenPGP keyblock reachable at hkp://pool.sks-keyservers.net
fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] Deleting old news items

2018-01-03 Thread kuzetsa
On 01/03/2018 06:07 AM, Ulrich Mueller wrote:
>> On Tue, 2 Jan 2018, Alec Warner wrote:
>> Problem:
>> New stages have numerous news items listed that are likely not
>> relevant, but are shown due to limitations in the filtering in NEWS
>> items. E.g. on a recent stage3:
>> [...]
> We could add an "Expires:" header to the news item format, and the
> package manager (or eselect news) could mask old items based on it.
>
> Ulrich

the storage footprint for news entries is cheap.

why not just improve the user-facing documentation:
if someone wants to hide "old" news, they opt-out.

It's much harder to opt-in to viewing deleted news.




signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] Deleting old news items

2018-01-03 Thread Ulrich Mueller
> On Tue, 2 Jan 2018, Alec Warner wrote:

> Problem:
> New stages have numerous news items listed that are likely not
> relevant, but are shown due to limitations in the filtering in NEWS
> items. E.g. on a recent stage3:

> [...]

We could add an "Expires:" header to the news item format, and the
package manager (or eselect news) could mask old items based on it.

Ulrich


pgp8tYyWmIGCt.pgp
Description: PGP signature


Re: [gentoo-dev] Deleting old news items

2018-01-03 Thread kuzetsa
On 01/03/2018 05:53 AM, Michał Górny wrote:
> W dniu wto, 02.01.2018 o godzinie 19∶13 -0500, użytkownik Alec Warner
> napisał:
>> Problem:
>>
>> New stages have numerous news items listed that are likely not relevant,
>> but are shown due to limitations in the filtering in NEWS items. E.g. on a
>> recent stage3:
>>
>> nspawntest / # eselect news list
>> News items:
>>   [1]   N  2013-09-27  Separate /usr on Linux requires initramfs
>>   [2]   N  2014-06-15  GCC 4.8.3 defaults to -fstack-protector
>>   [3]   N  2014-10-26  GCC 4.7 Introduced the New C++11 ABI
>>   [4]   N  2015-02-02  New portage plug-in sync system
>>   [5]   N  2015-07-25  Python 3.4 enabled by default
>>   [6]   N  2015-08-13  OpenSSH 7.0 disables ssh-dss keys by default
>>   [7]   N  2015-10-22  GCC 5 Defaults to the New C++11 ABI
>>   [8]   N  2016-06-19  L10N USE_EXPAND variable replacing LINGUAS
>>   [9]   N  2017-11-30  New 17.0 profiles in the Gentoo repository
>>
>> Many of these are always displayed. For example:
>>
>> https://gitweb.gentoo.org/data/gentoo-news.git/tree/2015-02-04-portage-sync-changes/2015-02-04-portage-sync-changes.en.txt
>>
>> has "Display-If-Installed: sys-apps/portage" and will be displayed on
>> nearly every Gentoo machine. While relevant in 2015; I'm skeptical that its
>> relevant today. I am also considering explicit changes in the filtering
>> directives to resolve this in the future.
>>
>> Glep42 states:
>>
>> ---
>> News Item Removal
>>
>> News items can be removed (by removing the news file from the main tree)
>> when they are no longer relevant, if they are made obsolete by a future
>> news item or after a long period of time. This is the same as the method
>> used for updates entries.
>> ---
>>
>> I suggest we delete all entries prior to 2016. Git keeps history forever,
>> so folks can gander at the old entries on gitweb.gentoo.org:
>>
> For completeness, I should point out that I've seen one user complaining
> about old news items disappearing. While I support the motion, I think
> we should take some care to make sure that there is some 'replacement'
> documentation for the things announced by news items.
>
> In other words, it's a bad idea to remove news items when the available
> documentation explains the 'before' state and the news item is the only
> source of information of the 'after' state.
>

I've personally needed to refer back to a few of those news
entries more than once. In particular, the instructions for
17.0 profile migration, the entry about -fstack-protector,
C++11 ABI notices, and the portage sync plugin system.

The most recent time I needed some of that was this week.

Following a mix-up with crossdev (still documenting the bug)
I decided to repair my toolchain in-place using a stage3
tarball rather than a full OS reinstall. Specifically, the
info was handy because there isn't much documentation on
how to correctly bootstrap from anything less than a
valid / non-broke stage3 tarball.

Even if nobody else has weird issues and needs to use a
strange method to repair their system in-place, the 17.0
profile migration news entry is recent enough that it
should be retained for at least a FULL YEAR, I feel.

- kuza



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] Deleting old news items

2018-01-03 Thread Michał Górny
W dniu wto, 02.01.2018 o godzinie 19∶13 -0500, użytkownik Alec Warner
napisał:
> Problem:
> 
> New stages have numerous news items listed that are likely not relevant,
> but are shown due to limitations in the filtering in NEWS items. E.g. on a
> recent stage3:
> 
> nspawntest / # eselect news list
> News items:
>   [1]   N  2013-09-27  Separate /usr on Linux requires initramfs
>   [2]   N  2014-06-15  GCC 4.8.3 defaults to -fstack-protector
>   [3]   N  2014-10-26  GCC 4.7 Introduced the New C++11 ABI
>   [4]   N  2015-02-02  New portage plug-in sync system
>   [5]   N  2015-07-25  Python 3.4 enabled by default
>   [6]   N  2015-08-13  OpenSSH 7.0 disables ssh-dss keys by default
>   [7]   N  2015-10-22  GCC 5 Defaults to the New C++11 ABI
>   [8]   N  2016-06-19  L10N USE_EXPAND variable replacing LINGUAS
>   [9]   N  2017-11-30  New 17.0 profiles in the Gentoo repository
> 
> Many of these are always displayed. For example:
> 
> https://gitweb.gentoo.org/data/gentoo-news.git/tree/2015-02-04-portage-sync-changes/2015-02-04-portage-sync-changes.en.txt
> 
> has "Display-If-Installed: sys-apps/portage" and will be displayed on
> nearly every Gentoo machine. While relevant in 2015; I'm skeptical that its
> relevant today. I am also considering explicit changes in the filtering
> directives to resolve this in the future.
> 
> Glep42 states:
> 
> ---
> News Item Removal
> 
> News items can be removed (by removing the news file from the main tree)
> when they are no longer relevant, if they are made obsolete by a future
> news item or after a long period of time. This is the same as the method
> used for updates entries.
> ---
> 
> I suggest we delete all entries prior to 2016. Git keeps history forever,
> so folks can gander at the old entries on gitweb.gentoo.org:
> 

For completeness, I should point out that I've seen one user complaining
about old news items disappearing. While I support the motion, I think
we should take some care to make sure that there is some 'replacement'
documentation for the things announced by news items.

In other words, it's a bad idea to remove news items when the available
documentation explains the 'before' state and the news item is the only
source of information of the 'after' state.

-- 
Best regards,
Michał Górny




[gentoo-dev] Re: Deleting old news items

2018-01-03 Thread Michael Palimaka
On 01/03/2018 11:13 AM, Alec Warner wrote:
> Problem:
> 
> New stages have numerous news items listed that are likely not relevant,
> but are shown due to limitations in the filtering in NEWS items. E.g. on
> a recent stage3:
> 
> nspawntest / # eselect news list
> News items:
>   [1]   N  2013-09-27  Separate /usr on Linux requires initramfs
>   [2]   N  2014-06-15  GCC 4.8.3 defaults to -fstack-protector
>   [3]   N  2014-10-26  GCC 4.7 Introduced the New C++11 ABI 
>   [4]   N  2015-02-02  New portage plug-in sync system
>   [5]   N  2015-07-25  Python 3.4 enabled by default
>   [6]   N  2015-08-13  OpenSSH 7.0 disables ssh-dss keys by default
>   [7]   N  2015-10-22  GCC 5 Defaults to the New C++11 ABI
>   [8]   N  2016-06-19  L10N USE_EXPAND variable replacing LINGUAS
>   [9]   N  2017-11-30  New 17.0 profiles in the Gentoo repository
> 
> Many of these are always displayed. For example:
> 
> https://gitweb.gentoo.org/data/gentoo-news.git/tree/2015-02-04-portage-sync-changes/2015-02-04-portage-sync-changes.en.txt
> 
> has "Display-If-Installed: sys-apps/portage" and will be displayed on
> nearly every Gentoo machine. While relevant in 2015; I'm skeptical that
> its relevant today. I am also considering explicit changes in the
> filtering directives to resolve this in the future.
> 
> Glep42 states:
> 
> ---
> News Item Removal
> 
> News items can be removed (by removing the news file from the main tree)
> when they are no longer relevant, if they are made obsolete by a future
> news item or after a long period of time. This is the same as the method
> used for updates entries.
> ---
> 
> I suggest we delete all entries prior to 2016. Git keeps history
> forever, so folks can gander at the old entries on gitweb.gentoo.org
> :
> 
> https://gitweb.gentoo.org/data/gentoo-news.git/tree/
> 
> -A

I strongly support this idea. I've tried to push this several times in
the past however was met with some resistance from several teams.