Re: [gentoo-portage-dev] [PATCH 0/4] Add sync-rcu support for rsync (bug 662070)

2018-08-09 Thread Brian Dolbec
On Mon,  6 Aug 2018 00:40:29 -0700
Zac Medico  wrote:

> Add a boolean sync-rcu repos.conf setting that behaves as follows:
> 
> sync-rcu = yes|no
> 
> Enable read-copy-update (RCU) behavior for sync operations. The
> current latest immutable version of a repository will be
> referenced by a symlink found where the repository would normally be
> located (see the location setting). Repository consumers should
> resolve the cannonical path of this symlink before attempt to access
> the repository, and all operations should be read-only, since
> the repository is considered immutable. Updates occur by atomic
> replacement of the symlink, which causes new consumers to use the
> new immutable version, while any earlier consumers continue to
> use the cannonical path that was resolved earlier. This option
> requires sync-allow-hardlinks and sync-rcu-store-dir options to
> be enabled, and currently also requires that sync-type is set
> to rsync. This option is disabled by default, since the symlink
> usage would require special handling for scenarios involving bind
> mounts and chroots.
> 
> sync-rcu-store-dir
> 
> Directory path reserved for sync-rcu storage. This directory must
> have a unique value for each repository (do not set it in the
> DEFAULT section).  This directory must not contain any other files
> or directories aside from those that are created automatically
> when sync-rcu is enabled.
> 
> sync-rcu-spare-snapshots = 1
> 
> Number of spare snapshots for sync-rcu to retain with expired
> ttl. This protects the previous latest snapshot from being removed
> immediately after a new version becomes available, since it might
> still be used by running processes.
> 
> sync-rcu-ttl-days = 7
> 
> Number of days for sync-rcu to retain previous immutable snapshots
> of a repository. After the ttl of a particular snapshot has
> expired, it will be remove automatically (the latest snapshot
> is exempt, and sync-rcu-spare-snapshots configures the number of
> previous snapshots that are exempt). If the ttl is set too low,
> then a snapshot could expire while it is in use by a running
> process.
> 
> Zac Medico (4):
>   Implement asyncio.iscoroutinefunction for compat_coroutine
>   Add _sync_decorator module
>   rsync: split out repo storage framework
>   Add sync-rcu support for rsync (bug 662070)
> 
>  lib/portage/repository/config.py   |  36 ++-
>  lib/portage/repository/storage/__init__.py |   0
>  .../repository/storage/hardlink_quarantine.py  |  95 
>  lib/portage/repository/storage/hardlink_rcu.py | 251
> +
> lib/portage/repository/storage/inplace.py  |  49 
> lib/portage/repository/storage/interface.py|  87 +++
> lib/portage/sync/controller.py |   1 +
> lib/portage/sync/modules/rsync/rsync.py|  85 ++-
> lib/portage/sync/syncbase.py   |  33
> +++ .../tests/util/futures/test_compat_coroutine.py|  14 ++
> lib/portage/util/futures/_asyncio/__init__.py  |  14 ++
> lib/portage/util/futures/_sync_decorator.py|  54 +
> lib/portage/util/futures/compat_coroutine.py   |  12 +
> man/portage.5  |  35 +++ 14 files
> changed, 700 insertions(+), 66 deletions(-) create mode 100644
> lib/portage/repository/storage/__init__.py create mode 100644
> lib/portage/repository/storage/hardlink_quarantine.py create mode
> 100644 lib/portage/repository/storage/hardlink_rcu.py create mode
> 100644 lib/portage/repository/storage/inplace.py create mode 100644
> lib/portage/repository/storage/interface.py create mode 100644
> lib/portage/util/futures/_sync_decorator.py
> 

series looks good, just the one typo



Re: [gentoo-portage-dev] [PATCH 3/4] rsync: split out repo storage framework

2018-08-09 Thread Brian Dolbec
On Mon,  6 Aug 2018 00:40:32 -0700
Zac Medico  wrote:

> Since there aremany ways to manage repository storage, split out a
> repo storage framework. The HardlinkQuarantineRepoStorage class
> implements the existing default behavior, and the InplaceRepoStorage
> class implements the legacy behavior (when sync-allow-hardlinks is
> disabled in repos.conf).
> 
> Each class implements RepoStorageInterface, which uses coroutine
> methods since coroutines are well-suited to the I/O bound tasks that
> these methods perform. The _sync_decorator is used to convert
> coroutine methods to synchronous methods, for smooth integration into
> the surrounding synchronous code.
> 
> Bug: https://bugs.gentoo.org/662070
>

missing space in first line of commit message
s/aremany/are many

 ---



Re: [gentoo-portage-dev] [PATCH] XARGS: use gxargs for USERLAND=BSD (bug 663256)

2018-08-09 Thread Brian Dolbec
On Thu,  9 Aug 2018 16:04:42 -0700
Zac Medico  wrote:

> For USERLAND=BSD, set XARGS="gxargs -r" if gxargs is available,
> so the code from bug 630292 works for USERLAND=BSD.
> 
> Fixes: 50283f1abb77 (install-qa-check.d/60pngfix: parallel support
> (bug 630292)) Reported-by: Michał Górny 
> Bug: https://bugs.gentoo.org/663256
> ---
>  bin/isolated-functions.sh | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
> index 28ca94532..cac42a4c5 100644
> --- a/bin/isolated-functions.sh
> +++ b/bin/isolated-functions.sh
> @@ -448,7 +448,11 @@ fi
>  if [[ -z ${XARGS} ]] ; then
>   case ${USERLAND} in
>   BSD)
> - export XARGS="xargs"
> + if type -P gxargs > /dev/null; then
> + export XARGS="gxargs -r"
> + else
> + export XARGS="xargs"
> + fi
>   ;;
>   *)
>   export XARGS="xargs -r"

LGTM



Re: [gentoo-portage-dev] [PATCH] XARGS: use gxargs for USERLAND=BSD (bug 663256)

