From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8F1BA1396D0 for ; Tue, 5 Sep 2017 14:16:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D3E38E0E47; Tue, 5 Sep 2017 14:16:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A2CA7E0E47 for ; Tue, 5 Sep 2017 14:16:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BABEA33E4AD for ; Tue, 5 Sep 2017 14:16:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 831988E26 for ; Tue, 5 Sep 2017 14:16:29 +0000 (UTC) From: "Aaron Swenson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Aaron Swenson" Message-ID: <1504620907.638b7478a001ccde8418c9a2a5d7e253c0df0678.titanofold@gentoo> Subject: [gentoo-commits] proj/postgresql/eclass:master commit in: / X-VCS-Repository: proj/postgresql/eclass X-VCS-Files: postgres-multi.eclass postgres.eclass X-VCS-Directories: / X-VCS-Committer: titanofold X-VCS-Committer-Name: Aaron Swenson X-VCS-Revision: 638b7478a001ccde8418c9a2a5d7e253c0df0678 X-VCS-Branch: master Date: Tue, 5 Sep 2017 14:16:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 49833545-8c1d-482b-9799-93c01865d30d X-Archives-Hash: 040b077342e1830b10ed3f5450589f60 commit: 638b7478a001ccde8418c9a2a5d7e253c0df0678 Author: Aaron W. Swenson gentoo org> AuthorDate: Tue Sep 5 14:15:07 2017 +0000 Commit: Aaron Swenson gentoo org> CommitDate: Tue Sep 5 14:15:07 2017 +0000 URL: https://gitweb.gentoo.org/proj/postgresql/eclass.git/commit/?id=638b7478 Use Simple Sort Calling external commands during metadata regen is forbidden by PMS and breaks new secure cache regen. Use a simple sort instead. Gentoo-Bug: 629226 postgres-multi.eclass | 3 ++- postgres.eclass | 25 +++++++++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/postgres-multi.eclass b/postgres-multi.eclass index 5d40a0e..9eb7ca2 100644 --- a/postgres-multi.eclass +++ b/postgres-multi.eclass @@ -105,7 +105,8 @@ postgres-multi_forbest() { postgres-multi_pkg_setup() { local user_slot - for user_slot in "${POSTGRES_COMPAT[@]}"; do + # _POSTGRES_COMPAT is created in postgres.eclass + for user_slot in "${_POSTGRES_COMPAT[@]}"; do use "postgres_targets_postgres${user_slot/\./_}" && \ _POSTGRES_INTERSECT_SLOTS+=( "${user_slot}" ) done diff --git a/postgres.eclass b/postgres.eclass index 13483a9..e5a9b6f 100644 --- a/postgres.eclass +++ b/postgres.eclass @@ -21,6 +21,14 @@ case ${EAPI:-0} in *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; esac +# @ECLASS-VARIABLE: _POSTGRES_ALL_VERSIONS +# @INTERNAL +# @DESCRIPTION: +# List of versions to reverse sort POSTGRES_COMPAT slots + +_POSTGRES_ALL_VERSIONS=( 11 10 9.6 9.5 9.4 9.3 9.2 ) + + # @ECLASS-VARIABLE: POSTGRES_COMPAT # @DEFAULT_UNSET @@ -47,15 +55,24 @@ esac # required if the package must build against one of the PostgreSQL slots # declared in POSTGRES_COMPAT. +# @ECLASS-VARIABLE: _POSTGRES_COMPAT +# @INTERNAL +# @DESCRIPTION: +# Copy of POSTGRES_COMPAT, reverse sorted +_POSTGRES_COMPAT=() + + if declare -p POSTGRES_COMPAT &> /dev/null ; then # Reverse sort the given POSTGRES_COMPAT so that the most recent # slot is preferred over an older slot. # -- do we care if dependencies are deterministic by USE flags? - readarray -t POSTGRES_COMPAT < <(printf '%s\n' "${POSTGRES_COMPAT[@]}" | sort -nr) + for i in ${_POSTGRES_ALL_VERSIONS[@]} ; do + has ${i} ${POSTGRES_COMPAT[@]} && _POSTGRES_COMPAT+=( ${i} ) + done POSTGRES_DEP="" POSTGRES_REQ_USE=" || (" - for slot in "${POSTGRES_COMPAT[@]}" ; do + for slot in "${_POSTGRES_COMPAT[@]}" ; do POSTGRES_DEP+=" postgres_targets_postgres${slot/\./_}? ( dev-db/postgresql:${slot}=" declare -p POSTGRES_USEDEP &>/dev/null && \ POSTGRES_DEP+="[${POSTGRES_USEDEP}]" @@ -127,7 +144,7 @@ postgres_pkg_setup() { local compat_slot local best_slot - for compat_slot in "${POSTGRES_COMPAT[@]}"; do + for compat_slot in "${_POSTGRES_COMPAT[@]}"; do if use "postgres_targets_postgres${compat_slot/\./_}"; then best_slot="${compat_slot}" break @@ -136,7 +153,7 @@ postgres_pkg_setup() { if [[ -z "${best_slot}" ]]; then local flags f - for f in "${POSTGRES_COMPAT[@]}"; do + for f in "${_POSTGRES_COMPAT[@]}"; do flags+=" postgres${f/./_}" done