summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-04-06 22:33:41 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-04-06 22:33:41 +0100
commite68d405c5d712af4387159df07e226217bdda049 (patch)
tree009ab0f3d427f0813e62930d71802cb054c07e30 /eclass
parent401101f9c8077911929d3f2b60a37098460a5d89 (diff)
gentoo resync : 06.04.2022
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin36129 -> 35954 bytes
-rw-r--r--eclass/acct-user.eclass17
-rw-r--r--eclass/bash-completion-r1.eclass4
-rw-r--r--eclass/cron.eclass12
-rw-r--r--eclass/ecm.eclass2
-rw-r--r--eclass/emboss-r2.eclass161
-rw-r--r--eclass/fcaps.eclass6
-rw-r--r--eclass/font.eclass6
-rw-r--r--eclass/gstreamer-meson.eclass14
-rw-r--r--eclass/llvm.org.eclass13
-rw-r--r--eclass/multilib.eclass7
-rw-r--r--eclass/portability.eclass5
-rw-r--r--eclass/preserve-libs.eclass16
-rw-r--r--eclass/python-utils-r1.eclass134
-rw-r--r--eclass/qmail.eclass12
-rw-r--r--eclass/ruby-fakegem.eclass2
-rw-r--r--eclass/ruby-ng.eclass9
-rw-r--r--eclass/subversion.eclass86
-rwxr-xr-xeclass/tests/python-utils-r1.sh86
-rw-r--r--eclass/tmpfiles.eclass6
-rw-r--r--eclass/toolchain.eclass2
-rw-r--r--eclass/user.eclass4
-rw-r--r--eclass/vala.eclass8
-rw-r--r--eclass/webapp.eclass4
-rw-r--r--eclass/wrapper.eclass17
-rw-r--r--eclass/xorg-3.eclass19
26 files changed, 243 insertions, 409 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index bb92e28945d5..b5697b842ad2 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index 70ae2434b5df..f2aaefc2ee39 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -1,4 +1,4 @@
-# Copyright 2019-2021 Gentoo Authors
+# Copyright 2019-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: acct-user.eclass
@@ -178,7 +178,7 @@ acct-user_add_deps() {
eislocked() {
[[ $# -eq 1 ]] || die "usage: ${FUNCNAME} <user>"
- if [[ ${EUID} != 0 ]]; then
+ if [[ ${EUID} -ne 0 ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
@@ -215,7 +215,7 @@ eislocked() {
elockuser() {
[[ $# -eq 1 ]] || die "usage: ${FUNCNAME} <user>"
- if [[ ${EUID} != 0 ]]; then
+ if [[ ${EUID} -ne 0 ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
@@ -258,7 +258,7 @@ elockuser() {
eunlockuser() {
[[ $# -eq 1 ]] || die "usage: ${FUNCNAME} <user>"
- if [[ ${EUID} != 0 ]]; then
+ if [[ ${EUID} -ne 0 ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
@@ -440,7 +440,7 @@ acct-user_pkg_preinst() {
acct-user_pkg_postinst() {
debug-print-function ${FUNCNAME} "${@}"
- if [[ ${EUID} != 0 ]]; then
+ if [[ ${EUID} -ne 0 ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
@@ -468,11 +468,16 @@ acct-user_pkg_postinst() {
acct-user_pkg_prerm() {
debug-print-function ${FUNCNAME} "${@}"
- if [[ ${EUID} != 0 ]]; then
+ if [[ ${EUID} -ne 0 ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
+ if [[ ${ACCT_USER_ID} -eq 0 ]]; then
+ elog "Refusing to lock out the superuser (UID 0)"
+ return 0
+ fi
+
if [[ -z ${REPLACED_BY_VERSION} ]]; then
if [[ -z $(egetent passwd "${ACCT_USER_NAME}") ]]; then
ewarn "User account not found: ${ACCT_USER_NAME}"
diff --git a/eclass/bash-completion-r1.eclass b/eclass/bash-completion-r1.eclass
index f0451b773a93..df1a2a54d39a 100644
--- a/eclass/bash-completion-r1.eclass
+++ b/eclass/bash-completion-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: bash-completion-r1.eclass
@@ -64,7 +64,7 @@ _bash-completion-r1_get_bashcompdir() {
_bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion/completions
}
-# @FUNCTION: _bash-completion-r1_get_helpersdir
+# @FUNCTION: _bash-completion-r1_get_bashhelpersdir
# @INTERNAL
# @DESCRIPTION:
# Get unprefixed bash-completion helpers directory.
diff --git a/eclass/cron.eclass b/eclass/cron.eclass
index 81f963a4f722..3198c181f21b 100644
--- a/eclass/cron.eclass
+++ b/eclass/cron.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: cron.eclass
@@ -44,12 +44,12 @@ done
# Both arguments are optional. Everything after 'dir' is considered
# the permissions (same format as insopts).
#
-# ex: docrondir /some/dir -m 0770 -o root -g cron
+# ex: docrondir /some/dir -m 0770 -o 0 -g cron
# docrondir /some/dir (uses default perms)
# docrondir -m0700 (uses default dir)
docrondir() {
# defaults
- local perms="-m0750 -o root -g cron" dir="/var/spool/cron/crontabs"
+ local perms="-m0750 -o 0 -g cron" dir="/var/spool/cron/crontabs"
if [[ -n $1 ]] ; then
case "$1" in
@@ -78,10 +78,10 @@ docrondir() {
#
# Both arguments are optional.
#
-# ex: docron -m 0700 -o root -g root ('exe' defaults to "cron")
+# ex: docron -m 0700 -o 0 -g root ('exe' defaults to "cron")
# docron crond -m 0110
docron() {
- local cron="cron" perms="-m 0750 -o root -g wheel"
+ local cron="cron" perms="-m 0750 -o 0 -g wheel"
if [[ -n $1 ]] ; then
case "$1" in
@@ -111,7 +111,7 @@ docron() {
#
# Uses same semantics as docron.
docrontab() {
- local crontab="crontab" perms="-m 4750 -o root -g cron"
+ local crontab="crontab" perms="-m 4750 -o 0 -g cron"
if [[ -n $1 ]] ; then
case "$1" in
diff --git a/eclass/ecm.eclass b/eclass/ecm.eclass
index 8c5e8bab1b4d..3cc586b82d82 100644
--- a/eclass/ecm.eclass
+++ b/eclass/ecm.eclass
@@ -5,7 +5,7 @@
# @MAINTAINER:
# kde@gentoo.org
# @SUPPORTED_EAPIS: 7 8
-# @PROVIDES: cmake
+# @PROVIDES: cmake virtualx
# @BLURB: Support eclass for packages that use KDE Frameworks with ECM.
# @DESCRIPTION:
# This eclass is intended to streamline the creation of ebuilds for packages
diff --git a/eclass/emboss-r2.eclass b/eclass/emboss-r2.eclass
deleted file mode 100644
index 65e1c83f16d9..000000000000
--- a/eclass/emboss-r2.eclass
+++ /dev/null
@@ -1,161 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# @DEAD
-# Removal on 2022-03-15.
-
-# @ECLASS: emboss-r2.eclass
-# @MAINTAINER:
-# sci-biology@gentoo.org
-# ted.tanberry@gmail.com
-# @AUTHOR:
-# Original author: Author Olivier Fisette <ofisette@gmail.com>
-# Next gen author: Justin Lecher <jlec@gentoo.org>
-# Next gen author: Ted Tanberry <ted.tanberry@gmail.com>
-# @SUPPORTED_EAPIS: 7
-# @BLURB: Use this to easy install EMBOSS and EMBASSY programs (EMBOSS add-ons).
-# @DESCRIPTION:
-# The inheriting ebuild must provide EBO_DESCRIPTION before the inherit line.
-#
-# Example:
-#
-# EAPI=7
-#
-# EBO_DESCRIPTION="applications from the CBS group"
-#
-# inherit emboss-r2
-
-# @ECLASS_VARIABLE: EBO_DESCRIPTION
-# @PRE_INHERIT
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Completes the generic description of the embassy module as follows:
-#
-# EMBOSS integrated version of ${EBO_DESCRIPTION}, e.g.
-#
-# "EMBOSS integrated version of applications from the CBS group"
-#
-# Defaults to the upstream name of the module.
-
-case ${EAPI:-0} in
- [0-6]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
- 7) ;;
- *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
-esac
-
-if [[ ! ${_EMBOSS_R2_ECLASS} ]]; then
-_EMBOSS_R2_ECLASS=1
-
-inherit autotools flag-o-matic
-
-HOMEPAGE="http://emboss.sourceforge.net/"
-
-LICENSE="LGPL-2 GPL-2"
-SLOT="0"
-IUSE="mysql pdf png postgres X"
-
-RDEPEND="
- dev-libs/expat
- dev-libs/libpcre:3
- sci-libs/plplot:=
- sys-libs/zlib
- mysql? ( dev-db/mysql-connector-c:0= )
- pdf? ( media-libs/libharu:= )
- png? ( media-libs/gd:2=[png] )
- postgres? ( dev-db/postgresql:= )
- X? ( x11-libs/libXt )"
-
-if [[ ${PN} == embassy-* ]]; then
- EMBASSY_PACKAGE=yes
- # The EMBASSY package name, retrieved from the inheriting ebuild's name
- EN=${PN:8}
- # The full name and version of the EMBASSY package (excluding the Gentoo
- # revision number)
- EF="${EN^^}-${PV}"
-
- [[ ${EBO_DESCRIPTION} ]] || die "EBO_DESCRIPTION was not set before inheriting emboss-r2.eclass"
-
- DESCRIPTION="EMBOSS integrated version of ${EBO_DESCRIPTION}"
- SRC_URI="ftp://emboss.open-bio.org/pub/EMBOSS/${EF}.tar.gz -> embassy-${EN}-${PV}.tar.gz"
- RDEPEND+=" >=sci-biology/emboss-6.6.0-r1[mysql=,pdf=,png=,postgres=,X=]"
-
- S="${WORKDIR}/${EF}"
-fi
-
-DEPEND="${RDEPEND}"
-
-# @ECLASS_VARIABLE: EBO_EAUTORECONF
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# If set, run eautoreconf from autotools.eclass after applying patches
-# in emboss-r2_src_prepare.
-
-# @FUNCTION: emboss-r2_src_prepare
-# @DESCRIPTION:
-# Does the following things
-#
-# 1. Renames configure.in to configure.ac, if possible
-# 2. Calls default_src_prepare (i.e. applies Gentoo and user patches)
-# 3. If EBO_EAUTORECONF is set, run eautoreconf
-
-emboss-r2_src_prepare() {
- if [[ -e configure.in ]]; then
- mv configure.{in,ac} || die
- fi
-
- default
- [[ ${EBO_EAUTORECONF} ]] && eautoreconf
-}
-
-# @FUNCTION: emboss-r2_src_configure
-# @DESCRIPTION:
-# runs econf with following options.
-#
-# --enable-shared
-# --disable-static
-# $(use_with X x)
-# $(use_with png pngdriver)
-# $(use_with pdf hpdf)
-# $(use_with mysql mysql)
-# $(use_with postgres postgresql)
-# --enable-large
-# --without-java
-# --enable-systemlibs
-#
-# can be appended to like econf, e.g.
-# emboss-r2_src_configure --enable-foo
-
-emboss-r2_src_configure() {
- local myconf=(
- --enable-shared
- --disable-static
- $(use_with X x)
- $(use_with png pngdriver "${EPREFIX}"/usr)
- $(use_with pdf hpdf "${EPREFIX}"/usr)
- $(use_with mysql mysql "${EPREFIX}"/usr/bin/mysql_config)
- $(use_with postgres postgresql "${EPREFIX}"/usr/bin/pg_config)
- --enable-large
- --without-java
- --enable-systemlibs
- )
-
- [[ ${EMBASSY_PACKAGE} == yes ]] && \
- append-cppflags "-I${EPREFIX}/usr/include/emboss"
-
- econf "${myconf[@]}" "$@"
-}
-
-# @FUNCTION: emboss-r2_src_install
-# @DESCRIPTION:
-# Installs the package into the staging area and removes unnecessary .la files.
-
-emboss-r2_src_install() {
- default
-
- # delete .la files
- find "${ED}" -name '*.la' -delete || die
-}
-
-fi
-
-EXPORT_FUNCTIONS src_prepare src_configure src_install
diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 93aa7cd5928d..d1860f5ac9a3 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -83,18 +83,18 @@ esac
#
# If the system is unable to set capabilities, it will use the specified user,
# group, and mode (presumably to make the binary set*id). The defaults there
-# are root:0 and 4711. Otherwise, the ownership and permissions will be
+# are 0:0 and 4711. Otherwise, the ownership and permissions will be
# unchanged.
fcaps() {
debug-print-function ${FUNCNAME} "$@"
- if [[ ${EUID} != 0 ]] ; then
+ if [[ ${EUID} -ne 0 ]] ; then
einfo "Insufficient privileges to execute ${FUNCNAME}, skipping."
return 0
fi
# Process the user options first.
- local owner='root'
+ local owner='0'
local group='0'
local mode='4711'
local caps_mode='711'
diff --git a/eclass/font.eclass b/eclass/font.eclass
index 13d2b5064c1d..83636ac3fed5 100644
--- a/eclass/font.eclass
+++ b/eclass/font.eclass
@@ -1,14 +1,14 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: font.eclass
# @MAINTAINER:
# fonts@gentoo.org
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: Eclass to make font installation uniform
case ${EAPI:-0} in
- 7) ;;
+ [7-8]) ;;
*) die "EAPI ${EAPI} is not supported by font.eclass." ;;
esac
diff --git a/eclass/gstreamer-meson.eclass b/eclass/gstreamer-meson.eclass
index 490e71e9b97b..bae35c7edcea 100644
--- a/eclass/gstreamer-meson.eclass
+++ b/eclass/gstreamer-meson.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gstreamer-meson.eclass
@@ -383,12 +383,20 @@ gstreamer_multilib_src_compile() {
if [[ "${PN}" == "${GST_ORG_MODULE}" ]]; then
eninja
else
- local plugin_dir plugin
+ local plugin_dir plugin build_dir
for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
plugin=$(_gstreamer_get_target_filename $(gstreamer_get_plugin_dir ${plugin_dir}))
+ # Read full link of build directory. Outputs symlink's true link.
+ # We want to get the full file path so it can be removed later.
+ # Working around ninja issues w/ symlinks (e.g. PORTAGE_TMPDIR as a symlink)
+
+ # https://github.com/ninja-build/ninja/issues/1251
+ # https://github.com/ninja-build/ninja/issues/1330
+ build_dir=$(readlink -f ${BUILD_DIR})
+
plugin_path="${plugin%%:*}"
- eninja "${plugin_path/"${BUILD_DIR}/"}"
+ eninja "${plugin_path/"${build_dir}/"/}"
done
fi
}
diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 2c5f1f9b79e5..fa23782cc244 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -300,15 +300,10 @@ llvm.org_src_unpack() {
grep -E -r -L "^Gentoo-Component:.*(${components[*]})" \
"${WORKDIR}/llvm-gentoo-patchset-${LLVM_PATCHSET}" |
xargs rm
- assert
-
- if ver_test -ge 13.0.1_rc3; then
- # fail if no patches remain
- if [[ ! -s ${WORKDIR}/llvm-gentoo-patchset-${LLVM_PATCHSET} ]]
- then
- die "No patches in the patchset apply to the package"
- fi
- fi
+ local status=( "${PIPESTATUS[@]}" )
+ [[ ${status[1]} -ne 0 ]] && die "rm failed"
+ [[ ${status[0]} -ne 0 ]] &&
+ die "No patches in the patchset apply to the package"
fi
}
diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
index fadd371f3ca7..ec2676cb6cfb 100644
--- a/eclass/multilib.eclass
+++ b/eclass/multilib.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: multilib.eclass
@@ -299,8 +299,13 @@ get_modname() {
echo ".${modname}"
}
+# @FUNCTION: multilib_env
+# @USAGE:
+# @DESCRIPTION:
# This is for the toolchain to setup profile variables when pulling in
# a crosscompiler (and thus they aren't set in the profile).
+#
+# This must only be used by toolchain packages.
multilib_env() {
local CTARGET=${1:-${CTARGET}}
local cpu=${CTARGET%%*-}
diff --git a/eclass/portability.eclass b/eclass/portability.eclass
index 1cc36757b625..8df8fcebc47b 100644
--- a/eclass/portability.eclass
+++ b/eclass/portability.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: portability.eclass
@@ -153,7 +153,4 @@ get_mounts() {
done
}
-_dead_portability_user_funcs() { die "if you really need this, please file a bug for base-system@gentoo.org"; }
-is-login-disabled() { _dead_portability_user_funcs; }
-
fi
diff --git a/eclass/preserve-libs.eclass b/eclass/preserve-libs.eclass
index da13e7943add..df07e511c130 100644
--- a/eclass/preserve-libs.eclass
+++ b/eclass/preserve-libs.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: preserve-libs.eclass
@@ -7,8 +7,8 @@
# @SUPPORTED_EAPIS: 5 6 7
# @BLURB: preserve libraries after SONAME changes
-case ${EAPI:-0} in
- [567]) ;;
+case ${EAPI} in
+ 5|6|7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -34,15 +34,13 @@ preserve_old_lib() {
# let portage worry about it
has preserve-libs ${FEATURES} && return 0
- has "${EAPI:-0}" 0 1 2 && local ED=${D} EROOT=${ROOT}
-
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}
+ dodir "${dir}"
+ cp "${EROOT}/${lib}" "${ED}/${lib}" || die "cp ${lib} failed"
+ touch "${ED}/${lib}"
done
}
@@ -59,8 +57,6 @@ preserve_old_lib_notify() {
# let portage worry about it
has preserve-libs ${FEATURES} && return 0
- has "${EAPI:-0}" 0 1 2 && local EROOT=${ROOT}
-
local lib notice=0
for lib in "$@" ; do
[[ -e ${EROOT}/${lib} ]] || continue
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 7b0c9aa280d8..98cb49c95fd7 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1001,25 +1001,30 @@ _python_wrapper_setup() {
# @FUNCTION: python_fix_shebang
# @USAGE: [-f|--force] [-q|--quiet] <path>...
# @DESCRIPTION:
-# Replace the shebang in Python scripts with the current Python
-# implementation (EPYTHON). If a directory is passed, works recursively
-# on all Python scripts.
+# Replace the shebang in Python scripts with the full path
+# to the current Python implementation (PYTHON, including EPREFIX).
+# If a directory is passed, works recursively on all Python scripts
+# found inside the directory tree.
#
-# Only files having a 'python*' shebang will be modified. Files with
-# other shebang will either be skipped when working recursively
-# on a directory or treated as error when specified explicitly.
+# Only files having a Python shebang (a path to any known Python
+# interpreter, optionally preceded by env(1) invocation) will
+# be processed. Files with any other shebang will either be skipped
+# silently when a directory was passed, or an error will be reported
+# for any files without Python shebangs specified explicitly.
#
-# Shebangs matching explicitly current Python version will be left
-# unmodified. Shebangs requesting another Python version will be treated
-# as fatal error, unless --force is given.
+# Shebangs that are compatible with the current Python version will be
+# mangled unconditionally. Incompatible shebangs will cause a fatal
+# error, unless --force is specified.
#
-# --force causes the function to replace even shebangs that require
-# incompatible Python version. --quiet causes the function not to list
-# modified files verbosely.
+# --force causes the function to replace shebangs with incompatible
+# Python version (but not non-Python shebangs). --quiet causes
+# the function not to list modified files verbosely.
python_fix_shebang() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${EPYTHON} ]] || die "${FUNCNAME}: EPYTHON unset (pkg_setup not called?)"
+ local PYTHON
+ _python_export "${EPYTHON}" PYTHON
local force quiet
while [[ ${@} ]]; do
@@ -1035,13 +1040,13 @@ python_fix_shebang() {
local path f
for path; do
- local any_correct any_fixed is_recursive
+ local any_fixed is_recursive
[[ -d ${path} ]] && is_recursive=1
while IFS= read -r -d '' f; do
local shebang i
- local error= from=
+ local error= match=
# note: we can't ||die here since read will fail if file
# has no newline characters
@@ -1050,64 +1055,36 @@ python_fix_shebang() {
# First, check if it's shebang at all...
if [[ ${shebang} == '#!'* ]]; then
local split_shebang=()
- read -r -a split_shebang <<<${shebang} || die
-
- # Match left-to-right in a loop, to avoid matching random
- # repetitions like 'python2.7 python2'.
- for i in "${split_shebang[@]}"; do
- case "${i}" in
- *"${EPYTHON}")
- debug-print "${FUNCNAME}: in file ${f#${D%/}}"
- debug-print "${FUNCNAME}: shebang matches EPYTHON: ${shebang}"
-
- # Nothing to do, move along.
- any_correct=1
- from=${EPYTHON}
- break
- ;;
- *python|*python[23])
- debug-print "${FUNCNAME}: in file ${f#${D%/}}"
- debug-print "${FUNCNAME}: rewriting shebang: ${shebang}"
-
- if [[ ${i} == *python2 ]]; then
- from=python2
- if [[ ! ${force} ]]; then
- error=1
- fi
- elif [[ ${i} == *python3 ]]; then
- from=python3
- else
- from=python
- fi
- break
- ;;
- *python[23].[0-9]|*python3.[1-9][0-9]|*pypy|*pypy3|*jython[23].[0-9])
- # Explicit mismatch.
- if [[ ! ${force} ]]; then
- error=1
- else
- case "${i}" in
- *python[23].[0-9])
- from="python[23].[0-9]";;
- *python3.[1-9][0-9])
- from="python3.[1-9][0-9]";;
- *pypy)
- from="pypy";;
- *pypy3)
- from="pypy3";;
- *jython[23].[0-9])
- from="jython[23].[0-9]";;
- *)
- die "${FUNCNAME}: internal error in 2nd pattern match";;
- esac
- fi
- break
- ;;
- esac
- done
+ read -r -a split_shebang <<<${shebang#"#!"} || die
+
+ local in_path=${split_shebang[0]}
+ local from='^#! *[^ ]*'
+ # if the first component is env(1), skip it
+ if [[ ${in_path} == */env ]]; then
+ in_path=${split_shebang[1]}
+ from+=' *[^ ]*'
+ fi
+
+ case ${in_path##*/} in
+ "${EPYTHON}")
+ match=1
+ ;;
+ python|python[23])
+ match=1
+ [[ ${in_path##*/} == python2 ]] && error=1
+ ;;
+ python[23].[0-9]|python3.[1-9][0-9]|pypy|pypy3|jython[23].[0-9])
+ # Explicit mismatch.
+ match=1
+ error=1
+ ;;
+ esac
fi
- if [[ ! ${error} && ! ${from} ]]; then
+ # disregard mismatches in force mode
+ [[ ${force} ]] && error=
+
+ if [[ ! ${match} ]]; then
# Non-Python shebang. Allowed in recursive mode,
# disallowed when specifying file explicitly.
[[ ${is_recursive} ]] && continue
@@ -1119,13 +1096,9 @@ python_fix_shebang() {
fi
if [[ ! ${error} ]]; then
- # We either want to match ${from} followed by space
- # or at end-of-string.
- if [[ ${shebang} == *${from}" "* ]]; then
- sed -i -e "1s:${from} :${EPYTHON} :" "${f}" || die
- else
- sed -i -e "1s:${from}$:${EPYTHON}:" "${f}" || die
- fi
+ debug-print "${FUNCNAME}: in file ${f#${D%/}}"
+ debug-print "${FUNCNAME}: rewriting shebang: ${shebang}"
+ sed -i -e "1s@${from}@#!${PYTHON}@" "${f}" || die
any_fixed=1
else
eerror "The file has incompatible shebang:"
@@ -1138,12 +1111,7 @@ python_fix_shebang() {
if [[ ! ${any_fixed} ]]; then
eerror "QA error: ${FUNCNAME}, ${path#${D%/}} did not match any fixable files."
- if [[ ${any_correct} ]]; then
- eerror "All files have ${EPYTHON} shebang already."
- else
- eerror "There are no Python files in specified directory."
- fi
-
+ eerror "There are no Python files in specified directory."
die "${FUNCNAME} did not match any fixable files"
fi
done
diff --git a/eclass/qmail.eclass b/eclass/qmail.eclass
index 33157b7e7871..471f2fe7ce5e 100644
--- a/eclass/qmail.eclass
+++ b/eclass/qmail.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: qmail.eclass
@@ -133,7 +133,7 @@ qmail_base_install() {
# subshell to not leak the install options
(
einfo "Setting up basic directory hierarchy"
- diropts -o root -g qmail
+ diropts -o 0 -g qmail
dodir "${QMAIL_HOME}"/bin
keepdir "${QMAIL_HOME}"/{control,users}
diropts -o alias -g qmail
@@ -145,7 +145,7 @@ qmail_base_install() {
einfo "Installing all qmail software"
exeinto "${QMAIL_HOME}"/bin
- exeopts -o root -g qmail
+ exeopts -o 0 -g qmail
doexe bouncesaying condredirect config-fast datemail except forward maildir2mbox \
maildirmake mailsubj predate preline qbiff \
qmail-{inject,qmqpc,qmqpd,qmtpd,qread,qstat,smtpd,tcpok,tcpto,showctl} \
@@ -158,11 +158,11 @@ qmail_base_install() {
use pop3 && doexe qmail-pop3d
- exeopts -o root -g qmail -m 711
+ exeopts -o 0 -g qmail -m 711
doexe qmail-{clean,getpw,local,pw2u,remote,rspawn,send} splogger
use pop3 && doexe qmail-popup
- exeopts -o root -g qmail -m 700
+ exeopts -o 0 -g qmail -m 700
doexe qmail-{lspawn,newmrh,newu,start}
exeopts -o qmailq -g qmail -m 4711
@@ -262,7 +262,7 @@ qmail_supervise_install_one() {
dosupervise ${1}
# subshell to not leak the install options
(
- diropts -o qmaill -g root
+ diropts -o qmaill -g 0
keepdir /var/log/qmail/${1}
)
}
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index 89bb97947b48..690709f20752 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -396,7 +396,7 @@ ruby_fakegem_binwrapper() {
# if another implementation already arrived, then make
# it generic and break out of the loop. This ensures
# that we do at most two iterations.
- rubycmd="/usr/bin/env ruby"
+ rubycmd="${EPREFIX}/usr/bin/env ruby"
break
fi
done
diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index 1bc934573140..72e714129715 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -66,20 +66,19 @@
# (e.g. selenium's firefox driver extension). When set this argument is
# passed to "grep -E" to remove reporting of these shared objects.
-local inherits=""
case ${EAPI} in
5)
- inherits="eutils toolchain-funcs"
+ inherit eutils toolchain-funcs
;;
6)
- inherits="estack toolchain-funcs"
+ inherit estack toolchain-funcs
;;
*)
- inherits="estack"
+ inherit estack
;;
esac
-inherit ${inherits} multilib ruby-utils
+inherit multilib ruby-utils
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install pkg_setup
diff --git a/eclass/subversion.eclass b/eclass/subversion.eclass
index 5530758d1baa..349878618427 100644
--- a/eclass/subversion.eclass
+++ b/eclass/subversion.eclass
@@ -12,11 +12,9 @@
# The subversion eclass provides functions to fetch software sources
# from subversion repositories.
-ESVN="${ECLASS}"
-
case ${EAPI} in
6|7|8) inherit estack ;;
- *) die "${ESVN}: EAPI ${EAPI:-0} is not supported" ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} is not supported" ;;
esac
PROPERTIES+=" live"
@@ -176,7 +174,7 @@ subversion_fetch() {
local S_dest="${2}"
if [[ -z ${repo_uri} ]]; then
- die "${ESVN}: ESVN_REPO_URI (or specified URI) is empty."
+ die "${ECLASS}: ESVN_REPO_URI (or specified URI) is empty."
fi
[[ -n "${ESVN_REVISION}" ]] && revision="${ESVN_REVISION}"
@@ -191,7 +189,7 @@ subversion_fetch() {
file)
;;
*)
- die "${ESVN}: fetch from '${scheme}' is not yet implemented."
+ die "${ECLASS}: fetch from '${scheme}' is not yet implemented."
;;
esac
@@ -204,10 +202,10 @@ subversion_fetch() {
if [[ ! -d ${ESVN_STORE_DIR} ]]; then
debug-print "${FUNCNAME}: initial checkout. creating subversion directory"
- mkdir -m 775 -p "${ESVN_STORE_DIR}" || die "${ESVN}: can't mkdir ${ESVN_STORE_DIR}."
+ mkdir -m 775 -p "${ESVN_STORE_DIR}" || die "${ECLASS}: can't mkdir ${ESVN_STORE_DIR}."
fi
- pushd "${ESVN_STORE_DIR}" >/dev/null || die "${ESVN}: can't chdir to ${ESVN_STORE_DIR}"
+ pushd "${ESVN_STORE_DIR}" >/dev/null || die "${ECLASS}: can't chdir to ${ESVN_STORE_DIR}"
local wc_path="$(subversion__get_wc_path "${repo_uri}")"
local options="${ESVN_OPTIONS} --config-dir ${ESVN_STORE_DIR}/.subversion"
@@ -237,32 +235,32 @@ subversion_fetch() {
debug-print "${FUNCNAME}: ${ESVN_FETCH_CMD} ${options} ${repo_uri}"
- mkdir -m 775 -p "${ESVN_PROJECT}" || die "${ESVN}: can't mkdir ${ESVN_PROJECT}."
- cd "${ESVN_PROJECT}" || die "${ESVN}: can't chdir to ${ESVN_PROJECT}"
+ mkdir -m 775 -p "${ESVN_PROJECT}" || die "${ECLASS}: can't mkdir ${ESVN_PROJECT}."
+ cd "${ESVN_PROJECT}" || die "${ECLASS}: can't chdir to ${ESVN_PROJECT}"
if [[ -n "${ESVN_USER}" ]]; then
- ${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
+ ${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
else
- ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
+ ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
fi
elif [[ -n ${ESVN_OFFLINE} ]]; then
svn upgrade "${wc_path}" &>/dev/null
svn cleanup "${wc_path}" &>/dev/null
- subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy."
+ subversion_wc_info "${repo_uri}" || die "${ECLASS}: unknown problem occurred while accessing working copy."
if [[ -n ${ESVN_REVISION} && ${ESVN_REVISION} != ${ESVN_WC_REVISION} ]]; then
- die "${ESVN}: You requested off-line updating and revision ${ESVN_REVISION} but only revision ${ESVN_WC_REVISION} is available locally."
+ die "${ECLASS}: You requested off-line updating and revision ${ESVN_REVISION} but only revision ${ESVN_WC_REVISION} is available locally."
fi
einfo "Fetching disabled: Using existing repository copy at revision ${ESVN_WC_REVISION}."
else
svn upgrade "${wc_path}" &>/dev/null
svn cleanup "${wc_path}" &>/dev/null
- subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy."
+ subversion_wc_info "${repo_uri}" || die "${ECLASS}: unknown problem occurred while accessing working copy."
local esvn_up_freq=
if [[ -n ${ESVN_UP_FREQ} ]]; then
if [[ -n ${ESVN_UP_FREQ//[[:digit:]]} ]]; then
- die "${ESVN}: ESVN_UP_FREQ must be an integer value corresponding to the minimum number of hours between svn up."
+ die "${ECLASS}: ESVN_UP_FREQ must be an integer value corresponding to the minimum number of hours between svn up."
elif [[ -z $(find "${wc_path}/.svn/entries" -mmin "+$((ESVN_UP_FREQ*60))") ]]; then
einfo "Fetching disabled since ${ESVN_UP_FREQ} hours has not passed since last update."
einfo "Using existing repository copy at revision ${ESVN_WC_REVISION}."
@@ -282,12 +280,12 @@ subversion_fetch() {
debug-print "${FUNCNAME}: ${ESVN_FETCH_CMD} ${options} ${repo_uri}"
- mkdir -m 775 -p "${ESVN_PROJECT}" || die "${ESVN}: can't mkdir ${ESVN_PROJECT}."
- cd "${ESVN_PROJECT}" || die "${ESVN}: can't chdir to ${ESVN_PROJECT}"
+ mkdir -m 775 -p "${ESVN_PROJECT}" || die "${ECLASS}: can't mkdir ${ESVN_PROJECT}."
+ cd "${ESVN_PROJECT}" || die "${ECLASS}: can't chdir to ${ESVN_PROJECT}"
if [[ -n "${ESVN_USER}" ]]; then
- ${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
+ ${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
else
- ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
+ ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
fi
elif [[ ${ESVN_WC_URL} != $(subversion__get_repository_uri "${repo_uri}") ]]; then
einfo "subversion switch start -->"
@@ -296,11 +294,11 @@ subversion_fetch() {
debug-print "${FUNCNAME}: ${ESVN_SWITCH_CMD} ${options} ${repo_uri}"
- cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
+ cd "${wc_path}" || die "${ECLASS}: can't chdir to ${wc_path}"
if [[ -n "${ESVN_USER}" ]]; then
- ${ESVN_SWITCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" ${repo_uri} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
+ ${ESVN_SWITCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" ${repo_uri} || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
else
- ${ESVN_SWITCH_CMD} ${options} ${repo_uri} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
+ ${ESVN_SWITCH_CMD} ${options} ${repo_uri} || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
fi
else
# update working copy
@@ -309,16 +307,16 @@ subversion_fetch() {
debug-print "${FUNCNAME}: ${ESVN_UPDATE_CMD} ${options}"
- cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
+ cd "${wc_path}" || die "${ECLASS}: can't chdir to ${wc_path}"
if [[ -n "${ESVN_USER}" ]]; then
- ${ESVN_UPDATE_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
+ ${ESVN_UPDATE_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
else
- ${ESVN_UPDATE_CMD} ${options} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
+ ${ESVN_UPDATE_CMD} ${options} || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
fi
fi
# export updated information for the working copy
- subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy."
+ subversion_wc_info "${repo_uri}" || die "${ECLASS}: unknown problem occurred while accessing working copy."
fi
fi
@@ -329,15 +327,15 @@ subversion_fetch() {
einfo " working copy: ${wc_path}"
if ! has "export" ${ESVN_RESTRICT}; then
- cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
+ cd "${wc_path}" || die "${ECLASS}: can't chdir to ${wc_path}"
local S="${S}/${S_dest}"
mkdir -p "${S}"
# export to the ${WORKDIR}
#* "svn export" has a bug. see https://bugs.gentoo.org/119236
- #* svn export . "${S}" || die "${ESVN}: can't export to ${S}."
- rsync -rlpgo --exclude=".svn/" . "${S}" || die "${ESVN}: can't export to ${S}."
+ #* svn export . "${S}" || die "${ECLASS}: can't export to ${S}."
+ rsync -rlpgo --exclude=".svn/" . "${S}" || die "${ECLASS}: can't export to ${S}."
fi
popd >/dev/null
@@ -374,7 +372,7 @@ subversion_wc_info() {
# @DESCRIPTION:
# Default src_unpack. Fetch.
subversion_src_unpack() {
- subversion_fetch || die "${ESVN}: unknown problem occurred in subversion_fetch."
+ subversion_fetch || die "${ECLASS}: unknown problem occurred in subversion_fetch."
}
# @FUNCTION: subversion_pkg_preinst
@@ -401,11 +399,9 @@ subversion_pkg_preinst() {
## -- Private Functions
-## -- subversion__svn_info() ------------------------------------------------- #
-#
-# param $1 - a target.
-# param $2 - a key name.
-#
+# @FUNCTION: subversion__svn_info
+# @USAGE: <target> <key name>
+# @INTERNAL
subversion__svn_info() {
local target="${1}"
local key="${2}"
@@ -415,15 +411,15 @@ subversion__svn_info() {
| cut -d" " -f2-
}
-## -- subversion__get_repository_uri() --------------------------------------- #
-#
-# param $1 - a repository URI.
+# @FUNCTION: subversion__get_repository_uri
+# @USAGE: <repository URI>
+# @INTERNAL
subversion__get_repository_uri() {
local repo_uri="${1}"
debug-print "${FUNCNAME}: repo_uri = ${repo_uri}"
if [[ -z ${repo_uri} ]]; then
- die "${ESVN}: ESVN_REPO_URI (or specified URI) is empty."
+ die "${ECLASS}: ESVN_REPO_URI (or specified URI) is empty."
fi
# delete trailing slash
if [[ -z ${repo_uri##*/} ]]; then
@@ -434,9 +430,9 @@ subversion__get_repository_uri() {
echo "${repo_uri}"
}
-## -- subversion__get_wc_path() ---------------------------------------------- #
-#
-# param $1 - a repository URI.
+# @FUNCTION: subversion__get_wc_path
+# @USAGE: <repository URI>
+# @INTERNAL
subversion__get_wc_path() {
local repo_uri="$(subversion__get_repository_uri "${1}")"
@@ -445,9 +441,9 @@ subversion__get_wc_path() {
echo "${ESVN_STORE_DIR}/${ESVN_PROJECT}/${repo_uri##*/}"
}
-## -- subversion__get_peg_revision() ----------------------------------------- #
-#
-# param $1 - a repository URI.
+# @FUNCTION: subversion__get_peg_revision
+# @USAGE: <repository URI>
+# @INTERNAL
subversion__get_peg_revision() {
local repo_uri="${1}"
local peg_rev=
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 8c733b22294e..ef7687b8a9cf 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -41,7 +41,7 @@ test_fix_shebang() {
local expect=${3}
local args=( "${@:4}" )
- tbegin "python_fix_shebang${args[@]+ ${args[*]}} from ${from} to ${to} (exp: ${expect})"
+ tbegin "python_fix_shebang${args[@]+ ${args[*]}} from ${from@Q} to ${to@Q} (exp: ${expect@Q})"
echo "${from}" > "${tmpfile}"
output=$( EPYTHON=${to} python_fix_shebang "${args[@]}" -q "${tmpfile}" 2>&1 )
@@ -156,36 +156,60 @@ fi
test_var PYTHON_PKG_DEP pypy3 '*dev-python/pypy3*:0='
test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3
-# generic shebangs
-test_fix_shebang '#!/usr/bin/python' python3.6 '#!/usr/bin/python3.6'
-test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3'
-
-# python2/python3 matching
-test_fix_shebang '#!/usr/bin/python3' python3.6 '#!/usr/bin/python3.6'
-test_fix_shebang '#!/usr/bin/python2' python3.6 FAIL
-test_fix_shebang '#!/usr/bin/python2' python3.6 '#!/usr/bin/python3.6' --force
-
-# pythonX.Y matching (those mostly test the patterns)
-test_fix_shebang '#!/usr/bin/python2.7' python3.2 FAIL
-test_fix_shebang '#!/usr/bin/python2.7' python3.2 '#!/usr/bin/python3.2' --force
-test_fix_shebang '#!/usr/bin/python3.2' python3.2 '#!/usr/bin/python3.2'
-
-# fancy path handling
-test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.6 \
- '#!/mnt/python2/usr/bin/python3.6'
-test_fix_shebang '#!/mnt/python2/usr/bin/python3' python3.8 \
- '#!/mnt/python2/usr/bin/python3.8'
-test_fix_shebang '#!/mnt/python2/usr/bin/env python' python3.8 \
- '#!/mnt/python2/usr/bin/env python3.8'
-test_fix_shebang '#!/mnt/python2/usr/bin/python3 python3' python3.8 \
- '#!/mnt/python2/usr/bin/python3.8 python3'
-test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 FAIL
-test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 \
- '#!/mnt/python2/usr/bin/python3.8 python3' --force
-test_fix_shebang '#!/usr/bin/foo' python3.8 FAIL
-
-# regression test for bug #522080
-test_fix_shebang '#!/usr/bin/python ' python3.8 '#!/usr/bin/python3.8 '
+for EPREFIX in '' /foo; do
+ einfo "with EPREFIX=${EPREFIX@Q}"
+ eindent
+ # generic shebangs
+ test_fix_shebang '#!/usr/bin/python' python3.6 \
+ "#!${EPREFIX}/usr/bin/python3.6"
+ test_fix_shebang '#!/usr/bin/python' pypy3 \
+ "#!${EPREFIX}/usr/bin/pypy3"
+
+ # python2/python3 matching
+ test_fix_shebang '#!/usr/bin/python3' python3.6 \
+ "#!${EPREFIX}/usr/bin/python3.6"
+ test_fix_shebang '#!/usr/bin/python2' python3.6 FAIL
+ test_fix_shebang '#!/usr/bin/python2' python3.6 \
+ "#!${EPREFIX}/usr/bin/python3.6" --force
+
+ # pythonX.Y matching (those mostly test the patterns)
+ test_fix_shebang '#!/usr/bin/python2.7' python3.2 FAIL
+ test_fix_shebang '#!/usr/bin/python2.7' python3.2 \
+ "#!${EPREFIX}/usr/bin/python3.2" --force
+ test_fix_shebang '#!/usr/bin/python3.2' python3.2 \
+ "#!${EPREFIX}/usr/bin/python3.2"
+
+ # fancy path handling
+ test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.6 \
+ "#!${EPREFIX}/usr/bin/python3.6"
+ test_fix_shebang '#!/mnt/python2/usr/bin/python3' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8"
+ test_fix_shebang '#!/mnt/python2/usr/bin/env python' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8"
+ test_fix_shebang '#!/mnt/python2/usr/bin/python3 python3' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8 python3"
+ test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 FAIL
+ test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8 python3" --force
+ test_fix_shebang '#!/usr/bin/foo' python3.8 FAIL
+
+ # regression test for bug #522080
+ test_fix_shebang '#!/usr/bin/python ' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8 "
+
+ # test random whitespace in shebang
+ test_fix_shebang '#! /usr/bin/python' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8"
+ test_fix_shebang '#! /usr/bin/python' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8"
+ test_fix_shebang '#! /usr/bin/env python' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8"
+
+ # test preserving options
+ test_fix_shebang '#! /usr/bin/python -b' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8 -b"
+ eoutdent
+done
# check _python_impl_matches behavior
test_is "_python_impl_matches python3_6 -3" 0
diff --git a/eclass/tmpfiles.eclass b/eclass/tmpfiles.eclass
index 165d95d4e6fb..39650401a6a0 100644
--- a/eclass/tmpfiles.eclass
+++ b/eclass/tmpfiles.eclass
@@ -1,4 +1,4 @@
-# Copyright 2016-2021 Gentoo Authors
+# Copyright 2016-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: tmpfiles.eclass
@@ -52,8 +52,8 @@
#
# @CODE
-if [[ -z ${TMPFILES_ECLASS} ]]; then
-TMPFILES_ECLASS=1
+if [[ -z ${_TMPFILES_ECLASS} ]]; then
+_TMPFILES_ECLASS=1
case "${EAPI}" in
5|6|7|8) ;;
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 495a305ed83e..8788e72efebb 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1780,7 +1780,7 @@ toolchain_src_install() {
# Use gid of 0 because some stupid ports don't have
# the group 'root' set to gid 0. Send to /dev/null
# for people who are testing as non-root.
- chown -R root:0 "${D}${LIBPATH}" 2>/dev/null
+ chown -R 0:0 "${D}${LIBPATH}" 2>/dev/null
# Installing gdb pretty-printers into gdb-specific location.
local py gdbdir=/usr/share/gdb/auto-load${LIBPATH}
diff --git a/eclass/user.eclass b/eclass/user.eclass
index 581704eae815..ff69be81c1ec 100644
--- a/eclass/user.eclass
+++ b/eclass/user.eclass
@@ -85,7 +85,7 @@ user_get_nologin() {
# If -M is passed, enewuser does not create the home directory if it does not
# exist.
enewuser() {
- if [[ ${EUID} != 0 ]] ; then
+ if [[ ${EUID} -ne 0 ]] ; then
ewarn "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
@@ -240,7 +240,7 @@ enewuser() {
# If -F is passed, enewgroup will always enforce specified GID and fail if it
# can not be assigned.
enewgroup() {
- if [[ ${EUID} != 0 ]] ; then
+ if [[ ${EUID} -ne 0 ]] ; then
ewarn "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
diff --git a/eclass/vala.eclass b/eclass/vala.eclass
index 1c38e54404e6..076ef9066067 100644
--- a/eclass/vala.eclass
+++ b/eclass/vala.eclass
@@ -25,13 +25,13 @@ _VALA_ECLASS=1
# @ECLASS_VARIABLE: VALA_MIN_API_VERSION
# @DESCRIPTION:
-# Minimum vala API version (e.g. 0.46).
-VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.46}
+# Minimum vala API version (e.g. 0.50).
+VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.50}
# @ECLASS_VARIABLE: VALA_MAX_API_VERSION
# @DESCRIPTION:
-# Maximum vala API version (e.g. 0.54).
-VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.54}
+# Maximum vala API version (e.g. 0.56).
+VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.56}
# @ECLASS_VARIABLE: VALA_USE_DEPEND
# @DEFAULT_UNSET
diff --git a/eclass/webapp.eclass b/eclass/webapp.eclass
index 3c0dfc811ac6..1efe4e66b6a9 100644
--- a/eclass/webapp.eclass
+++ b/eclass/webapp.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: webapp.eclass
@@ -457,7 +457,7 @@ webapp_src_install() {
chmod -R g-s "${D}/"
keepdir "${MY_PERSISTDIR}"
- fowners "root:0" "${MY_PERSISTDIR}"
+ fowners "0:0" "${MY_PERSISTDIR}"
fperms 755 "${MY_PERSISTDIR}"
}
diff --git a/eclass/wrapper.eclass b/eclass/wrapper.eclass
index 399c7cc269d4..8d3d273d81c6 100644
--- a/eclass/wrapper.eclass
+++ b/eclass/wrapper.eclass
@@ -1,11 +1,17 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: wrapper.eclass
# @MAINTAINER:
# base-system@gentoo.org
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: create a shell wrapper script
+case ${EAPI} in
+ 5|6|7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
if [[ -z ${_WRAPPER_ECLASS} ]]; then
_WRAPPER_ECLASS=1
@@ -19,7 +25,6 @@ _WRAPPER_ECLASS=1
make_wrapper() {
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
local tmpwrapper="${T}/tmp.wrapper.${wrapper##*/}"
- has "${EAPI:-0}" 0 1 2 && local EPREFIX=""
(
echo '#!/bin/sh'
@@ -30,11 +35,11 @@ make_wrapper() {
else
var=LD_LIBRARY_PATH
fi
- cat <<-EOF
+ sed 's/^X//' <<-EOF || die
if [ "\${${var}+set}" = "set" ] ; then
- export ${var}="\${${var}}:${EPREFIX}${libdir}"
+ X export ${var}="\${${var}}:${EPREFIX}${libdir}"
else
- export ${var}="${EPREFIX}${libdir}"
+ X export ${var}="${EPREFIX}${libdir}"
fi
EOF
fi
@@ -52,7 +57,7 @@ make_wrapper() {
newexe "${tmpwrapper}" "${wrapper}"
) || die
else
- newbin "${tmpwrapper}" "${wrapper}" || die
+ newbin "${tmpwrapper}" "${wrapper}"
fi
}
diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index e908d51c669f..c68b3041629a 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: xorg-3.eclass
@@ -8,7 +8,7 @@
# Author: Tomáš Chvátal <scarabeus@gentoo.org>
# Author: Donnie Berkholz <dberkholz@gentoo.org>
# Author: Matt Turner <mattst88@gentoo.org>
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
# @PROVIDES: multilib-minimal
# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
# @DESCRIPTION:
@@ -52,19 +52,19 @@ fi
# we need to inherit autotools first to get the deps
inherit autotools libtool multilib toolchain-funcs flag-o-matic \
${FONT_ECLASS} ${GIT_ECLASS}
+unset FONT_ECLASS GIT_ECLASS
if [[ ${XORG_MULTILIB} == yes ]]; then
inherit multilib-minimal
fi
-EXPORTED_FUNCTIONS="src_prepare src_configure src_unpack src_compile src_install pkg_postinst pkg_postrm"
case "${EAPI:-0}" in
- 7) ;;
+ [7-8]) ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
# exports must be ALWAYS after inherit
-EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
+EXPORT_FUNCTIONS src_prepare src_configure src_unpack src_compile src_install pkg_postinst pkg_postrm
IUSE=""
@@ -119,7 +119,7 @@ HOMEPAGE="https://www.x.org/wiki/ https://gitlab.freedesktop.org/xorg/${XORG_MOD
# to bz2.
: ${XORG_TARBALL_SUFFIX:="bz2"}
-if [[ -n ${GIT_ECLASS} ]]; then
+if [[ ${PV} == *9999* ]]; then
: ${EGIT_REPO_URI:="https://gitlab.freedesktop.org/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}.git"}
elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then
SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.${XORG_TARBALL_SUFFIX}"
@@ -143,12 +143,10 @@ if [[ ${PN} != util-macros ]] ; then
# Required even by xorg-server
[[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0"
fi
-WANT_AUTOCONF="latest"
-WANT_AUTOMAKE="latest"
for arch in ${XORG_EAUTORECONF_ARCHES}; do
EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )"
done
-unset arch
+unset arch XORG_EAUTORECONF_ARCHES
BDEPEND+=" ${EAUTORECONF_DEPENDS}"
[[ ${XORG_EAUTORECONF} != no ]] && BDEPEND+=" ${EAUTORECONF_DEPEND}"
unset EAUTORECONF_DEPENDS
@@ -226,7 +224,6 @@ DOC_DEPEND="
doc? (
|| ( app-text/asciidoc dev-ruby/asciidoctor )
app-text/xmlto
- app-doc/doxygen
app-text/docbook-xml-dtd:4.1.2
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.3
@@ -269,7 +266,7 @@ xorg-3_pkg_setup() {
xorg-3_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
- if [[ -n ${GIT_ECLASS} ]]; then
+ if [[ ${PV} == *9999* ]]; then
git-r3_src_unpack
else
unpack ${A}