2018-08-09 Thread M. J. Everitt
On 10/08/18 00:17, M. J. Everitt wrote:
> On 10/08/18 00:04, Zac Medico wrote:
>> For USERLAND=BSD, set XARGS="gxargs -r" if gxargs is available,
>> so the code from bug 630292 works for USERLAND=BSD.
>>
>> Fixes: 50283f1abb77 (install-qa-check.d/60pngfix: parallel support (bug 
>> 630292))
>> Reported-by: Michał Górny 
>> Bug: https://bugs.gentoo.org/663256
>> ---
>>  bin/isolated-functions.sh | 6 +-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
>> index 28ca94532..cac42a4c5 100644
>> --- a/bin/isolated-functions.sh
>> +++ b/bin/isolated-functions.sh
>> @@ -448,7 +448,11 @@ fi
>>  if [[ -z ${XARGS} ]] ; then
>>  case ${USERLAND} in
>>  BSD)
>> -export XARGS="xargs"
>> +if type -P gxargs > /dev/null; then
>> +export XARGS="gxargs -r"
>> +else
>> +export XARGS="xargs"
>> +fi
>>  ;;
>>  *)
>>  export XARGS="xargs -r"
> Isn't the else clause there redundant?
>
Oops, sorry missed the minus before the first export .. my bad .. 



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-portage-dev] [PATCH] XARGS: use gxargs for USERLAND=BSD (bug 663256)

2018-08-09 Thread M. J. Everitt
On 10/08/18 00:04, Zac Medico wrote:
> For USERLAND=BSD, set XARGS="gxargs -r" if gxargs is available,
> so the code from bug 630292 works for USERLAND=BSD.
>
> Fixes: 50283f1abb77 (install-qa-check.d/60pngfix: parallel support (bug 
> 630292))
> Reported-by: Michał Górny 
> Bug: https://bugs.gentoo.org/663256
> ---
>  bin/isolated-functions.sh | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
> index 28ca94532..cac42a4c5 100644
> --- a/bin/isolated-functions.sh
> +++ b/bin/isolated-functions.sh
> @@ -448,7 +448,11 @@ fi
>  if [[ -z ${XARGS} ]] ; then
>   case ${USERLAND} in
>   BSD)
> - export XARGS="xargs"
> + if type -P gxargs > /dev/null; then
> + export XARGS="gxargs -r"
> + else
> + export XARGS="xargs"
> + fi
>   ;;
>   *)
>   export XARGS="xargs -r"
Isn't the else clause there redundant?



signature.asc
Description: OpenPGP digital signature


[gentoo-portage-dev] [PATCH] XARGS: use gxargs for USERLAND=BSD (bug 663256)

2018-08-09 Thread Zac Medico
For USERLAND=BSD, set XARGS="gxargs -r" if gxargs is available,
so the code from bug 630292 works for USERLAND=BSD.

Fixes: 50283f1abb77 (install-qa-check.d/60pngfix: parallel support (bug 630292))
Reported-by: Michał Górny 
Bug: https://bugs.gentoo.org/663256
---
 bin/isolated-functions.sh | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 28ca94532..cac42a4c5 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -448,7 +448,11 @@ fi
 if [[ -z ${XARGS} ]] ; then
case ${USERLAND} in
BSD)
-   export XARGS="xargs"
+   if type -P gxargs > /dev/null; then
+   export XARGS="gxargs -r"
+   else
+   export XARGS="xargs"
+   fi
;;
*)
export XARGS="xargs -r"
-- 
2.16.4




[gentoo-dev] [PATCH v2] libretro-core.eclass: An eclass to streamline the construction of Libretro core ebuilds

2018-08-09 Thread Craig Andrews
I'm proposing the addition of a new eclass,  libretro-core.eclass, which 
I'll use when adding a number of libretro ebuilds.


This version incorporates all the changes and suggestions posed so far.

The pull request which includes this eclass as well as a few ebuilds 
using it (with more to come) can be found at 
https://github.com/gentoo/gentoo/pull/9330


Thanks,
~Craig

---
 eclass/libretro-core.eclass | 197 
 1 file changed, 197 insertions(+)
 create mode 100644 eclass/libretro-core.eclass

diff --git a/eclass/libretro-core.eclass b/eclass/libretro-core.eclass
new file mode 100644
index ..510f905111ce
--- /dev/null
+++ b/eclass/libretro-core.eclass
@@ -0,0 +1,197 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: libretro-core.eclass
+# @MAINTAINER:
+# candr...@gentoo.org
+# @AUTHOR:
+# Cecil Curry 
+# Craig Andrews 
+# @BLURB: Simplify libretro core ebuilds
+# @DESCRIPTION:
+# The libretro eclass is designed to streamline the construction of
+# ebuilds for Libretro core ebuilds.
+#
+# Libretro cores can be found under https://github.com/libretro/
+#
+# They all use the same basic make based build system, are located
+# in the same github account, and do not release named or numbered
+# versions (so ebuild versions for git commits are keys).
+# This eclass covers those commonalities reducing much duplication
+# between the ebuilds.
+# @EXAMPLE:
+# @CODE
+# EAPI=7
+#
+# LIBRETRO_CORE_NAME="2048"
+# LIBRETRO_COMMIT_SHA="45655d3662e4cbcd8afb28e2ee3f5494a75888de"
+# KEYWORDS="~amd64 ~x86"
+# inherit libretro-core
+#
+# DESCRIPTION="Port of 2048 puzzle game to the libretro API"
+# LICENSE="Unlicense"
+# SLOT="0"
+# @CODE
+
+if [[ -z ${_LIBRETRO_CORE_ECLASS} ]]; then
+_LIBRETRO_CORE_ECLASS=1
+
+IUSE="debug"
+
+# @ECLASS-VARIABLE: LIBRETRO_CORE_NAME
+# @REQUIRED
+# @DESCRIPTION:
+# Name of this Libretro core. The libretro-core_src_install() phase 
function
+# will install the shared library 
"${S}/${LIBRETRO_CORE_NAME}_libretro.so" as a
+# Libretro core. Defaults to the name of the current package excluding 
the

