Re: [gentoo-portage-dev] [PATCH gentoolkit 1/2] eclean: Rewrite findPackages()

2020-02-20 Thread Michael 'veremitz' Everitt
On 21/02/20 05:29, Matt Turner wrote:
> I found the original code to be nearly incomprehensible. Instead of
> populating a dict of potential binpkgs to remove and then removing from
> the to-be-removed list, just selectively add to-be-removed packages.
>
> Signed-off-by: Matt Turner 
> ---
> I switched from tabs to spaces in the process. I can revert back if
> desired.
>
Probably best to stick to tabs for consistency with the other portage code,
although naturally Zac probably better to ACK/NACK that.

Otherwise I think this is a good refresh. +1.



signature.asc
Description: OpenPGP digital signature


[gentoo-portage-dev] Re: [PATCH gentoolkit 1/2] eclean: Rewrite findPackages()

2020-02-20 Thread Matt Turner
On Thu, Feb 20, 2020 at 9:29 PM Matt Turner  wrote:
>
> I found the original code to be nearly incomprehensible. Instead of
> populating a dict of potential binpkgs to remove and then removing from
> the to-be-removed list, just selectively add to-be-removed packages.
>
> Signed-off-by: Matt Turner 
> ---
> I switched from tabs to spaces in the process. I can revert back if
> desired.
>
>  pym/gentoolkit/eclean/search.py | 189 
>  1 file changed, 94 insertions(+), 95 deletions(-)
>
> diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py
> index 58bd97e..831ba39 100644
> --- a/pym/gentoolkit/eclean/search.py
> +++ b/pym/gentoolkit/eclean/search.py
> @@ -489,98 +489,97 @@ class DistfilesSearch(object):
>
>
>  def findPackages(
> -   options,
> -   exclude=None,
> -   destructive=False,
> -   time_limit=0,
> -   package_names=False,
> -   pkgdir=None,
> -   port_dbapi=portage.db[portage.root]["porttree"].dbapi,
> -   var_dbapi=portage.db[portage.root]["vartree"].dbapi
> -   ):
> -   """Find all obsolete binary packages.
> -
> -   XXX: packages are found only by symlinks.
> -   Maybe i should also return .tbz2 files from All/ that have
> -   no corresponding symlinks.
> -
> -   @param options: dict of options determined at runtime
> -   @param exclude: an exclusion dict as defined in
> -   exclude.parseExcludeFile class.
> -   @param destructive: boolean, defaults to False
> -   @param time_limit: integer time value as returned by parseTime()
> -   @param package_names: boolean, defaults to False.
> -   used only if destructive=True
> -   @param pkgdir: path to the binary package dir being checked
> -   @param port_dbapi: defaults to 
> portage.db[portage.root]["porttree"].dbapi
> -   can be overridden for tests.
> -   @param var_dbapi: defaults to 
> portage.db[portage.root]["vartree"].dbapi
> -   can be overridden for tests.
> -
> -   @rtype: dict
> -   @return clean_me i.e. {'cat/pkg-ver.tbz2': [filepath],}
> -   """
> -   if exclude is None:
> -   exclude = {}
> -   clean_me = {}
> -   # create a full package dictionary
> -
> -   # now do an access test, os.walk does not error for "no read 
> permission"
> -   try:
> -   test = os.listdir(pkgdir)
> -   del test
> -   except EnvironmentError as er:
> -   if options['ignore-failure']:
> -   exit(0)
> -   print( pp.error("Error accessing PKGDIR." ), file=sys.stderr)
> -   print( pp.error("(Check your make.conf file and 
> environment)."), file=sys.stderr)
> -   print( pp.error("Error: %s" %str(er)), file=sys.stderr)
> -   exit(1)
> -
> -   # if portage supports FEATURES=binpkg-multi-instance, then
> -   # cpv_all can return multiple instances per cpv, where
> -   # instances are distinguishable by some extra attributes
> -   # provided by portage's _pkg_str class
> -   bin_dbapi = portage.binarytree(pkgdir=pkgdir, 
> settings=var_dbapi.settings).dbapi
> -   for cpv in bin_dbapi.cpv_all():
> -   mtime = int(bin_dbapi.aux_get(cpv, ['_mtime_'])[0])
> -   if time_limit and mtime >= time_limit:
> -   # time-limit exclusion
> -   continue
> -   # dict is cpv->[pkgs] (supports binpkg-multi-instance)
> -   clean_me.setdefault(cpv, []).append(cpv)
> -
> -   # keep only obsolete ones
> -   if destructive and package_names:
> -   cp_all = dict.fromkeys(var_dbapi.cp_all())
> -   else:
> -   cp_all = {}
> -   for cpv in list(clean_me):
> -   if exclDictMatchCP(exclude,portage.cpv_getkey(cpv)):
> -   # exclusion because of the exclude file
> -   del clean_me[cpv]
> -   continue
> -   if not destructive and port_dbapi.cpv_exists(cpv):
> -   # exclusion because pkg still exists (in porttree)
> -   del clean_me[cpv]
> -   continue
> -   if destructive and var_dbapi.cpv_exists(cpv):
> -   buildtime = var_dbapi.aux_get(cpv, ['BUILD_TIME'])[0]
> -   clean_me[cpv] = [pkg for pkg in clean_me[cpv]
> -   # only keep path if BUILD_TIME is identical 
> with vartree
> -   if bin_dbapi.aux_get(pkg, ['BUILD_TIME'])[0] 
> != buildtime]
> -   if not clean_me[cpv]:
> -   # nothing we can clean for this package
> -   del clean_me[cpv]
> -   

[gentoo-portage-dev] [PATCH gentoolkit 2/2] eclean: Add option to delete binpkgs with changed deps

2020-02-20 Thread Matt Turner
Signed-off-by: Matt Turner 
---
 pym/gentoolkit/eclean/cli.py|  7 ++-
 pym/gentoolkit/eclean/search.py | 30 +-
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/eclean/cli.py b/pym/gentoolkit/eclean/cli.py
index 1a99b3e..39aafd3 100644
--- a/pym/gentoolkit/eclean/cli.py
+++ b/pym/gentoolkit/eclean/cli.py
@@ -147,6 +147,8 @@ def printUsage(_error=None, help=None):
or help in ('all','packages'):
print( "Available", yellow("options"),"for the",
green("packages"),"action:", file=out)
+   print( yellow(" --changed-deps")+
+   "   - delete packages for which ebuild 
dependencies have changed", file=out)
print( yellow(" -i, --ignore-failure")+
" - ignore failure to locate PKGDIR", 
file=out)
print( file=out)
@@ -263,6 +265,8 @@ def parseArgs(options={}):
options['size-limit'] = parseSize(a)
elif o in ("-v", "--verbose") and not options['quiet']:
options['verbose'] = True
+   elif o in ("--changed-deps"):
+   options['changed-deps'] = True
elif o in ("-i", "--ignore-failure"):
options['ignore-failure'] = True
else:
@@ -290,7 +294,7 @@ 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"]
+   getopt_options['long']['packages'] = ["ignore-failure", "changed-deps"]
# set default options, except 'nocolor', which is set in main()
options['interactive'] = False
options['pretend'] = False
@@ -303,6 +307,7 @@ def parseArgs(options={}):
options['fetch-restricted'] = False
options['size-limit'] = 0
options['verbose'] = False
+   options['changed-deps'] = 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 831ba39..da8c286 100644
--- a/pym/gentoolkit/eclean/search.py
+++ b/pym/gentoolkit/eclean/search.py
@@ -13,6 +13,8 @@ import sys
 from functools import partial
 
 import portage
+from portage.dep import Atom, use_reduce
+from portage.dep._slot_operator import strip_slots
 
 import gentoolkit.pprinter as pp
 from gentoolkit.eclean.exclude import (exclDictMatchCP, exclDictExpand,
@@ -488,6 +490,17 @@ class DistfilesSearch(object):
return clean_me, saved
 
 
+def _deps_equal(deps_a, deps_b, eapi, uselist=None):
+"""Compare two dependency lists given a set of USE flags"""
+if deps_a == deps_b: return True
+
+deps_a = use_reduce(deps_a, uselist=uselist, eapi=eapi, token_class=Atom)
+deps_b = use_reduce(deps_b, uselist=uselist, eapi=eapi, token_class=Atom)
+strip_slots(deps_a)
+strip_slots(deps_b)
+return deps_a == deps_b
+
+
 def findPackages(
 options,
 exclude=None,
@@ -564,7 +577,22 @@ def findPackages(
 
 # Exclude if binpkg exists in the porttree and not --deep
 if not destructive and port_dbapi.cpv_exists(cpv):
-continue
+if not options['changed-deps']:
+continue
+
+uselist = bin_dbapi.aux_get(cpv, ['USE'])[0].split()
+all_equal = True
+
+for k in ('RDEPEND', 'PDEPEND'):
+binpkg_deps = bin_dbapi.aux_get(cpv, [k])
+ebuild_deps = port_dbapi.aux_get(cpv, [k])
+
+if not _deps_equal(binpkg_deps, ebuild_deps, cpv.eapi, 
uselist):
+all_equal = False
+break
+
+if all_equal:
+continue
 
 if destructive and var_dbapi.cpv_exists(cpv):
 # Exclude if an instance of the package is installed due to
-- 
2.24.1




[gentoo-portage-dev] [PATCH gentoolkit 1/2] eclean: Rewrite findPackages()

2020-02-20 Thread Matt Turner
I found the original code to be nearly incomprehensible. Instead of
populating a dict of potential binpkgs to remove and then removing from
the to-be-removed list, just selectively add to-be-removed packages.

Signed-off-by: Matt Turner 
---
I switched from tabs to spaces in the process. I can revert back if
desired.

 pym/gentoolkit/eclean/search.py | 189 
 1 file changed, 94 insertions(+), 95 deletions(-)

diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py
index 58bd97e..831ba39 100644
--- a/pym/gentoolkit/eclean/search.py
+++ b/pym/gentoolkit/eclean/search.py
@@ -489,98 +489,97 @@ class DistfilesSearch(object):
 
 
 def findPackages(
-   options,
-   exclude=None,
-   destructive=False,
-   time_limit=0,
-   package_names=False,
-   pkgdir=None,
-   port_dbapi=portage.db[portage.root]["porttree"].dbapi,
-   var_dbapi=portage.db[portage.root]["vartree"].dbapi
-   ):
-   """Find all obsolete binary packages.
-
-   XXX: packages are found only by symlinks.
-   Maybe i should also return .tbz2 files from All/ that have
-   no corresponding symlinks.
-
-   @param options: dict of options determined at runtime
-   @param exclude: an exclusion dict as defined in
-   exclude.parseExcludeFile class.
-   @param destructive: boolean, defaults to False
-   @param time_limit: integer time value as returned by parseTime()
-   @param package_names: boolean, defaults to False.
-   used only if destructive=True
-   @param pkgdir: path to the binary package dir being checked
-   @param port_dbapi: defaults to 
portage.db[portage.root]["porttree"].dbapi
-   can be overridden for tests.
-   @param var_dbapi: defaults to portage.db[portage.root]["vartree"].dbapi
-   can be overridden for tests.
-
-   @rtype: dict
-   @return clean_me i.e. {'cat/pkg-ver.tbz2': [filepath],}
-   """
-   if exclude is None:
-   exclude = {}
-   clean_me = {}
-   # create a full package dictionary
-
-   # now do an access test, os.walk does not error for "no read permission"
-   try:
-   test = os.listdir(pkgdir)
-   del test
-   except EnvironmentError as er:
-   if options['ignore-failure']:
-   exit(0)
-   print( pp.error("Error accessing PKGDIR." ), file=sys.stderr)
-   print( pp.error("(Check your make.conf file and 
environment)."), file=sys.stderr)
-   print( pp.error("Error: %s" %str(er)), file=sys.stderr)
-   exit(1)
-
-   # if portage supports FEATURES=binpkg-multi-instance, then
-   # cpv_all can return multiple instances per cpv, where
-   # instances are distinguishable by some extra attributes
-   # provided by portage's _pkg_str class
-   bin_dbapi = portage.binarytree(pkgdir=pkgdir, 
settings=var_dbapi.settings).dbapi
-   for cpv in bin_dbapi.cpv_all():
-   mtime = int(bin_dbapi.aux_get(cpv, ['_mtime_'])[0])
-   if time_limit and mtime >= time_limit:
-   # time-limit exclusion
-   continue
-   # dict is cpv->[pkgs] (supports binpkg-multi-instance)
-   clean_me.setdefault(cpv, []).append(cpv)
-
-   # keep only obsolete ones
-   if destructive and package_names:
-   cp_all = dict.fromkeys(var_dbapi.cp_all())
-   else:
-   cp_all = {}
-   for cpv in list(clean_me):
-   if exclDictMatchCP(exclude,portage.cpv_getkey(cpv)):
-   # exclusion because of the exclude file
-   del clean_me[cpv]
-   continue
-   if not destructive and port_dbapi.cpv_exists(cpv):
-   # exclusion because pkg still exists (in porttree)
-   del clean_me[cpv]
-   continue
-   if destructive and var_dbapi.cpv_exists(cpv):
-   buildtime = var_dbapi.aux_get(cpv, ['BUILD_TIME'])[0]
-   clean_me[cpv] = [pkg for pkg in clean_me[cpv]
-   # only keep path if BUILD_TIME is identical 
with vartree
-   if bin_dbapi.aux_get(pkg, ['BUILD_TIME'])[0] != 
buildtime]
-   if not clean_me[cpv]:
-   # nothing we can clean for this package
-   del clean_me[cpv]
-   continue
-   if portage.cpv_getkey(cpv) in cp_all and 
port_dbapi.cpv_exists(cpv):
-   # exclusion because of --package-names
-   del clean_me[cpv]
-
-   # the getname method correctly supports 

Re: [gentoo-portage-dev] [PATCH] einstalldocs: Fix test for DOCS being unset.

2020-02-20 Thread Ulrich Mueller
> On Thu, 20 Feb 2020, Zac Medico wrote:

> Looks good. Even though earlier EAPIs are deprecated, would there be a
> problem with updating __eapi4_src_install for consistency?

I'd rather not, because for EAPIs 4 and 5 PMS specifies that the return
status of declare -p should be tested [1].

Presumably it wouldn't make much of a difference, because we don't
account for the "assigned, but empty" case in these EAPIs.
src_install format 4 will just fail for DOCS="" or DOCS=().

[1] https://projects.gentoo.org/pms/7/pms.html#x1-94001r7


signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] einstalldocs: Fix test for DOCS being unset.

2020-02-20 Thread Zac Medico
On 2/20/20 5:04 AM, Ulrich Müller wrote:
> The current test does not exactly test for unset DOCS, because it also
> evaluates as true if the variable has attributes. Such attributes can
> be defined even for an unset variable.
> 
> Therefore test the output of declare -p for presence of an = sign
> instead, which indicates that a value has been assigned to the
> variable (bug 710076 comment #2).
> 
> PMS reference: Algorithm 12.4, line 7:
> https://projects.gentoo.org/pms/7/pms.html#x1-135011r183
> 
> See also bash upstream discussion:
> https://lists.gnu.org/archive/html/bug-bash/2020-02/msg00045.html
> 
> Closes: https://bugs.gentoo.org/710076
> Signed-off-by: Ulrich Müller 
> ---
>   bin/phase-helpers.sh | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
> index 3deb28c68..9495465f9 100644
> --- a/bin/phase-helpers.sh
> +++ b/bin/phase-helpers.sh
> @@ -1,5 +1,5 @@
>   #!/bin/bash
> -# Copyright 1999-2019 Gentoo Authors
> +# Copyright 1999-2020 Gentoo Authors
>   # Distributed under the terms of the GNU General Public License v2
>   
>   if ___eapi_has_DESTTREE_INSDESTTREE; then
> @@ -953,7 +953,7 @@ fi
>   if ___eapi_has_einstalldocs; then
>   einstalldocs() {
>   (
> - if ! declare -p DOCS &>/dev/null ; then
> + if [[ $(declare -p DOCS 2>/dev/null) != *=* ]]; then
>   local d
>   for d in README* ChangeLog AUTHORS NEWS TODO 
> CHANGES \
>   THANKS BUGS FAQ CREDITS 
> CHANGELOG ; do
> 

Looks good. Even though earlier EAPIs are deprecated, would there be a
problem with updating __eapi4_src_install for consistency?
-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] [PATCH 0/3] *** SUBJECT HERE ***

2020-02-20 Thread Michał Górny
On Thu, 2020-02-20 at 17:54 +0100, Ulrich Müller wrote:
> At present, the eclass-to-manpage.awk conversion script supports an
> escape mechanism via the @ROFF tag, which allows to write groff commands
> in eclass documentation. This makes direct conversion of eclass
> documentation to any other format than a man page close to impossible,
> because processing with groff is required.
> 
> The following series of commits will replace or remove all @ROFF tags
> from eclass documentation. The conversion script was already updated:
> https://github.com/mgorny/eclass-to-manpage/commit/2be88fd421c7549f659439a287bbb849418a3a3e
> 
> Ulrich Müller (3):
>   eapi7-ver.eclass: Replace @ROFF in eclass documentation.
>   elisp-common.eclass: Replace @ROFF in eclass documentation.
>   savedconfig.eclass: Remove @ROFF from eclass documentation.
> 
>  eclass/eapi7-ver.eclass|  8 +++-
>  eclass/elisp-common.eclass | 14 +-
>  eclass/savedconfig.eclass  | 20 ++--
>  3 files changed, 18 insertions(+), 24 deletions(-)
> 

Thanks for doing this.  This is certainly going to improve readability.

-- 
Best regards,
Michał Górny



signature.asc
Description: This is a digitally signed message part


[gentoo-dev] [PATCH 3/3] savedconfig.eclass: Remove @ROFF from eclass documentation.

2020-02-20 Thread Ulrich Müller
Remove all @ROFF tokens, because they make conversion to any format
other than a man page very difficult. Replace the numbered list by
explicitly numbered paragraphs.

Signed-off-by: Ulrich Müller 
---
 eclass/savedconfig.eclass | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/eclass/savedconfig.eclass b/eclass/savedconfig.eclass
index 8f64c5b8edd..e90a9b618d6 100644
--- a/eclass/savedconfig.eclass
+++ b/eclass/savedconfig.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: savedconfig.eclass
@@ -14,21 +14,21 @@
 # so users can modify these config files and the ebuild will take it
 # into account as needed.
 #
-# @ROFF .nr R 1 1
 # Typically you can create your own configuration files quickly by
 # doing:
-# @ROFF .IP \nR 3
-# Build the package with FEATURES=noclean USE=savedconfig.
-# @ROFF .IP \n+R
-# Go into the build dir and edit the relevant configuration system
+#
+# 1. Build the package with FEATURES=noclean USE=savedconfig.
+#
+# 2. Go into the build dir and edit the relevant configuration system
 # (e.g. `make menuconfig` or `nano config-header.h`).  You can look
 # at the files in /etc/portage/savedconfig/ to see what files get
 # loaded/restored.
-# @ROFF .IP \n+R
-# Copy the modified configuration files out of the workdir and to
+#
+# 3. Copy the modified configuration files out of the workdir and to
 # the paths in /etc/portage/savedconfig/.
-# @ROFF .IP \n+R
-# Emerge the package with just USE=savedconfig to get the custom build.
+#
+# 4. Emerge the package with just USE=savedconfig to get the custom
+# build.
 
 inherit portability
 
-- 
2.25.1


signature.asc
Description: PGP signature


[gentoo-dev] [PATCH 1/3] eapi7-ver.eclass: Replace @ROFF in eclass documentation.

2020-02-20 Thread Ulrich Müller
Replace all @ROFF tokens by @SUBSECTION, because the former makes
conversion to any format other than a man page very difficult.

Signed-off-by: Ulrich Müller 
---
 eclass/eapi7-ver.eclass | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/eclass/eapi7-ver.eclass b/eclass/eapi7-ver.eclass
index b7f9715bc42..8f13fc9af76 100644
--- a/eclass/eapi7-ver.eclass
+++ b/eclass/eapi7-ver.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: eapi7-ver.eclass
@@ -17,8 +17,7 @@
 #
 # https://bugs.gentoo.org/482170
 #
-# @ROFF .SS
-# Version strings
+# @SUBSECTION Version strings
 #
 # The functions support arbitrary version strings consisting of version
 # components interspersed with (possibly empty) version separators.
@@ -50,8 +49,7 @@
 #  0 1  1
 # @CODE
 #
-# @ROFF .SS
-# Ranges
+# @SUBSECTION Ranges
 #
 # A range can be specified as 'm' for m-th version component, 'm-'
 # for all components starting with m-th or 'm-n' for components starting
-- 
2.25.1


signature.asc
Description: PGP signature


[gentoo-dev] [PATCH 2/3] elisp-common.eclass: Replace @ROFF in eclass documentation.

2020-02-20 Thread Ulrich Müller
Replace all @ROFF tokens by @SUBSECTION, because the former makes
conversion to any format other than a man page very difficult.

Signed-off-by: Ulrich Müller 
---
 eclass/elisp-common.eclass | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
index b5ea21cb22b..6fa2bbea614 100644
--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: elisp-common.eclass
@@ -43,8 +43,7 @@
 # Please note that this should be done only for packages that are known
 # to fail with lower Emacs versions.
 #
-# @ROFF .SS
-# src_compile() usage:
+# @SUBSECTION src_compile() usage:
 #
 # An elisp file is compiled by the elisp-compile() function defined
 # here and simply takes the source files as arguments.  The case of
@@ -64,8 +63,7 @@
 # comments.  See the Emacs Lisp Reference Manual (node "Autoload") for
 # a detailed explanation.
 #
-# @ROFF .SS
-# src_install() usage:
+# @SUBSECTION src_install() usage:
 #
 # The resulting compiled files (.elc) should be put in a subdirectory of
 # /usr/share/emacs/site-lisp/ which is named after the first argument
@@ -132,8 +130,7 @@
 # "50${PN}-gentoo.el".  If your subdirectory is not named ${PN}, give
 # the differing name as second argument.
 #
-# @ROFF .SS
-# pkg_setup() usage:
+# @SUBSECTION pkg_setup() usage:
 #
 # If your ebuild uses the elisp-compile eclass function to compile
 # its elisp files (see above), then you don't need a pkg_setup phase,
@@ -149,8 +146,7 @@
 # When having optional Emacs support, you should prepend "use emacs &&"
 # to above call of elisp-check-emacs-version().
 #
-# @ROFF .SS
-# pkg_postinst() / pkg_postrm() usage:
+# @SUBSECTION pkg_postinst() / pkg_postrm() usage:
 #
 # After that you need to recreate the start-up file of Emacs after
 # emerging and unmerging by using
-- 
2.25.1


signature.asc
Description: PGP signature


[gentoo-dev] [PATCH 0/3] *** SUBJECT HERE ***

2020-02-20 Thread Ulrich Müller
At present, the eclass-to-manpage.awk conversion script supports an
escape mechanism via the @ROFF tag, which allows to write groff commands
in eclass documentation. This makes direct conversion of eclass
documentation to any other format than a man page close to impossible,
because processing with groff is required.

The following series of commits will replace or remove all @ROFF tags
from eclass documentation. The conversion script was already updated:
https://github.com/mgorny/eclass-to-manpage/commit/2be88fd421c7549f659439a287bbb849418a3a3e

Ulrich Müller (3):
  eapi7-ver.eclass: Replace @ROFF in eclass documentation.
  elisp-common.eclass: Replace @ROFF in eclass documentation.
  savedconfig.eclass: Remove @ROFF from eclass documentation.

 eclass/eapi7-ver.eclass|  8 +++-
 eclass/elisp-common.eclass | 14 +-
 eclass/savedconfig.eclass  | 20 ++--
 3 files changed, 18 insertions(+), 24 deletions(-)

-- 
2.25.1


signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH] einstalldocs: Fix test for DOCS being unset.

2020-02-20 Thread Ulrich Müller
The current test does not exactly test for unset DOCS, because it also
evaluates as true if the variable has attributes. Such attributes can
be defined even for an unset variable.

Therefore test the output of declare -p for presence of an = sign
instead, which indicates that a value has been assigned to the
variable (bug 710076 comment #2).

PMS reference: Algorithm 12.4, line 7:
https://projects.gentoo.org/pms/7/pms.html#x1-135011r183

See also bash upstream discussion:
https://lists.gnu.org/archive/html/bug-bash/2020-02/msg00045.html

Closes: https://bugs.gentoo.org/710076
Signed-off-by: Ulrich Müller 
---
 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3deb28c68..9495465f9 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 if ___eapi_has_DESTTREE_INSDESTTREE; then
@@ -953,7 +953,7 @@ fi
 if ___eapi_has_einstalldocs; then
einstalldocs() {
(
-   if ! declare -p DOCS &>/dev/null ; then
+   if [[ $(declare -p DOCS 2>/dev/null) != *=* ]]; then
local d
for d in README* ChangeLog AUTHORS NEWS TODO 
CHANGES \
THANKS BUGS FAQ CREDITS 
CHANGELOG ; do
-- 
2.25.1


signature.asc
Description: PGP signature