[gentoo-dev] [PATCH 2/2] eclass/tests: Initial test cases for eapi8-dosym.eclass.
Signed-off-by: Ulrich Müller --- eclass/tests/eapi8-dosym.sh | 78 + 1 file changed, 78 insertions(+) create mode 100755 eclass/tests/eapi8-dosym.sh diff --git a/eclass/tests/eapi8-dosym.sh b/eclass/tests/eapi8-dosym.sh new file mode 100755 index ..ac1defc6c5f1 --- /dev/null +++ b/eclass/tests/eapi8-dosym.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# Copyright 2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +source tests-common.sh + +inherit eapi8-dosym + +dosym() { + echo "$1" +} + +# reference implementation using GNU realpath +ref_canonicalize() { + realpath -m -s "$1" +} + +ref_dosym_r() { + local link=$(realpath -m -s "/${2#/}") + realpath -m -s --relative-to="$(dirname "${link}")" "$1" +} + +randompath() { + dd if=/dev/urandom bs=128 count=1 2>/dev/null | LC_ALL=C sed \ + -e 's/[^a-zA-M]//g;s/[A-E]/\/.\//g;s/[F-J]/\/..\//g;s/[K-M]/\//g' \ + -e 's/^/\//;q' +} + +teq() { + local expected=$1; shift + tbegin "$* -> ${expected}" + local got=$("$@") + [[ ${got} == "${expected}" ]] + tend $? "returned: ${got}" +} + +for f in ref_canonicalize "_dosym8_canonicalize"; do + # canonicalize absolute paths + teq / ${f} / + teq /foo/baz/quux ${f} /foo/bar/../baz/quux + teq /foo ${f} /../../../foo + teq /bar ${f} /foo//./..///bar + teq /baz ${f} /foo/bar/../../../baz + teq /a/d/f/g ${f} /a/b/c/../../d/e/../f/g + + # canonicalize relative paths (not actually used) + teq . _dosym8_canonicalize . + teq foo _dosym8_canonicalize foo + teq foo _dosym8_canonicalize ./foo + teq ../foo _dosym8_canonicalize ../foo + teq ../baz _dosym8_canonicalize foo/bar/../../../baz +done + +for f in ref_dosym_r "dosym8 -r"; do + teq ../../bin/foo ${f} /bin/foo /usr/bin/foo + teq ../../../doc/foo-1 \ + ${f} /usr/share/doc/foo-1 /usr/share/texmf-site/doc/fonts/foo + teq ../../opt/bar/foo ${f} /opt/bar/foo /usr/bin/foo + teq ../c/d/e ${f} /a/b/c/d/e a/b/f/g + teq b/f ${f} /a/b///./c/d/../e/..//../f /a/./.g/../h + teq ../h ${f} /a/./.g/../h /a/b///./c/d/../e/..//../f + teq . ${f} /foo /foo/bar + teq .. ${f} /foo /foo/bar/baz + teq '../../fo . o/b ar' ${f} '/fo . o/b ar' '/baz / qu .. ux/qu x' + teq '../../f"o\o/b$a[]r' ${f} '/f"o\o/b$a[]r' '/ba\z/qu$u"x/qux' +done + +# set RANDOMTESTS to a positive number to enable random tests +for (( i = 0; i < RANDOMTESTS; i++ )); do + targ=$(randompath) + link=$(randompath) + out=$(ref_dosym_r "${targ}" "${link}") + teq "${out}" dosym8 -r "${targ}" "${link}" +done + +texit -- 2.29.2
[gentoo-dev] [PATCH 1/2] eapi8-dosym.eclass: New eclass.
This implements the dosym command proposed for EAPI 8 (called dosym8 because we cannot use the same name as the package-manager builtin). "dosym -r " will expand the (apparent) path of relative to the (apparent) path of the directory containing . The main aim of this is to allow for an absolute path to be specified as the link target, and the function will count path components and convert it into a relative path. Since we're inside ED at this point but the image will finally be installed in EROOT, we don't try to resolve any pre-existing symlinks in or . In other words, path expansion only looks at the specified apparent paths, without touching any actual files in ED or EROOT. Signed-off-by: Ulrich Müller --- eclass/eapi8-dosym.eclass | 108 ++ 1 file changed, 108 insertions(+) create mode 100644 eclass/eapi8-dosym.eclass diff --git a/eclass/eapi8-dosym.eclass b/eclass/eapi8-dosym.eclass new file mode 100644 index ..52f0ffe3e62b --- /dev/null +++ b/eclass/eapi8-dosym.eclass @@ -0,0 +1,108 @@ +# Copyright 2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: eapi8-dosym.eclass +# @MAINTAINER: +# PMS team +# @AUTHOR: +# Ulrich Müller +# @SUPPORTED_EAPIS: 5 6 7 +# @BLURB: Testing implementation of EAPI 8 dosym -r option +# @DESCRIPTION: +# A stand-alone implementation of the dosym command aimed for EAPI 8. +# Intended to be used for wider testing of the proposed option and to +# allow ebuilds to switch to the new model early, with minimal change +# needed for actual EAPI 8. +# +# https://bugs.gentoo.org/708360 + +case ${EAPI} in + 5|6|7) ;; + *) die "${ECLASS}: EAPI=${EAPI:-0} not supported" ;; +esac + +# @FUNCTION: _dosym8_canonicalize +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Transparent bash-only replacement for GNU "realpath -m -s". +# Resolve references to "/./", "/../" and remove extra "/" characters +# from , without touching any actual file. +_dosym8_canonicalize() { + local path slash i prev out IFS=/ + + path=( $1 ) + [[ $1 == /* ]] && slash=/ + + while true; do + # Find first instance of non-".." path component followed by "..", + # or as a special case, "/.." at the beginning of the path. + # Also drop empty and "." path components as we go along. + prev= + for i in ${!path[@]}; do + if [[ -z ${path[i]} || ${path[i]} == . ]]; then + unset "path[i]" + elif [[ ${path[i]} != .. ]]; then + prev=${i} + elif [[ ${prev} || ${slash} ]]; then + # Found, remove path components and reiterate + [[ ${prev} ]] && unset "path[prev]" + unset "path[i]" + continue 2 + fi + done + # No (further) instance found, so we're done + break + done + + out="${slash}${path[*]}" + echo "${out:-.}" +} + +# @FUNCTION: dosym8 +# @USAGE: [-r] +# @DESCRIPTION: +# Create a symbolic link , pointing to . If the +# directory containing the new link does not exist, create it. +# +# If called with option -r, expand relative to the apparent +# path of the directory containing . For example, "dosym8 -r +# /bin/foo /usr/bin/foo" will create a link named "../../bin/foo". +dosym8() { + local option_r + + case $1 in + -r) option_r=t; shift ;; + esac + + [[ $# -eq 2 ]] || die "${FUNCNAME}: bad number of arguments" + + local target=$1 link=$2 + + if [[ ${option_r} ]]; then + local linkdir comp + + # Expansion makes sense only for an absolute target path + [[ ${target} == /* ]] \ + || die "${FUNCNAME}: -r specified but no absolute target path" + + target=$(_dosym8_canonicalize "${target}") + linkdir=$(_dosym8_canonicalize "/${link#/}") + linkdir=${linkdir%/*} # poor man's dirname(1) + linkdir=${linkdir:-/} # always keep the initial "/" + + local ifs_save=${IFS-$' \t\n'} IFS=/ + for comp in ${linkdir}; do + if [[ ${target%%/*} == "${comp}" ]]; then + target=${target#"${comp}"} + target=${target#/} + else + target=..${target:+/}${target} + fi + done + IFS=${ifs_save} + target=${target:-.} + fi + + dosym "${target}" "${link}" +} -- 2.29.2
[gentoo-dev] [PATCH] user.eclass: Deprecate general use for future EAPIs.
No functional difference for existing EAPIs. Reviewed-by: David Seifert Reviewed-by: Michał Górny Reviewed-by: Andreas K. Hüttel Signed-off-by: Ulrich Müller --- eclass/user.eclass | 13 + 1 file changed, 13 insertions(+) diff --git a/eclass/user.eclass b/eclass/user.eclass index b70698356a3a..a661b4bc 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -13,6 +13,19 @@ if [[ -z ${_USER_ECLASS} ]]; then _USER_ECLASS=1 +case ${EAPI:-0} in + 0|1|2|3|4|5|6|7) ;; + *) + if [[ ${CATEGORY} != acct-* ]]; then + eerror "In EAPI ${EAPI}, packages must not inherit user.eclass" + eerror "unless they are in the acct-user or acct-group category." + eerror "Migrate your package to GLEP 81 user/group management," + eerror "or inherit user-info if you need only the query functions." + die "Invalid \"inherit user\" in EAPI ${EAPI}" + fi + ;; +esac + inherit user-info # @FUNCTION: _assert_pkg_ebuild_phase -- 2.29.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH 7/8] eutils.eclass: Deprecate emktemp().
Signed-off-by: Ulrich Müller --- eclass/eutils.eclass | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index cd59d3f9ccc4..0a99d00ee01a 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -31,9 +31,11 @@ esac # @FUNCTION: emktemp # @USAGE: [temp dir] # @DESCRIPTION: -# Cheap replacement for when debianutils (and thus mktemp) -# does not exist on the users system. +# Cheap replacement for when coreutils (and thus mktemp) does not exist +# on the user's system. emktemp() { + eqawarn "emktemp is deprecated. Create a temporary file in \${T} instead." + local exe="touch" [[ $1 == -d ]] && exe="mkdir" && shift local topdir=$1 -- 2.28.0
[gentoo-dev] [PATCH 8/8] eutils.eclass: Deprecate use_if_iuse().
The function is not called from any ebuilds in the gentoo repository. Inline it as "in_iuse foo && use foo" in other eclasses, or define it as a local function when it is called multiple times. Signed-off-by: Ulrich Müller --- eclass/chromium-2.eclass | 4 +-- eclass/eutils.eclass | 3 ++ eclass/gnome2.eclass | 2 +- eclass/mate.eclass | 4 +-- eclass/toolchain.eclass | 77 ++-- 5 files changed, 51 insertions(+), 39 deletions(-) diff --git a/eclass/chromium-2.eclass b/eclass/chromium-2.eclass index c9cfe5acebee..b3d63f302d05 100644 --- a/eclass/chromium-2.eclass +++ b/eclass/chromium-2.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: chromium-2.eclass @@ -126,7 +126,7 @@ chromium_pkg_die() { fi # No ricer bugs. - if use_if_iuse custom-cflags; then + if in_iuse custom-cflags && use custom-cflags; then ewarn ewarn "You have enabled the custom-cflags USE flag." ewarn "Please disable it before reporting a bug." diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 0a99d00ee01a..ba6bf8178673 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -79,6 +79,9 @@ path_exists() { # # Note that this function should not be used in the global scope. use_if_iuse() { + eqawarn "use_if_iuse is deprecated." + eqawarn "Define it as a local function, or inline it:" + eqawarn "in_iuse foo && use foo" in_iuse $1 || return 1 use $1 } diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass index a16fc916c6d2..1a4ff451df32 100644 --- a/eclass/gnome2.eclass +++ b/eclass/gnome2.eclass @@ -296,7 +296,7 @@ gnome2_src_install() { if has ${EAPI:-0} 4; then if [[ "${GNOME2_LA_PUNT}" != "no" ]]; then ebegin "Removing .la files" - if ! use_if_iuse static-libs ; then + if ! in_iuse static-libs || ! use static-libs ; then find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed" fi eend diff --git a/eclass/mate.eclass b/eclass/mate.eclass index d7dd2dbceec0..34d5e47acc22 100644 --- a/eclass/mate.eclass +++ b/eclass/mate.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: mate.eclass @@ -120,7 +120,7 @@ mate_src_configure() { local mateconf=() # Pass --disable-static whenever possible - if ! use_if_iuse static-libs; then + if ! in_iuse static-libs || ! use static-libs; then if grep -q "enable-static" "${ECONF_SOURCE:-.}"/configure; then mateconf+=( --disable-static ) fi diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 6fb3eb941a2c..32996a2f8f71 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -398,10 +398,13 @@ SRC_URI=$(get_gcc_src_uri) #>> pkg_pretend << toolchain_pkg_pretend() { - if ! use_if_iuse cxx ; then - use_if_iuse go && ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"' - use_if_iuse objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"' - use_if_iuse gcj && ewarn 'GCJ requires a C++ compiler, disabled due to USE="-cxx"' + if ! _tc_use_if_iuse cxx ; then + _tc_use_if_iuse go && \ + ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"' + _tc_use_if_iuse objc++ && \ + ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"' + _tc_use_if_iuse gcj && \ + ewarn 'GCJ requires a C++ compiler, disabled due to USE="-cxx"' fi want_minispecs @@ -461,7 +464,8 @@ toolchain_src_prepare() { *) die "Update toolchain_src_prepare() for ${EAPI}." ;; esac - if ( tc_version_is_at_least 4.8.2 || use_if_iuse hardened ) && ! use vanilla ; then + if ( tc_version_is_at_least 4.8.2 || _tc_use_if_iuse hardened ) \ + && ! use vanilla ; then make_gcc_hard fi @@ -481,7 +485,7 @@ toolchain_src_prepare() { fi # >= gcc-4.3 doesn't bundle ecj.jar, so copy it - if tc_version_is_at_least 4.3 && use_if_iuse gcj ; then + if tc_
[gentoo-dev] [PATCH 4/8] wrapper.eclass: Do not use emktemp.
Signed-off-by: Ulrich Müller --- eclass/wrapper.eclass | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eclass/wrapper.eclass b/eclass/wrapper.eclass index 8cde94979d1a..399c7cc269d4 100644 --- a/eclass/wrapper.eclass +++ b/eclass/wrapper.eclass @@ -9,8 +9,6 @@ if [[ -z ${_WRAPPER_ECLASS} ]]; then _WRAPPER_ECLASS=1 -inherit eutils # for emktemp - # @FUNCTION: make_wrapper # @USAGE: [chdir] [libpaths] [installpath] # @DESCRIPTION: @@ -20,7 +18,7 @@ inherit eutils # for emktemp # libpaths followed by optionally changing directory to chdir. make_wrapper() { local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5 - local tmpwrapper=$(emktemp) + local tmpwrapper="${T}/tmp.wrapper.${wrapper##*/}" has "${EAPI:-0}" 0 1 2 && local EPREFIX="" ( -- 2.28.0
[gentoo-dev] [PATCH 6/8] l10n.eclass: strip-linguas() moved from eutils to here.
Signed-off-by: Ulrich Müller --- eclass/eutils.eclass | 53 ++-- eclass/l10n.eclass | 47 +++ 2 files changed, 49 insertions(+), 51 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 0072f4ccf3e7..cd59d3f9ccc4 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -21,10 +21,10 @@ _EUTILS_ECLASS=1 # implicitly inherited (now split) eclasses case ${EAPI:-0} in 0|1|2|3|4|5|6) - inherit desktop edos2unix epatch estack ltprune multilib \ + inherit desktop edos2unix epatch estack l10n ltprune multilib \ preserve-libs toolchain-funcs vcs-clean wrapper ;; - 7) inherit edos2unix wrapper ;; + 7) inherit edos2unix l10n wrapper ;; *) die "${ECLASS} is banned in EAPI ${EAPI}" ;; esac @@ -63,55 +63,6 @@ emktemp() { fi } -# @FUNCTION: strip-linguas -# @USAGE: [|<-i|-u> ] -# @DESCRIPTION: -# Make sure that LINGUAS only contains languages that -# a package can support. The first form allows you to -# specify a list of LINGUAS. The -i builds a list of po -# files found in all the directories and uses the -# intersection of the lists. The -u builds a list of po -# files found in all the directories and uses the union -# of the lists. -strip-linguas() { - local ls newls nols - if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then - local op=$1; shift - ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift - local d f - for d in "$@" ; do - if [[ ${op} == "-u" ]] ; then - newls=${ls} - else - newls="" - fi - for f in $(find "$d" -name '*.po' -exec basename {} .po ';') ; do - if [[ ${op} == "-i" ]] ; then - has ${f} ${ls} && newls="${newls} ${f}" - else - has ${f} ${ls} || newls="${newls} ${f}" - fi - done - ls=${newls} - done - else - ls="$@" - fi - - nols="" - newls="" - for f in ${LINGUAS} ; do - if has ${f} ${ls} ; then - newls="${newls} ${f}" - else - nols="${nols} ${f}" - fi - done - [[ -n ${nols} ]] \ - && einfo "Sorry, but ${PN} does not support the LINGUAS:" ${nols} - export LINGUAS=${newls:1} -} - path_exists() { eerror "path_exists has been removed. Please see the following post" eerror "for a replacement snippet:" diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass index 73d54ec22334..7bd8f382fbe3 100644 --- a/eclass/l10n.eclass +++ b/eclass/l10n.eclass @@ -124,4 +124,51 @@ l10n_get_locales() { printf "%s" "${locs}" } +# @FUNCTION: strip-linguas +# @USAGE: [|<-i|-u> ] +# @DESCRIPTION: +# Make sure that LINGUAS only contains languages that a package can +# support. The first form allows you to specify a list of LINGUAS. +# The -i builds a list of po files found in all the directories and uses +# the intersection of the lists. The -u builds a list of po files found +# in all the directories and uses the union of the lists. +strip-linguas() { + local ls newls nols + if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then + local op=$1; shift + ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift + local d f + for d in "$@" ; do + if [[ ${op} == "-u" ]] ; then + newls=${ls} + else + newls="" + fi + for f in $(find "$d" -name '*.po' -exec basename {} .po ';') ; do + if [[ ${op} == "-i" ]] ; then + has ${f} ${ls} && newls="${newls} ${f}" + else + has ${f} ${ls} || newls="${newls} ${f}" + fi + done + ls=${newls} + done + else + ls="$@" + fi + + nols="" + newls="" + for f in ${LINGUAS} ; do + if has ${f} ${ls} ; then + newls="${newls} ${f}" + else + nols="${nols} ${f}" + fi + done + [[ -n ${nols} ]] \ + && einfo "Sorry, but ${PN} does not support the LINGUAS:" ${nols} + export LINGUAS=${newls:1} +} + fi -- 2.28.0
[gentoo-dev] [PATCH 5/8] l10n.eclass: Add conditional to prevent multiple inclusion.
Signed-off-by: Ulrich Müller --- eclass/l10n.eclass | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass index 0b2d287afa7f..73d54ec22334 100644 --- a/eclass/l10n.eclass +++ b/eclass/l10n.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: l10n.eclass @@ -14,6 +14,9 @@ # determining the cross-section between the user's set LINGUAS and what # is offered by the package. +if [[ -z ${_L10N_ECLASS} ]]; then +_L10N_ECLASS=1 + # @ECLASS-VARIABLE: PLOCALES # @DEFAULT_UNSET # @DESCRIPTION: @@ -120,3 +123,5 @@ l10n_get_locales() { fi printf "%s" "${locs}" } + +fi -- 2.28.0
[gentoo-dev] [PATCH 1/8] eutils.eclass: Specify supported EAPIs.
Proactively deprecate in future EAPIs, as requested by soap. Signed-off-by: Ulrich Müller --- eclass/eutils.eclass | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index c2fc05c9dbed..f74074fb4f16 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -4,6 +4,7 @@ # @ECLASS: eutils.eclass # @MAINTAINER: # base-sys...@gentoo.org +# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 # @BLURB: many extra (but common) functions that are used in ebuilds # @DESCRIPTION: # The eutils eclass contains a suite of functions that complement @@ -19,10 +20,12 @@ _EUTILS_ECLASS=1 # implicitly inherited (now split) eclasses case ${EAPI:-0} in -0|1|2|3|4|5|6) - inherit desktop epatch estack ltprune multilib preserve-libs \ - toolchain-funcs vcs-clean - ;; + 0|1|2|3|4|5|6) + inherit desktop epatch estack ltprune multilib preserve-libs \ + toolchain-funcs vcs-clean + ;; + 7) ;; + *) die "${ECLASS} is banned in EAPI ${EAPI}" ;; esac # @FUNCTION: emktemp -- 2.28.0
[gentoo-dev] [PATCH 3/8] wrapper.eclass: New eclass, split off from eutils.
Signed-off-by: Ulrich Müller --- eclass/eutils.eclass | 51 ++-- eclass/wrapper.eclass | 61 +++ 2 files changed, 63 insertions(+), 49 deletions(-) create mode 100644 eclass/wrapper.eclass diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 3b3e328ba30d..0072f4ccf3e7 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -22,9 +22,9 @@ _EUTILS_ECLASS=1 case ${EAPI:-0} in 0|1|2|3|4|5|6) inherit desktop edos2unix epatch estack ltprune multilib \ - preserve-libs toolchain-funcs vcs-clean + preserve-libs toolchain-funcs vcs-clean wrapper ;; - 7) inherit edos2unix ;; + 7) inherit edos2unix wrapper ;; *) die "${ECLASS} is banned in EAPI ${EAPI}" ;; esac @@ -112,53 +112,6 @@ strip-linguas() { export LINGUAS=${newls:1} } -# @FUNCTION: make_wrapper -# @USAGE: [chdir] [libpaths] [installpath] -# @DESCRIPTION: -# Create a shell wrapper script named wrapper in installpath -# (defaults to the bindir) to execute target (default of wrapper) by -# first optionally setting LD_LIBRARY_PATH to the colon-delimited -# libpaths followed by optionally changing directory to chdir. -make_wrapper() { - local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5 - local tmpwrapper=$(emktemp) - has "${EAPI:-0}" 0 1 2 && local EPREFIX="" - - ( - echo '#!/bin/sh' - if [[ -n ${libdir} ]] ; then - local var - if [[ ${CHOST} == *-darwin* ]] ; then - var=DYLD_LIBRARY_PATH - else - var=LD_LIBRARY_PATH - fi - cat <<-EOF - if [ "\${${var}+set}" = "set" ] ; then - export ${var}="\${${var}}:${EPREFIX}${libdir}" - else - export ${var}="${EPREFIX}${libdir}" - fi - EOF - fi - [[ -n ${chdir} ]] && printf 'cd "%s" &&\n' "${EPREFIX}${chdir}" - # We don't want to quote ${bin} so that people can pass complex - # things as ${bin} ... "./someprog --args" - printf 'exec %s "$@"\n' "${bin/#\//${EPREFIX}/}" - ) > "${tmpwrapper}" - chmod go+rx "${tmpwrapper}" - - if [[ -n ${path} ]] ; then - ( - exeopts -m 0755 - exeinto "${path}" - newexe "${tmpwrapper}" "${wrapper}" - ) || die - else - newbin "${tmpwrapper}" "${wrapper}" || die - fi -} - path_exists() { eerror "path_exists has been removed. Please see the following post" eerror "for a replacement snippet:" diff --git a/eclass/wrapper.eclass b/eclass/wrapper.eclass new file mode 100644 index ..8cde94979d1a --- /dev/null +++ b/eclass/wrapper.eclass @@ -0,0 +1,61 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: wrapper.eclass +# @MAINTAINER: +# base-sys...@gentoo.org +# @BLURB: create a shell wrapper script + +if [[ -z ${_WRAPPER_ECLASS} ]]; then +_WRAPPER_ECLASS=1 + +inherit eutils # for emktemp + +# @FUNCTION: make_wrapper +# @USAGE: [chdir] [libpaths] [installpath] +# @DESCRIPTION: +# Create a shell wrapper script named wrapper in installpath +# (defaults to the bindir) to execute target (default of wrapper) +# by first optionally setting LD_LIBRARY_PATH to the colon-delimited +# libpaths followed by optionally changing directory to chdir. +make_wrapper() { + local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5 + local tmpwrapper=$(emktemp) + has "${EAPI:-0}" 0 1 2 && local EPREFIX="" + + ( + echo '#!/bin/sh' + if [[ -n ${libdir} ]] ; then + local var + if [[ ${CHOST} == *-darwin* ]] ; then + var=DYLD_LIBRARY_PATH + else + var=LD_LIBRARY_PATH + fi + cat <<-EOF + if [ "\${${var}+set}" = "set" ] ; then + export ${var}="\${${var}}:${EPREFIX}${libdir}" + else + export ${var}="${EPREFIX}${libdir}" + fi + EOF + fi + [[ -n ${chdir} ]] && printf 'cd "%s" &&\n' "${EPREFIX}${chdir}" + # We don't want to quote ${bin} so that people can pass complex + # things as ${bin} ... "./someprog --args" + printf 'ex
[gentoo-dev] [PATCH 2/8] edos2unix.eclass: New eclass, split off from eutils.
Signed-off-by: Ulrich Müller --- eclass/edos2unix.eclass | 21 + eclass/eutils.eclass| 18 +++--- 2 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 eclass/edos2unix.eclass diff --git a/eclass/edos2unix.eclass b/eclass/edos2unix.eclass new file mode 100644 index ..8b774844cb8a --- /dev/null +++ b/eclass/edos2unix.eclass @@ -0,0 +1,21 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: edos2unix.eclass +# @MAINTAINER: +# base-sys...@gentoo.org +# @BLURB: convert files from DOS CRLF to UNIX LF line endings + +# @FUNCTION: edos2unix +# @USAGE: [more files ...] +# @DESCRIPTION: +# A handy replacement for dos2unix, recode, fixdos, etc... This allows +# you to remove all of these text utilities from DEPEND variables +# because this is a script based solution. Just give it a list of files +# to convert and they will all be changed from the DOS CRLF format to +# the UNIX LF format. + +edos2unix() { + [[ $# -eq 0 ]] && return 0 + sed -i 's/\r$//' -- "$@" || die +} diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index f74074fb4f16..3b3e328ba30d 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -21,10 +21,10 @@ _EUTILS_ECLASS=1 # implicitly inherited (now split) eclasses case ${EAPI:-0} in 0|1|2|3|4|5|6) - inherit desktop epatch estack ltprune multilib preserve-libs \ - toolchain-funcs vcs-clean + inherit desktop edos2unix epatch estack ltprune multilib \ + preserve-libs toolchain-funcs vcs-clean ;; - 7) ;; + 7) inherit edos2unix ;; *) die "${ECLASS} is banned in EAPI ${EAPI}" ;; esac @@ -63,18 +63,6 @@ emktemp() { fi } -# @FUNCTION: edos2unix -# @USAGE: [more files ...] -# @DESCRIPTION: -# A handy replacement for dos2unix, recode, fixdos, etc... This allows you -# to remove all of these text utilities from DEPEND variables because this -# is a script based solution. Just give it a list of files to convert and -# they will all be changed from the DOS CRLF format to the UNIX LF format. -edos2unix() { - [[ $# -eq 0 ]] && return 0 - sed -i 's/\r$//' -- "$@" || die -} - # @FUNCTION: strip-linguas # @USAGE: [|<-i|-u> ] # @DESCRIPTION: -- 2.28.0
[gentoo-dev] [PATCH 0/8] Split off remaining functions from eutils.eclass
In the old times, eutils.eclass used to be inherited by almost all ebuilds, mainly for the epatch function. Today, this is often no longer needed since the package manager provides eapply() in EAPI 6 and later. So, with introduction of EAPI 7, we had already moved most of the functions in eutils.eclass to more specific eclasses. The hope back then was that usage of eutils would further dwindle, and that the eclass might be kept as a collection of small tools that don't fit anywhere else. Looking at the numbers today, I find these numbers of ebuilds inheriting eutils.eclass: 37.6 % (3765 of 10013) in EAPI 6 38.3 % (6334 of 16546) in EAPI 7 Which means that there is no visible reduction. Even worse, of the 6334 ebuilds inheriting eutils in EAPI 7, only 140 actually call any of its remaining functions. Presumably many of the above inherits are caused by eutils being indirectly inherited from other eclasses. Which means that ebuild maintainers don't have any incentive to act (after all, their ebuilds _don't_ inherit eutils). OTOH, eclass maintainers don't dare to remove the eutils inherit, because it could potentially break ebuilds that rely on indirect inheritance. I think the only way to get out of this is to phase out eutils.eclass entirely, by moving its remaining functions to other eclasses, or deprecate them, as follows: edos2unix: split out to new edos2unix.eclass make_wrapper: split out to new wrapper.eclass strip-linguas: move to l10n.eclass emktemp: deprecate (create file in ${T} instead) use_in_iuse: deprecate (only used in eclasses, where it can be inlined) Please review the following series of patches. (Note that this is to be applied on top of soap's optfeature patch: https://github.com/gentoo/gentoo/pull/17452) Ulrich Müller (8): eutils.eclass: Specify supported EAPIs. edos2unix.eclass: New eclass, split off from eutils. wrapper.eclass: New eclass, split off from eutils. wrapper.eclass: Do not use emktemp. l10n.eclass: Add conditional to prevent multiple inclusion. l10n.eclass: strip-linguas() moved from eutils to here. eutils.eclass: Deprecate emktemp(). eutils.eclass: Deprecate use_if_iuse(). eclass/chromium-2.eclass | 4 +- eclass/edos2unix.eclass | 21 +++ eclass/eutils.eclass | 128 +-- eclass/gnome2.eclass | 2 +- eclass/l10n.eclass | 54 - eclass/mate.eclass | 4 +- eclass/toolchain.eclass | 77 --- eclass/wrapper.eclass| 59 ++ 8 files changed, 195 insertions(+), 154 deletions(-) create mode 100644 eclass/edos2unix.eclass create mode 100644 eclass/wrapper.eclass -- 2.28.0
[gentoo-dev] [PATCH] elisp-common.eclass: Support installation of dynamic modules.
Signed-off-by: Ulrich Müller --- eclass/elisp-common.eclass | 42 -- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 6fa2bbe..0bf6c01 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -180,6 +180,12 @@ SITELISP=/usr/share/emacs/site-lisp # Directory where packages install miscellaneous (not Lisp) files. SITEETC=/usr/share/emacs/etc +# @ECLASS-VARIABLE: EMACSMODULES +# @DESCRIPTION: +# Directory where packages install dynamically loaded modules. +# May contain a @libdir@ token which will be replaced by $(get_libdir). +EMACSMODULES=/usr/@libdir@/emacs/modules + # @ECLASS-VARIABLE: EMACS # @DESCRIPTION: # Path of Emacs executable. @@ -362,17 +368,37 @@ elisp-install() { eend $? "elisp-install: doins failed" || die } +# @FUNCTION: elisp-modules-install +# @USAGE: +# @DESCRIPTION: +# Install dynamic modules in EMACSMODULES directory. + +elisp-modules-install() { + local subdir="$1" + shift + # Don't bother inheriting multilib.eclass for get_libdir(), but + # error out in old EAPIs that don't support it natively. + [[ ${EAPI} == [45] ]] \ + && die "${ECLASS}: Dynamic modules not supported in EAPI ${EAPI}" + ebegin "Installing dynamic modules for GNU Emacs support" + ( # subshell to avoid pollution of calling environment + exeinto "${EMACSMODULES//@libdir@/$(get_libdir)}/${subdir}" + doexe "$@" + ) + eend $? "elisp-modules-install: doins failed" || die +} + # @FUNCTION: elisp-site-file-install # @USAGE: [subdirectory] # @DESCRIPTION: # Install Emacs site-init file in SITELISP directory. Automatically -# inserts a standard comment header with the name of the package (unless -# it is already present). Tokens @SITELISP@ and @SITEETC@ are replaced -# by the path to the package's subdirectory in SITELISP and SITEETC, -# respectively. +# inserts a standard comment header with the name of the package +# (unless it is already present). Tokens @SITELISP@, @SITEETC@, and +# @EMACSMODULES@ are replaced by the path to the package's subdirectory +# in SITELISP, SITEETC, and EMACSMODULES, respectively. elisp-site-file-install() { - local sf="${1##*/}" my_pn="${2:-${PN}}" ret + local sf="${1##*/}" my_pn="${2:-${PN}}" modules ret local header=" ${PN} site-lisp configuration" [[ ${sf} == [0-9][0-9]*-gentoo*.el ]] \ @@ -381,9 +407,13 @@ elisp-site-file-install() { sf="${T}/${sf}" ebegin "Installing site initialisation file for GNU Emacs" [[ $1 = "${sf}" ]] || cp "$1" "${sf}" + [[ ${EAPI} == [45] ]] && grep -q "@EMACSMODULES@" "${sf}" \ + && die "${ECLASS}: Dynamic modules not supported in EAPI ${EAPI}" + modules=${EMACSMODULES//@libdir@/$(get_libdir)} sed -i -e "1{:x;/^\$/{n;bx;};/^;.*${PN}/I!s:^:${header}\n\n:;1s:^:\n:;}" \ -e "s:@SITELISP@:${EPREFIX}${SITELISP}/${my_pn}:g" \ - -e "s:@SITEETC@:${EPREFIX}${SITEETC}/${my_pn}:g;\$q" "${sf}" + -e "s:@SITEETC@:${EPREFIX}${SITEETC}/${my_pn}:g" \ + -e "s:@EMACSMODULES@:${EPREFIX}${modules}/${my_pn}:g;\$q" "${sf}" ( # subshell to avoid pollution of calling environment insinto "${SITELISP}/site-gentoo.d" doins "${sf}" -- 2.27.0
[gentoo-dev] [PATCH] linux-info.eclass: Pass M=${T} to the Linux Makefile unconditionally.
Using M="${S}" breaks in the pkg_setup phase where the S variable is not valid. Previous commit messages don't give any rationale why some phases would need the dir pointing to ${S}. Therefore, use ${T} in all phases unconditionally. Closes: https://bugs.gentoo.org/729178 Bug: https://bugs.gentoo.org/469210 Signed-off-by: Ulrich Müller --- eclass/linux-info.eclass | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass index 405ef5571e1c..11a890889e4f 100644 --- a/eclass/linux-info.eclass +++ b/eclass/linux-info.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: linux-info.eclass @@ -166,7 +166,7 @@ qeerror() { qout eerror "${@}" ; } # done by including the configfile, and printing the variable with Make. # It WILL break if your makefile has missing dependencies! getfilevar() { - local ERROR basefname basedname myARCH="${ARCH}" M="${S}" + local ERROR basefname basedname myARCH="${ARCH}" ERROR=0 [ -z "${1}" ] && ERROR=1 @@ -184,11 +184,8 @@ getfilevar() { # We use nonfatal because we want the caller to take care of things #373151 [[ ${EAPI:-0} == [0123] ]] && nonfatal() { "$@"; } - case ${EBUILD_PHASE_FUNC} in - pkg_info|pkg_nofetch|pkg_pretend) M="${T}" ;; - esac echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \ - nonfatal emake -C "${basedname}" M="${M}" ${BUILD_FIXES} -s -f - 2>/dev/null + nonfatal emake -C "${basedname}" M="${T}" ${BUILD_FIXES} -s -f - 2>/dev/null ARCH=${myARCH} fi -- 2.27.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] font.eclass: Fix condition for FONT_S in src_install().
Whitespace can be other characters than literal space. Fixes: 58cea2803d7aa7b1a98f72aa55b6221618dc5e5f Signed-off-by: Ulrich Müller --- eclass/font.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/font.eclass b/eclass/font.eclass index bf24701f12fc..e9e448a8155b 100644 --- a/eclass/font.eclass +++ b/eclass/font.eclass @@ -170,7 +170,7 @@ font_src_install() { font_xfont_config "${dir}" popd > /dev/null || die done - elif [[ ${FONT_S/ } != "${FONT_S}" ]]; then + elif [[ ${FONT_S/[[:space:]]} != "${FONT_S}" ]]; then # backwards compatibility code, can be removed after 2021-02-14 eqawarn "Using a space-separated list for FONT_S is deprecated." eqawarn "Use a bash array instead if there are multiple directories." -- 2.26.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] desktop.eclass: Sanitize filename of desktop entry.
make_desktop_entry() extracts the first component of the filename from the Exec key in the desktop entry. This can however include arguments which will end up in the filename. For example, www-client/links has "Exec=links -g %u", resulting in links_-g_%u-links-2.desktop as the name of the file. The current extraction pattern originates from this CVS commit: https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?r1=1.271=1.272 with the commit message "scrub exec filename in case someone does something silly like pass the fullpath to a binary". Before that commit, anything after a space in Exec would have been removed. Restore that behaviour, and in addition use only the executable's basename. While at it, get rid of the sed call and handle everything in bash. Signed-off-by: Ulrich Müller --- eclass/desktop.eclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eclass/desktop.eclass b/eclass/desktop.eclass index 6fc72ab8ec03..f310f210dfba 100644 --- a/eclass/desktop.eclass +++ b/eclass/desktop.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: desktop.eclass @@ -162,8 +162,8 @@ make_desktop_entry() { else local desktop_name="${PN}-${slot}" fi - local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop" - #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop + local desktop="${exec%%[[:space:]]*}" + desktop="${T}/${desktop##*/}-${desktop_name}.desktop" # Don't append another ";" when a valid category value is provided. type=${type%;}${type:+;} -- 2.26.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] elisp.eclass: Test if the DOCS variable has a value.
The current test for the return status of declare -p will be true if DOCS is declared but otherwise has a void value. Test for presence of an = sign in the output instead. Signed-off-by: Ulrich Müller --- eclass/elisp.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass index a411f602cf7..7876928c7fb 100644 --- a/eclass/elisp.eclass +++ b/eclass/elisp.eclass @@ -1,4 +1,4 @@ -# Copyright 2002-2019 Gentoo Authors +# Copyright 2002-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: elisp.eclass @@ -173,7 +173,7 @@ elisp_src_install() { # install documentation only when explicitly requested case ${EAPI} in 4|5) [[ -n ${DOCS} ]] && dodoc ${DOCS} ;; - *) declare -p DOCS &>/dev/null && einstalldocs ;; + *) [[ $(declare -p DOCS 2>/dev/null) == *=* ]] && einstalldocs ;; esac if declare -f readme.gentoo_create_doc >/dev/null; then readme.gentoo_create_doc -- 2.25.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH 3/3] savedconfig.eclass: Remove @ROFF from eclass documentation.
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.
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.
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 ***
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.
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
[gentoo-dev] [PATCH v2] font.eclass: Don't assign FONT_S in global scope, allow an array.
Accessing ${S} in global scope is not allowed by PMS, therefore remove the global variable assignment of FONT_S which uses it. Add a fallback to ${S} in font_src_install() instead. Allow FONT_S to be an array, if there are multiple directories. Support for whitespace-separated lists will be kept for some time, and a QA warning will be shown. Die if pushd or popd fails. Closes: https://bugs.gentoo.org/613108 Closes: https://bugs.gentoo.org/709578 Signed-off-by: Ulrich Müller --- v2: Quote pattern substitution, fix die message eclass/font.eclass | 36 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/eclass/font.eclass b/eclass/font.eclass index 1287f2273454..6b50c28890a1 100644 --- a/eclass/font.eclass +++ b/eclass/font.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: font.eclass @@ -25,10 +25,10 @@ EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm FONT_SUFFIX=${FONT_SUFFIX:-} # @ECLASS-VARIABLE: FONT_S -# @REQUIRED +# @DEFAULT_UNSET # @DESCRIPTION: -# Space delimited list of directories containing the fonts. -FONT_S=${FONT_S:-${S}} +# Directory containing the fonts. If unset, ${S} is used instead. +# Can also be an array of several directories. # @ECLASS-VARIABLE: FONT_PN # @DESCRIPTION: @@ -159,27 +159,39 @@ font_pkg_setup() { font_src_install() { local dir suffix commondoc - set -- ${FONT_S:-${S}} - if [[ $# -gt 1 ]]; then - # if we have multiple FONT_S elements then we want to recreate the dir - # structure + if [[ $(declare -p FONT_S) == "declare -a "* ]]; then + # recreate the directory structure if FONT_S is an array + for dir in "${FONT_S[@]}"; do + pushd "${dir}" > /dev/null || die "pushd ${dir} failed" + insinto "${FONTDIR}/${dir#"${S}"}" + for suffix in ${FONT_SUFFIX}; do + doins *.${suffix} + done + font_xfont_config "${dir}" + popd > /dev/null || die + done + elif [[ ${FONT_S/ } != "${FONT_S}" ]]; then + # backwards compatibility code, can be removed after 2021-02-14 + eqawarn "Using a space-separated list for FONT_S is deprecated." + eqawarn "Use a bash array instead if there are multiple directories." for dir in ${FONT_S}; do - pushd "${dir}" > /dev/null + pushd "${dir}" > /dev/null || die "pushd ${dir} failed" insinto "${FONTDIR}/${dir//${S}/}" for suffix in ${FONT_SUFFIX}; do doins *.${suffix} done font_xfont_config "${dir}" - popd > /dev/null + popd > /dev/null || die done else - pushd "${FONT_S}" > /dev/null + pushd "${FONT_S:-${S}}" > /dev/null \ + || die "pushd ${FONT_S:-${S}} failed" insinto "${FONTDIR}" for suffix in ${FONT_SUFFIX}; do doins *.${suffix} done font_xfont_config - popd > /dev/null + popd > /dev/null || die fi font_fontconfig -- 2.25.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] font.eclass: Don't assign FONT_S in global scope, allow an array.
Accessing ${S} in global scope is not allowed by PMS, therefore remove the global variable assignment of FONT_S which uses it. Add a fallback to ${S} in font_src_install() instead. Allow FONT_S to be an array, if there are multiple directories. Support for whitespace-separated lists will be kept for some time, and a QA warning will be shown. Die if pushd or popd fails. Closes: https://bugs.gentoo.org/613108 Closes: https://bugs.gentoo.org/709578 Signed-off-by: Ulrich Müller --- This will be committed in 60 days from now. The backwards compatibility code for whitespace-separated FONT_S will be removed in one year. * ATTENTION OVERLAY USERS * If your ebuilds currently output error messages like: /var/tmp/portage/media-fonts/foo/temp/environment: line 1036: pushd: /var/tmp/portage/media-fonts/foo/work/foo: No such file or directory /var/tmp/portage/media-fonts/foo/temp/environment: line 1043: popd: directory stack empty then in future these will be caught by the added "|| die" statements after pushd and popd. So make sure to fix such breakage before the updated eclass will be committed. eclass/font.eclass | 35 +++ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/eclass/font.eclass b/eclass/font.eclass index 1287f2273454..8418edf24ebb 100644 --- a/eclass/font.eclass +++ b/eclass/font.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: font.eclass @@ -25,10 +25,10 @@ EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm FONT_SUFFIX=${FONT_SUFFIX:-} # @ECLASS-VARIABLE: FONT_S -# @REQUIRED +# @DEFAULT_UNSET # @DESCRIPTION: -# Space delimited list of directories containing the fonts. -FONT_S=${FONT_S:-${S}} +# Directory containing the fonts. If unset, ${S} is used instead. +# Can also be an array of several directories. # @ECLASS-VARIABLE: FONT_PN # @DESCRIPTION: @@ -159,27 +159,38 @@ font_pkg_setup() { font_src_install() { local dir suffix commondoc - set -- ${FONT_S:-${S}} - if [[ $# -gt 1 ]]; then - # if we have multiple FONT_S elements then we want to recreate the dir - # structure + if [[ $(declare -p FONT_S) == "declare -a "* ]]; then + # recreate the directory structure if FONT_S is an array + for dir in "${FONT_S[@]}"; do + pushd "${dir}" > /dev/null || die "pushd ${dir} failed" + insinto "${FONTDIR}${dir#${S}}" + for suffix in ${FONT_SUFFIX}; do + doins *.${suffix} + done + font_xfont_config "${dir}" + popd > /dev/null || die + done + elif [[ ${FONT_S/ } != "${FONT_S}" ]]; then + # backwards compatibility code, can be removed after 2021-02-14 + eqawarn "Using a space-separated list for FONT_S is deprecated." + eqawarn "Use a bash array instead if there are multiple directories." for dir in ${FONT_S}; do - pushd "${dir}" > /dev/null + pushd "${dir}" > /dev/null || die "pushd ${dir} failed" insinto "${FONTDIR}/${dir//${S}/}" for suffix in ${FONT_SUFFIX}; do doins *.${suffix} done font_xfont_config "${dir}" - popd > /dev/null + popd > /dev/null || die done else - pushd "${FONT_S}" > /dev/null + pushd "${FONT_S:-${S}}" > /dev/null || die "pushd ${dir} failed" insinto "${FONTDIR}" for suffix in ${FONT_SUFFIX}; do doins *.${suffix} done font_xfont_config - popd > /dev/null + popd > /dev/null || die fi font_fontconfig -- 2.25.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] mount-boot.eclass: Make awk expression work with mawk.
gensub() is a GNUism and doesn't exist in all awk variants. Use a loop instead. Tested with gawk, nawk, mawk, and busybox awk. Closes: https://bugs.gentoo.org/709322 Signed-off-by: Ulrich Müller --- eclass/mount-boot.eclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eclass/mount-boot.eclass b/eclass/mount-boot.eclass index c5c6b69b063e..00b367793252 100644 --- a/eclass/mount-boot.eclass +++ b/eclass/mount-boot.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: mount-boot.eclass @@ -62,8 +62,8 @@ mount-boot_check_status() { return fi - local procstate=$(awk '$2 == "/boot" \ - { print gensub(/^(.*,)?(ro|rw)(,.*)?$/, "\\2", 1, $4); exit }' \ + local procstate=$(awk '$2 == "/boot" { split($4, a, ","); \ + for (i in a) if (a[i] ~ /^r[ow]$/) { print a[i]; break }; exit }' \ /proc/mounts || die "awk failed") if [[ -z ${procstate} ]] ; then -- 2.25.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH v2 3/3] elisp.eclass: Depend on app-editors/emacs directly.
This replaces the indirect dependency on virtual/emacs. Update pkg_setup() to call elisp-check-emacs-version instead of the now deprecated elisp-need-emacs. Signed-off-by: Ulrich Müller --- eclass/elisp.eclass | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass index df160ea01e2..2b50111a535 100644 --- a/eclass/elisp.eclass +++ b/eclass/elisp.eclass @@ -30,8 +30,8 @@ # @DEFAULT_UNSET # @DESCRIPTION: # If you need anything different from Emacs 23, use the NEED_EMACS -# variable before inheriting elisp.eclass. Set it to the major version -# your package uses and the dependency will be adjusted. +# variable before inheriting elisp.eclass. Set it to the version your +# package uses and the dependency will be adjusted. # @ECLASS-VARIABLE: ELISP_PATCHES # @DEFAULT_UNSET @@ -70,7 +70,7 @@ esac EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ pkg_{setup,postinst,postrm} -RDEPEND=">=virtual/emacs-${NEED_EMACS:-23}" +RDEPEND=">=app-editors/emacs-${NEED_EMACS}:*" case ${EAPI} in 4|5|6) DEPEND="${RDEPEND}" ;; *) BDEPEND="${RDEPEND}" ;; @@ -78,16 +78,11 @@ esac # @FUNCTION: elisp_pkg_setup # @DESCRIPTION: -# Test if the eselected Emacs version is sufficient to fulfil the major +# Test if the eselected Emacs version is sufficient to fulfil the # version requirement of the NEED_EMACS variable. elisp_pkg_setup() { - elisp-need-emacs "${NEED_EMACS:-23}" - case $? in - 0) ;; - 1) die "Emacs version too low" ;; - *) die "Could not determine Emacs version" ;; - esac + elisp-check-emacs-version } # @FUNCTION: elisp_src_unpack -- 2.24.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH v2 1/3] elisp-common.eclass: New function elisp-check-emacs-version.
Tests if the Emacs version is at least the (full) version specified by NEED_EMACS, otherwise dies. Intended as a replacement for function elisp-need-emacs, which did only a simple numeric comparison of the major version. Call the new function before doing any actual work in elisp-compile() and elisp-make-autoload-file(), so ebuilds inheriting only elisp-common.eclass (but not elisp.eclass) won't have to add a pkg_setup phase function. Drop support for EAPIs 0 to 3. Signed-off-by: Ulrich Müller --- v2: Don't change elisp-need-emacs() in place, but add a new function for the new functionality, and and deprecate the old function. eclass/elisp-common.eclass | 52 +- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 05b03f49395..8e5d70046bc 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: elisp-common.eclass @@ -156,6 +156,12 @@ # environment, so it is no problem when you unset USE=emacs between # merge and unmerge of a package. +case ${EAPI:-0} in + 4|5|6) inherit eapi7-ver ;; + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + # @ECLASS-VARIABLE: SITELISP # @DESCRIPTION: # Directory where packages install Emacs Lisp files. @@ -182,6 +188,17 @@ EMACSFLAGS="-batch -q --no-site-file" # Emacs flags used for byte-compilation in elisp-compile(). BYTECOMPFLAGS="-L ." +# @ECLASS-VARIABLE: NEED_EMACS +# @DESCRIPTION: +# The minimum Emacs version required for the package. +: ${NEED_EMACS:=23.1} + +# @ECLASS-VARIABLE: _ELISP_EMACS_VERSION +# @INTERNAL +# @DESCRIPTION: +# Cached value of Emacs version detected in elisp-check-emacs-version(). +_ELISP_EMACS_VERSION="" + # @FUNCTION: elisp-emacs-version # @RETURN: exit status of Emacs # @DESCRIPTION: @@ -212,6 +229,35 @@ elisp-emacs-version() { echo "${version}" } +# @FUNCTION: elisp-check-emacs-version +# @USAGE: [version] +# @DESCRIPTION: +# Test if the eselected Emacs version is at least the version of +# GNU Emacs specified in the NEED_EMACS variable, or die otherwise. + +elisp-check-emacs-version() { + if [[ -z ${_ELISP_EMACS_VERSION} ]]; then + local have_emacs + have_emacs=$(elisp-emacs-version) \ + || die "Could not determine Emacs version" + elog "Emacs version: ${have_emacs}" + if [[ ${have_emacs} =~ XEmacs|Lucid ]]; then + die "XEmacs detected. This package needs GNU Emacs." + fi + # GNU Emacs versions have only numeric components. + if ! [[ ${have_emacs} =~ ^[0-9]+(\.[0-9]+)*$ ]]; then + die "Malformed version string: ${have_emacs}" + fi + _ELISP_EMACS_VERSION=${have_emacs} + fi + + if ! ver_test "${_ELISP_EMACS_VERSION}" -ge "${NEED_EMACS}"; then + eerror "This package needs at least Emacs ${NEED_EMACS}." + eerror "Use \"eselect emacs\" to select the active version." + die "Emacs version too low" + fi +} + # @FUNCTION: elisp-need-emacs # @USAGE: # @RETURN: 0 if true, 1 if false, 2 if trouble @@ -249,6 +295,8 @@ elisp-need-emacs() { # in case they require or load one another. elisp-compile() { + elisp-check-emacs-version + ebegin "Compiling GNU Emacs Elisp files" ${EMACS} ${EMACSFLAGS} ${BYTECOMPFLAGS} -f batch-byte-compile "$@" eend $? "elisp-compile: batch-byte-compile failed" || die @@ -262,6 +310,8 @@ elisp-compile() { elisp-make-autoload-file() { local f="${1:-${PN}-autoloads.el}" null="" page=$'\f' shift + elisp-check-emacs-version + ebegin "Generating autoload file for GNU Emacs" cat >"${f}" <<-EOF -- 2.24.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH v2 2/3] elisp-common.eclass: Update documentation.
After the package split between emacs and emacs-vcs is gone, packages can depend on app-editors/emacs directly. Deprecate function elisp-need-emacs; ebuilds should assign variable NEED_EMACS instead. Signed-off-by: Ulrich Müller --- eclass/elisp-common.eclass | 45 ++ 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 8e5d70046bc..aac50fc65f0 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -23,26 +23,25 @@ # When relying on the emacs USE flag, you need to add # # @CODE -# emacs? ( virtual/emacs ) +# emacs? ( >=app-editors/emacs-23.1:* ) # @CODE # # to your DEPEND/RDEPEND line and use the functions provided here to # bring the files to the correct locations. # -# If your package requires a minimum Emacs version, e.g. Emacs 24, then -# the dependency should be on >=virtual/emacs-24 instead. Because the -# user can select the Emacs executable with eselect, you should also -# make sure that the active Emacs version is sufficient. This can be -# tested with function elisp-need-emacs(), which would typically be -# called from pkg_setup(), as in the following example: +# If your package requires a minimum Emacs version, e.g. Emacs 26.1, +# then the dependency should be on >=app-editors/emacs-26.1:* instead. +# Because the user can select the Emacs executable with eselect, you +# should also make sure that the active Emacs version is sufficient. +# The eclass will automatically ensure this if you assign variable +# NEED_EMACS with the Emacs version, as in the following example: # # @CODE -# elisp-need-emacs 24 || die "Emacs version too low" +# NEED_EMACS=26.1 # @CODE # -# Please note that such tests should be limited to packages that are -# known to fail with lower Emacs versions; the standard case is to -# depend on virtual/emacs without version. +# Please note that this should be done only for packages that are known +# to fail with lower Emacs versions. # # @ROFF .SS # src_compile() usage: @@ -134,6 +133,20 @@ # the differing name as second argument. # # @ROFF .SS +# 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, +# because elisp-compile and elisp-make-autoload-file do their own sanity +# checks. On the other hand, if the elisp files are compiled by the +# package's build system, then there is often no check for the Emacs +# version. In this case, you can add an explicit check in pkg_setup: +# +# @CODE +# elisp-check-emacs-version +# @CODE +# +# @ROFF .SS # pkg_postinst() / pkg_postrm() usage: # # After that you need to recreate the start-up file of Emacs after @@ -151,10 +164,6 @@ # # When having optional Emacs support, you should prepend "use emacs &&" # to above calls of elisp-site-regen(). -# Don't use "has_version virtual/emacs"! When unmerging the state of -# the emacs USE flag is taken from the package database and not from the -# environment, so it is no problem when you unset USE=emacs between -# merge and unmerge of a package. case ${EAPI:-0} in 4|5|6) inherit eapi7-ver ;; @@ -258,12 +267,10 @@ elisp-check-emacs-version() { fi } -# @FUNCTION: elisp-need-emacs -# @USAGE: -# @RETURN: 0 if true, 1 if false, 2 if trouble -# @DESCRIPTION: # Test if the eselected Emacs version is at least the major version # of GNU Emacs specified as argument. +# Return 0 if true, 1 if false, 2 if trouble. +# Deprecated, use elisp-check-emacs-version instead. elisp-need-emacs() { local need_emacs=$1 have_emacs -- 2.24.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH 3/3] elisp.eclass: Depend on app-editors/emacs directly.
This replaces the indirect dependency on virtual/emacs. Signed-off-by: Ulrich Müller --- eclass/elisp.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass index df160ea01e2..8f907bbb5d6 100644 --- a/eclass/elisp.eclass +++ b/eclass/elisp.eclass @@ -70,7 +70,7 @@ esac EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ pkg_{setup,postinst,postrm} -RDEPEND=">=virtual/emacs-${NEED_EMACS:-23}" +RDEPEND=">=app-editors/emacs-${NEED_EMACS:-23.1}:*" case ${EAPI} in 4|5|6) DEPEND="${RDEPEND}" ;; *) BDEPEND="${RDEPEND}" ;; @@ -82,7 +82,7 @@ esac # version requirement of the NEED_EMACS variable. elisp_pkg_setup() { - elisp-need-emacs "${NEED_EMACS:-23}" + elisp-need-emacs "${NEED_EMACS:-23.1}" case $? in 0) ;; 1) die "Emacs version too low" ;; -- 2.24.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH 2/3] elisp-common.eclass: Update documentation.
After the package split between emacs and emacs-vcs is gone, packages can depend on app-editors/emacs directly. Signed-off-by: Ulrich Müller --- eclass/elisp-common.eclass | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 6f79caee2f0..47e33ac28ae 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -24,26 +24,26 @@ # When relying on the emacs USE flag, you need to add # # @CODE -# emacs? ( virtual/emacs ) +# emacs? ( app-editors/emacs:* ) # @CODE # # to your DEPEND/RDEPEND line and use the functions provided here to # bring the files to the correct locations. # -# If your package requires a minimum Emacs version, e.g. Emacs 24, then -# the dependency should be on >=virtual/emacs-24 instead. Because the -# user can select the Emacs executable with eselect, you should also -# make sure that the active Emacs version is sufficient. This can be -# tested with function elisp-need-emacs(), which would typically be -# called from pkg_setup(), as in the following example: +# If your package requires a minimum Emacs version, e.g. Emacs 26.1, +# then the dependency should be on >=app-editors/emacs-26.1:* instead. +# Because the user can select the Emacs executable with eselect, you +# should also make sure that the active Emacs version is sufficient. +# This can be tested with function elisp-need-emacs(), which would +# typically be called from pkg_setup(), as in the following example: # # @CODE -# elisp-need-emacs 24 || die "Emacs version too low" +# elisp-need-emacs 26.1 || die "Emacs version too low" # @CODE # # Please note that such tests should be limited to packages that are # known to fail with lower Emacs versions; the standard case is to -# depend on virtual/emacs without version. +# depend on app-editors/emacs without version. # # @ROFF .SS # src_compile() usage: @@ -152,10 +152,6 @@ # # When having optional Emacs support, you should prepend "use emacs &&" # to above calls of elisp-site-regen(). -# Don't use "has_version virtual/emacs"! When unmerging the state of -# the emacs USE flag is taken from the package database and not from the -# environment, so it is no problem when you unset USE=emacs between -# merge and unmerge of a package. case ${EAPI:-0} in 4|5|6) inherit eapi7-ver ;; -- 2.24.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH 1/3] elisp-common.eclass: Allow full versions in elisp-need-emacs().
To this end, replace the simple numeric comparison of the first component by a call to ver_test. Signed-off-by: Ulrich Müller --- eclass/elisp-common.eclass | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 79f29ef95ad..6f79caee2f0 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -158,7 +158,8 @@ # merge and unmerge of a package. case ${EAPI:-0} in - 4|5|6|7) ;; + 4|5|6) inherit eapi7-ver ;; + 7) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -230,11 +231,16 @@ elisp-need-emacs() { have_emacs=$(elisp-emacs-version) || return 2 einfo "Emacs version: ${have_emacs}" if [[ ${have_emacs} =~ XEmacs|Lucid ]]; then - eerror "This package needs GNU Emacs." + eerror "XEmacs detected. This package needs GNU Emacs." return 1 fi - if ! [[ ${have_emacs%%.*} -ge ${need_emacs%%.*} ]]; then - eerror "This package needs at least Emacs ${need_emacs%%.*}." + # GNU Emacs versions have only numeric components. + if ! [[ ${have_emacs} =~ ^[0-9]+(\.[0-9]+)*$ ]]; then + eerror "Malformed version string: ${have_emacs}" + return 2 + fi + if ! ver_test "${have_emacs}" -ge "${need_emacs}"; then + eerror "This package needs at least Emacs ${need_emacs}." eerror "Use \"eselect emacs\" to select the active version." return 1 fi -- 2.24.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH 0/3] elisp{,-common}.eclass update for emacs-vcs consolidation
The package split between app-editors/emacs for regular ebuilds and app-editors/emacs-vcs for live ebuilds has outlived its usefulness, and it entails additional maintenance effort to keep the two packages (e.g., the list of their use flags in metadata.xml) synchronised. Therefore, consolidate all GNU Emacs ebuilds in a single package. Now is a good time to do this change, because no further releases of Emacs 26 are to be expected, and the release cycle of Emacs 27 hasn't started yet. So, the plan is: - Copy the live ebuilds into separate slots of app-editors/emacs (done). - Update all reverse dependencies to depend on app-editors/emacs:* directly, instead of virtual/emacs. Since we allow switching the version with eselect, this includes a ":*" type slot dependency. No revbumps will be done for this (and virtual/emacs will be simply removed without prior masking). See patches 2 and 3 of this series. - This allows NEED_EMACS to be more fine-grained and include the minor version. Therefore, elisp-need-emacs() from elisp-common.eclass switches to ver_test() for version comparison, instead of comparing the major version only. See patch 1 of this series. - Package mask app-editors/emacs-vcs (but not the virtual) for removal. Ulrich Müller (3): elisp-common.eclass: Allow full versions in elisp-need-emacs(). elisp-common.eclass: Update documentation. elisp.eclass: Depend on app-editors/emacs directly. eclass/elisp-common.eclass | 36 +++- eclass/elisp.eclass| 4 ++-- 2 files changed, 21 insertions(+), 19 deletions(-) -- 2.24.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] elisp-common.eclass: Drop support for EAPIs 0 to 3.
This goes along with a small code simplification, since doins will die by itself in EAPI 4 or later. Signed-off-by: Ulrich Müller --- eclass/elisp-common.eclass | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 05b03f493957..ea172fe5a870 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: elisp-common.eclass @@ -10,6 +10,7 @@ # Mamoru Komachi # Christian Faulhammer # Ulrich Müller +# @SUPPORTED_EAPIS: 4 5 6 7 # @BLURB: Emacs-related installation utilities # @DESCRIPTION: # @@ -156,6 +157,11 @@ # environment, so it is no problem when you unset USE=emacs between # merge and unmerge of a package. +case ${EAPI:-0} in + 4|5|6|7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + # @ECLASS-VARIABLE: SITELISP # @DESCRIPTION: # Directory where packages install Emacs Lisp files. @@ -298,12 +304,11 @@ elisp-make-autoload-file() { elisp-install() { local subdir="$1" shift - ebegin "Installing Elisp files for GNU Emacs support" + einfo "Installing Elisp files for GNU Emacs support" ( # subshell to avoid pollution of calling environment insinto "${SITELISP}/${subdir}" doins "$@" ) - eend $? "elisp-install: doins failed" || die } # @FUNCTION: elisp-site-file-install @@ -316,14 +321,14 @@ elisp-install() { # respectively. elisp-site-file-install() { - local sf="${1##*/}" my_pn="${2:-${PN}}" ret + local sf="${1##*/}" my_pn="${2:-${PN}}" local header=" ${PN} site-lisp configuration" [[ ${sf} == [0-9][0-9]*-gentoo*.el ]] \ || ewarn "elisp-site-file-install: bad name of site-init file" [[ ${sf%-gentoo*.el} != "${sf}" ]] && sf="${sf%-gentoo*.el}-gentoo.el" + einfo "Installing site-init file ${sf} for GNU Emacs" sf="${T}/${sf}" - ebegin "Installing site initialisation file for GNU Emacs" [[ $1 = "${sf}" ]] || cp "$1" "${sf}" sed -i -e "1{:x;/^\$/{n;bx;};/^;.*${PN}/I!s:^:${header}\n\n:;1s:^:\n:;}" \ -e "s:@SITELISP@:${EPREFIX}${SITELISP}/${my_pn}:g" \ @@ -332,9 +337,7 @@ elisp-site-file-install() { insinto "${SITELISP}/site-gentoo.d" doins "${sf}" ) - ret=$? rm -f "${sf}" - eend ${ret} "elisp-site-file-install: doins failed" || die } # @FUNCTION: elisp-site-regen -- 2.24.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] git-r3.eclass: Remove SGR control sequences from messages.
These prevent NOCOLOR in make.conf or emerge --color=n from working correctly, and may also be problematic for accessibility. Signed-off-by: Ulrich Müller --- eclass/git-r3.eclass | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass index e0d2bbb5edc0..144236c6ac38 100644 --- a/eclass/git-r3.eclass +++ b/eclass/git-r3.eclass @@ -227,19 +227,19 @@ _git-r3_env_setup() { ;; single) if [[ ${EGIT_CLONE_TYPE} == shallow ]]; then - einfo "git-r3: ebuild needs to be cloned in '\e[1msingle\e[22m' mode, adjusting" + einfo "git-r3: ebuild needs to be cloned in 'single' mode, adjusting" EGIT_CLONE_TYPE=single fi ;; single+tags) if [[ ${EGIT_CLONE_TYPE} == shallow || ${EGIT_CLONE_TYPE} == single ]]; then - einfo "git-r3: ebuild needs to be cloned in '\e[1msingle+tags\e[22m' mode, adjusting" + einfo "git-r3: ebuild needs to be cloned in 'single+tags' mode, adjusting" EGIT_CLONE_TYPE=single+tags fi ;; mirror) if [[ ${EGIT_CLONE_TYPE} != mirror ]]; then - einfo "git-r3: ebuild needs to be cloned in '\e[1mmirror\e[22m' mode, adjusting" + einfo "git-r3: ebuild needs to be cloned in 'mirror' mode, adjusting" EGIT_CLONE_TYPE=mirror fi ;; @@ -439,7 +439,7 @@ _git-r3_set_submodules() { done if [[ ! ${res} ]]; then - einfo "Skipping submodule \e[1m${subname}\e[22m" + einfo "Skipping submodule ${subname}" continue fi fi @@ -658,7 +658,7 @@ git-r3_fetch() { fi for r in "${repos[@]}"; do if [[ ! ${EVCS_OFFLINE} ]]; then - einfo "Fetching \e[1m${r}\e[22m ..." + einfo "Fetching ${r} ..." local fetch_command=( git fetch "${r}" ) local clone_type=${EGIT_CLONE_TYPE} @@ -892,7 +892,7 @@ git-r3_checkout() { local -x GIT_DIR _git-r3_set_gitdir "${repos[0]}" - einfo "Checking out \e[1m${repos[0]}\e[22m to \e[1m${out_dir}\e[22m ..." + einfo "Checking out ${repos[0]} to ${out_dir} ..." if ! git cat-file -e refs/git-r3/"${local_id}"/__main__; then die "Logic error: no local clone of ${repos[0]}. git-r3_fetch not used?" @@ -1042,7 +1042,7 @@ git-r3_peek_remote_ref() { local r success for r in "${repos[@]}"; do - einfo "Peeking \e[1m${remote_ref}\e[22m on \e[1m${r}\e[22m ..." >&2 + einfo "Peeking ${remote_ref} on ${r} ..." >&2 local lookup_ref if [[ ${remote_ref} == refs/* || ${remote_ref} == HEAD ]] @@ -1098,9 +1098,9 @@ git-r3_pkg_needrebuild() { [[ ${new_commit_id} && ${EGIT_VERSION} ]] || die "Lookup failed" if [[ ${EGIT_VERSION} != ${new_commit_id} ]]; then - einfo "Update from \e[1m${EGIT_VERSION}\e[22m to \e[1m${new_commit_id}\e[22m" + einfo "Update from ${EGIT_VERSION} to ${new_commit_id}" else - einfo "Local and remote at \e[1m${EGIT_VERSION}\e[22m" + einfo "Local and remote at ${EGIT_VERSION}" fi [[ ${EGIT_VERSION} != ${new_commit_id} ]] -- 2.24.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH v4] mount-boot.eclass: Check if /boot is sane, but don't try to mount it.
The eclass failed to remount a read-only mounted /boot, because package collision sanity checks in recent Portage versions prevented it from reaching pkg_preinst() at all. Furthermore, with the "mount-sandbox" feature enabled, the mount won't be propagated past pkg_preinst() and installed files would end up under the (shadowed) mount point. Therefore don't even attempt to mount /boot ourselves, but error out if it isn't mounted read/write and ask the user to mount /boot. Also clean up and simplify. (For example, awk is a grown-up program which doesn't need any help from egrep or sed. :-) Closes: https://bugs.gentoo.org/532264 See-also: https://bugs.gentoo.org/274130#c5 Signed-off-by: Ulrich Müller --- v3: Exit awk commands on first match. v4: Added die statements after awk commands Fixed typo in mount-boot_is_disabled function documentation Reverted renaming of I_KNOW_WHAT_I_AM_DOING variable eclass/mount-boot.eclass | 144 +-- 1 file changed, 48 insertions(+), 96 deletions(-) diff --git a/eclass/mount-boot.eclass b/eclass/mount-boot.eclass index 938df6732f43..ca27aca7efbd 100644 --- a/eclass/mount-boot.eclass +++ b/eclass/mount-boot.eclass @@ -1,156 +1,108 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: mount-boot.eclass # @MAINTAINER: # base-sys...@gentoo.org # @BLURB: functions for packages that install files into /boot # @DESCRIPTION: # This eclass is really only useful for bootloaders. # # If the live system has a separate /boot partition configured, then this # function tries to ensure that it's mounted in rw mode, exiting with an -# error if it can't. It does nothing if /boot isn't a separate partition. +# error if it can't. It does nothing if /boot isn't a separate partition. + +case ${EAPI:-0} in + 4|5|6|7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac EXPORT_FUNCTIONS pkg_pretend pkg_preinst pkg_postinst pkg_prerm pkg_postrm -# @FUNCTION: mount-boot_disabled +# @FUNCTION: mount-boot_is_disabled # @INTERNAL # @DESCRIPTION: # Detect whether the current environment/build settings are such that we do not # want to mess with any mounts. mount-boot_is_disabled() { - # Since this eclass only deals with /boot, skip things when ROOT is active. - if [[ "${ROOT:-/}" != "/" ]] ; then + # Since this eclass only deals with /boot, skip things when EROOT is active. + if [[ ${EROOT:-/} != / ]] ; then return 0 fi # If we're only building a package, then there's no need to check things. - if [[ "${MERGE_TYPE}" == "buildonly" ]] ; then + if [[ ${MERGE_TYPE} == buildonly ]] ; then return 0 fi # The user wants us to leave things be. if [[ -n ${DONT_MOUNT_BOOT} ]] ; then return 0 fi # OK, we want to handle things ourselves. return 1 } # @FUNCTION: mount-boot_check_status # @INTERNAL # @DESCRIPTION: -# Figure out what kind of work we need to do in order to have /boot be sane. -# Return values are: -# 0 - Do nothing at all! -# 1 - It's mounted, but is currently ro, so need to remount rw. -# 2 - It's not mounted, so need to mount it rw. +# Check if /boot is sane, i.e., mounted read/write if on a separate +# partition. Die if conditions are not fulfilled. mount-boot_check_status() { # Get out fast if possible. - mount-boot_is_disabled && return 0 + mount-boot_is_disabled && return # note that /dev/BOOT is in the Gentoo default /etc/fstab file - local fstabstate=$(awk '!/^#|^[[:blank:]]+#|^\/dev\/BOOT/ {print $2}' /etc/fstab | egrep "^/boot$" ) - local procstate=$(awk '$2 ~ /^\/boot$/ {print $2}' /proc/mounts) - local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts | sed -n '/^\/boot .*,ro,/p') - - if [ -n "${fstabstate}" ] && [ -n "${procstate}" ] ; then - if [ -n "${proc_ro}" ] ; then - echo - einfo "Your boot partition, detected as being mounted at /boot, is read-only." - einfo "It will be remounted in read-write mode temporarily." - return 1 - else - echo - einfo "Your boot partition was detected as being mounted at /boot." - einfo "Files will be installed there for ${PN} to function correctly." - return 0 - fi - elif [ -n "${fstabstate}" ] && [ -z "${procstate}" ] ; then - echo - einfo "Your boot partition was no
[gentoo-dev] [PATCH v3] mount-boot.eclass: Check if /boot is sane, but don't try to mount it.
MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The eclass failed to remount a read-only mounted /boot, because package collision sanity checks in recent Portage versions prevented it from reaching pkg_preinst() at all. Furthermore, with the "mount-sandbox" feature enabled, the mount won't be propagated past pkg_preinst() and installed files would end up under the (shadowed) mount point. Therefore don't even attempt to mount /boot ourselves, but error out if it isn't mounted read/write and ask the user to mount /boot. Also clean up and simplify. (For example, awk is a grown-up program which doesn't need any help from egrep or sed. :-) Closes: https://bugs.gentoo.org/532264 See-also: https://bugs.gentoo.org/274130#c5 Signed-off-by: Ulrich Müller --- v3: Exit awk commands on first match. eclass/mount-boot.eclass | 144 +-- 1 file changed, 48 insertions(+), 96 deletions(-) diff --git a/eclass/mount-boot.eclass b/eclass/mount-boot.eclass index 938df6732f4..a7d8851aa6e 100644 --- a/eclass/mount-boot.eclass +++ b/eclass/mount-boot.eclass @@ -1,156 +1,108 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: mount-boot.eclass # @MAINTAINER: # base-sys...@gentoo.org # @BLURB: functions for packages that install files into /boot # @DESCRIPTION: # This eclass is really only useful for bootloaders. # # If the live system has a separate /boot partition configured, then this # function tries to ensure that it's mounted in rw mode, exiting with an -# error if it can't. It does nothing if /boot isn't a separate partition. +# error if it can't. It does nothing if /boot isn't a separate partition. + +case ${EAPI:-0} in + 4|5|6|7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac EXPORT_FUNCTIONS pkg_pretend pkg_preinst pkg_postinst pkg_prerm pkg_postrm # @FUNCTION: mount-boot_disabled # @INTERNAL # @DESCRIPTION: # Detect whether the current environment/build settings are such that we do not # want to mess with any mounts. mount-boot_is_disabled() { - # Since this eclass only deals with /boot, skip things when ROOT is active. - if [[ "${ROOT:-/}" != "/" ]] ; then + # Since this eclass only deals with /boot, skip things when EROOT is active. + if [[ ${EROOT:-/} != / ]] ; then return 0 fi # If we're only building a package, then there's no need to check things. - if [[ "${MERGE_TYPE}" == "buildonly" ]] ; then + if [[ ${MERGE_TYPE} == buildonly ]] ; then return 0 fi # The user wants us to leave things be. - if [[ -n ${DONT_MOUNT_BOOT} ]] ; then + if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]] ; then return 0 fi # OK, we want to handle things ourselves. return 1 } # @FUNCTION: mount-boot_check_status # @INTERNAL # @DESCRIPTION: -# Figure out what kind of work we need to do in order to have /boot be sane. -# Return values are: -# 0 - Do nothing at all! -# 1 - It's mounted, but is currently ro, so need to remount rw. -# 2 - It's not mounted, so need to mount it rw. +# Check if /boot is sane, i.e., mounted read/write if on a separate +# partition. Die if conditions are not fulfilled. mount-boot_check_status() { # Get out fast if possible. - mount-boot_is_disabled && return 0 + mount-boot_is_disabled && return # note that /dev/BOOT is in the Gentoo default /etc/fstab file - local fstabstate=$(awk '!/^#|^[[:blank:]]+#|^\/dev\/BOOT/ {print $2}' /etc/fstab | egrep "^/boot$" ) - local procstate=$(awk '$2 ~ /^\/boot$/ {print $2}' /proc/mounts) - local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts | sed -n '/^\/boot .*,ro,/p') - - if [ -n "${fstabstate}" ] && [ -n "${procstate}" ] ; then - if [ -n "${proc_ro}" ] ; then - echo - einfo "Your boot partition, detected as being mounted at /boot, is read-only." - einfo "It will be remounted in read-write mode temporarily." - return 1 - else - echo - einfo "Your boot partition was detected as being mounted at /boot." - einfo "Files will be installed there for ${PN} to function correctly." - return 0 - fi - elif [ -n "${fstabstate}" ] && [ -z "${procstate}" ] ; then - echo - einfo "Your boot partition was not mounted at /boot, so it will be automounted for you." -
[gentoo-dev] [PATCH v2] mount-boot.eclass: Check if /boot is sane, but don't try to mount it.
The eclass failed to remount a read-only mounted /boot, because package collision sanity checks in recent Portage versions prevented it from reaching pkg_preinst() at all. Furthermore, with the "mount-sandbox" feature enabled, the mount won't be propagated past pkg_preinst() and installed files would end up under the (shadowed) mount point. Therefore don't even attempt to mount /boot ourselves, but error out if it isn't mounted read/write and ask the user to mount /boot. Also clean up and simplify. (For example, awk is a grown-up program which doesn't need any help from egrep or sed. :-) Closes: https://bugs.gentoo.org/532264 See-also: https://bugs.gentoo.org/274130#c5 Signed-off-by: Ulrich Müller --- eclass/mount-boot.eclass | 144 +-- 1 file changed, 47 insertions(+), 97 deletions(-) diff --git a/eclass/mount-boot.eclass b/eclass/mount-boot.eclass index 938df6732f4..8994cf1aa42 100644 --- a/eclass/mount-boot.eclass +++ b/eclass/mount-boot.eclass @@ -1,156 +1,106 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: mount-boot.eclass # @MAINTAINER: # base-sys...@gentoo.org # @BLURB: functions for packages that install files into /boot # @DESCRIPTION: # This eclass is really only useful for bootloaders. # # If the live system has a separate /boot partition configured, then this # function tries to ensure that it's mounted in rw mode, exiting with an -# error if it can't. It does nothing if /boot isn't a separate partition. +# error if it can't. It does nothing if /boot isn't a separate partition. + +case ${EAPI:-0} in + 4|5|6|7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac EXPORT_FUNCTIONS pkg_pretend pkg_preinst pkg_postinst pkg_prerm pkg_postrm # @FUNCTION: mount-boot_disabled # @INTERNAL # @DESCRIPTION: # Detect whether the current environment/build settings are such that we do not # want to mess with any mounts. mount-boot_is_disabled() { - # Since this eclass only deals with /boot, skip things when ROOT is active. - if [[ "${ROOT:-/}" != "/" ]] ; then + # Since this eclass only deals with /boot, skip things when EROOT is active. + if [[ ${EROOT:-/} != / ]] ; then return 0 fi # If we're only building a package, then there's no need to check things. - if [[ "${MERGE_TYPE}" == "buildonly" ]] ; then + if [[ ${MERGE_TYPE} == buildonly ]] ; then return 0 fi # The user wants us to leave things be. - if [[ -n ${DONT_MOUNT_BOOT} ]] ; then + if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]] ; then return 0 fi # OK, we want to handle things ourselves. return 1 } # @FUNCTION: mount-boot_check_status # @INTERNAL # @DESCRIPTION: -# Figure out what kind of work we need to do in order to have /boot be sane. -# Return values are: -# 0 - Do nothing at all! -# 1 - It's mounted, but is currently ro, so need to remount rw. -# 2 - It's not mounted, so need to mount it rw. +# Check if /boot is sane, i.e., mounted read/write if on a separate +# partition. Die if conditions are not fulfilled. mount-boot_check_status() { # Get out fast if possible. - mount-boot_is_disabled && return 0 + mount-boot_is_disabled && return # note that /dev/BOOT is in the Gentoo default /etc/fstab file - local fstabstate=$(awk '!/^#|^[[:blank:]]+#|^\/dev\/BOOT/ {print $2}' /etc/fstab | egrep "^/boot$" ) - local procstate=$(awk '$2 ~ /^\/boot$/ {print $2}' /proc/mounts) - local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts | sed -n '/^\/boot .*,ro,/p') - - if [ -n "${fstabstate}" ] && [ -n "${procstate}" ] ; then - if [ -n "${proc_ro}" ] ; then - echo - einfo "Your boot partition, detected as being mounted at /boot, is read-only." - einfo "It will be remounted in read-write mode temporarily." - return 1 - else - echo - einfo "Your boot partition was detected as being mounted at /boot." - einfo "Files will be installed there for ${PN} to function correctly." - return 0 - fi - elif [ -n "${fstabstate}" ] && [ -z "${procstate}" ] ; then - echo - einfo "Your boot partition was not mounted at /boot, so it will be automounted for you." - einfo "Files will be installed there for ${PN} to function correctly." - return 2 -
[gentoo-dev] [PATCH] mount-boot.eclass: Check if /boot is sane, but don't try to mount it.
The eclass failed to remount a read-only mounted /boot, because package collision sanity checks in recent Portage versions prevented it from reaching pkg_pretend() at all. Furthermore, with the "mount-sandbox" feature enabled, the mount won't be propagated past pkg_preinst() and installed files would end up under the (shadowed) mount point. Therefore don't even attempt to mount /boot ourselves, but error out if it isn't mounted read/write and ask the user to mount /boot. Also clean up and simplify. (For example, awk is a grown-up program which doesn't need any help from egrep or sed. :-) Closes: https://bugs.gentoo.org/532264 Signed-off-by: Ulrich Müller --- eclass/mount-boot.eclass | 137 --- 1 file changed, 43 insertions(+), 94 deletions(-) diff --git a/eclass/mount-boot.eclass b/eclass/mount-boot.eclass index 938df6732f4..1d7eb8bfc29 100644 --- a/eclass/mount-boot.eclass +++ b/eclass/mount-boot.eclass @@ -1,156 +1,105 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: mount-boot.eclass # @MAINTAINER: # base-sys...@gentoo.org # @BLURB: functions for packages that install files into /boot # @DESCRIPTION: # This eclass is really only useful for bootloaders. # # If the live system has a separate /boot partition configured, then this # function tries to ensure that it's mounted in rw mode, exiting with an -# error if it can't. It does nothing if /boot isn't a separate partition. +# error if it can't. It does nothing if /boot isn't a separate partition. + +case ${EAPI:-0} in + 4|5|6|7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac EXPORT_FUNCTIONS pkg_pretend pkg_preinst pkg_postinst pkg_prerm pkg_postrm # @FUNCTION: mount-boot_disabled # @INTERNAL # @DESCRIPTION: # Detect whether the current environment/build settings are such that we do not # want to mess with any mounts. mount-boot_is_disabled() { # Since this eclass only deals with /boot, skip things when ROOT is active. - if [[ "${ROOT:-/}" != "/" ]] ; then + if [[ ${ROOT:-/} != "/" ]] ; then return 0 fi # If we're only building a package, then there's no need to check things. - if [[ "${MERGE_TYPE}" == "buildonly" ]] ; then + if [[ ${MERGE_TYPE} == "buildonly" ]] ; then return 0 fi # The user wants us to leave things be. - if [[ -n ${DONT_MOUNT_BOOT} ]] ; then + if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]] ; then return 0 fi # OK, we want to handle things ourselves. return 1 } # @FUNCTION: mount-boot_check_status # @INTERNAL # @DESCRIPTION: -# Figure out what kind of work we need to do in order to have /boot be sane. -# Return values are: -# 0 - Do nothing at all! -# 1 - It's mounted, but is currently ro, so need to remount rw. -# 2 - It's not mounted, so need to mount it rw. +# Check if /boot is sane, i.e., mounted read/write if on a separate +# partition. Return 0 if conditions are fulfilled, otherwise die. mount-boot_check_status() { # Get out fast if possible. mount-boot_is_disabled && return 0 # note that /dev/BOOT is in the Gentoo default /etc/fstab file - local fstabstate=$(awk '!/^#|^[[:blank:]]+#|^\/dev\/BOOT/ {print $2}' /etc/fstab | egrep "^/boot$" ) - local procstate=$(awk '$2 ~ /^\/boot$/ {print $2}' /proc/mounts) - local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts | sed -n '/^\/boot .*,ro,/p') - - if [ -n "${fstabstate}" ] && [ -n "${procstate}" ] ; then - if [ -n "${proc_ro}" ] ; then - echo - einfo "Your boot partition, detected as being mounted at /boot, is read-only." - einfo "It will be remounted in read-write mode temporarily." - return 1 - else - echo - einfo "Your boot partition was detected as being mounted at /boot." - einfo "Files will be installed there for ${PN} to function correctly." - return 0 - fi - elif [ -n "${fstabstate}" ] && [ -z "${procstate}" ] ; then - echo - einfo "Your boot partition was not mounted at /boot, so it will be automounted for you." - einfo "Files will be installed there for ${PN} to function correctly." - return 2 - else - echo + local fstabstate=$(awk '!/^[[:blank:]]*#|^\/dev\/BOOT/ && $2 == "/boot" \ +
[gentoo-portage-dev] [PATCH] eapply: Drop -s option for patch.
We generally try to have verbose build logs, e.g., by calling configure with --disable-silent-rules. Silencing patch contradicts this, and will suppress reporting of fuzz factors. Note that the eapply specification in PMS calls patch without -s: https://projects.gentoo.org/pms/7/pms.html#x1-127001r1 Traditionally, the -s option wasn't used by epatch either. Bug: https://bugs.gentoo.org/674562 Signed-off-by: Ulrich Müller --- bin/phase-helpers.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index b53d39650..60f8d3243 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -993,10 +993,9 @@ if ___eapi_has_eapply; then ebegin "${prefix:-Applying }${f##*/}" # -p1 as a sane default # -f to avoid interactivity - # -s to silence progress output # -g0 to guarantee no VCS interaction # --no-backup-if-mismatch not to pollute the sources - ${patch_cmd} -p1 -f -s -g0 --no-backup-if-mismatch \ + ${patch_cmd} -p1 -f -g0 --no-backup-if-mismatch \ "${patch_options[@]}" < "${f}" failed=${?} if ! eend "${failed}"; then -- 2.24.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] eutils.eclass: Drop epause() and ebeep().
No ebuilds calling these functions in EAPIs 0 to 2 are left in the tree. Signed-off-by: Ulrich Müller --- eclass/eutils.eclass | 49 +--- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 7b6336e2aee1..20dec774f2f5 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: eutils.eclass @@ -231,53 +231,6 @@ optfeature() { fi } -case ${EAPI:-0} in -0|1|2) - -# @FUNCTION: epause -# @USAGE: [seconds] -# @DESCRIPTION: -# Sleep for the specified number of seconds (default of 5 seconds). Useful when -# printing a message the user should probably be reading and often used in -# conjunction with the ebeep function. If the EPAUSE_IGNORE env var is set, -# don't wait at all. Defined in EAPIs 0 1 and 2. -epause() { - [[ -z ${EPAUSE_IGNORE} ]] && sleep ${1:-5} -} - -# @FUNCTION: ebeep -# @USAGE: [number of beeps] -# @DESCRIPTION: -# Issue the specified number of beeps (default of 5 beeps). Useful when -# printing a message the user should probably be reading and often used in -# conjunction with the epause function. If the EBEEP_IGNORE env var is set, -# don't beep at all. Defined in EAPIs 0 1 and 2. -ebeep() { - local n - if [[ -z ${EBEEP_IGNORE} ]] ; then - for ((n=1 ; n <= ${1:-5} ; n++)) ; do - echo -ne "\a" - sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null - echo -ne "\a" - sleep 1 - done - fi -} - -;; -*) - -ebeep() { - ewarn "QA Notice: ebeep is not defined in EAPI=${EAPI}, please file a bug at https://bugs.gentoo.org; -} - -epause() { - ewarn "QA Notice: epause is not defined in EAPI=${EAPI}, please file a bug at https://bugs.gentoo.org; -} - -;; -esac - case ${EAPI:-0} in 0|1|2|3|4) -- 2.24.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] estack.eclass: Drop isdigit function.
It isn't (and never was) used by anything else in the tree. Inline its only usage in evar_pop() and drop the function. --- eclass/estack.eclass | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/eclass/estack.eclass b/eclass/estack.eclass index b0177bdb358e..2aa6f366dc12 100644 --- a/eclass/estack.eclass +++ b/eclass/estack.eclass @@ -115,7 +115,8 @@ evar_pop() { local cnt=${1:-bad} case $# in 0) cnt=1 ;; - 1) isdigit "${cnt}" || die "${FUNCNAME}: first arg must be a number: $*" ;; + 1) [[ -z ${cnt//[0-9]} ]] \ + || die "${FUNCNAME}: first arg must be a number: $*" ;; *) die "${FUNCNAME}: only accepts one arg: $*" ;; esac @@ -197,17 +198,5 @@ eumask_pop() { umask ${s} || die "${FUNCNAME}: sanity: could not restore umask: ${s}" } -# @FUNCTION: isdigit -# @USAGE: [more numbers] -# @DESCRIPTION: -# Return true if all arguments are numbers. -isdigit() { - local d - for d ; do - [[ ${d:-bad} == *[!0-9]* ]] && return 1 - done - return 0 -} - _ESTACK_ECLASS=1 fi #_ESTACK_ECLASS -- 2.24.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] estack.eclass: Properly restore shopt options.
Calling "eshopts_push; eshopts_pop" makes Portage report a QA issue: * QA Notice: Global shell options changed and were not restored while calling 'src_prepare' This is caused by some side effect, by which restoring the noglob option disables the expand_aliases option. Work around the problem by always saving and restoring both "set -o" and "shopt" option sets. Also fix "estack_push -s" which should not execute shopt when called without further parameters. Closes: https://bugs.gentoo.org/662586 Signed-off-by: Ulrich Müller --- eclass/estack.eclass | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eclass/estack.eclass b/eclass/estack.eclass index f548abf8c283..b0177bdb358e 100644 --- a/eclass/estack.eclass +++ b/eclass/estack.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: estack.eclass @@ -153,12 +153,13 @@ evar_pop() { # eshopts_pop # @CODE eshopts_push() { + # Save both "shopt" and "set -o" option sets, because otherwise + # restoring noglob would disable expand_aliases by side effect. #662586 + estack_push eshopts "$(shopt -p -o) $(shopt -p)" if [[ $1 == -[su] ]] ; then - estack_push eshopts "$(shopt -p)" - [[ $# -eq 0 ]] && return 0 + [[ $# -le 1 ]] && return 0 shopt "$@" || die "${FUNCNAME}: bad options to shopt: $*" else - estack_push eshopts "$(shopt -p -o)" [[ $# -eq 0 ]] && return 0 set "$@" || die "${FUNCNAME}: bad options to set: $*" fi -- 2.24.0 signature.asc Description: PGP signature
[gentoo-dev] [GLEP repo] [PATCH] Replace outdated mail archive URLs.
Globally replace URLs pointing to gmane.org or marc.theaimsgroup.com, preferably by archives.gentoo.org if the article is available there. As suggested by robbat2, also add the Message-ID and bibliographical information, in order to have a permanent reference to the message. Notes on single GLEPs: - GLEP 40: http://thread.gmane.org/gmane.linux.gentoo.devel/31060 had pointed to the first message of the thread (by g2boojum), not to stuart's followup. Corrected. - GLEP 57: Two messages in gentoo-dev from January/February 2005 and one message in gentoo-security from April 2003 are missing from Gentoo archives. Use marc.info instead. Signed-off-by: Ulrich Müller --- glep-0011.rst | 26 +- glep-0029.rst | 7 +++--- glep-0030.rst | 6 +++-- glep-0038.rst | 4 ++-- glep-0039.rst | 5 +++-- glep-0040.rst | 30 +++-- glep-0042.rst | 6 ++--- glep-0044.rst | 19 +++- glep-0057.rst | 61 +++ glep-0063.rst | 9 glep-0068.rst | 9 +--- glep-0069.rst | 11 ++ glep-0075.rst | 13 +++ glep-0077.rst | 7 +++--- glep-0080.rst | 6 +++-- 15 files changed, 146 insertions(+), 73 deletions(-) diff --git a/glep-0011.rst b/glep-0011.rst index 4184bb0..466f7e4 100644 --- a/glep-0011.rst +++ b/glep-0011.rst @@ -6,7 +6,7 @@ Type: Standards Track Status: Final Version: 1 Created: 2003-08-02 -Last-Modified: 2014-01-15 +Last-Modified: 2019-11-07 Post-History: 2003-08-07, 2003-08-12, 2003-08-13, 2006-09-03 Content-Type: text/x-rst --- @@ -221,7 +221,7 @@ application will be affected, see below for more details. To assist administration of multiple virtual hosts a "VHost Configuration Tool" needs to be developed and implemented. Initial discussion regarding the VHost -Config tool and proposed usage can be found at http://article.gmane.org/gmane.linux.gentoo.devel/10874. +Config tool and proposed usage can be found at [#VHost-Config-Tool]_. It's the job of the VHost Config toolset to make a local instance of the web application run under a specific web server. @@ -311,9 +311,25 @@ The main issues are: References == -.. [#WebAppPost1] http://article.gmane.org/gmane.linux.gentoo.devel/10411 -.. [#WebAppPost2] http://news.gmane.org/onethread.php?group=gmane.linux.gentoo.devel=%3C1059843010.5023.80.camel%40carbon.internal.lan%3E -.. [#WebAppPost3] http://news.gmane.org/onethread.php?group=gmane.linux.gentoo.devel=%3C8696.1060038977%40valkyrie.lsit.ucsb.edu%3E +.. [#WebAppPost1] Stuart Herbert. *Poll: Where should web applications be + installed?* gentoo-dev mailing list, 2003-07-23, + Message-ID 200307231512.51710.stuart\@gentoo.org, + https://archives.gentoo.org/gentoo-dev/message/18e8a6aacd202e117d1876d249d51af8 + +.. [#WebAppPost2] Troy Dack. *[GLEP] Web Application Installation.* + gentoo-dev mailing list, 2003-08-02, + Message-ID 1059843010.5023.80.camel\@carbon.internal.lan, + https://archives.gentoo.org/gentoo-dev/message/a94608da1bd57f387fb1091764f5226c + +.. [#WebAppPost3] Max Kalika. *Re: [GLEP] Web Application Installation.* + gentoo-dev mailing list, 2003-08-04, + Message-ID 8696.1060038977\@valkyrie.lsit.ucsb.edu, + https://archives.gentoo.org/gentoo-dev/message/523c8123b7e4a179f6ae3aab74db66e2 + +.. [#VHost-Config-Tool] Robin H. Johnson. *Re: [GLEP] Web Application + Installation. Plotting a VHOST config tool.* gentoo-dev mailing list, + 2003-08-06, Message-ID 20030806043741.GF27029\@cherenkov.orbis-terrarum.net, + https://archives.gentoo.org/gentoo-dev/message/1386ab5e25ee17f3a72490145877d124. Copyright = diff --git a/glep-0029.rst b/glep-0029.rst index 974cbc0..5ccffa3 100644 --- a/glep-0029.rst +++ b/glep-0029.rst @@ -6,7 +6,7 @@ Type: Standards Track Status: Withdrawn Version: 1 Created: 2004-08-19 -Last-Modified: 2014-01-17 +Last-Modified: 2019-11-07 Post-History: 2004-08-21, 2004-10-18, 2004-10-25, 2005-07-24 Content-Type: text/x-rst --- @@ -257,8 +257,9 @@ References .. [1] GLEP 23: Portage handling of ACCEPT_LICENSE (https://www.gentoo.org/glep/glep-0023.html) .. [2] http://www.gentoo.org/dyn/use-index.xml -.. [3] GLEP 29 discussion on the gentoo-dev mailing list - (http://marc.theaimsgroup.com/?l=gentoo-dev=109813990013812) +.. [3] GLEP 29 discussion on the gentoo-dev mailing list, + Message-ID 20041018225119.GK26288\@mail.lieber.org + (https://archives.gentoo.org/gentoo-dev/message/aba918fc38f72ff332de08b5e01e20e5) Copyright = diff --git a/glep-0030.rst b/glep-0030.rst index 73b6fc7..8d09a26 100644 --- a/glep-0030.rst +++ b/glep-0030.rst @@ -6,7 +6,7 @@ Type: Standards Track Status: Final Version: 1 Created: 2004-10-24 -Last-Modified: 2014-01-17 +Last-Modified: 2019-11-07 Post-History: 2004-10-25, 2004-11-10, 2005-03-11 Content-Type: text/x-rst --- @@ -169,7 +169,9 @@ References .. _Wordpress: http://packages.gentoo.o
[gentoo-portage-dev] [PATCH] doins: Fix directory install options when called as dodoc.
PMS does not mention that diropts should be respected when dodoc -r creates directories recursively. This is consistent with the behaviour for regular files, where insopts isn't respected either. A parallel patch for further clarification of the PMS wording has been sent to the gentoo-pms mailing list for review. Signed-off-by: Ulrich Müller --- bin/ebuild-helpers/doins | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins index fb5fc7c7c..24fe48121 100755 --- a/bin/ebuild-helpers/doins +++ b/bin/ebuild-helpers/doins @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 @@ -15,6 +15,7 @@ if [[ ${helper} == dodoc ]] ; then exit 0 fi export INSOPTIONS=-m0644 + export DIROPTIONS="" export _E_INSDESTTREE_=usr/share/doc/${PF}/${_E_DOCDESTTREE_} else if ! ___eapi_has_DESTTREE_INSDESTTREE; then -- 2.23.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] elisp.eclass: Use EAPI defaults where possible.
src_unpack: Call default instead of explicit unpack. src_prepare: Call default, so that the PATCHES variable will be respected in EAPIs 6 and 7. src_install: Call einstalldocs in EAPIs where it is supported. Drop unnecessary die statements, because helpers die by themselves in all supported EAPIs. Signed-off-by: Ulrich Müller --- eclass/elisp.eclass | 32 ++-- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass index c885345a7a8..d1b6cf71731 100644 --- a/eclass/elisp.eclass +++ b/eclass/elisp.eclass @@ -1,209 +1,205 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: elisp.eclass # @MAINTAINER: # Gentoo GNU Emacs project # @AUTHOR: # Matthew Kennedy # Jeremy Maitin-Shepard # Christian Faulhammer # Ulrich Müller # @SUPPORTED_EAPIS: 4 5 6 7 # @BLURB: Eclass for Emacs Lisp packages # @DESCRIPTION: # # This eclass is designed to install elisp files of Emacs related # packages into the site-lisp directory. The majority of elisp packages # will only need to define the standard ebuild variables (like SRC_URI) # and optionally SITEFILE for successful installation. # # Emacs support for other than pure elisp packages is handled by # elisp-common.eclass where you won't have a dependency on Emacs itself. # All elisp-* functions are documented there. # # If the package's source is a single (in whatever way) compressed elisp # file with the file name ${P}.el, then this eclass will move ${P}.el to # ${PN}.el in src_unpack(). # @ECLASS-VARIABLE: NEED_EMACS # @DEFAULT_UNSET # @DESCRIPTION: # If you need anything different from Emacs 23, use the NEED_EMACS # variable before inheriting elisp.eclass. Set it to the major version # your package uses and the dependency will be adjusted. # @ECLASS-VARIABLE: ELISP_PATCHES # @DEFAULT_UNSET # @DESCRIPTION: # Space separated list of patches to apply after unpacking the sources. # Patch files are searched for in the current working dir, WORKDIR, and -# FILESDIR. +# FILESDIR. This variable is semi-deprecated, preferably use the +# PATCHES array instead if the EAPI supports it. # @ECLASS-VARIABLE: ELISP_REMOVE # @DEFAULT_UNSET # @DESCRIPTION: # Space separated list of files to remove after unpacking the sources. # @ECLASS-VARIABLE: SITEFILE # @DEFAULT_UNSET # @DESCRIPTION: # Name of package's site-init file. The filename must match the shell # pattern "[1-8][0-9]*-gentoo.el"; numbers below 10 and above 89 are # reserved for internal use. "50${PN}-gentoo.el" is a reasonable choice # in most cases. # @ECLASS-VARIABLE: ELISP_TEXINFO # @DEFAULT_UNSET # @DESCRIPTION: # Space separated list of Texinfo sources. Respective GNU Info files # will be generated in src_compile() and installed in src_install(). -# @ECLASS-VARIABLE: DOCS -# @DEFAULT_UNSET -# @DESCRIPTION: -# DOCS="blah.txt ChangeLog" is automatically used to install the given -# files by dodoc in src_install(). - inherit elisp-common case ${EAPI:-0} in 4|5) inherit epatch ;; 6|7) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ pkg_{setup,postinst,postrm} RDEPEND=">=virtual/emacs-${NEED_EMACS:-23}" case ${EAPI} in 4|5|6) DEPEND="${RDEPEND}" ;; *) BDEPEND="${RDEPEND}" ;; esac # @FUNCTION: elisp_pkg_setup # @DESCRIPTION: # Test if the eselected Emacs version is sufficient to fulfil the major # version requirement of the NEED_EMACS variable. elisp_pkg_setup() { elisp-need-emacs "${NEED_EMACS:-23}" case $? in 0) ;; 1) die "Emacs version too low" ;; *) die "Could not determine Emacs version" ;; esac } # @FUNCTION: elisp_src_unpack # @DESCRIPTION: # Unpack the sources; also handle the case of a single *.el file in # WORKDIR for packages distributed that way. elisp_src_unpack() { - [[ -n ${A} ]] && unpack ${A} + default if [[ -f ${P}.el ]]; then # the "simple elisp" case with a single *.el file in WORKDIR mv ${P}.el ${PN}.el || die [[ -d ${S} ]] || S=${WORKDIR} fi } # @FUNCTION: elisp_src_prepare # @DESCRIPTION: # Apply any patches listed in ELISP_PATCHES. Patch files are searched # for in the current working dir, WORKDIR, and FILESDIR. elisp_src_prepare() { local patch file for patch in ${ELISP_PATCHES}; do if [[ -f ${patch} ]]; then file="${patch}" elif [[ -f ${WORKDIR}/${patch} ]]; then file="${WORKDIR}/${patch}" elif [[ -f ${FILESDIR
[gentoo-dev] [PATCH] bzr.eclass: Respect the EVCS_UMASK variable.
Bug: https://bugs.gentoo.org/497798 Signed-off-by: Ulrich Müller --- eclass/bzr.eclass | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass index 10bd6bc7e5a..598a0f87fe6 100644 --- a/eclass/bzr.eclass +++ b/eclass/bzr.eclass @@ -140,6 +140,17 @@ EXPORT_FUNCTIONS src_unpack # by users. : ${EBZR_OFFLINE=${EVCS_OFFLINE}} +# @ECLASS-VARIABLE: EVCS_UMASK +# @DEFAULT_UNSET +# @DESCRIPTION: +# Set this variable to a custom umask. This is intended to be set by +# users. By setting this to something like 002, it can make life easier +# for people who do development as non-root (but are in the portage +# group), and then switch over to building with FEATURES=userpriv. +# Or vice-versa. Shouldn't be a security issue here as anyone who has +# portage group write access already can screw the system over in more +# creative ways. + # @ECLASS-VARIABLE: EBZR_WORKDIR_CHECKOUT # @DEFAULT_UNSET # @DESCRIPTION: @@ -197,7 +208,7 @@ bzr_update() { # working copy. bzr_fetch() { local repo_dir branch_dir - local save_sandbox_write=${SANDBOX_WRITE} + local save_sandbox_write=${SANDBOX_WRITE} save_umask [[ -n ${EBZR_REPO_URI} ]] || die "${EBZR}: EBZR_REPO_URI is empty" @@ -214,6 +225,10 @@ bzr_fetch() { repo_dir=${EBZR_STORE_DIR}/${EBZR_PROJECT} branch_dir=${repo_dir}${EBZR_BRANCH:+/${EBZR_BRANCH}} + if [[ -n ${EVCS_UMASK} ]]; then + save_umask=$(umask) + umask "${EVCS_UMASK}" || die + fi addwrite "${EBZR_STORE_DIR}" if [[ ! -d ${branch_dir}/.bzr ]]; then @@ -240,8 +255,11 @@ bzr_fetch() { bzr_update "${EBZR_REPO_URI}" "${branch_dir}" fi - # Restore sandbox environment + # Restore sandbox environment and umask SANDBOX_WRITE=${save_sandbox_write} + if [[ -n ${save_umask} ]]; then + umask "${save_umask}" || die + fi cd "${branch_dir}" || die "${EBZR}: can't chdir to ${branch_dir}" -- 2.23.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] check-reqs.eclass: Drop unused code for EAPIs without MERGE_TYPE.
Signed-off-by: Ulrich Müller --- eclass/check-reqs.eclass | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass index 95f73a3012eb..242abde4e279 100644 --- a/eclass/check-reqs.eclass +++ b/eclass/check-reqs.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Bo Ørsted Andresen # Original Author: Ciaran McCreesh -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 +# @SUPPORTED_EAPIS: 4 5 6 7 # @BLURB: Provides a uniform way of handling ebuild which have very high build requirements # @DESCRIPTION: # This eclass provides a uniform way of handling ebuilds which have very high @@ -60,13 +60,13 @@ if [[ ! ${_CHECK_REQS_ECLASS_} ]]; then # @DESCRIPTION: # How much space is needed in /var? Eg.: CHECKREQS_DISK_VAR=3000M -EXPORT_FUNCTIONS pkg_setup -case "${EAPI:-0}" in - 0|1|2|3) ;; - 4|5|6|7) EXPORT_FUNCTIONS pkg_pretend ;; - *) die "EAPI=${EAPI} is not supported" ;; +case ${EAPI:-0} in + 4|5|6|7) ;; + *) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;; esac +EXPORT_FUNCTIONS pkg_pretend pkg_setup + # Obsolete function executing all the checks and printing out results check_reqs() { eerror "Package calling old ${FUNCNAME} function." @@ -123,9 +123,6 @@ check-reqs_run() { # some people are *censored* unset CHECKREQS_FAILED - [[ ${EAPI:-0} == [0123] ]] && local MERGE_TYPE="" - - # use != in test, because MERGE_TYPE only exists in EAPI 4 and later if [[ ${MERGE_TYPE} != binary ]]; then [[ -n ${CHECKREQS_MEMORY} ]] && \ check-reqs_memory \ -- 2.22.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] skel.ebuild: Use relative paths for directories.
/usr/portage is no longer the default repository location. Signed-off-by: Ulrich Müller --- This looks larger than it is, because most of it is caused by rewrapping of paragraphs. The only text changes are: "/usr/portage/eclass/" -> "the eclass/ directory" "/usr/portage/licenses/" -> "the licenses/ directory" "/usr/portage/profiles/" -> "the profiles/ directory" skel.ebuild | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/skel.ebuild b/skel.ebuild index 77337142ec36..9c9e6b366eb9 100644 --- a/skel.ebuild +++ b/skel.ebuild @@ -19,8 +19,8 @@ EAPI=7 # without the following line: #inherit autotools # -# eclasses tend to list descriptions of how to use their functions properly. -# take a look at /usr/portage/eclass/ for more examples. +# Eclasses tend to list descriptions of how to use their functions properly. +# Take a look at the eclass/ directory for more examples. # Short one-line description of this package. DESCRIPTION="This is a sample skeleton ebuild file" @@ -33,8 +33,8 @@ HOMEPAGE="https://foo.example.org/; SRC_URI="ftp://foo.example.org/${P}.tar.gz; -# License of the package. This must match the name of file(s) in -# /usr/portage/licenses/. For complex license combination see the developer +# License of the package. This must match the name of file(s) in the +# licenses/ directory. For complex license combination see the developer # docs on gentoo.org for details. LICENSE="" @@ -52,14 +52,15 @@ LICENSE="" SLOT="0" # Using KEYWORDS, we can record masking information *inside* an ebuild -# instead of relying on an external package.mask file. Right now, you should -# set the KEYWORDS variable for every ebuild so that it contains the names of -# all the architectures with which the ebuild works. All of the official -# architectures can be found in the arch.list file which is in -# /usr/portage/profiles/. Usually you should just set this to "~amd64". -# The ~ in front of the architecture indicates that the package is new and -# should be considered unstable until testing proves its stability. So, if -# you've confirmed that your ebuild works on amd64 and ppc, you'd specify: +# instead of relying on an external package.mask file. Right now, you +# should set the KEYWORDS variable for every ebuild so that it contains +# the names of all the architectures with which the ebuild works. +# All of the official architectures can be found in the arch.list file +# which is in the profiles/ directory. Usually you should just set this +# to "~amd64". The ~ in front of the architecture indicates that the +# package is new and should be considered unstable until testing proves +# its stability. So, if you've confirmed that your ebuild works on +# amd64 and ppc, you'd specify: # KEYWORDS="~amd64 ~ppc" # Once packages go stable, the ~ prefix is removed. # For binary packages, use -* and then list the archs the bin package -- 2.22.0 signature.asc Description: PGP signature
[gentoo-portage-dev] [PATCH 1/2] man/ebuild.5: Fix .nf macro usage.
Several .nf (no-fill mode) blocks were not terminated by .fi, causing broken formatting of the rest of the manpage. Fixes: cdcf4a28409daa7c56a0c2c94054f48bd5e43c6d Signed-off-by: Ulrich Müller --- man/ebuild.5 | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/man/ebuild.5 b/man/ebuild.5 index 7742ffbce..31bd8f771 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -351,16 +351,18 @@ xfree\-4.2.1\-r2.ebuild \-\-> $PR=='r2' .B PVR Contains the version number with the revision (if non-zero). -xfree\-4.2.1.ebuild \-\-> $PVR=='4.2.1' .nf +xfree\-4.2.1.ebuild \-\-> $PVR=='4.2.1' xfree\-4.2.1\-r2.ebuild \-\-> $PVR=='4.2.1\-r2' +.fi .TP .B PF Contains the full package name \fBPN\fR\-\fBPVR\fR -xfree\-4.2.1.ebuild \-\-> $PF=='xfree\-4.2.1' .nf +xfree\-4.2.1.ebuild \-\-> $PF=='xfree\-4.2.1' xfree\-4.2.1\-r2.ebuild \-\-> $PF=='xfree\-4.2.1\-r2' +.fi .TP .B CATEGORY Contains the package category name. -- 2.22.0 signature.asc Description: PGP signature
[gentoo-portage-dev] [PATCH 2/2] man/ebuild.5: Document PROPERTIES="live".
Signed-off-by: Ulrich Müller --- man/ebuild.5 | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/man/ebuild.5 b/man/ebuild.5 index 31bd8f771..b002f3889 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -1,4 +1,4 @@ -.TH "EBUILD" "5" "Apr 2019" "Portage VERSION" "Portage" +.TH "EBUILD" "5" "Jul 2019" "Portage VERSION" "Portage" .SH "NAME" ebuild \- the internal format, variables, and functions in an ebuild script @@ -708,13 +708,17 @@ Disables userpriv for specific packages. .RE .PD 1 .TP -.B PROPERTIES\fR = \fI[interactive] +.B PROPERTIES\fR = \fI[interactive,live] A space delimited list of properties, with conditional syntax support. .PD 0 .RS .TP .I interactive One or more ebuild phases will produce a prompt that requires user interaction. +.TP +.I live +The package uses live source code that may vary each time that the package +is installed. .RE .PD 1 .TP -- 2.22.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] user.eclass: Allocate next free UID or GID from 999 downwards.
Fixed UIDs and GIDs are mostly located in the low range, therefore going downwards from 999 to 101 will minimise collisions between fixed and dynamically allocated IDs. Note that on Linux and other targets using "groupadd -r" from sys-apps/shadow, GIDs are already allocated that way implicitly. Signed-off-by: Ulrich Müller --- eclass/user.eclass | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eclass/user.eclass b/eclass/user.eclass index fdf98caa6099..6563a03a1505 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -157,10 +157,10 @@ enewuser() { euid="next" fi if [[ ${euid} == "next" ]] ; then - for ((euid = 101; euid <= 999; euid++)); do + for ((euid = 999; euid >= 101; euid--)); do [[ -z $(egetent passwd ${euid}) ]] && break done - [[ ${euid} -le 999 ]] || die "${FUNCNAME}: no free UID found" + [[ ${euid} -ge 101 ]] || die "${FUNCNAME}: no free UID found" fi opts+=( -u ${euid} ) einfo " - Userid: ${euid}" @@ -318,10 +318,10 @@ enewgroup() { _enewgroup_next_gid() { if [[ ${egid} == *[!0-9]* ]] ; then # Non numeric - for ((egid = 101; egid <= 999; egid++)) ; do + for ((egid = 999; egid >= 101; egid--)) ; do [[ -z $(egetent group ${egid}) ]] && break done - [[ ${egid} -le 999 ]] || die "${FUNCNAME}: no free GID found" + [[ ${egid} -ge 101 ]] || die "${FUNCNAME}: no free GID found" fi } -- 2.22.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] cdrom.eclass: Append to PROPERTIES variable.
It is not accumulated across eclasses. Signed-off-by: Ulrich Müller --- eclass/cdrom.eclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eclass/cdrom.eclass b/eclass/cdrom.eclass index 7b0eb9c6c3b5..77b9d6ceb209 100644 --- a/eclass/cdrom.eclass +++ b/eclass/cdrom.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: cdrom.eclass @@ -28,9 +28,9 @@ inherit portability # conditionally based on USE="cdinstall". if [[ ${CDROM_OPTIONAL} == "yes" ]] ; then IUSE="cdinstall" - PROPERTIES="cdinstall? ( interactive )" + PROPERTIES+=" cdinstall? ( interactive )" else - PROPERTIES="interactive" + PROPERTIES+=" interactive" fi # @FUNCTION: cdrom_get_cds -- 2.22.0 signature.asc Description: PGP signature
[gentoo-portage-dev] [PATCH] Drop removed git and tla from list of live eclasses.
Signed-off-by: Ulrich Müller --- cnf/sets/portage.conf | 2 +- lib/portage/const.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf index ed4c6d9a7..38c50a647 100644 --- a/cnf/sets/portage.conf +++ b/cnf/sets/portage.conf @@ -65,7 +65,7 @@ includes = live [deprecated-live-rebuild] class = portage.sets.dbapi.VariableSet variable = INHERITED -includes = bzr cvs darcs git git-2 git-r3 golang-vcs mercurial subversion tla +includes = bzr cvs darcs git-2 git-r3 golang-vcs mercurial subversion # Installed packages that own files inside /lib/modules. [module-rebuild] diff --git a/lib/portage/const.py b/lib/portage/const.py index edbfb9f17..0ed64a742 100644 --- a/lib/portage/const.py +++ b/lib/portage/const.py @@ -1,5 +1,5 @@ # portage: Constants -# Copyright 1998-2018 Gentoo Authors +# Copyright 1998-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals @@ -240,13 +240,11 @@ LIVE_ECLASSES = frozenset([ "bzr", "cvs", "darcs", - "git", "git-2", "git-r3", "golang-vcs", "mercurial", "subversion", - "tla", ]) SUPPORTED_BINPKG_FORMATS = ("tar", "rpm") -- 2.22.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] eclass: Assign PROPERTIES="live" in live eclasses.
Bug: https://bugs.gentoo.org/233589 Signed-off-by: Ulrich Müller --- As previously discussed [1], add a "live" token to PROPERTIES in all live eclasses. This can also be used to tag live ebuilds that don't inherit any live eclass. Corresponding updates for PMS [2] and Portage [3] are under way. [1] https://archives.gentoo.org/gentoo-dev/message/64b83155637bcad67478e2d2af276780 [2] https://archives.gentoo.org/gentoo-pms/message/1e1b5523a885ef4d90417a6176baa65b [3] https://archives.gentoo.org/gentoo-portage-dev/message/8eab171cf105482062dda189ed2b0b59 eclass/bzr.eclass| 4 +++- eclass/cvs.eclass| 2 ++ eclass/darcs.eclass | 4 +++- eclass/git-2.eclass | 4 +++- eclass/git-r3.eclass | 4 +++- eclass/golang-vcs.eclass | 4 +++- eclass/mercurial.eclass | 4 +++- eclass/subversion.eclass | 2 ++ 8 files changed, 22 insertions(+), 6 deletions(-) diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass index cc46be794214..8734f7f2f6af 100644 --- a/eclass/bzr.eclass +++ b/eclass/bzr.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # # @ECLASS: bzr.eclass @@ -21,6 +21,8 @@ EBZR="bzr.eclass" +PROPERTIES="live" + if [[ ${EBZR_REPO_URI%%:*} = sftp ]]; then DEPEND=">=dev-vcs/bzr-2.6.0[sftp]" else diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass index e667b563fb3d..dce52b468a92 100644 --- a/eclass/cvs.eclass +++ b/eclass/cvs.eclass @@ -173,6 +173,8 @@ _CVS_ECLASS=1 # Set this to get a clean copy when updating (passes the # -C option to cvs update) +PROPERTIES="live" + # add cvs to deps # ssh is used for ext auth DEPEND="dev-vcs/cvs" diff --git a/eclass/darcs.eclass b/eclass/darcs.eclass index 09b718823670..fed7d1490091 100644 --- a/eclass/darcs.eclass +++ b/eclass/darcs.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Authors +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: darcs.eclass @@ -85,6 +85,8 @@ SRC_URI="" # --- end ebuild-configurable settings --- +PROPERTIES="live" + case ${EAPI:-0} in [0-6]) # no need to care about 5-HDEPEND and similar DEPEND="dev-vcs/darcs diff --git a/eclass/git-2.eclass b/eclass/git-2.eclass index 5371a612dccf..8860aa6ce19a 100644 --- a/eclass/git-2.eclass +++ b/eclass/git-2.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: git-2.eclass @@ -20,6 +20,8 @@ esac # This eclass support all EAPIs. EXPORT_FUNCTIONS src_unpack +PROPERTIES="live" + DEPEND="dev-vcs/git" # @ECLASS-VARIABLE: EGIT_SOURCEDIR diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass index a1ad0d238dc9..df1645364709 100644 --- a/eclass/git-r3.eclass +++ b/eclass/git-r3.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: git-r3.eclass @@ -25,6 +25,8 @@ EXPORT_FUNCTIONS src_unpack if [[ ! ${_GIT_R3} ]]; then +PROPERTIES="live" + if [[ ! ${_INHERITED_BY_GIT_2} ]]; then if [[ ${EAPI:-0} != [0123456] ]]; then BDEPEND=">=dev-vcs/git-1.8.2.1[curl]" diff --git a/eclass/golang-vcs.eclass b/eclass/golang-vcs.eclass index 561d1a0c4da1..c8b894c8b6be 100644 --- a/eclass/golang-vcs.eclass +++ b/eclass/golang-vcs.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: golang-vcs.eclass @@ -26,6 +26,8 @@ if [[ -z ${_GOLANG_VCS} ]]; then _GOLANG_VCS=1 +PROPERTIES="live" + # @ECLASS-VARIABLE: EGO_PN # @REQUIRED # @DESCRIPTION: diff --git a/eclass/mercurial.eclass b/eclass/mercurial.eclass index 9a5bd191c231..e6c4c7495bfc 100644 --- a/eclass/mercurial.eclass +++ b/eclass/mercurial.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: mercurial.eclass @@ -18,6 +18,8 @@ inherit eutils EXPORT_FUNCTIONS src_unpack +PROPERTIES="live" + DEPEND="dev-vcs/mercurial" # @ECLASS-VARIABLE: EHG_REPO_URI diff --git a/eclass/subversion.eclass b/eclass/subversion.eclass index 4dd2b48c6ce6..7ba134c519a2 100644 --- a/eclass/subversion.eclass +++ b/eclass/subversion.eclass @@ -28,6 +28,8 @@ case ${EAPI:-0} in ;; esac +PROPERTIES="live" + DEPEND="|| ( dev-vcs/subversion[http] dev-vcs/subversion[webdav-neon] -- 2.22.0 signature.asc Description: PGP signature
[gentoo-portage-dev] [PATCH] Support PROPERTIES="live".
Bug: https://bugs.gentoo.org/233589 Signed-off-by: Ulrich Müller --- cnf/sets/portage.conf | 8 +++- lib/_emerge/EbuildExecuter.py | 4 ++-- lib/portage/_sets/__init__.py | 12 +--- repoman/lib/repoman/modules/scan/ebuild/ebuild.py | 3 +-- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf index ac282d911..ed4c6d9a7 100644 --- a/cnf/sets/portage.conf +++ b/cnf/sets/portage.conf @@ -55,9 +55,15 @@ world-candidate = True [preserved-rebuild] class = portage.sets.libs.PreservedLibraryConsumerSet -# Installed ebuilds that inherit from known live eclasses. +# Installed ebuilds with "live" property. [live-rebuild] class = portage.sets.dbapi.VariableSet +variable = PROPERTIES +includes = live + +# Installed ebuilds that inherit from known live eclasses. +[deprecated-live-rebuild] +class = portage.sets.dbapi.VariableSet variable = INHERITED includes = bzr cvs darcs git git-2 git-r3 golang-vcs mercurial subversion tla diff --git a/lib/_emerge/EbuildExecuter.py b/lib/_emerge/EbuildExecuter.py index d387b42be..ca9859437 100644 --- a/lib/_emerge/EbuildExecuter.py +++ b/lib/_emerge/EbuildExecuter.py @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 from _emerge.EbuildPhase import EbuildPhase @@ -49,7 +49,7 @@ class EbuildExecuter(CompositeTask): phase="unpack", scheduler=self.scheduler, settings=self.settings) - if self._live_eclasses.intersection(self.pkg.inherited): + if "live" in self.settings.get("PROPERTIES", "").split(): # Serialize $DISTDIR access for live ebuilds since # otherwise they can interfere with eachother. diff --git a/lib/portage/_sets/__init__.py b/lib/portage/_sets/__init__.py index 2c9bf9715..7b81c55e2 100644 --- a/lib/portage/_sets/__init__.py +++ b/lib/portage/_sets/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2007-2014 Gentoo Foundation +# Copyright 2007-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function @@ -121,8 +121,14 @@ class SetConfig(object): parser.remove_section("live-rebuild") parser.add_section("live-rebuild") parser.set("live-rebuild", "class", "portage.sets.dbapi.VariableSet") - parser.set("live-rebuild", "variable", "INHERITED") - parser.set("live-rebuild", "includes", " ".join(sorted(portage.const.LIVE_ECLASSES))) + parser.set("live-rebuild", "variable", "PROPERTIES") + parser.set("live-rebuild", "includes", "live") + + parser.remove_section("deprecated-live-rebuild") + parser.add_section("deprecated-live-rebuild") + parser.set("deprecated-live-rebuild", "class", "portage.sets.dbapi.VariableSet") + parser.set("deprecated-live-rebuild", "variable", "INHERITED") + parser.set("deprecated-live-rebuild", "includes", " ".join(sorted(portage.const.LIVE_ECLASSES))) parser.remove_section("module-rebuild") parser.add_section("module-rebuild") diff --git a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py index d2715bc6e..70011e387 100644 --- a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py +++ b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py @@ -12,7 +12,6 @@ from repoman.modules.scan.scanbase import ScanBase # import our initialized portage instance from repoman._portage import portage from portage import os -from portage.const import LIVE_ECLASSES from portage.exception import InvalidPackageName pv_toolong_re = re.compile(r'[0-9]{19,}') @@ -110,7 +109,7 @@ class Ebuild(ScanBase): self.metadata = self.pkg._metadata self.eapi = self.metadata["EAPI"] self.inherited = self.pkg.inherited - self.live_ebuild = LIVE_ECLASSES.intersection(self.inherited) + self.live_ebuild = "live" in self.metadata["PROPERTIES"].split() self.keywords = self.metadata["KEYWORDS"].split() self.archs = set(kw.lstrip("~") for kw in self.keywords if not kw.startswith("-")) return False -- 2.22.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH 3/3] cvs.eclass: Add proper EAPI conditional, drop EAPIs 0 to 3.
--- eclass/cvs.eclass | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass index 8c9b41f586f3..ff23bd9df496 100644 --- a/eclass/cvs.eclass +++ b/eclass/cvs.eclass @@ -4,6 +4,7 @@ # @ECLASS: cvs.eclass # @MAINTAINER: # vap...@gentoo.org (and anyone who wants to help) +# @SUPPORTED_EAPIS: 4 5 6 7 # @BLURB: This eclass provides generic cvs fetching functions # @DESCRIPTION: # This eclass provides the generic cvs fetching functions. To use this from an @@ -185,10 +186,14 @@ if [[ ${ECVS_AUTH} == "ext" ]] ; then DEPEND+=" net-misc/openssh" fi +case ${EAPI:-0} in + 4|5|6) ;; + 7) BDEPEND="${DEPEND}"; DEPEND="" ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} is not supported" ;; +esac + # called from cvs_src_unpack cvs_fetch() { - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= - # Make these options local variables so that the global values are # not affected by modifications in this function. -- 2.22.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH 1/3] cvs.eclass: Remove support for running under sudo.
This neither works, nor is it used in the tree. Signed-off-by: Ulrich Müller --- eclass/cvs.eclass | 53 +++ 1 file changed, 8 insertions(+), 45 deletions(-) diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass index e2121f4724f2..128c065ebe78 100644 --- a/eclass/cvs.eclass +++ b/eclass/cvs.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: cvs.eclass @@ -174,22 +174,10 @@ inherit eutils # Set this to get a clean copy when updating (passes the # -C option to cvs update) -# @ECLASS-VARIABLE: ECVS_RUNAS -# @DEFAULT_UNSET -# @DESCRIPTION: -# Specifies an alternate (non-root) user to use to run cvs. Currently -# b0rked and wouldn't work with portage userpriv anyway without -# special magic. - -# : ${ECVS_RUNAS:=$(whoami)} - # add cvs to deps # ssh is used for ext auth -# sudo is used to run as a specified user DEPEND="dev-vcs/cvs" -[[ -n ${ECVS_RUNAS} ]] && DEPEND+=" app-admin/sudo" - if [[ ${ECVS_AUTH} == "ext" ]] ; then #default to ssh [[ -z ${CVS_RSH} ]] && export CVS_RSH="ssh" @@ -250,15 +238,6 @@ cvs_fetch() { ECVS_UP_OPTS+=" -D ${ECVS_DATE}" fi - # It would be easiest to always be in "run-as mode", logic-wise, - # if sudo didn't ask for a password even when sudo'ing to `whoami`. - - if [[ -z ${ECVS_RUNAS} ]] ; then - run="" - else - run="sudo -u ${ECVS_RUNAS}" - fi - # Create the top dir if needed if [[ ! -d ${ECVS_TOP_DIR} ]] ; then @@ -274,7 +253,7 @@ cvs_fetch() { debug-print "${FUNCNAME}: checkout mode. creating cvs directory" addwrite /foobar addwrite / - ${run} mkdir -p "/${ECVS_TOP_DIR}" + mkdir -p "/${ECVS_TOP_DIR}" export SANDBOX_WRITE="${SANDBOX_WRITE//:\/foobar:\/}" fi @@ -287,11 +266,6 @@ cvs_fetch() { # Disable the sandbox for this dir addwrite "${ECVS_TOP_DIR}" - # Chown the directory and all of its contents - if [[ -n ${ECVS_RUNAS} ]] ; then - ${run} chown -R "${ECVS_RUNAS}" "/${ECVS_TOP_DIR}" - fi - # Determine the CVS command mode (checkout or update) if [[ ! -d ${ECVS_TOP_DIR}/${ECVS_LOCALNAME}/CVS ]] ; then mode=checkout @@ -313,13 +287,13 @@ cvs_fetch() { # Switch servers automagically if needed if [[ ${mode} == "update" ]] ; then cd "/${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" - local oldserver=$(${run} cat CVS/Root) + local oldserver=$(cat CVS/Root) if [[ ${server} != "${oldserver}" ]] ; then einfo "Changing the CVS server from ${oldserver} to ${server}:" debug-print "${FUNCNAME}: Changing the CVS server from ${oldserver} to ${server}:" einfo "Searching for CVS directories ..." - local cvsdirs=$(${run} find . -iname CVS -print) + local cvsdirs=$(find . -iname CVS -print) debug-print "${FUNCNAME}: CVS directories found:" debug-print "${cvsdirs}" @@ -327,7 +301,7 @@ cvs_fetch() { local x for x in ${cvsdirs} ; do debug-print "In ${x}" - ${run} echo "${server}" > "${x}/Root" + echo "${server}" > "${x}/Root" done fi fi @@ -336,9 +310,6 @@ cvs_fetch() { # mess with ~/.cvspass touch "${T}/cvspass" export CVS_PASSFILE="${T}/cvspass" - if [[ -n ${ECVS_RUNAS} ]] ; then - chown "${ECVS_RUNAS}" "${T}/cvspass" - fi # The server string with the password in it, for login (only used for pserver) cvsroot_pass=":${connection}:${ECVS_USER}:${ECVS_PASS}@${ECVS_SERVER}" @@ -352,9 +323,9 @@ cvs_fetch() { fi # Commands to run - cmdlogin=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_pass}" login ) - cmdupdate=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" update ${ECVS_UP_OPTS} ${ECVS_LOCALNAME} ) - cmdcheckout=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" checkout ${ECVS_CO_OPTS} ${ECVS_MODULE} ) + cmdlogin=( ${ECVS_CVS_COMMAND} -d "${cvsroot_pass}" login ) + cmdupdate=( ${ECVS_CVS_COMM
[gentoo-dev] [PATCH 2/3] cvs.eclass: Remove support for PATCHES.
Not used in the tree, and broken in EAPI 7. Signed-off-by: Ulrich Müller --- eclass/cvs.eclass | 15 --- 1 file changed, 15 deletions(-) diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass index 128c065ebe78..8c9b41f586f3 100644 --- a/eclass/cvs.eclass +++ b/eclass/cvs.eclass @@ -15,8 +15,6 @@ if [[ -z ${_CVS_ECLASS} ]]; then _CVS_ECLASS=1 -inherit eutils - # TODO: # Implement more auth types (gserver?, kserver?) @@ -524,19 +522,6 @@ cvs_src_unpack() { debug-print "${FUNCNAME}: removing empty CVS directory ${ECVS_LOCALNAME}" rm -rf "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" fi - - # Implement some of base_src_unpack's functionality; note however - # that base.eclass may not have been inherited! - if [[ -n ${PATCHES} ]] ; then - debug-print "${FUNCNAME}: PATCHES=${PATCHES}, S=${S}, autopatching" - cd "${S}" - epatch ${PATCHES} - # Make sure we don't try to apply patches more than once, - # since cvs_src_unpack is usually called several times from - # e.g. kde-source_src_unpack - export PATCHES="" - fi - einfo "CVS module ${ECVS_MODULE} is now in ${WORKDIR}" } -- 2.22.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH 0/3] cvs.eclass update
This removes some broken and unused code, and adds proper EAPI support. Ulrich Müller (3): cvs.eclass: Remove support for running under sudo. cvs.eclass: Remove support for PATCHES. cvs.eclass: Add proper EAPI conditional, drop EAPIs 0 to 3. eclass/cvs.eclass | 77 +-- 1 file changed, 15 insertions(+), 62 deletions(-) -- 2.22.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] subversion.eclass: Support EAPI 7, drop EAPIs 0 to 3.
Closes: https://bugs.gentoo.org/678344 Signed-off-by: Ulrich Müller --- eclass/subversion.eclass | 44 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/eclass/subversion.eclass b/eclass/subversion.eclass index d9f9daf7eb6e..ab707027a502 100644 --- a/eclass/subversion.eclass +++ b/eclass/subversion.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: subversion.eclass @@ -6,35 +6,39 @@ # Akinori Hattori # @AUTHOR: # Original Author: Akinori Hattori -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 -# @BLURB: The subversion eclass is written to fetch software sources from subversion repositories +# @SUPPORTED_EAPIS: 4 5 6 7 +# @BLURB: Fetch software sources from subversion repositories # @DESCRIPTION: # The subversion eclass provides functions to fetch, patch and bootstrap # software sources from subversion repositories. -inherit eutils - ESVN="${ECLASS}" -case "${EAPI:-0}" in - 0|1) - EXPORT_FUNCTIONS src_unpack pkg_preinst - DEPEND="dev-vcs/subversion" - ;; - 2|3|4|5) +case ${EAPI:-0} in + 4|5) + inherit eutils EXPORT_FUNCTIONS src_unpack src_prepare pkg_preinst - DEPEND="|| ( dev-vcs/subversion[http] dev-vcs/subversion[webdav-neon] dev-vcs/subversion[webdav-serf] )" ;; - 6) + 6|7) + inherit estack EXPORT_FUNCTIONS src_unpack pkg_preinst - DEPEND="|| ( dev-vcs/subversion[http] dev-vcs/subversion[webdav-neon] dev-vcs/subversion[webdav-serf] )" ;; *) - die "EAPI ${EAPI} is not supported in subversion.eclass" + die "${ESVN}: EAPI ${EAPI:-0} is not supported" ;; esac -DEPEND+=" net-misc/rsync" +DEPEND="|| ( + dev-vcs/subversion[http] + dev-vcs/subversion[webdav-neon] + dev-vcs/subversion[webdav-serf] + ) + net-misc/rsync" + +case ${EAPI} in + 4|5|6) ;; + *) BDEPEND="${DEPEND}"; DEPEND="" ;; +esac # @ECLASS-VARIABLE: ESVN_STORE_DIR # @DESCRIPTION: @@ -434,12 +438,9 @@ subversion_wc_info() { # @FUNCTION: subversion_src_unpack # @DESCRIPTION: -# Default src_unpack. Fetch and, in older EAPIs, bootstrap. +# Default src_unpack. Fetch. subversion_src_unpack() { subversion_fetch || die "${ESVN}: unknown problem occurred in subversion_fetch." - if has "${EAPI:-0}" 0 1; then - subversion_bootstrap || die "${ESVN}: unknown problem occurred in subversion_bootstrap." - fi } # @FUNCTION: subversion_src_prepare @@ -458,10 +459,9 @@ subversion_src_prepare() { # want the logs to stick around if packages are uninstalled without messing with # config protection. subversion_pkg_preinst() { - has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}" local pkgdate=$(date "+%Y%m%d %H:%M:%S") if [[ -n ${ESCM_LOGDIR} ]]; then - local dir="${EROOT}/${ESCM_LOGDIR}/${CATEGORY}" + local dir="${EROOT%/}${ESCM_LOGDIR}/${CATEGORY}" if [[ ! -d ${dir} ]]; then mkdir -p "${dir}" || eerror "Failed to create '${dir}' for logging svn revision" fi -- 2.22.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] elisp.eclass: Drop support for EAPIs 0 to 3.
Signed-off-by: Ulrich Müller --- eclass/elisp.eclass | 36 +--- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass index 55635398d54..c885345a7a8 100644 --- a/eclass/elisp.eclass +++ b/eclass/elisp.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: elisp.eclass @@ -9,7 +9,7 @@ # Jeremy Maitin-Shepard # Christian Faulhammer # Ulrich Müller -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 +# @SUPPORTED_EAPIS: 4 5 6 7 # @BLURB: Eclass for Emacs Lisp packages # @DESCRIPTION: # @@ -67,21 +67,17 @@ inherit elisp-common case ${EAPI:-0} in - 0|1|2|3|4|5) inherit epatch ;; + 4|5) inherit epatch ;; 6|7) ;; - *) die "${ECLASS}: EAPI ${EAPI} not supported" ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -case ${EAPI:-0} in - 0|1) EXPORT_FUNCTIONS src_{unpack,compile,install} \ - pkg_{setup,postinst,postrm} ;; - *) EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ - pkg_{setup,postinst,postrm} ;; -esac +EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ + pkg_{setup,postinst,postrm} RDEPEND=">=virtual/emacs-${NEED_EMACS:-23}" -case ${EAPI:-0} in - 0|1|2|3|4|5|6) DEPEND="${RDEPEND}" ;; +case ${EAPI} in + 4|5|6) DEPEND="${RDEPEND}" ;; *) BDEPEND="${RDEPEND}" ;; esac @@ -102,8 +98,7 @@ elisp_pkg_setup() { # @FUNCTION: elisp_src_unpack # @DESCRIPTION: # Unpack the sources; also handle the case of a single *.el file in -# WORKDIR for packages distributed that way. For EAPIs without -# src_prepare, call elisp_src_prepare. +# WORKDIR for packages distributed that way. elisp_src_unpack() { [[ -n ${A} ]] && unpack ${A} @@ -112,11 +107,6 @@ elisp_src_unpack() { mv ${P}.el ${PN}.el || die [[ -d ${S} ]] || S=${WORKDIR} fi - - case ${EAPI:-0} in - 0|1) [[ -d ${S} ]] && cd "${S}" - elisp_src_prepare ;; - esac } # @FUNCTION: elisp_src_prepare @@ -136,15 +126,15 @@ elisp_src_prepare() { else die "Cannot find ${patch}" fi - case ${EAPI:-0} in - 0|1|2|3|4|5) epatch "${file}" ;; + case ${EAPI} in + 4|5) epatch "${file}" ;; *) eapply "${file}" ;; esac done # apply any user patches - case ${EAPI:-0} in - 0|1|2|3|4|5) epatch_user ;; + case ${EAPI} in + 4|5) epatch_user ;; *) eapply_user ;; esac -- 2.22.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] wxwidgets.eclass: Support EAPI 7.
Don't inherit multilib, which apparently was needed only for get_libdir (and should have been removed for EAPI 6 already). Drop deprecated need-wxwidgets function. Signed-off-by: Ulrich Müller --- eclass/wxwidgets.eclass | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass index 1cd6e49505d..9b37074d3b6 100644 --- a/eclass/wxwidgets.eclass +++ b/eclass/wxwidgets.eclass @@ -4,7 +4,7 @@ # @ECLASS: wxwidgets.eclass # @MAINTAINER: # wxwidg...@gentoo.org -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 +# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 # @BLURB: Manages build configuration for wxGTK-using packages. # @DESCRIPTION: # This eclass sets up the proper environment for ebuilds using the wxGTK @@ -23,9 +23,11 @@ if [[ -z ${_WXWIDGETS_ECLASS} ]]; then -case ${EAPI} in +inherit flag-o-matic + +case ${EAPI:-0} in 0|1|2|3|4|5) - inherit eutils flag-o-matic multilib + inherit eutils multilib # This was used to set up a sane default for ebuilds so they could # avoid calling need-wxwidgets if they didn't need a particular build. @@ -56,12 +58,9 @@ case ${EAPI} in unset _wxdebug unset _wxconf ;; - 6) - inherit flag-o-matic multilib - ;; - *) - die "EAPI=${EAPI:-0} is not supported" - ;; + 6) inherit multilib ;; # compatibility only, not needed by eclass + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} is not supported" ;; esac # @FUNCTION: setup-wxwidgets @@ -130,10 +129,14 @@ setup-wxwidgets() { echo } -# deprecated -need-wxwidgets() { - setup-wxwidgets -} +case ${EAPI:-0} in + 0|1|2|3|4|5|6) + # deprecated + need-wxwidgets() { + setup-wxwidgets + } + ;; +esac _WXWIDGETS_ECLASS=1 fi -- 2.22.0 signature.asc Description: PGP signature
[gentoo-portage-dev] [PATCH] __dyn_test: Make fallback to WORKDIR conditional.
When the fallback from S to WORKDIR was made conditional in EAPI 4, src_test() was originally omitted. This has been fixed retroactively in PMS: https://gitweb.gentoo.org/proj/pms.git/commit/?id=0038f90a942f0856ae2533b26f709002a3ec80ae There should be no issues with backwards compatibility of existing ebuilds. The feature is not used in the Gentoo repository. Plus, the scenario is very unlikely, because in src_test the fallback to WORKDIR could only happen for an ebuild that: - Has no files in A to be unpacked. - Doesn't define any of the unpack, prepare, configure, compile or install phases (otherwise it would die in one of these phases). Signed-off-by: Ulrich Müller --- bin/phase-functions.sh | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh index d8ebf3d3e..4c6420bfa 100644 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -358,7 +358,7 @@ __abort_install() { __has_phase_defined_up_to() { local phase - for phase in unpack prepare configure compile install; do + for phase in unpack prepare configure compile test install; do has ${phase} ${DEFINED_PHASES} && return 0 [[ ${phase} == $1 ]] && return 1 done @@ -497,8 +497,12 @@ __dyn_test() { if [ -d "${S}" ]; then cd "${S}" - else + elif ___eapi_has_S_WORKDIR_fallback; then + cd "${WORKDIR}" + elif [[ -z ${A} ]] && ! __has_phase_defined_up_to test; then cd "${WORKDIR}" + else + die "The source directory '${S}' doesn't exist" fi if has test ${RESTRICT} ; then -- 2.20.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] kernel-2.eclass: Fix LICENSE for Linux 4.14 and later.
Starting with version 4.14, the whole firmware tree has been dropped from the kernel: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b38923a068c10fc36ca8f596d650d095ce390b85 Therefore including "linux-firmware" in LICENSE is no longer accurate. Bug: https://bugs.gentoo.org/677756 Reviewed-by: Mike Pagano Reviewed-by: Alice Ferrazzi Signed-off-by: Ulrich Müller --- eclass/kernel-2.eclass | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 48146b7284b9..edbb4a8584d4 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: kernel-2.eclass @@ -624,8 +624,9 @@ if [[ ${ETYPE} == sources ]]; then IUSE="${IUSE} deblob" # Reflect that kernels contain firmware blobs unless otherwise - # stripped - LICENSE="${LICENSE} !deblob? ( linux-firmware )" + # stripped. Starting with version 4.14, the whole firmware + # tree has been dropped from the kernel. + kernel_is lt 4 14 && LICENSE+=" !deblob? ( linux-firmware )" DEPEND+=" deblob? ( ${PYTHON_DEPS} )" @@ -654,10 +655,10 @@ if [[ ${ETYPE} == sources ]]; then ${DEBLOB_URI} ${DEBLOB_CHECK_URI} )" - else + elif kernel_is lt 4 14; then # We have no way to deblob older kernels, so just mark them as # tainted with non-libre materials. - LICENSE="${LICENSE} linux-firmware" + LICENSE+=" linux-firmware" fi fi -- 2.19.1 signature.asc Description: PGP signature
[gentoo-portage-dev] [PATCH] isolated-functions.sh: Do not define any aliases.
save_IFS and restore_IFS are the only aliases that Portage defines, and they are used exactly once. Rewrite __source_all_bashrcs() not to depend on them, and remove their definitions. The intention is to drop the expand_aliases shell option at some time in the future. Signed-off-by: Ulrich Müller --- bin/ebuild.sh | 8 ++-- bin/isolated-functions.sh | 2 -- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 5491c4f58..00524d019 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -421,13 +421,9 @@ __source_all_bashrcs() { if [[ $EBUILD_PHASE != depend ]] ; then # source the existing profile.bashrcs. - save_IFS - IFS=$'\n' - local bashenv_files=($PORTAGE_BASHRC_FILES) - restore_IFS - for x in "${bashenv_files[@]}" ; do + while read -r x; do __try_source "${x}" - done + done <<<"${PORTAGE_BASHRC_FILES}" fi # The user's bashrc is the ONLY non-portage bit of code diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 39b0ad344..22a6dbb0f 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -11,8 +11,6 @@ fi # We need this next line for "die" and "assert". It expands # It _must_ preceed all the calls to die and assert. shopt -s expand_aliases -alias save_IFS='[ "${IFS:-unset}" != "unset" ] && old_IFS="${IFS}"' -alias restore_IFS='if [ "${old_IFS:-unset}" != "unset" ]; then IFS="${old_IFS}"; unset old_IFS; else unset IFS; fi' assert() { local x pipestatus=${PIPESTATUS[*]} -- 2.19.1 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] eutils.eclass: Disable eqawarn in EAPI 7.
The eqawarn command is part of EAPI 7, therefore the eclass should not override it. Also we cannot rely on its being a shell function. --- eclass/eutils.eclass | 32 +++- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 9b4767e1874a..e5d0ebeebb06 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -25,19 +25,6 @@ case ${EAPI:-0} in ;; esac -# @FUNCTION: eqawarn -# @USAGE: [message] -# @DESCRIPTION: -# Proxy to ewarn for package managers that don't provide eqawarn and use the PM -# implementation if available. Reuses PORTAGE_ELOG_CLASSES as set by the dev -# profile. -if ! declare -F eqawarn >/dev/null ; then - eqawarn() { - has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@" - : - } -fi - # @FUNCTION: emktemp # @USAGE: [temp dir] # @DESCRIPTION: @@ -415,4 +402,23 @@ in_iuse() { ;; esac +case ${EAPI:-0} in +0|1|2|3|4|5|6) + +# @FUNCTION: eqawarn +# @USAGE: [message] +# @DESCRIPTION: +# Proxy to ewarn for package managers that don't provide eqawarn and use the PM +# implementation if available. Reuses PORTAGE_ELOG_CLASSES as set by the dev +# profile. +if ! declare -F eqawarn >/dev/null ; then + eqawarn() { + has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@" + : + } +fi + +;; +esac + fi -- 2.18.0 signature.asc Description: PGP signature
[gentoo-dev] [PATCH] glep-0001: Small update to reflect current practice.
Drop the requirement that GLEPs must be discussed in forums (in addition to mailing lists), since no GLEPs have been sent there since at least 2011. --- See also the discussion about the previous update of GLEP 1 in 2011: https://archives.gentoo.org/gentoo-dev/message/21796e64595d63f09d64ea1703aa4f2f The intention back then was "not let people pick only the forums". Subsequently, the clause "mailing list and/or forums" was changed to "mailing list and forums", which doesn't follow the intention, though. glep-0001.rst | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/glep-0001.rst b/glep-0001.rst index 310c538..f819a76 100644 --- a/glep-0001.rst +++ b/glep-0001.rst @@ -8,7 +8,7 @@ Type: Informational Status: Active Version: 3 Created: 2003-05-31 -Last-Modified: 2017-10-28 +Last-Modified: 2018-07-10 Post-History: 2003-06-01, 2003-07-02, 2008-01-19, 2008-06-05, 2011-03-09, 2013-12-14, 2017-09-17 Content-Type: text/x-rst @@ -109,12 +109,11 @@ the form of code, patch, or URL to same -- before it can be considered Final. GLEP authors are responsible for collecting community feedback on a GLEP before submitting it for review. A GLEP that has not been discussed on -the mailing lists and the Gentoo Linux forums [#FORUMS]_ will not be -accepted. However, wherever possible, long open-ended discussions on public -mailing lists should be avoided. Strategies to keep the discussions efficient -include setting up a specific forums thread for the topic, having the GLEP -author accept private comments in the early design phases, etc. GLEP authors -should use their discretion here. +the mailing lists will not be accepted. However, wherever possible, long +open-ended discussions on public mailing lists should be avoided. Strategies +to keep the discussions efficient include setting up a specific forums thread +for the topic, having the GLEP author accept private comments in the early +design phases, etc. GLEP authors should use their discretion here. Once the authors have completed a GLEP, they must inform the Gentoo Council [#COUNCIL]_ that it is ready for review by way of the appropriate mailing -- 2.18.0 pgpitF3RrVp6X.pgp Description: PGP signature
[gentoo-dev] [PATCH] latex-package.eclass: Support EAPI 7.
--- eclass/latex-package.eclass | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eclass/latex-package.eclass b/eclass/latex-package.eclass index f42b6fdd25d8..3402c94cc081 100644 --- a/eclass/latex-package.eclass +++ b/eclass/latex-package.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: latex-package.eclass @@ -54,13 +54,16 @@ case ${EAPI:-0} in 0|1|2|3|4|5) inherit base eutils ;; - 6) ;; - *) die "Unknown EAPI ${EAPI} for ${ECLASS}" ;; esac RDEPEND="virtual/latex-base" DEPEND="${RDEPEND} >=sys-apps/texinfo-4.2-r5" +case ${EAPI:-0} in + 0|1|2|3|4|5|6) ;; + 7) BDEPEND="${DEPEND}"; DEPEND="" ;; + *) die "${ECLASS}: Unknown EAPI ${EAPI}" ;; +esac HOMEPAGE="http://www.tug.org/; TEXMF="/usr/share/texmf-site" -- 2.17.1 pgpfrsFe72M8n.pgp Description: PGP signature
[gentoo-dev] [PATCH 2/2] readme.gentoo-r1.eclass: Support EAPI 7.
No changes appear to be necessary, other than updating the case statement. --- eclass/readme.gentoo-r1.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/readme.gentoo-r1.eclass b/eclass/readme.gentoo-r1.eclass index a9f91cb10e38..78cbead639d3 100644 --- a/eclass/readme.gentoo-r1.eclass +++ b/eclass/readme.gentoo-r1.eclass @@ -23,7 +23,7 @@ case "${EAPI:-0}" in 0|1|2|3) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - 4|5|6) + 4|5|6|7) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" -- 2.17.1 pgpsTybTDQqvZ.pgp Description: PGP signature
[gentoo-dev] [PATCH 1/2] readme.gentoo-r1.eclass: Fix @BLURB.
Closes: https://bugs.gentoo.org/637860 --- eclass/readme.gentoo-r1.eclass | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/eclass/readme.gentoo-r1.eclass b/eclass/readme.gentoo-r1.eclass index 6f80cbaccdcc..a9f91cb10e38 100644 --- a/eclass/readme.gentoo-r1.eclass +++ b/eclass/readme.gentoo-r1.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: readme.gentoo-r1.eclass @@ -6,8 +6,7 @@ # Pacho Ramos # @AUTHOR: # Author: Pacho Ramos -# @BLURB: An eclass for installing a README.gentoo doc file recording tips -# shown via elog messages. +# @BLURB: install a doc file shown via elog messages # @DESCRIPTION: # An eclass for installing a README.gentoo doc file recording tips # shown via elog messages. With this eclass, those elog messages will only be -- 2.17.1 pgpQHDQWnTEUs.pgp Description: PGP signature
[gentoo-dev] [PATCH] elisp.eclass: Depend on virtual/emacs on the build system.
For byte-compilation, Emacs is required to run on the native build system. Therefore BDEPEND on virtual/emacs in EAPI 7. Reorganise EAPI conditionals to be more compact. --- eclass/elisp.eclass | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass index 9a66ec58ce50..0f07a3ef1f7e 100644 --- a/eclass/elisp.eclass +++ b/eclass/elisp.eclass @@ -65,24 +65,24 @@ # files by dodoc in src_install(). inherit elisp-common +case ${EAPI:-0} in + 0|1|2|3|4|5) inherit epatch ;; + 6|7) ;; + *) die "${ECLASS}: EAPI ${EAPI} not supported" ;; +esac case ${EAPI:-0} in - 0|1) - inherit epatch - EXPORT_FUNCTIONS src_{unpack,compile,install} \ - pkg_{setup,postinst,postrm} ;; - 2|3|4|5) - inherit epatch - EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ + 0|1) EXPORT_FUNCTIONS src_{unpack,compile,install} \ pkg_{setup,postinst,postrm} ;; - 6|7) - EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ + *) EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ pkg_{setup,postinst,postrm} ;; - *) die "${ECLASS}: EAPI ${EAPI} not supported" ;; esac -DEPEND=">=virtual/emacs-${NEED_EMACS:-23}" -RDEPEND="${DEPEND}" +RDEPEND=">=virtual/emacs-${NEED_EMACS:-23}" +case ${EAPI:-0} in + 0|1|2|3|4|5|6) DEPEND="${RDEPEND}" ;; + *) BDEPEND="${RDEPEND}" ;; +esac # @FUNCTION: elisp_pkg_setup # @DESCRIPTION: -- 2.17.1 pgp4JchmRoKh0.pgp Description: PGP signature
[gentoo-dev] [PATCH] eclass: Remove remaining uses of epause and ebeep.
These functions are long deprecated and only defined in EAPIs 0 to 2. --- eclass/gnatbuild-r1.eclass | 1 - eclass/gnatbuild.eclass| 1 - eclass/kernel-2.eclass | 2 -- eclass/linux-info.eclass | 3 +-- eclass/webapp.eclass | 5 + 5 files changed, 2 insertions(+), 10 deletions(-) diff --git a/eclass/gnatbuild-r1.eclass b/eclass/gnatbuild-r1.eclass index cdc64a3fe7c6..236a9aa1ce16 100644 --- a/eclass/gnatbuild-r1.eclass +++ b/eclass/gnatbuild-r1.eclass @@ -313,7 +313,6 @@ should_we_eselect_gnat() { echo elog "eselect gnat set " echo - ebeep return 1 fi } diff --git a/eclass/gnatbuild.eclass b/eclass/gnatbuild.eclass index 5d485c9338ca..da72f554439d 100644 --- a/eclass/gnatbuild.eclass +++ b/eclass/gnatbuild.eclass @@ -237,7 +237,6 @@ should_we_eselect_gnat() { echo elog "eselect gnat set " echo - ebeep return 1 fi } diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 6ffbd37f300e..94937b6630ba 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -749,7 +749,6 @@ unpack_2_6() { touch .config eerror "make defconfig failed." eerror "assuming you dont have any headers installed yet and continuing" - epause 5 fi make -s include/linux/version.h ${xmakeopts} 2>/dev/null \ @@ -1607,7 +1606,6 @@ kernel-2_pkg_setup() { ewarn "Also be aware that bugreports about gcc-4 not working" ewarn "with linux-2.4 based ebuilds will be closed as INVALID!" echo - epause 10 fi fi diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass index 035b722e2d6d..dd62b26855d2 100644 --- a/eclass/linux-info.eclass +++ b/eclass/linux-info.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: linux-info.eclass @@ -914,7 +914,6 @@ linux-info_pkg_setup() { ewarn "Also be aware that bugreports about gcc-4 not working" ewarn "with linux-2.4 based ebuilds will be closed as INVALID!" echo - epause 10 fi fi diff --git a/eclass/webapp.eclass b/eclass/webapp.eclass index c80674d3b13e..8983af334ab8 100644 --- a/eclass/webapp.eclass +++ b/eclass/webapp.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: webapp.eclass @@ -411,9 +411,6 @@ webapp_pkg_setup() { ewarn "This ebuild may be overwriting important files." ewarn echo - if has "${EAPI:-0}" 0 1 2; then - ebeep 10 - fi elif [[ "$(echo ${my_output} | awk '{ print $1 }')" != "${PN}" ]]; then echo eerror "You already have ${my_output} installed in ${my_dir}" -- 2.17.0 pgpZsaBzSNyki.pgp Description: PGP signature
[gentoo-dev] [PATCH v3] eapi7-ver.eclass: Support EAPIs 0 to 6.
--- v3, including suggestions from Duncan and Hello71. eclass/eapi7-ver.eclass | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/eclass/eapi7-ver.eclass b/eclass/eapi7-ver.eclass index 6117124a90a5..e34025e201c7 100644 --- a/eclass/eapi7-ver.eclass +++ b/eclass/eapi7-ver.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: eapi7-ver.eclass @@ -58,12 +58,9 @@ # the version string, it is truncated silently. case ${EAPI:-0} in - 0|1|2|3|4|5) - die "${ECLASS}: EAPI=${EAPI:-0} not supported";; - 6) - ;; - *) - die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass";; + 0|1|2|3|4|5|6) ;; + 7) die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass" ;; + *) die "${ECLASS}: EAPI=${EAPI} unknown" ;; esac # @FUNCTION: _ver_parse_range @@ -135,11 +132,12 @@ ver_cut() { local max=$((${#comp[@]}/2)) _ver_parse_range "${range}" "${max}" - local IFS= if [[ ${start} -gt 0 ]]; then start=$(( start*2 - 1 )) fi - echo "${comp[*]:start:end*2-start}" + # Work around a bug in bash-3.2, where "${comp[*]:start:end*2-start}" + # inserts spurious 0x7f characters for empty array elements + printf "%s" "${comp[@]:start:end*2-start}" $'\n' } # @FUNCTION: ver_rs -- 2.17.0 pgpXRFKDbJnD2.pgp Description: PGP signature
[gentoo-dev] [PATCH v2] eapi7-ver.eclass: Support EAPIs 0 to 6.
--- Sorry, I had sent the wrong patch. eclass/eapi7-ver.eclass | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/eclass/eapi7-ver.eclass b/eclass/eapi7-ver.eclass index 6117124a90a5..43b6a4122506 100644 --- a/eclass/eapi7-ver.eclass +++ b/eclass/eapi7-ver.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: eapi7-ver.eclass @@ -58,12 +58,8 @@ # the version string, it is truncated silently. case ${EAPI:-0} in - 0|1|2|3|4|5) - die "${ECLASS}: EAPI=${EAPI:-0} not supported";; - 6) - ;; - *) - die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass";; + 0|1|2|3|4|5|6) ;; + *) die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass" ;; esac # @FUNCTION: _ver_parse_range @@ -139,7 +135,10 @@ ver_cut() { if [[ ${start} -gt 0 ]]; then start=$(( start*2 - 1 )) fi - echo "${comp[*]:start:end*2-start}" + # Work around a bug in bash-3.2, where "${comp[*]:start:end*2-start}" + # inserts spurious 0x7f characters for empty array elements + local out=( "${comp[@]:start:end*2-start}" ) + echo "${out[*]}" } # @FUNCTION: ver_rs -- 2.17.0 pgppkKZbnuSgh.pgp Description: PGP signature
[gentoo-dev] [PATCH] eapi7-ver.eclass: Support EAPIs 0 to 6.
--- eclass/eapi7-ver.eclass | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/eclass/eapi7-ver.eclass b/eclass/eapi7-ver.eclass index 6117124a90a5..3a200cbe9ef2 100644 --- a/eclass/eapi7-ver.eclass +++ b/eclass/eapi7-ver.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: eapi7-ver.eclass @@ -58,12 +58,8 @@ # the version string, it is truncated silently. case ${EAPI:-0} in - 0|1|2|3|4|5) - die "${ECLASS}: EAPI=${EAPI:-0} not supported";; - 6) - ;; - *) - die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass";; + 0|1|2|3|4|5|6) ;; + *) die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass" ;; esac # @FUNCTION: _ver_parse_range @@ -128,18 +124,22 @@ _ver_split() { ver_cut() { local range=${1} local v=${2:-${PV}} - local start end + local start end i out local -a comp _ver_split "${v}" local max=$((${#comp[@]}/2)) _ver_parse_range "${range}" "${max}" - local IFS= if [[ ${start} -gt 0 ]]; then start=$(( start*2 - 1 )) fi - echo "${comp[*]:start:end*2-start}" + # Work around a bug in bash-3.2, where "${comp[*]:start:end*2-start}" + # inserts spurious 0x7f characters for empty array elements + for (( i = start; i < end*2; i++ )); do + out+=${comp[i]} + done + echo "${out}" } # @FUNCTION: ver_rs -- 2.17.0 pgpIIUIMwuL2N.pgp Description: PGP signature
[gentoo-dev] [PATCH] bzr.eclass: Support EAPI 7.
--- eclass/bzr.eclass | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass index 710b64db28c0..7cfe73a70268 100644 --- a/eclass/bzr.eclass +++ b/eclass/bzr.eclass @@ -20,19 +20,20 @@ EBZR="bzr.eclass" +if [[ ${EBZR_REPO_URI%%:*} = sftp ]]; then + DEPEND=">=dev-vcs/bzr-2.6.0[sftp]" +else + DEPEND=">=dev-vcs/bzr-2.6.0" +fi + case ${EAPI:-0} in 2|3|4|5|6) ;; + 7) BDEPEND="${DEPEND}"; DEPEND="" ;; *) die "${EBZR}: EAPI ${EAPI:-0} is not supported" ;; esac EXPORT_FUNCTIONS src_unpack -if [[ ${EBZR_REPO_URI%%:*} = sftp ]]; then - DEPEND=">=dev-vcs/bzr-2.6.0[sftp]" -else - DEPEND=">=dev-vcs/bzr-2.6.0" -fi - # @ECLASS-VARIABLE: EBZR_STORE_DIR # @DESCRIPTION: # The directory to store all fetched Bazaar live sources. -- 2.17.0 pgpIhkED99vp9.pgp Description: PGP signature
[gentoo-dev] [PATCH] bzr.eclass: Drop bzr_bootstrap and bzr_src_prepare.
No ebuild in the Gentoo repository uses the bzr_bootstrap functionality. Therefore drop the function along with bzr_src_prepare (which would not have worked in EAPI 6 anyway, due to missing call to eapply_user). After this change, inheriting eutils is not needed any more. Drop support for EAPIs 0 and 1 for further simplification. --- This is to be applied on top of the patch posted earlier today. We could go for bzr-r1.eclass instead. However, the functionality associated with EBZR_PATCHES and EBZR_BOOTSTRAP is not used in the tree, and overall the eclass is little used. Therefore I think that applying these changes in-place is acceptable here. eclass/bzr.eclass | 99 --- 1 file changed, 13 insertions(+), 86 deletions(-) diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass index 9b3e0b6cf4dc..710b64db28c0 100644 --- a/eclass/bzr.eclass +++ b/eclass/bzr.eclass @@ -18,21 +18,20 @@ # Note: Just set EBZR_REPO_URI to the URI of the branch and src_unpack() # of this eclass will export the branch to ${WORKDIR}/${P}. -inherit eutils - EBZR="bzr.eclass" -case "${EAPI:-0}" in - 0|1) EXPORT_FUNCTIONS src_unpack ;; - *) EXPORT_FUNCTIONS src_unpack src_prepare ;; +case ${EAPI:-0} in + 2|3|4|5|6) ;; + *) die "${EBZR}: EAPI ${EAPI:-0} is not supported" ;; esac -DEPEND=">=dev-vcs/bzr-2.6.0" -case "${EAPI:-0}" in - 0|1) ;; - *) [[ ${EBZR_REPO_URI%%:*} = sftp ]] \ - && DEPEND=">=dev-vcs/bzr-2.6.0[sftp]" ;; -esac +EXPORT_FUNCTIONS src_unpack + +if [[ ${EBZR_REPO_URI%%:*} = sftp ]]; then + DEPEND=">=dev-vcs/bzr-2.6.0[sftp]" +else + DEPEND=">=dev-vcs/bzr-2.6.0" +fi # @ECLASS-VARIABLE: EBZR_STORE_DIR # @DESCRIPTION: @@ -85,9 +84,8 @@ esac # @DESCRIPTION: # The repository URI for the source package. # -# Note: If the ebuild uses an sftp:// URI, then in EAPI 0 or 1 it must -# make sure that dev-vcs/bzr was built with USE="sftp". In EAPI 2 or -# later, the eclass will depend on dev-vcs/bzr[sftp]. +# Note: If the ebuild uses an sftp:// URI, then the eclass will depend +# on dev-vcs/bzr[sftp]. # @ECLASS-VARIABLE: EBZR_INITIAL_URI # @DEFAULT_UNSET @@ -100,21 +98,6 @@ esac # # Normally, this variable needs not be set. -# @ECLASS-VARIABLE: EBZR_BOOTSTRAP -# @DEFAULT_UNSET -# @DESCRIPTION: -# Bootstrap script or command like autogen.sh or etc. - -# @ECLASS-VARIABLE: EBZR_PATCHES -# @DEFAULT_UNSET -# @DESCRIPTION: -# bzr.eclass can apply patches in bzr_bootstrap(). You can use regular -# expressions in this variable like *.diff or *.patch and the like. -# Note: These patches will be applied before EBZR_BOOTSTRAP is processed. -# -# Patches are searched both in ${PWD} and ${FILESDIR}. If not found in -# either location, the installation dies. - # @ECLASS-VARIABLE: EBZR_PROJECT # @DESCRIPTION: # The project name of your ebuild. Normally, the branch will be stored @@ -276,65 +259,9 @@ bzr_fetch() { popd > /dev/null } -# @FUNCTION: bzr_bootstrap -# @DESCRIPTION: -# Apply patches in ${EBZR_PATCHES} and run ${EBZR_BOOTSTRAP} if specified. -bzr_bootstrap() { - local patch lpatch - - pushd "${S}" > /dev/null || die "${EBZR}: can't chdir to ${S}" - - if [[ -n ${EBZR_PATCHES} ]] ; then - einfo "apply patches -->" - - for patch in ${EBZR_PATCHES} ; do - if [[ -f ${patch} ]] ; then - epatch "${patch}" - else - # This loop takes care of wildcarded patches given via - # EBZR_PATCHES in an ebuild - for lpatch in "${FILESDIR}"/${patch} ; do - if [[ -f ${lpatch} ]] ; then - epatch "${lpatch}" - else - die "${EBZR}: ${patch} is not found" - fi - done - fi - done - fi - - if [[ -n ${EBZR_BOOTSTRAP} ]] ; then - einfo "begin bootstrap -->" - - if [[ -f ${EBZR_BOOTSTRAP} ]] && [[ -x ${EBZR_BOOTSTRAP} ]] ; then - einfo " bootstrap with a file: ${EBZR_BOOTSTRAP}" - "./${EBZR_BOOTSTRAP}" \ - || die "${EBZR}: can't execute EBZR_BOOTSTRAP" - else - einfo " bootstrap with commands: ${EBZR_BOOTSTRAP}" - "${EBZR_BOOTSTRAP}" \ - || die "${EBZR}: can't eval EBZR_BOOTSTRAP" - fi - fi - - popd > /dev/null -} - # @FUNCTION: bzr_src_unpack # @DESCRIPTION: -# Default src_unpack(), calls bzr_fetch. For EAPIs 0 and 1, also calls -# bzr_src_prepare. +# Default src_unpack(), calls bzr_fetch. bzr_src_unpack() {
[gentoo-dev] [PATCH] bzr.eclass: Add --overwrite-tags option to pull command.
Fixes: https://bugs.gentoo.org/446422 --- eclass/bzr.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass index ef1b47936867..792cc3bec36f 100644 --- a/eclass/bzr.eclass +++ b/eclass/bzr.eclass @@ -27,7 +27,7 @@ case "${EAPI:-0}" in *) EXPORT_FUNCTIONS src_unpack src_prepare ;; esac -DEPEND=">=dev-vcs/bzr-2.0.1" +DEPEND=">=dev-vcs/bzr-2.6.0" case "${EAPI:-0}" in 0|1) ;; *) [[ ${EBZR_REPO_URI%%:*} = sftp ]] \ @@ -57,7 +57,7 @@ esac # @ECLASS-VARIABLE: EBZR_UPDATE_CMD # @DESCRIPTION: # The Bazaar command to update the sources. -: ${EBZR_UPDATE_CMD:="bzr pull"} +: ${EBZR_UPDATE_CMD:="bzr pull --overwrite-tags"} # @ECLASS-VARIABLE: EBZR_EXPORT_CMD # @DESCRIPTION: -- 2.16.1 pgpfAcAI_ChjH.pgp Description: PGP signature
[gentoo-dev] [PATCH] eutils.eclass: Update function documentation.
Mention that einstalldocs() and in_iuse() are provided by the package manager in EAPI 6. in_iuse "must not" (rather than "should not") be used in global scope. --- eclass/eutils.eclass | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index be8251f5794a..8bbd561015ad 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -362,12 +362,14 @@ case ${EAPI:-0} in # @FUNCTION: einstalldocs # @DESCRIPTION: -# Install documentation using DOCS and HTML_DOCS. +# Install documentation using DOCS and HTML_DOCS, in EAPIs that do not +# provide this function. When available (i.e., in EAPI 6 or later), +# the package manager implementation should be used instead. # # If DOCS is declared and non-empty, all files listed in it are -# installed. The files must exist, otherwise the function will fail. -# In EAPI 4 and subsequent EAPIs DOCS may specify directories as well, -# in other EAPIs using directories is unsupported. +# installed. The files must exist, otherwise the function will fail. +# In EAPI 4 and 5, DOCS may specify directories as well; in earlier +# EAPIs using directories is unsupported. # # If DOCS is not declared, the files matching patterns given # in the default EAPI implementation of src_install will be installed. @@ -424,10 +426,11 @@ einstalldocs() { # @FUNCTION: in_iuse # @USAGE: # @DESCRIPTION: -# Determines whether the given flag is in IUSE. Strips IUSE default prefixes -# as necessary. +# Determines whether the given flag is in IUSE. Strips IUSE default +# prefixes as necessary. In EAPIs where it is available (i.e., EAPI 6 +# or later), the package manager implementation should be used instead. # -# Note that this function should not be used in the global scope. +# Note that this function must not be used in the global scope. in_iuse() { debug-print-function ${FUNCNAME} "${@}" [[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()" -- 2.16.0 pgpoYda6E6V9z.pgp Description: PGP signature
[gentoo-dev] [PATCH] eutils.eclass: Remove built_with_use().
The function was deprecated in 2010 and is no longer used in the tree. Use EAPI 2 use deps and has_version as replacement. Closes: https://bugs.gentoo.org/261562 --- To be committed after removal of x-modular.eclass which is scheduled for 2018-02-01. eclass/eutils.eclass | 92 1 file changed, 92 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 63f73db290f4..be8251f5794a 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -164,98 +164,6 @@ strip-linguas() { export LINGUAS=${newls:1} } -# @FUNCTION: built_with_use -# @USAGE: [--hidden] [--missing ] [-a|-o] -# @DESCRIPTION: -# -# Deprecated: Use EAPI 2 use deps in DEPEND|RDEPEND and with has_version calls. -# -# A temporary hack until portage properly supports DEPENDing on USE -# flags being enabled in packages. This will check to see if the specified -# DEPEND atom was built with the specified list of USE flags. The -# --missing option controls the behavior if called on a package that does -# not actually support the defined USE flags (aka listed in IUSE). -# The default is to abort (call die). The -a and -o flags control -# the requirements of the USE flags. They correspond to "and" and "or" -# logic. So the -a flag means all listed USE flags must be enabled -# while the -o flag means at least one of the listed IUSE flags must be -# enabled. The --hidden option is really for internal use only as it -# means the USE flag we're checking is hidden expanded, so it won't be found -# in IUSE like normal USE flags. -# -# Remember that this function isn't terribly intelligent so order of optional -# flags matter. -built_with_use() { - local hidden="no" - if [[ $1 == "--hidden" ]] ; then - hidden="yes" - shift - fi - - local missing_action="die" - if [[ $1 == "--missing" ]] ; then - missing_action=$2 - shift ; shift - case ${missing_action} in - true|false|die) ;; - *) die "unknown action '${missing_action}'";; - esac - fi - - local opt=$1 - [[ ${opt:0:1} = "-" ]] && shift || opt="-a" - - local PKG=$(best_version $1) - [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package" - shift - - has "${EAPI:-0}" 0 1 2 && local EROOT=${ROOT} - local USEFILE=${EROOT}/var/db/pkg/${PKG}/USE - local IUSEFILE=${EROOT}/var/db/pkg/${PKG}/IUSE - - # if the IUSE file doesn't exist, the read will error out, we need to handle - # this gracefully - if [[ ! -e ${USEFILE} ]] || [[ ! -e ${IUSEFILE} && ${hidden} == "no" ]] ; then - case ${missing_action} in - true) return 0;; - false) return 1;; - die)die "Unable to determine what USE flags $PKG was built with";; - esac - fi - - if [[ ${hidden} == "no" ]] ; then - local IUSE_BUILT=( $(<"${IUSEFILE}") ) - # Don't check USE_EXPAND #147237 - local expand - for expand in $(echo ${USE_EXPAND} | tr '[:upper:]' '[:lower:]') ; do - if [[ $1 == ${expand}_* ]] ; then - expand="" - break - fi - done - if [[ -n ${expand} ]] ; then - if ! has $1 ${IUSE_BUILT[@]#[-+]} ; then - case ${missing_action} in - true) return 0;; - false) return 1;; - die) die "$PKG does not actually support the $1 USE flag!";; - esac - fi - fi - fi - - local USE_BUILT=$(<${USEFILE}) - while [[ $# -gt 0 ]] ; do - if [[ ${opt} = "-o" ]] ; then - has $1 ${USE_BUILT} && return 0 - else - has $1 ${USE_BUILT} || return 1 - fi - shift - done - [[ ${opt} = "-a" ]] -} - # @FUNCTION: make_wrapper # @USAGE: [chdir] [libpaths] [installpath] # @DESCRIPTION: -- 2.16.0 pgpjUmOB6SDfy.pgp Description: PGP signature
[gentoo-dev] [PATCH] l10n.eclass: Disabled locales are the complement of enabled ones.
Disabled locales returned by l10n_get_locales() should be the complement of enabled locales: disabled = PLOCALES \ enabled. So far, in the case of the enabled set falling back to PLOCALE_BACKUP, the backup locale would end up being both enabled and disabled. Closes: https://bugs.gentoo.org/547790 --- eclass/l10n.eclass | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass index 4b0111934d72..82f4ab113f52 100644 --- a/eclass/l10n.eclass +++ b/eclass/l10n.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: l10n.eclass @@ -102,26 +102,22 @@ l10n_find_plocales_changes() { # are selected, fall back on PLOCALE_BACKUP. When the disabled argument # is given, return the disabled locales instead of the enabled ones. l10n_get_locales() { - local disabled_locales enabled_locales loc locs + local loc locs if [[ -z ${LINGUAS+set} ]]; then # enable all if unset - enabled_locales=${PLOCALES} - elif [[ -z ${LINGUAS} ]]; then - # disable all if empty - disabled_locales=${PLOCALES} + locs=${PLOCALES} else - for loc in ${PLOCALES}; do - if has ${loc} ${LINGUAS}; then - enabled_locales+="${loc} " - else - disabled_locales+="${loc} " - fi + for loc in ${LINGUAS}; do + has ${loc} ${PLOCALES} && locs+="${loc} " done fi + [[ -z ${locs} ]] && locs=${PLOCALE_BACKUP} if [[ ${1} == disabled ]]; then - locs=${disabled_locales} - else - locs=${enabled_locales:-${PLOCALE_BACKUP}} + local disabled_locs + for loc in ${PLOCALES}; do + has ${loc} ${locs} || disabled_locs+="${loc} " + done + locs=${disabled_locs} fi printf "%s" "${locs}" } -- 2.15.1 pgp1JaON0LM3P.pgp Description: PGP signature
[gentoo-dev] [PATCH] check-reqs.eclass: Make obsolete usage fatal.
QA warnings for calling the obsolete check_reqs function and for missing size units were in place for more than two years, and usage in the Gentoo repository has been fixed. Error out on all obsolete usage. This will also allow dropping the eutils inherit which was only needed for eqawarn(). --- eclass/check-reqs.eclass | 33 ++--- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass index fe1852213441..781991da84ba 100644 --- a/eclass/check-reqs.eclass +++ b/eclass/check-reqs.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: check-reqs.eclass @@ -39,8 +39,6 @@ if [[ ! ${_CHECK_REQS_ECLASS_} ]]; then -inherit eutils - # @ECLASS-VARIABLE: CHECKREQS_MEMORY # @DEFAULT_UNSET # @DESCRIPTION: @@ -68,22 +66,13 @@ case "${EAPI:-0}" in *) die "EAPI=${EAPI} is not supported" ;; esac -# @FUNCTION: check_reqs -# @DESCRIPTION: # Obsolete function executing all the checks and printing out results check_reqs() { debug-print-function ${FUNCNAME} "$@" - [[ ${EAPI:-0} == [012345] ]] || die "${FUNCNAME} is banned in EAPI > 5" - - echo - eqawarn "Package calling old ${FUNCNAME} function." - eqawarn "Please file a bug against the package." - eqawarn "It should call check-reqs_pkg_pretend and check-reqs_pkg_setup" - eqawarn "and possibly use EAPI=4 or later." - echo - - check-reqs_pkg_setup "$@" + eerror "Package calling old ${FUNCNAME} function." + eerror "It should call check-reqs_pkg_pretend and check-reqs_pkg_setup." + die "${FUNCNAME} is banned" } # @FUNCTION: check-reqs_pkg_setup @@ -179,7 +168,6 @@ check-reqs_get_kibibytes() { G) echo $((1024 * 1024 * size)) ;; M) echo $((1024 * size)) ;; T) echo $((1024 * 1024 * 1024 * size)) ;; - [0-9]) echo $((1024 * size)) ;; *) die "${FUNCNAME}: Unknown unit: ${unit}" ;; @@ -196,17 +184,8 @@ check-reqs_get_number() { [[ -z ${1} ]] && die "Usage: ${FUNCNAME} [size]" - local unit=${1:(-1)} local size=${1%[GMT]} - local msg=eerror - [[ ${EAPI:-0} == [012345] ]] && msg=eqawarn - - # Check for unset units and warn about them. - # Backcompat. - if [[ ${size} == ${1} ]]; then - ${msg} "Package does not specify unit for the size check" - ${msg} "File bug against the package. It should specify the unit." - fi + [[ ${size} == ${1} ]] && die "${FUNCNAME}: Missing unit: ${1}" echo ${size} } @@ -225,7 +204,7 @@ check-reqs_get_unit() { case ${unit} in G) echo "GiB" ;; - [M0-9]) echo "MiB" ;; + M) echo "MiB" ;; T) echo "TiB" ;; *) die "${FUNCNAME}: Unknown unit: ${unit}" -- 2.15.1 pgpnMV_ZOroTR.pgp Description: PGP signature
[gentoo-dev] [PATCH 2/2] eutils.eclass: Inline remaining uses of _eutils_eprefix_init.
Inline the remaining two uses of the function. This shortens the code, and also allows to declare the variables as local. --- eclass/eutils.eclass | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 91d329e99c9e..63f73db290f4 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -164,14 +164,6 @@ strip-linguas() { export LINGUAS=${newls:1} } -# @FUNCTION: _eutils_eprefix_init -# @INTERNAL -# @DESCRIPTION: -# Initialized prefix variables for EAPI<3. -_eutils_eprefix_init() { - has "${EAPI:-0}" 0 1 2 && : ${ED:=${D}} ${EPREFIX:=} ${EROOT:=${ROOT}} -} - # @FUNCTION: built_with_use # @USAGE: [--hidden] [--missing ] [-a|-o] # @DESCRIPTION: @@ -194,7 +186,6 @@ _eutils_eprefix_init() { # Remember that this function isn't terribly intelligent so order of optional # flags matter. built_with_use() { - _eutils_eprefix_init local hidden="no" if [[ $1 == "--hidden" ]] ; then hidden="yes" @@ -218,6 +209,7 @@ built_with_use() { [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package" shift + has "${EAPI:-0}" 0 1 2 && local EROOT=${ROOT} local USEFILE=${EROOT}/var/db/pkg/${PKG}/USE local IUSEFILE=${EROOT}/var/db/pkg/${PKG}/IUSE @@ -272,9 +264,9 @@ built_with_use() { # first optionally setting LD_LIBRARY_PATH to the colon-delimited # libpaths followed by optionally changing directory to chdir. make_wrapper() { - _eutils_eprefix_init local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5 local tmpwrapper=$(emktemp) + has "${EAPI:-0}" 0 1 2 && local EPREFIX="" ( echo '#!/bin/sh' -- 2.15.1 pgp_09nAaDsQk.pgp Description: PGP signature
[gentoo-dev] [PATCH 1/2] preserve-libs.eclass: Split off preserve_old_lib from eutils.
Split off functions preserve_old_lib and preserve_old_lib_notify from eutils.eclass into a dedicated preserve-libs.eclass. These functions are rarely used and are independent of the rest of eutils, therefore moving them into their own eclass will help clarifying eclass inheritance in ebuilds. For backwards compatibility, eutils inherits the new eclass in existing EAPIs. --- eclass/eutils.eclass| 65 ++- eclass/preserve-libs.eclass | 74 + 2 files changed, 76 insertions(+), 63 deletions(-) create mode 100644 eclass/preserve-libs.eclass diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 7d4193e76b51..91d329e99c9e 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: eutils.eclass @@ -20,7 +20,7 @@ _EUTILS_ECLASS=1 # implicitly inherited (now split) eclasses case ${EAPI:-0} in 0|1|2|3|4|5|6) - inherit desktop epatch estack ltprune multilib toolchain-funcs + inherit desktop epatch estack ltprune multilib preserve-libs toolchain-funcs ;; esac @@ -172,67 +172,6 @@ _eutils_eprefix_init() { has "${EAPI:-0}" 0 1 2 && : ${ED:=${D}} ${EPREFIX:=} ${EROOT:=${ROOT}} } -# @FUNCTION: preserve_old_lib -# @USAGE: [more libs] -# @DESCRIPTION: -# These functions are useful when a lib in your package changes ABI SONAME. -# An example might be from libogg.so.0 to libogg.so.1. Removing libogg.so.0 -# would break packages that link against it. Most people get around this -# by using the portage SLOT mechanism, but that is not always a relevant -# solution, so instead you can call this from pkg_preinst. See also the -# preserve_old_lib_notify function. -preserve_old_lib() { - _eutils_eprefix_init - if [[ ${EBUILD_PHASE} != "preinst" ]] ; then - eerror "preserve_old_lib() must be called from pkg_preinst() only" - die "Invalid preserve_old_lib() usage" - fi - [[ -z $1 ]] && die "Usage: preserve_old_lib [more libraries to preserve]" - - # let portage worry about it - has preserve-libs ${FEATURES} && return 0 - - local lib dir - for lib in "$@" ; do - [[ -e ${EROOT}/${lib} ]] || continue - dir=${lib%/*} - dodir ${dir} || die "dodir ${dir} failed" - cp "${EROOT}"/${lib} "${ED}"/${lib} || die "cp ${lib} failed" - touch "${ED}"/${lib} - done -} - -# @FUNCTION: preserve_old_lib_notify -# @USAGE: [more libs] -# @DESCRIPTION: -# Spit helpful messages about the libraries preserved by preserve_old_lib. -preserve_old_lib_notify() { - if [[ ${EBUILD_PHASE} != "postinst" ]] ; then - eerror "preserve_old_lib_notify() must be called from pkg_postinst() only" - die "Invalid preserve_old_lib_notify() usage" - fi - - # let portage worry about it - has preserve-libs ${FEATURES} && return 0 - - _eutils_eprefix_init - - local lib notice=0 - for lib in "$@" ; do - [[ -e ${EROOT}/${lib} ]] || continue - if [[ ${notice} -eq 0 ]] ; then - notice=1 - ewarn "Old versions of installed libraries were detected on your system." - ewarn "In order to avoid breaking packages that depend on these old libs," - ewarn "the libraries are not being removed. You need to run revdep-rebuild" - ewarn "in order to remove these old dependencies. If you do not have this" - ewarn "helper program, simply emerge the 'gentoolkit' package." - ewarn - fi - ewarn " # revdep-rebuild --library '${lib}' && rm '${lib}'" - done -} - # @FUNCTION: built_with_use # @USAGE: [--hidden] [--missing ] [-a|-o] # @DESCRIPTION: diff --git a/eclass/preserve-libs.eclass b/eclass/preserve-libs.eclass new file mode 100644 index ..548c6411fcf0 --- /dev/null +++ b/eclass/preserve-libs.eclass @@ -0,0 +1,74 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: preserve-libs.eclass +# @MAINTAINER: +# base-sys...@gentoo.org +# @BLURB: preserve libraries after SONAME changes + +if [[ -z ${_PRESERVE_LIBS_ECLASS} ]]; then +_PRESERVE_LIBS_ECLASS=1 + +# @FUNCTION: preserve_old_lib +# @USAGE: [more libs] +# @DESCRIPTION: +# These functions are useful when a lib in your package changes ABI SONAME. +# An example might be from libogg.so.0 to libogg.so.1. Removing libogg.so.0 +# would break packages that link against it. Most people get around this +# by using the portage SLOT mechanism, but that is not always a relevant +# solution, so instead you can call
[gentoo-dev] [PATCH] versionator.eclass: inherit estack rather than eutils.
The only functions needed from the eutils.eclass are eshopts_push and eshopts_pop, which have been split off to estack.eclass. See also commit 401ef96525d8c21c33bdd6e88e475e09f3a42717 (in historical.git) which added the eutils inherit. --- eclass/versionator.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/versionator.eclass b/eclass/versionator.eclass index 7c03c1e1b23a..54d77a30b015 100644 --- a/eclass/versionator.eclass +++ b/eclass/versionator.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: versionator.eclass @@ -28,7 +28,7 @@ if [[ -z ${_VERSIONATOR_ECLASS} ]]; then _VERSIONATOR_ECLASS=1 -inherit eutils +inherit estack # @FUNCTION: get_all_version_components # @USAGE: [version] -- 2.15.1 pgpD5UIT9IVBX.pgp Description: PGP signature
[gentoo-dev] [PATCH v2] skel.ebuild: Update comments for inherit, SLOT, KEYWORDS.
Change the example used for inherit. Also comment the inherit line, since not every ebuild will use it. Empty SLOT doesn't disable slots, but is outright illegal in all EAPIs. Similar for KEYWORDS="*", which isn't "deprecated" but invalid. Replace x86 by amd64 as an example, where appropriate. --- Changes in v2: - inherit uses autotools rather than epatch as an example. - x86 replaced by amd64 where appropriate. - More accurate wording for IUSE. skel.ebuild | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/skel.ebuild b/skel.ebuild index 591b58e8d367..129f61dcdb29 100644 --- a/skel.ebuild +++ b/skel.ebuild @@ -13,9 +13,9 @@ EAPI=6 # inherit lists eclasses to inherit functions from. For example, an ebuild -# that needs the epatch function from eutils.eclass won't work without the -# following line: -inherit eutils +# that needs the eautoreconf function from autotools.eclass won't work +# without the following line: +#inherit autotools # # eclasses tend to list descriptions of how to use their functions properly. # take a look at /usr/portage/eclass/ for more examples. @@ -46,7 +46,7 @@ LICENSE="" # of each SLOT and remove everything else. # Note that normal applications should use SLOT="0" if possible, since # there should only be exactly one version installed at a time. -# DO NOT USE SLOT=""! This tells Portage to disable SLOTs for this package. +# Do not use SLOT="", because the SLOT variable must not be empty. SLOT="0" # Using KEYWORDS, we can record masking information *inside* an ebuild @@ -54,22 +54,21 @@ SLOT="0" # set the KEYWORDS variable for every ebuild so that it contains the names of # all the architectures with which the ebuild works. All of the official # architectures can be found in the arch.list file which is in -# /usr/portage/profiles/. Usually you should just set this to "~x86". The ~ -# in front of the architecture indicates that the package is new and should be -# considered unstable until testing proves its stability. So, if you've -# confirmed that your ebuild works on x86 and ppc, you'd specify: -# KEYWORDS="~x86 ~ppc" +# /usr/portage/profiles/. Usually you should just set this to "~amd64". +# The ~ in front of the architecture indicates that the package is new and +# should be considered unstable until testing proves its stability. So, if +# you've confirmed that your ebuild works on amd64 and ppc, you'd specify: +# KEYWORDS="~amd64 ~ppc" # Once packages go stable, the ~ prefix is removed. # For binary packages, use -* and then list the archs the bin package # exists for. If the package was for an x86 binary package, then # KEYWORDS would be set like this: KEYWORDS="-* x86" -# DO NOT USE KEYWORDS="*". This is deprecated and only for backward -# compatibility reasons. -KEYWORDS="~x86" +# Do not use KEYWORDS="*"; this is not valid in an ebuild context. +KEYWORDS="~amd64" # Comprehensive list of any and all USE flags leveraged in the ebuild, -# with the exception of any ARCH specific flags, i.e. "ppc", "sparc", -# "x86" and "alpha". Not needed if the ebuild doesn't use any USE flags. +# with some exceptions, e.g., ARCH specific flags like "amd64" or "ppc". +# Not needed if the ebuild doesn't use any USE flags. IUSE="gnome X" # A space delimited list of portage features to restrict. man 5 ebuild -- 2.15.1 pgp03mpWMBYnt.pgp Description: PGP signature
[gentoo-dev] [PATCH] skel.ebuild: Update comments for inherit, SLOT, KEYWORDS.
epatch() is provided by epatch.eclass now. Also comment the inherit line, since not every ebuild will use it. Empty SLOT doesn't disable slots, but is outright illegal in all EAPIs. Similar for KEYWORDS="*", which isn't "deprecated" but invalid. --- skel.ebuild | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/skel.ebuild b/skel.ebuild index 7ac9dfb7d6d8..4c19b1de4cb8 100644 --- a/skel.ebuild +++ b/skel.ebuild @@ -13,9 +13,9 @@ EAPI=6 # inherit lists eclasses to inherit functions from. For example, an ebuild -# that needs the epatch function from eutils.eclass won't work without the +# that needs the epatch function from epatch.eclass won't work without the # following line: -inherit eutils +#inherit epatch # # eclasses tend to list descriptions of how to use their functions properly. # take a look at /usr/portage/eclass/ for more examples. @@ -46,7 +46,7 @@ LICENSE="" # of each SLOT and remove everything else. # Note that normal applications should use SLOT="0" if possible, since # there should only be exactly one version installed at a time. -# DO NOT USE SLOT=""! This tells Portage to disable SLOTs for this package. +# Do not use SLOT="", because the SLOT variable must not be empty. SLOT="0" # Using KEYWORDS, we can record masking information *inside* an ebuild @@ -63,8 +63,7 @@ SLOT="0" # For binary packages, use -* and then list the archs the bin package # exists for. If the package was for an x86 binary package, then # KEYWORDS would be set like this: KEYWORDS="-* x86" -# DO NOT USE KEYWORDS="*". This is deprecated and only for backward -# compatibility reasons. +# Do not use KEYWORDS="*". This is not valid in an ebuild context. KEYWORDS="~x86" # Comprehensive list of any and all USE flags leveraged in the ebuild, -- 2.15.1 pgp_xTapo9jvZ.pgp Description: PGP signature
[gentoo-dev] [PATCH] l10n.eclass: Update for unexpanded LINGUAS.
--- This is meant to be merged after removal of LINGUAS from USE_EXPAND. Any packages inheriting l10n.eclass but not using any of its functions (i.e. relying only on the global scope snippet that adds linguas_* USE flags) will be updated at the same time. eclass/l10n.eclass | 40 +--- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass index 2283088d0d0a..d60f7befd0d2 100644 --- a/eclass/l10n.eclass +++ b/eclass/l10n.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: l10n.eclass @@ -12,8 +12,7 @@ # conveniently handle localizations (translations) offered by packages. # These are meant to prevent code duplication for such boring tasks as # determining the cross-section between the user's set LINGUAS and what -# is offered by the package; and generating the right list of linguas_* -# USE flags. +# is offered by the package. # @ECLASS-VARIABLE: PLOCALES # @DEFAULT_UNSET @@ -33,11 +32,6 @@ # # Example: PLOCALE_BACKUP="en_US" -# Add linguas useflags -for u in ${PLOCALES}; do - IUSE+=" linguas_${u}" -done - # @FUNCTION: l10n_for_each_locale_do # @USAGE: # @DESCRIPTION: @@ -103,19 +97,27 @@ l10n_find_plocales_changes() { # @FUNCTION: l10n_get_locales # @USAGE: [disabled] # @DESCRIPTION: -# Determine which LINGUAS USE flags the user has enabled that are offered -# by the package, as listed in PLOCALES, and return them. In case no locales -# are selected, fall back on PLOCALE_BACKUP. When the disabled argument is -# given, return the disabled useflags instead of the enabled ones. +# Determine which LINGUAS the user has enabled that are offered by the +# package, as listed in PLOCALES, and return them. In case no locales +# are selected, fall back on PLOCALE_BACKUP. When the disabled argument +# is given, return the disabled locales instead of the enabled ones. l10n_get_locales() { local disabled_locales enabled_locales loc locs - for loc in ${PLOCALES}; do - if use linguas_${loc}; then - enabled_locales+="${loc} " - else - disabled_locales+="${loc} " - fi - done + if [[ -z ${LINGUAS+set} ]]; then + # enable all if unset + enabled_locales=${PLOCALES} + elif [[ -z ${LINGUAS} ]]; then + # disable all if empty + disabled_locales=${PLOCALES} + else + for loc in ${PLOCALES}; do + if has ${loc} ${LINGUAS}; then + enabled_locales+="${loc} " + else + disabled_locales+="${loc} " + fi + done + fi if [[ ${1} == disabled ]]; then locs=${disabled_locales} else -- 2.15.1 pgptfG1IRTZhY.pgp Description: PGP signature
[gentoo-dev] [PATCH] elisp.eclass: Inherit epatch rather than eutils.
The only function needed from eutils was epatch() which has been split off into its own eclass. --- eclass/elisp.eclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass index 078a7994d00c..67459730aa61 100644 --- a/eclass/elisp.eclass +++ b/eclass/elisp.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: elisp.eclass @@ -68,11 +68,11 @@ inherit elisp-common case ${EAPI:-0} in 0|1) - inherit eutils + inherit epatch EXPORT_FUNCTIONS src_{unpack,compile,install} \ pkg_{setup,postinst,postrm} ;; 2|3|4|5) - inherit eutils + inherit epatch EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ pkg_{setup,postinst,postrm} ;; 6) -- 2.15.1 pgppbm5TsMdlY.pgp Description: PGP signature
[gentoo-dev] [PATCH 2/2] glep-0042: Update and clarify naming rules.
Update the GLEP from ISO 639 to IETF language tags (BCP 47), in order to make it consistent with usage in the L10N USE_EXPAND variable. This will make no difference for most common languages. Also there are currently no translations of news items at all. Add a note clarifying what "very short" means. --- glep-0042.rst | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/glep-0042.rst b/glep-0042.rst index 7726ea4..90ae0b2 100644 --- a/glep-0042.rst +++ b/glep-0042.rst @@ -179,7 +179,9 @@ form ``-mm-dd-short-name``, where ```` is the year (e.g. ``2005``), ``mm`` is the month (``01`` through ``12``) and dd is the day of the month (``01`` through ``31``). The ``short-name`` is a very short name describing the news item (e.g. ``yoursql-updates``), consisting only of the characters ``a-z``, -``0-9``, ``+`` (plus), ``-`` (hyphen) and ``_`` (underscore). +``0-9``, ``+`` (plus), ``-`` (hyphen) and ``_`` (underscore). While there +is no hard restriction for the length of ``short-name``, it is strongly +recommended to limit it to at most 20 characters. News Item Directories - @@ -191,8 +193,8 @@ The directory will contain a file named ``-mm-dd-short-name.en.txt``, which contains the text of the news item, in English, in the format described below. If a news item is translated, other files named ``-mm-dd-short-name.xx.txt`` -(where ``xx`` is the ISO 639 [#iso-639]_ two letter language code, and the date -remains the same as the original news item) will also be provided. However, only +(where ``xx`` is a valid IETF language tag [#bcp-47]_, and the date remains +the same as the original news item) will also be provided. However, only the English version of a news item is authoritative. This anglocentricity is justified by precedent [#glep-34]_. @@ -475,6 +477,8 @@ Example Files References == +.. [#bcp-47] BCP 47: "Tags for identifying languages", + https://tools.ietf.org/rfc/bcp/bcp47.txt .. [#bug-11359] Bugzilla Bug 11359 "[NEW FEATURE] pkg_postinst/pkg_preinst ewarn/einfo logging", https://bugs.gentoo.org/show_bug.cgi?id=11359 @@ -500,7 +504,6 @@ References .. [#glep-74] GLEP 74: "Full-tree verification using Manifest files", Michał Górny, Robin Hugh Johnson, Ulrich Müller, https://www.gentoo.org/glep/glep-0074.html -.. [#iso-639] ISO 639 "Code for the representation of names of languages" .. [#ramereth-repo] "Re: [gentoo-dev] GLEP ??: Critical News Reporting", Lance Albertson, https://archives.gentoo.org/gentoo-dev/message/4204839d4091758c3bad1dbd18ed16f7 -- 2.15.0 pgpSN2WafPRNC.pgp Description: PGP signature
[gentoo-dev] [PATCH 0/2] Two updates for GLEP 42
Here are two updates for GLEP 42, for review. Currently it is required that every news item is accompanied by a detached OpenPGP signature. To my knowledge, verification of these signatures was never implemented. With Git commit signing and after full-tree verification is implemented, these detached signatures will become fully redundant. In addition, we noticed that several of the signatures have a bad format (e.g., are not detached signatures at all). Therefore the first patch drops the requirement for detached OpenPGP signatures. The second patch updates the GLEP from ISO 639 to IETF language codes (BCP 47), in order to make it consistent with usage in the L10N USE_EXPAND variable. This will make no difference for most common languages. Please note that a BCP 47 language tag can in principle be longer than two letters, and can contain characters [A-Za-z0-9-]. (Since there are currently no translations of news items, all this is rather academic, though.) Finally (also in the second patch) a note is added clarifying what "very short" means in a filename context. Technically, the short-name is needed only to distinguish between multiple news items posted at the same day. However, there seems to be a tendency to repeat half of the news item's content in its filename. ;-) Ulrich Müller (2): glep-0042: Drop requirement for detached signatures. glep-0042: Update and clarify naming rules. glep-0042.rst | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) -- 2.15.0 pgpa3ind7X16Y.pgp Description: PGP signature
[gentoo-dev] [PATCH 1/2] glep-0042: Drop requirement for detached signatures.
--- glep-0042.rst | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/glep-0042.rst b/glep-0042.rst index c6b41e9..7726ea4 100644 --- a/glep-0042.rst +++ b/glep-0042.rst @@ -9,7 +9,7 @@ Type: Standards Track Status: Final Version: 3 Created: 2005-10-31 -Last-Modified: 2016-03-18 +Last-Modified: 2017-11-26 Post-History: 2005-11-01, 2005-11-05, 2005-11-07, 2005-12-11, 2005-12-13, 2005-12-18, 2006-01-05, 2006-03-02, 2006-03-06, 2006-06-12, 2006-09-05, 2016-03-10 @@ -203,19 +203,16 @@ A news item file is a text file, encoded using UTF-8 [#rfc-3629]_ for compatibility with and for the same reasons as existing Gentoo documentation [#docs-policy]_ and the tree [#glep-31]_. -News items must be signed with a detached GPG signature.:: - -gpg --armour --detach-sign -??-??-*.??.txt - -This GLEP does not specify the type or strength of signature to be used, nor -does it discuss how, if at all, a centralised keychain will be provided. These -issues should be handled as part of the signing policy discussions. - A news item file's content will consist of an RFC 822 style header [#rfc-822]_ followed by the main body of the message as plain text. This GLEP defines various optional and mandatory headers. Future GLEPs may propose new headers — tools handling these news items must ignore any unrecognised header. +.. Note:: A previous version of this GLEP had required that news items must + be signed with a detached OpenPGP signature. This was no longer deemed + necessary after moving news items to a Git repository with commit signing, + and deployment of full-tree verification per GLEP 74 [#glep-74]_. + News Item Headers ' @@ -500,6 +497,9 @@ References https://www.gentoo.org/glep/glep-0034.html .. [#glep-45] GLEP 45: "GLEP date format", Henrik Brix Andersen, https://www.gentoo.org/glep/glep-0045.html +.. [#glep-74] GLEP 74: "Full-tree verification using Manifest files", + Michał Górny, Robin Hugh Johnson, Ulrich Müller, + https://www.gentoo.org/glep/glep-0074.html .. [#iso-639] ISO 639 "Code for the representation of names of languages" .. [#ramereth-repo] "Re: [gentoo-dev] GLEP ??: Critical News Reporting", Lance Albertson, -- 2.15.0 pgpOwZEhtTxGU.pgp Description: PGP signature
[gentoo-dev] [PATCH 3/3] desktop.eclass: Split off desktop, menu, and icon functions from eutils.
Split off functions make_desktop_entry, make_session_desktop, domenu, newmenu, doicon, and newicon from eutils.eclass into a dedicated desktop.eclass. These functions are independent of the rest of eutils, therefore moving them into their own eclass will help clarifying eclass inheritance in ebuilds. For backwards compatibility, eutils inherits the new eclass in existing EAPIs. --- eclass/desktop.eclass | 395 + eclass/eutils.eclass | 401 ++ 2 files changed, 404 insertions(+), 392 deletions(-) create mode 100644 eclass/desktop.eclass diff --git a/eclass/desktop.eclass b/eclass/desktop.eclass new file mode 100644 index ..d65b0d0bf074 --- /dev/null +++ b/eclass/desktop.eclass @@ -0,0 +1,395 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: desktop.eclass +# @MAINTAINER: +# base-sys...@gentoo.org +# @BLURB: support for desktop files, menus, and icons + +if [[ -z ${_DESKTOP_ECLASS} ]]; then +_DESKTOP_ECLASS=1 + +# @FUNCTION: make_desktop_entry +# @USAGE: make_desktop_entry(, [name], [icon], [type], [fields]) +# @DESCRIPTION: +# Make a .desktop file. +# +# @CODE +# binary: what command does the app run with ? +# name: the name that will show up in the menu +# icon: the icon to use in the menu entry +# this can be relative (to /usr/share/pixmaps) or +# a full path to an icon +# type: what kind of application is this? +# for categories: +# https://specifications.freedesktop.org/menu-spec/latest/apa.html +# if unset, function tries to guess from package's category +# fields: extra fields to append to the desktop file; a printf string +# @CODE +make_desktop_entry() { + [[ -z $1 ]] && die "make_desktop_entry: You must specify the executable" + + local exec=${1} + local name=${2:-${PN}} + local icon=${3:-${PN}} + local type=${4} + local fields=${5} + + if [[ -z ${type} ]] ; then + local catmaj=${CATEGORY%%-*} + local catmin=${CATEGORY##*-} + case ${catmaj} in + app) + case ${catmin} in + accessibility) type="Utility;Accessibility";; + admin) type=System;; + antivirus) type=System;; + arch) type="Utility;Archiving";; + backup) type="Utility;Archiving";; + cdr) type="AudioVideo;DiscBurning";; + dicts) type="Office;Dictionary";; + doc) type=Documentation;; + editors) type="Utility;TextEditor";; + emacs) type="Development;TextEditor";; + emulation) type="System;Emulator";; + laptop) type="Settings;HardwareSettings";; + office)type=Office;; + pda) type="Office;PDA";; + vim) type="Development;TextEditor";; + xemacs) type="Development;TextEditor";; + esac + ;; + + dev) + type="Development" + ;; + + games) + case ${catmin} in + action|fps) type=ActionGame;; + arcade) type=ArcadeGame;; + board) type=BoardGame;; + emulation) type=Emulator;; + kids) type=KidsGame;; + puzzle) type=LogicGame;; + roguelike) type=RolePlaying;; + rpg)type=RolePlaying;; + simulation) type=Simulation;; + sports) type=SportsGame;; + strategy) type=StrategyGame;; + esac + type="Game;${type}" + ;; + + gnome) + type="Gnome;GTK" + ;; + + kde) + type="KDE;Qt" + ;; +
[gentoo-dev] [PATCH 2/3] eutils.eclass: Remove validate_desktop_entries function.
This function is no longer used in the tree. It was deprecated more than 8 months ago in commit 650a1ebe8f63d3750908142e2117b24a8efc9403. --- eclass/eutils.eclass | 30 -- 1 file changed, 30 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 7fd4b847a649..972a2138aad7 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -314,36 +314,6 @@ _eutils_eprefix_init() { has "${EAPI:-0}" 0 1 2 && : ${ED:=${D}} ${EPREFIX:=} ${EROOT:=${ROOT}} } -# @FUNCTION: validate_desktop_entries -# @USAGE: [directories] -# @DESCRIPTION: -# Validate desktop entries using desktop-file-utils -validate_desktop_entries() { - eqawarn "validate_desktop_entries is deprecated and should be not be used." - eqawarn ".desktop file validation is done implicitly by Portage now." - - _eutils_eprefix_init - if [[ -x "${EPREFIX}"/usr/bin/desktop-file-validate ]] ; then - einfo "Checking desktop entry validity" - local directories="" - for d in /usr/share/applications $@ ; do - [[ -d ${ED}${d} ]] && directories="${directories} ${ED}${d}" - done - if [[ -n ${directories} ]] ; then - for FILE in $(find ${directories} -name "*\.desktop" \ - -not -path '*.hidden*' | sort -u 2>/dev/null) - do - local temp=$(desktop-file-validate ${FILE} | grep -v "warning:" | \ - sed -e "s|error: ||" -e "s|${FILE}:|--|g" ) - [[ -n $temp ]] && elog ${temp/--/${FILE/${ED}/}:} - done - fi - echo "" - else - einfo "Passing desktop entry validity check. Install dev-util/desktop-file-utils, if you want to help to improve Gentoo." - fi -} - # @FUNCTION: make_session_desktop # @USAGE: [command args...] # @DESCRIPTION: -- 2.15.0 pgpiSgjYZXknT.pgp Description: PGP signature
[gentoo-dev] [PATCH 1/3] eutils.eclass: Remove check_license function.
This is an inoperative stub since 2011, and no longer used in the tree. --- eclass/eutils.eclass | 4 1 file changed, 4 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index f35fa5980d7a..7fd4b847a649 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -869,10 +869,6 @@ optfeature() { fi } -check_license() { - die "you no longer need this as portage supports ACCEPT_LICENSE itself" -} - case ${EAPI:-0} in 0|1|2) -- 2.15.0 pgp9LGZl_gTE_.pgp Description: PGP signature
[gentoo-dev] [PATCH 0/3] Further cleanup of eutils.eclass
We already had a first round of cleanup in March of this year, where some of the functions (epatch being the most prominent of them) were moved to their own dedicated eclasses. The following series of patches removes two deprecated functions, and splits others off into their own dedicated eclass. Other than that, there are no code changes. For existing EAPIs, the split-off eclass will still be inherited by eutils. The plan would be to drop that inherit in EAPI 7. Please review. Ulrich Müller (3): eutils.eclass: Remove check_license function. eutils.eclass: Remove validate_desktop_entries function. desktop.eclass: Split off desktop, menu, and icon functions from eutils. eclass/desktop.eclass | 395 + eclass/eutils.eclass | 435 ++ 2 files changed, 404 insertions(+), 426 deletions(-) create mode 100644 eclass/desktop.eclass -- 2.15.0 pgpmm5mpfzHIj.pgp Description: PGP signature
[gentoo-portage-dev] [PATCH] man/ebuild.5: Do not document internal functions.
Functions containing "hook" or "prep" in their name may not be used or relied upon by ebuilds. Therefore they should not be documented in ebuild(5) which describes the funtions available for ebuilds. PMS reference: https://projects.gentoo.org/pms/6/pms.html#x1-14700011.3.3.16 --- man/ebuild.5 | 76 +--- 1 file changed, 1 insertion(+), 75 deletions(-) diff --git a/man/ebuild.5 b/man/ebuild.5 index 43d12765d..42a0599fe 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -1,4 +1,4 @@ -.TH "EBUILD" "5" "Nov 2014" "Portage VERSION" "Portage" +.TH "EBUILD" "5" "Oct 2017" "Portage VERSION" "Portage" .SH "NAME" ebuild \- the internal format, variables, and functions in an ebuild script @@ -1104,16 +1104,6 @@ Example: installed) .fi -.SS "Hooks:" -.TP -.B register_die_hook\fR \fI[list of function names] -Register one or more functions to call when the ebuild fails for any reason, -including file collisions with other packages. -.TP -.B register_success_hook\fR \fI[list of function names] -Register one or more functions to call when the ebuild builds and/or installs -successfully. - .SS "Output:" .TP .B einfo\fR \fI"disposable message" @@ -1225,70 +1215,6 @@ Please do \fBnot\fR use this in place of 'emake install DESTDIR=${D}'. That is the preferred way of installing make\-based packages. Also, do not utilize the \fIEXTRA_EINSTALL\fR variable since it is for users. -.PD 0 -.TP -.B prepall -.TP -.B prepalldocs -.TP -.B prepallinfo -.TP -.B prepallman -.TP -.B prepallstrip -.PD 1 -Useful for when a package installs into \fB${D}\fR via scripts -(i.e. makefiles). If you want to be sure that libraries are executable, -aclocal files are installed into the right place, doc/info/man files are -all compressed, and that executables are all stripped of debugging symbols, -then use these suite of functions. -.RS -.PD 0 -.TP -.B prepall: -Runs \fBprepallman\fR, \fBprepallinfo\fR, \fBprepallstrip\fR, sets -libraries +x, and then checks aclocal directories. Please note this -does \fI*not*\fR run \fBprepalldocs\fR. -.TP -.B prepalldocs: -Compresses all doc files in ${ED}/usr/share/doc. -.TP -.B prepallinfo: -Compresses all info files in ${ED}/usr/share/info. -.TP -.B prepallman: -Compresses all man files in ${ED}/usr/share/man. -.TP -.B prepallstrip: -Strips all executable files of debugging symboles. This includes libraries. -.RE - -.TP -.B prepinfo\fR \fI[dir] -.TP -.B prepman\fR \fI[dir] -.TP -.B prepstrip\fR \fI[dir] -.PD 1 -Similar to the \fBprepall\fR functions, these are subtle in their differences. -.RS -.PD 0 -.TP -.B prepinfo: -If a \fIdir\fR is not specified, then \fBprepinfo\fR will assume the dir -\fIusr\fR. \fBprepinfo\fR will then compress all the files in -${ED}/\fIdir\fR/info. -.TP -.B prepman: -If a \fIdir\fR is not specified, then \fBprepman\fR will assume the dir -\fIusr\fR. \fBprepman\fR will then compress all the files in -${ED}/\fIdir\fR/man/*/. -.TP -.B prepstrip: -All the files found in ${ED}/\fIdir\fR will be stripped. You may specify -multiple directories. -.RE -.PD 1 .TP .B docompress\fR \fI[\-x] [list of more paths] .RS -- 2.14.2 pgpZ4C6XO5BRX.pgp Description: PGP signature
[gentoo-portage-dev] [PATCH] man: Update URI of GLEP references.
GLEPs have been moved to https://www.gentoo.org/glep/. --- man/ebuild.5| 2 +- man/emerge.1| 2 +- man/make.conf.5 | 4 ++-- man/portage.5 | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/man/ebuild.5 b/man/ebuild.5 index e4c866cd2..43d12765d 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -730,7 +730,7 @@ allows for packages to depend on \fIvirtual/jdk\fR rather than on blackdown or sun specifically. The \fBPROVIDE\fR variable has been deprecated. See -\fIhttps://wiki.gentoo.org/wiki/GLEP:37\fR for details. +\fIhttps://www.gentoo.org/glep/glep-0037.html\fR for details. .TP .B DOCS diff --git a/man/emerge.1 b/man/emerge.1 index 12a0db166..3198ba028 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -108,7 +108,7 @@ later updating. .BR \-\-check\-news Scan all repositories for relevant unread GLEP 42 news items, and display how many are found. See -\fIhttps://wiki.gentoo.org/wiki/GLEP:42\fR. +\fIhttps://www.gentoo.org/glep/glep-0042.html\fR. .TP .BR \-\-clean Cleans up the system by examining the installed packages and removing older diff --git a/man/make.conf.5 b/man/make.conf.5 index 65c18cc6d..a81b497bd 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -62,7 +62,7 @@ with the '@' symbol. License groups are defined in the \fIlicense_groups\fR file (see \fBportage\fR(5)). In addition to license and group names, the \fI*\fR and \fI-*\fR wildcard tokens are also supported. Refer to GLEP 23 for further information: -\fIhttps://wiki.gentoo.org/wiki/GLEP:23\fR. +\fIhttps://www.gentoo.org/glep/glep-0023.html\fR. .br Defaults to the value of * -@EULA. .br @@ -503,7 +503,7 @@ configures new enough distcc to use the proxy. .TP .B news Enable GLEP 42 news support. See -\fIhttps://wiki.gentoo.org/wiki/GLEP:42\fR. +\fIhttps://www.gentoo.org/glep/glep-0042.html\fR. .TP .B noauto When utilizing \fBebuild\fR(1), only run the function requested. Also, forces diff --git a/man/portage.5 b/man/portage.5 index 5b1dfa838..89dc8ce44 100644 --- a/man/portage.5 +++ b/man/portage.5 @@ -1408,7 +1408,7 @@ A list of all the variables which will be displayed when you run `emerge info`. This contains groups of licenses that may be specifed in the \fBACCEPT_LICENSE\fR variable (see \fBmake.conf\fR(5)). Refer to GLEP 23 for further information: -\fIhttps://wiki.gentoo.org/wiki/GLEP:23\fR. +\fIhttps://www.gentoo.org/glep/glep-0023.html\fR. .I Format: .nf @@ -1542,7 +1542,7 @@ All local USE flags are listed here along with the package and a description. This file is automatically generated from the metadata.xml files that are included with each individual package. Refer to GLEP 56 for further information: -\fIhttps://wiki.gentoo.org/wiki/GLEP:56\fR. +\fIhttps://www.gentoo.org/glep/glep-0056.html\fR. .nf .I Format: -- 2.14.2 pgpATU0G0BryM.pgp Description: PGP signature
[gentoo-portage-dev] [PATCH] dosym: Make implicit basename a fatal error.
The respective QA warning in the dosym helper is in place since 2011. All known violations in the gentoo repository have been fixed. Gentoo-Bug: 379899 --- bin/ebuild-helpers/dosym | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym index 0bc8cc7be..b9c70ce9c 100755 --- a/bin/ebuild-helpers/dosym +++ b/bin/ebuild-helpers/dosym @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 @@ -13,10 +13,9 @@ if ! ___eapi_has_prefix_variables; then ED=${D} fi -if [[ ${2} == */ ]] || \ - [[ -d ${ED}${2} && ! -L ${ED}${2} ]] ; then +if [[ ${2} == */ ]] || [[ -d ${ED}${2} && ! -L ${ED}${2} ]] ; then # implicit basename not allowed by PMS (bug #379899) - eqawarn "QA Notice: dosym target omits basename: '${2}'" + __helpers_die "${0##*/}: dosym target omits basename: '${2}'" fi destdir=${2%/*} -- 2.12.2 pgpTL2tc7Xb51.pgp Description: PGP signature
[gentoo-portage-dev] [PATCH] phase-helpers.sh: Loop over A rather than SRC_URI in __eapi0_pkg_nofetch.
Looping over SRC_URI also outputs non-filename elements (e.g, use conditionals) which is avoided when looping over A. Gentoo-Bug: 613132 --- bin/phase-helpers.sh | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 9e4e6a2f8..e1dcfd5e8 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 export DESTTREE=/usr @@ -726,11 +726,11 @@ einstall() { } __eapi0_pkg_nofetch() { - [ -z "${SRC_URI}" ] && return + [[ -z ${A} ]] && return - elog "The following are listed in SRC_URI for ${PN}:" + elog "The following files cannot be fetched for ${PN}:" local x - for x in $(echo ${SRC_URI}); do + for x in ${A}; do elog " ${x}" done } -- 2.12.1 pgp529zGwiQ94.pgp Description: PGP signature