+# "libretro-" prefix (e.g., "mgba" for the package "libretro-mgba").
+: ${LIBRETRO_CORE_NAME:=${PN#libretro-}}
+
+# @ECLASS-VARIABLE: LIBRETRO_COMMIT_SHA
+# @DESCRIPTION:
+# Commit SHA used for SRC_URI will die if not set in < ebuilds.
+# Needs to be set before inherit.
+
+# @ECLASS-VARIABLE: LIBRETRO_REPO_NAME
+# @REQUIRED
+# @DESCRIPTION:
+# Contains the real repo name of the core formatted as 
"repouser/reponame".
+# Needs to be set before inherit. Otherwise defaults to 
"libretro/${PN}"

+: ${LIBRETRO_REPO_NAME:="libretro/libretro-${LIBRETRO_CORE_NAME}"}
+
+: ${HOMEPAGE:="https://github.com/${LIBRETRO_REPO_NAME}"}
+
+if [[ ${PV} == * ]]; then
+   : ${EGIT_REPO_URI:="https://github.com/${LIBRETRO_REPO_NAME}.git"}
+   inherit git-r3
+else
+	[[ -z "${LIBRETRO_COMMIT_SHA}" ]] && die "LIBRETRO_COMMIT_SHA must be 
set before inherit."

+   S="${WORKDIR}/${LIBRETRO_REPO_NAME##*/}-${LIBRETRO_COMMIT_SHA}"
+	: 
${SRC_URI:="https://github.com/${LIBRETRO_REPO_NAME}/archive/${LIBRETRO_COMMIT_SHA}.tar.gz 
-> ${P}.tar.gz"}

+fi
+inherit flag-o-matic
+
+# @ECLASS-VARIABLE: LIBRETRO_CORE_LIB_FILE
+# @REQUIRED
+# @DESCRIPTION:
+# Absolute path of this Libretro core's shared library.
+: ${LIBRETRO_CORE_LIB_FILE:="${S}/${LIBRETRO_CORE_NAME}_libretro.so"}
+
+case "${EAPI:-0}" in
+   6|7)
+   EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install
+   ;;
+   *)
+   die "EAPI=${EAPI} is not supported" ;;
+esac
+
+# @FUNCTION: libretro-core_src_unpack
+# @DESCRIPTION:
+# The libretro-core src_unpack function which is exported.
+#
+# This function retrieves the remote Libretro core info files.
+libretro-core_src_unpack() {
+   # If this is a live ebuild, retrieve this core's remote repository.
+   if [[ ${PV} == * ]]; then
+   git-r3_src_unpack
+		# Add used commit SHA for version information, the above could also 
work.

+   LIBRETRO_COMMIT_SHA=$(git -C "${WORKDIR}/${P}" rev-parse HEAD)
+   # Else, unpack this core's local tarball.
+   else
+   default_src_unpack
+   fi
+}
+
+# @FUNCTION: libretro-core_src_prepare
+# @DESCRIPTION:
+# The libretro-core src_prepare function which is exported.
+#
+# This function prepares the source by making custom modifications.
+libretro-core_src_prepare() {
+   ebegin "Attempting to hack Makefiles to use custom cflags"
+   # Populate COMMIT for GIT_VERSION
+   CUSTOM_LIBRETRO_COMMIT_SHA="\" ${LIBRETRO_COMMIT_SHA:0:7}\""
+   local makefile
+   local flags_modified=0
+   local shopt_saved=$(shopt -p nullglob)
+   shopt -s nullglob
+	for makefile in "${S}"/[Mm]akefile* 
"${S}"/target-libretro/[Mm]akefile*; do

+   # * Convert CRLF to LF
+   # * Expand *FLAGS to prevent potential 

Re: [gentoo-dev] Experimental 2-step authentication support on dev.gentoo.org

2018-08-09 Thread Richard Yao


> On Aug 9, 2018, at 4:27 AM, Michał Górny  wrote:
> 
> Hi, everyone.
> 
> Just a short notice: we've enabled experimental support for 2-step
> authentication when logging in to woodpecker via SSH.  For more details,
> see [1].
Awesome. I had no idea that the hooks for this were in place.
> 
> TL;DR: as a technical limitation, some SSH clients may start asking you
> for a password.  Using any non-empty string will work.
> 
> [1]:https://wiki.gentoo.org/wiki/Project:Infrastructure/dev.gentoo.org_2-step_authentication
> 
> -- 
> Best regards,
> Michał Górny




[gentoo-dev] [PATCH v2 8/8] eutils.eclass: Ban path_exists

2018-08-09 Thread Michał Górny
---
 eclass/eutils.eclass   | 30 -
 eclass/tests/eutils_path_exists.sh | 35 --
 2 files changed, 4 insertions(+), 61 deletions(-)
 delete mode 100755 eclass/tests/eutils_path_exists.sh

diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 9b4767e1874a..3b9fc28319c6 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -181,33 +181,11 @@ make_wrapper() {
fi
 }
 
-# @FUNCTION: path_exists
-# @USAGE: [-a|-o] 
-# @DESCRIPTION:
-# Check if the specified paths exist.  Works for all types of paths
-# (files/dirs/etc...).  The -a and -o flags control the requirements
-# of the paths.  They correspond to "and" and "or" logic.  So the -a
-# flag means all the paths must exist while the -o flag means at least
-# one of the paths must exist.  The default behavior is "and".  If no
-# paths are specified, then the return value is "false".
 path_exists() {
-   local opt=$1
-   [[ ${opt} == -[ao] ]] && shift || opt="-a"
-
-   # no paths -> return false
-   # same behavior as: [[ -e "" ]]
-   [[ $# -eq 0 ]] && return 1
-
-   local p r=0
-   for p in "$@" ; do
-   [[ -e ${p} ]]
-   : $(( r += $? ))
-   done
-
-   case ${opt} in
-   -a) return $(( r != 0 )) ;;
-   -o) return $(( r == $# )) ;;
-   esac
+   eerror "path_exists has been removed.  Please see the following post"
+   eerror "for a replacement snippet:"
+   eerror 
"https://blogs.gentoo.org/mgorny/2018/08/09/inlining-path_exists/;
+   die "path_exists is banned"
 }
 
 # @FUNCTION: use_if_iuse
diff --git a/eclass/tests/eutils_path_exists.sh 
b/eclass/tests/eutils_path_exists.sh
deleted file mode 100755
index 00a89c7e446d..
--- a/eclass/tests/eutils_path_exists.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-source tests-common.sh
-
-inherit eutils
-
-test-path_exists() {
-   local exp=$1; shift
-   tbegin "path_exists($*) == ${exp}"
-   path_exists "$@"
-   [[ ${exp} -eq $? ]]
-   tend $?
-}
-
-test-path_exists 1
-test-path_exists 1 -a
-test-path_exists 1 -o
-
-good="/ . tests-common.sh /bin/bash"
-test-path_exists 0 ${good}
-test-path_exists 0 -a ${good}
-test-path_exists 0 -o ${good}
-
-bad="/asjdkfljasdlfkja jlakjdsflkasjdflkasdjflkasdjflaskdjf"
-test-path_exists 1 ${bad}
-test-path_exists 1 -a ${bad}
-test-path_exists 1 -o ${bad}
-
-test-path_exists 1 ${good} ${bad}
-test-path_exists 1 -a ${good} ${bad}
-test-path_exists 0 -o ${good} ${bad}
-
-texit
-- 
2.18.0




[gentoo-dev] [PATCH v2 7/8] autotools-utils.eclass: Remove EAPI 2&3 support

2018-08-09 Thread Michał Górny
---
 eclass/autotools-utils.eclass | 29 -
 1 file changed, 4 insertions(+), 25 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index f8d2c7fdc247..b0047048662d 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.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: autotools-utils.eclass
@@ -89,7 +89,7 @@
 
 case ${EAPI:-0} in
6) die "${ECLASS}.eclass is banned in EAPI ${EAPI}";;
-   2|3|4|5) ;;
+   4|5) ;;
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -281,8 +281,6 @@ autotools-utils_src_configure() {
[[ -z ${myeconfargs+1} || $(declare -p myeconfargs) == 'declare -a'* ]] 
\
|| die 'autotools-utils.eclass: myeconfargs has to be an array.'
 
-   [[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX=
-
# Common args
local econfargs=()
 
@@ -338,31 +336,12 @@ autotools-utils_src_install() {
emake DESTDIR="${D}" "$@" install || die "emake install failed"
popd > /dev/null || die
 
-   # Move docs installed by autotools (in EAPI < 4).
-   if [[ ${EAPI} == [23] ]] \
-   && path_exists "${D}${EPREFIX}"/usr/share/doc/${PF}/*; 
then
-   if [[ $(find "${D}${EPREFIX}"/usr/share/doc/${PF}/* -type d) 
]]; then
-   eqawarn "autotools-utils: directories in docdir require 
at least EAPI 4"
-   else
-   mkdir "${T}"/temp-docdir
-   mv "${D}${EPREFIX}"/usr/share/doc/${PF}/* 
"${T}"/temp-docdir/ \
-   || die "moving docs to tempdir failed"
-
-   dodoc "${T}"/temp-docdir/* || die "docdir dodoc failed"
-   rm -r "${T}"/temp-docdir || die
-   fi
-   fi
-
# XXX: support installing them from builddir as well?
if declare -p DOCS &>/dev/null; then
# an empty list == don't install anything
if [[ ${DOCS[@]} ]]; then
-   if [[ ${EAPI} == [23] ]]; then
-   dodoc "${DOCS[@]}" || die
-   else
-   # dies by itself
-   dodoc -r "${DOCS[@]}"
-   fi
+   # dies by itself
+   dodoc -r "${DOCS[@]}"
fi
else
local f
-- 
2.18.0




[gentoo-dev] [PATCH v2 5/8] www-apps/postfixadmin: Replace path_exists with inline logic

2018-08-09 Thread Michał Górny
Replace the call to path_exists with local filename expansion.  While
at it, also kill the ugly ls-abuse in favor of using the results
of earlier expansion.
---
 www-apps/postfixadmin/postfixadmin-3.1.ebuild | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/www-apps/postfixadmin/postfixadmin-3.1.ebuild 
b/www-apps/postfixadmin/postfixadmin-3.1.ebuild
index 3e69bc6b6573..5cb58aab877a 100644
--- a/www-apps/postfixadmin/postfixadmin-3.1.ebuild
+++ b/www-apps/postfixadmin/postfixadmin-3.1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI="6"
 
-inherit eutils user webapp
+inherit user webapp
 
 DESCRIPTION="Web Based Management tool for Postfix style virtual domains and 
users"
 HOMEPAGE="http://postfixadmin.sourceforge.net;
@@ -89,10 +89,12 @@ pkg_postinst() {
 pkg_postrm() {
# Make sure we don't leave broken vacation.pl symlink
find -L "${ROOT}"/var/spool/vacation/ -type l -delete
-   if [[ ! -e "${ROOT}"/var/spool/vacation/vacation.pl ]] &&
-   path_exists "${ROOT}"/var/spool/vacation/vacation.pl-*; then
-   ln -s $(LC_ALL=C ls -1 /var/spool/vacation/vacation.pl-* | tail 
-n1) \
-   "${ROOT}"/var/spool/vacation/vacation.pl || die
+   local shopt_save=$(shopt -p nullglob)
+   shopt -s nullglob
+   local vacation=( "${ROOT}"/var/spool/vacation/vacation.pl-* )
+   ${shopt_save}
+   if [[ ! -e "${ROOT}"/var/spool/vacation/vacation.pl && -n 
${vacation[@]} ]]; then
+   ln -s "${vacation[-1]}" 
"${ROOT}"/var/spool/vacation/vacation.pl || die
ewarn "/var/spool/vacation/vacation.pl was updated to point on 
most"
ewarn "recent verion, but please, do your own checks"
fi
-- 
2.18.0




[gentoo-dev] [PATCH v2 6/8] app-eselect/eselect-opengl: Replace path_exists

2018-08-09 Thread Michał Górny
Replace path_exists call with nullglob-based filename expansion.
---
 .../eselect-opengl/eselect-opengl-1.3.1-r4.ebuild  | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/app-eselect/eselect-opengl/eselect-opengl-1.3.1-r4.ebuild 
b/app-eselect/eselect-opengl/eselect-opengl-1.3.1-r4.ebuild
index 1206be17c265..d3f04c9469cb 100644
--- a/app-eselect/eselect-opengl/eselect-opengl-1.3.1-r4.ebuild
+++ b/app-eselect/eselect-opengl/eselect-opengl-1.3.1-r4.ebuild
@@ -49,11 +49,15 @@ pkg_preinst() {
 }
 
 pkg_postinst() {
-   if path_exists "${EROOT}"/usr/lib*/opengl; then
+   local shopt_save=$(shopt -p nullglob)
+   shopt -s nullglob
+   local opengl_dirs=( "${EROOT}"/usr/lib*/opengl )
+   ${shopt_save}
+   if [[ -n ${opengl_dirs[@]} ]]; then
# delete broken symlinks
-   find "${EROOT}"/usr/lib*/opengl -xtype l -delete
+   find "${opengl_dirs[@]}" -xtype l -delete
# delete empty leftover directories (they confuse eselect)
-   find "${EROOT}"/usr/lib*/opengl -depth -type d -empty -exec 
rmdir -v {} +
+   find "${opengl_dirs[@]}" -depth -type d -empty -exec rmdir -v 
{} +
fi
 
if [[ -n "${OLD_IMPL}" && "${OLD_IMPL}" != '(none)' ]] ; then
-- 
2.18.0




[gentoo-dev] [PATCH v2 4/8] sys-apps/openrc: Replace path_exists with inline bash test

2018-08-09 Thread Michał Górny
path_exists was really meant to be used with wildcards (i.e. when plain
bash tests can't work easily).  Here it is really unnecessary.
---
 sys-apps/openrc/openrc-0.34.11.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-apps/openrc/openrc-0.34.11.ebuild 
b/sys-apps/openrc/openrc-0.34.11.ebuild
index 4e2ed59e45f4..7fd281798c14 100644
--- a/sys-apps/openrc/openrc-0.34.11.ebuild
+++ b/sys-apps/openrc/openrc-0.34.11.ebuild
@@ -289,7 +289,7 @@ pkg_postinst() {
fi
 
# Handle the conf.d/local.{start,stop} -> local.d transition
-   if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+   if [[ -f ${EROOT}etc/conf.d/local.start || -f 
${EROOT}etc/conf.d/local.stop ]] ; then
elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
elog "files to ${EROOT}etc/local.d"
mv "${EROOT}"etc/conf.d/local.start 
"${EROOT}"etc/local.d/baselayout1.start
-- 
2.18.0




[gentoo-dev] [PATCH v2 2/8] media-plugins/vdr-vdrmanager: Replace unnecessary path_exists call

2018-08-09 Thread Michał Górny
Replace the unnecessary path_exists calls with plain bash -f test.
The path_exists function was only intended to be used when necessary
to deal with wildcards.

Closes: https://bugs.gentoo.org/662178
---
 media-plugins/vdr-vdrmanager/vdr-vdrmanager-0.14.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/media-plugins/vdr-vdrmanager/vdr-vdrmanager-0.14.ebuild 
b/media-plugins/vdr-vdrmanager/vdr-vdrmanager-0.14.ebuild
index 8639a6df48d1..6f324f6bcdc8 100644
--- a/media-plugins/vdr-vdrmanager/vdr-vdrmanager-0.14.ebuild
+++ b/media-plugins/vdr-vdrmanager/vdr-vdrmanager-0.14.ebuild
@@ -63,7 +63,7 @@ pkg_postinst() {
einfo "Add a password to /etc/conf.d/vdr.vdrmanager"
 
if use ssl ; then
-   if path_exists -a "${ROOT}${VDRMANAGER_SSL_KEY_FILE}.pem"; then
+   if [[ -f ${ROOT}${VDRMANAGER_SSL_KEY_FILE}.pem ]]; then
einfo "found an existing SSL cert, to create a new SSL 
cert, run:\n"
einfo "emerge --config ${PN}"
else
-- 
2.18.0




[gentoo-dev] [PATCH v2 3/8] net-vpn/openvpn: Remove obsolete postinst warning about old paths

2018-08-09 Thread Michał Górny
Suggested-by: Michael Orlitzky 
---
 net-vpn/openvpn/openvpn-2.4.4.ebuild | 5 -
 net-vpn/openvpn/openvpn-2.4.5.ebuild | 5 -
 net-vpn/openvpn/openvpn-2.4.6.ebuild | 5 -
 net-vpn/openvpn/openvpn-.ebuild  | 5 -
 4 files changed, 20 deletions(-)

diff --git a/net-vpn/openvpn/openvpn-2.4.4.ebuild 
b/net-vpn/openvpn/openvpn-2.4.4.ebuild
index 16fa5b91ead4..aa8b2b1360c9 100644
--- a/net-vpn/openvpn/openvpn-2.4.4.ebuild
+++ b/net-vpn/openvpn/openvpn-2.4.4.ebuild
@@ -123,11 +123,6 @@ pkg_postinst() {
enewgroup openvpn
enewuser openvpn "" "" "" openvpn
 
-   if path_exists -o "${EROOT%/}"/etc/openvpn/*/local.conf ; then
-   ewarn "WARNING: The openvpn init script has changed"
-   ewarn ""
-   fi
-
if use x64-macos; then
elog "You might want to install tuntaposx for TAP interface 
support:"
elog "http://tuntaposx.sourceforge.net;
diff --git a/net-vpn/openvpn/openvpn-2.4.5.ebuild 
b/net-vpn/openvpn/openvpn-2.4.5.ebuild
index ce60c5a55f98..a856d6a63b82 100644
--- a/net-vpn/openvpn/openvpn-2.4.5.ebuild
+++ b/net-vpn/openvpn/openvpn-2.4.5.ebuild
@@ -124,11 +124,6 @@ pkg_postinst() {
enewgroup openvpn
enewuser openvpn "" "" "" openvpn
 
-   if path_exists -o "${EROOT%/}"/etc/openvpn/*/local.conf ; then
-   ewarn "WARNING: The openvpn init script has changed"
-   ewarn ""
-   fi
-
if use x64-macos; then
elog "You might want to install tuntaposx for TAP interface 
support:"
elog "http://tuntaposx.sourceforge.net;
diff --git a/net-vpn/openvpn/openvpn-2.4.6.ebuild 
b/net-vpn/openvpn/openvpn-2.4.6.ebuild
index a52f8d6e4a8b..4205ff52a29f 100644
--- a/net-vpn/openvpn/openvpn-2.4.6.ebuild
+++ b/net-vpn/openvpn/openvpn-2.4.6.ebuild
@@ -124,11 +124,6 @@ pkg_postinst() {
enewgroup openvpn
enewuser openvpn "" "" "" openvpn
 
-   if path_exists -o "${EROOT%/}"/etc/openvpn/*/local.conf ; then
-   ewarn "WARNING: The openvpn init script has changed"
-   ewarn ""
-   fi
-
if use x64-macos; then
elog "You might want to install tuntaposx for TAP interface 
support:"
elog "http://tuntaposx.sourceforge.net;
diff --git a/net-vpn/openvpn/openvpn-.ebuild 
b/net-vpn/openvpn/openvpn-.ebuild
index 4f6a5737ccd7..60662fa4fd3a 100644
--- a/net-vpn/openvpn/openvpn-.ebuild
+++ b/net-vpn/openvpn/openvpn-.ebuild
@@ -120,11 +120,6 @@ pkg_postinst() {
enewgroup openvpn
enewuser openvpn "" "" "" openvpn
 
-   if path_exists -o "${EROOT%/}"/etc/openvpn/*/local.conf ; then
-   ewarn "WARNING: The openvpn init script has changed"
-   ewarn ""
-   fi
-
elog "The openvpn init script expects to find the configuration file"
elog "openvpn.conf in /etc/openvpn along with any extra files it may 
need."
elog ""
-- 
2.18.0




[gentoo-dev] [PATCH v2 1/8] media-plugins/vdr-live: Replace unnecessary path_exists calls

2018-08-09 Thread Michał Górny
Replace the unnecessary path_exists calls with plain bash -f test.
The path_exists function was only intended to be used when necessary
to deal with wildcards.

Bug: https://bugs.gentoo.org/662178
---
 media-plugins/vdr-live/vdr-live-0.3.0_p20130504-r1.ebuild | 2 +-
 media-plugins/vdr-live/vdr-live-0.3.0_p20130504-r2.ebuild | 2 +-
 media-plugins/vdr-live/vdr-live-2.3.1.ebuild  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/media-plugins/vdr-live/vdr-live-0.3.0_p20130504-r1.ebuild 
b/media-plugins/vdr-live/vdr-live-0.3.0_p20130504-r1.ebuild
index 6041faafd99e..24ec6897b14f 100644
--- a/media-plugins/vdr-live/vdr-live-0.3.0_p20130504-r1.ebuild
+++ b/media-plugins/vdr-live/vdr-live-0.3.0_p20130504-r1.ebuild
@@ -90,7 +90,7 @@ pkg_postinst() {
elog "\tadmin:live"
 
if use ssl ; then
-   if path_exists -a "${ROOT}"/etc/vdr/plugins/live/live.pem; then
+   if [[ -f ${ROOT}/etc/vdr/plugins/live/live.pem ]]; then
einfo "found an existing SSL cert, to create a new SSL 
cert, run:\n"
einfo "emerge --config ${PN}"
else
diff --git a/media-plugins/vdr-live/vdr-live-0.3.0_p20130504-r2.ebuild 
b/media-plugins/vdr-live/vdr-live-0.3.0_p20130504-r2.ebuild
index 0dbcc0a04730..9ecf777aa274 100644
--- a/media-plugins/vdr-live/vdr-live-0.3.0_p20130504-r2.ebuild
+++ b/media-plugins/vdr-live/vdr-live-0.3.0_p20130504-r2.ebuild
@@ -93,7 +93,7 @@ pkg_postinst() {
elog "\tadmin:live"
 
if use ssl ; then
-   if path_exists -a "${ROOT}"/etc/vdr/plugins/live/live.pem; then
+   if [[ -f ${ROOT}/etc/vdr/plugins/live/live.pem ]]; then
einfo "found an existing SSL cert, to create a new SSL 
cert, run:\n"
einfo "emerge --config ${PN}"
else
diff --git a/media-plugins/vdr-live/vdr-live-2.3.1.ebuild 
b/media-plugins/vdr-live/vdr-live-2.3.1.ebuild
index f46cff93c6de..6a0ea6d24b88 100644
--- a/media-plugins/vdr-live/vdr-live-2.3.1.ebuild
+++ b/media-plugins/vdr-live/vdr-live-2.3.1.ebuild
@@ -86,7 +86,7 @@ pkg_postinst() {
elog "\tadmin:live"
 
if use ssl ; then
-   if path_exists -a "${ROOT}"/etc/vdr/plugins/live/live.pem; then
+   if [[ -f ${ROOT}/etc/vdr/plugins/live/live.pem ]]; then
einfo "found an existing SSL cert, to create a new SSL 
cert, run:\n"
einfo "emerge --config ${PN}"
else
-- 
2.18.0




[gentoo-dev] [PATCH v2 0/8] eutils/path_exists removal

2018-08-09 Thread Michał Górny
Hi,

Here's a second version of path_exists cleanup.  This time the few uses
are replaced by inline snippets, and the function is banned completely.

--
Best regards,
Michał Górny

Michał Górny (8):
  media-plugins/vdr-live: Replace unnecessary path_exists calls
  media-plugins/vdr-vdrmanager: Replace unnecessary path_exists call
  net-vpn/openvpn: Remove obsolete postinst warning about old paths
  sys-apps/openrc: Replace path_exists with inline bash test
  www-apps/postfixadmin: Replace path_exists with inline logic
  app-eselect/eselect-opengl: Replace path_exists
  autotools-utils.eclass: Remove EAPI 2&3 support
  eutils.eclass: Ban path_exists

 .../eselect-opengl-1.3.1-r4.ebuild| 10 --
 eclass/autotools-utils.eclass | 29 +++
 eclass/eutils.eclass  | 30 +++-
 eclass/tests/eutils_path_exists.sh| 35 ---
 .../vdr-live-0.3.0_p20130504-r1.ebuild|  2 +-
 .../vdr-live-0.3.0_p20130504-r2.ebuild|  2 +-
 media-plugins/vdr-live/vdr-live-2.3.1.ebuild  |  2 +-
 .../vdr-vdrmanager/vdr-vdrmanager-0.14.ebuild |  2 +-
 net-vpn/openvpn/openvpn-2.4.4.ebuild  |  5 ---
 net-vpn/openvpn/openvpn-2.4.5.ebuild  |  5 ---
 net-vpn/openvpn/openvpn-2.4.6.ebuild  |  5 ---
 net-vpn/openvpn/openvpn-.ebuild   |  5 ---
 sys-apps/openrc/openrc-0.34.11.ebuild |  2 +-
 www-apps/postfixadmin/postfixadmin-3.1.ebuild | 12 ---
 14 files changed, 27 insertions(+), 119 deletions(-)
 delete mode 100755 eclass/tests/eutils_path_exists.sh

-- 
2.18.0




Re: [gentoo-dev] Experimental 2-step authentication support on dev.gentoo.org

2018-08-09 Thread Michał Górny
W dniu czw, 09.08.2018 o godzinie 18∶10 +0300, użytkownik Andrew
Savchenko napisał:
> On Thu, 09 Aug 2018 10:27:35 +0200 Michał Górny wrote:
> > Hi, everyone.
> > 
> > Just a short notice: we've enabled experimental support for 2-step
> > authentication when logging in to woodpecker via SSH.  For more details,
> > see [1].
> > 
> > TL;DR: as a technical limitation, some SSH clients may start asking you
> > for a password.  Using any non-empty string will work.
> 
> When authenticating as usual (using encrypted ssh key) I see
> "Authenticated with partial success.", auth itself is OK.
> 
> Could you please disable this ambiguous message?
> 

It's your client, not us.

-- 
Best regards,
Michał Górny


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


Re: [gentoo-dev] Experimental 2-step authentication support on dev.gentoo.org

2018-08-09 Thread Andrew Savchenko
On Thu, 09 Aug 2018 10:27:35 +0200 Michał Górny wrote:
> Hi, everyone.
> 
> Just a short notice: we've enabled experimental support for 2-step
> authentication when logging in to woodpecker via SSH.  For more details,
> see [1].
> 
> TL;DR: as a technical limitation, some SSH clients may start asking you
> for a password.  Using any non-empty string will work.

When authenticating as usual (using encrypted ssh key) I see
"Authenticated with partial success.", auth itself is OK.

Could you please disable this ambiguous message?

Best regards,
Andrew Savchenko


pgpfNZSZE32Bl.pgp
Description: PGP signature


Re: [gentoo-dev] [PATCH 3/5] net-vpn/openvpn: Remove unnecessary option switch to path_exists

2018-08-09 Thread Michael Orlitzky
On 08/08/2018 05:34 PM, Michał Górny wrote:
>  
> - if path_exists -o "${EROOT%/}"/etc/openvpn/*/local.conf ; then
> + if path_exists "${EROOT%/}"/etc/openvpn/*/local.conf ; then
>   ewarn "WARNING: The openvpn init script has changed"
>   ewarn ""
>   fi

Not that this warning is at all helpful, but it's obsolete (the change
was over ten years ago). The whole "if" block can go.



Re: [gentoo-dev] [PATCH] systemd.eclass: set BDEPEND for EAPI 7

2018-08-09 Thread Michael Orlitzky
On 08/06/2018 04:23 PM, Toralf Förster wrote:
> On 08/06/2018 10:09 PM, Alec Warner wrote:
>>
>> They do not even do so by convention; there are numerous EAPIs in the
>> wild that are non-numeric.
> 
> Then this line
> 
>if [[ ${EAPI} == [0123456] ]]; then
> 
> is a short-term solution, right?

Presumably any new EAPIs will want BDEPEND rather than DEPEND, and
there's a complete whitelist,

  case ${EAPI:-0} in
0|1|2|3|4|5|6|7) ;;

of supported EAPIs at the top of the eclass. So it will probably do the
right thing for a new EAPI, but somebody's going to have to read the
code and think about it when the time comes anyway.



Re: [gentoo-portage-dev] [PATCH] install-qa-check.d/60pngfix: parallel support (bug 630292)

2018-08-09 Thread Michał Górny
W dniu czw, 09.08.2018 o godzinie 11∶09 +0200, użytkownik Ulrich Mueller
napisał:
> > > > > > On Thu, 09 Aug 2018, Michał Górny wrote:
> > > + if xargs --help | grep -q -- --max-procs=; then
> > '--help' is not a valid argument on FreeBSD, so this spews errors
> > to stderr:
> 
> IIRC, GNU findutils is required by PMS?
> 

Yes, using gxargs is another option.  I suppose the usual ebuild env
override is not used in this phase.

-- 
Best regards,
Michał Górny


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


Re: [gentoo-portage-dev] [PATCH] install-qa-check.d/60pngfix: parallel support (bug 630292)

2018-08-09 Thread Ulrich Mueller
> On Thu, 09 Aug 2018, Michał Górny wrote:

>> +if xargs --help | grep -q -- --max-procs=; then

> '--help' is not a valid argument on FreeBSD, so this spews errors
> to stderr:

IIRC, GNU findutils is required by PMS?

Ulrich



[gentoo-dev] Experimental 2-step authentication support on dev.gentoo.org

2018-08-09 Thread Michał Górny
Hi, everyone.

Just a short notice: we've enabled experimental support for 2-step
authentication when logging in to woodpecker via SSH.  For more details,
see [1].

TL;DR: as a technical limitation, some SSH clients may start asking you
for a password.  Using any non-empty string will work.

[1]:https://wiki.gentoo.org/wiki/Project:Infrastructure/dev.gentoo.org_2-step_authentication

-- 
Best regards,
Michał Górny


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


Re: [gentoo-portage-dev] [PATCH] install-qa-check.d/60pngfix: parallel support (bug 630292)

2018-08-09 Thread Michał Górny
W dniu śro, 25.07.2018 o godzinie 12∶59 -0700, użytkownik Zac Medico
napisał:
> If xargs supports the --max-procs option then use the makeopts_jobs
> function from helper-functions.sh to generate a --max-procs argument.
> 
> Bug: https://bugs.gentoo.org/630292
> ---
>  bin/install-qa-check.d/60pngfix | 14 --
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/bin/install-qa-check.d/60pngfix b/bin/install-qa-check.d/60pngfix
> index 8d53040b6..2bf020079 100644
> --- a/bin/install-qa-check.d/60pngfix
> +++ b/bin/install-qa-check.d/60pngfix
> @@ -1,7 +1,17 @@
>  # Check for issues with PNG files
>  
> +source "${PORTAGE_BIN_PATH}/helper-functions.sh" || exit 1
> +
>  pngfix_check() {
> - local pngfix=$(type -P pngfix)
> + local jobs pngfix=$(type -P pngfix) xargs=(${XARGS})
> +
> + if xargs --help | grep -q -- --max-procs=; then

'--help' is not a valid argument on FreeBSD, so this spews errors
to stderr:

 * Final size of build directory: 3655 KiB (3.5 MiB)
 * Final size of installed tree:24 KiB 

xargs: illegal option -- -
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]]
 [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]
 [-s size] [utility [argument ...]]
strip: strip --strip-unneeded -R .comment -R .GCC.command.line -R 
.note.gnu.gold-version
   usr/lib/libgraphene-1.0.so.0.800.2

Also note that -P is more portable than --max-procs.

> + jobs=$(makeopts_jobs)
> + if [[ ${jobs} -gt 1 ]]; then
> + xargs+=(--max-procs=${jobs})
> + fi
> + fi
> +
>   if [[ -n ${pngfix} ]] ; then
>   local pngout=()
>   local next
> @@ -25,7 +35,7 @@ pngfix_check() {
>   fi
>   eqawarn "   ${pngout[@]:7}: ${error}"
>   fi
> - done < <(find "${ED}" -type f -name '*.png' -exec "${pngfix}" 
> {} +)
> + done < <(find "${ED}" -type f -name '*.png' -print0 | 
> "${xargs[@]}" -0 "${pngfix}")
>   fi
>  }
>  

-- 
Best regards,
Michał Górny


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


Re: [gentoo-dev] [PATCH 5/5] eutils.eclass: Restore the original path_exists function

2018-08-09 Thread Michał Górny
W dniu czw, 09.08.2018 o godzinie 07∶05 +0200, użytkownik Ulrich Mueller
napisał:
> > > > > > On Wed, 8 Aug 2018, Michał Górny wrote:
> > Alternatively, we could remove the function entirely and inline its
> > use in the three packages that need it.
> 
> Sounds like a better plan. Removing the options is an incompatible
> change anyway, so maybe removing the function would be a cleaner
> solution? Especially if it's so little used.
> 

Sure.  Will prepare another patch series soonish.

-- 
Best regards,
Michał Górny


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


Re: [gentoo-dev] Packages up for grabs

2018-08-09 Thread Sergei Trofimovich
On Wed, 8 Aug 2018 09:18:46 +0200
Manuel Rüger  wrote:

> Hi,
> 
> it looks like parts of the Gentoo project and I don't share the same
> values anymore.
> Therefore, I currently don't know if I want to continue contributing and
> am looking for new maintainers for the following packages:

Sad to hear that. Totally understand why it can be the case :(

-- 

  Sergei



Re: [gentoo-dev] [PATCH 5/5] eutils.eclass: Restore the original path_exists function

2018-08-09 Thread M. J. Everitt
On 08/08/18 22:34, Michał Górny wrote [excerpted]:
> +# Example:
> +# @CODE
> +# if path_exists "${ROOT}"/etc/foo.d/*.conf; then
> +#   do_something
> +# fi
> +# @CODE
>  path_exists() {
> - local opt=$1
> - [[ ${opt} == -[ao] ]] && shift || opt="-a"
> -
> - # no paths -> return false
> - # same behavior as: [[ -e "" ]]
> - [[ $# -eq 0 ]] && return 1
> -
> - local p r=0
> - for p in "$@" ; do
> - [[ -e ${p} ]]
> - : $(( r += $? ))
> + local p
> + for p; do
> + [[ -e ${p} ]] && return 0
>   done
You seem to have lost the inclusion of the function parameters in the
execution code - was this intentional?!
Regards,
Michael.



signature.asc
Description: OpenPGP digital signature


[gentoo-dev] Package up for grabs: dev-db/couchdb

2018-08-09 Thread Dirkjan Ochtman
While I have maintained this for a long time, I've been unhappy with
upstream since they released 2.x with no proper Unix build system (there
have also been a number of bundled dependencies that I have been unable to
move them off of). There is a newly released remote code execution
vulnerability, announced today (https://bugs.gentoo.org/663164) which has
only been fixed on 2.x; 1.x maintenance was recently ended.

If no one else wants to pick this up, it will probably get last rited soon.