From 391b5b359a346aff490103da7dddc85047f83830 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 1 Oct 2021 20:54:53 +0100 Subject: gentoo resync : 01.10.2021 --- eclass/Manifest.gz | Bin 35993 -> 36162 bytes eclass/bzr.eclass | 257 +++++++++++++++++++++++++++++++++++++++++++ eclass/distutils-r1.eclass | 4 + eclass/mozcoreconf-v6.eclass | 7 +- eclass/mozextension.eclass | 2 - eclass/mozlinguas-v2.eclass | 4 +- eclass/postgres.eclass | 2 +- eclass/savedconfig.eclass | 10 +- 8 files changed, 271 insertions(+), 15 deletions(-) create mode 100644 eclass/bzr.eclass (limited to 'eclass') diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz index c024f3a9237d..7b000046d1e0 100644 Binary files a/eclass/Manifest.gz and b/eclass/Manifest.gz differ diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass new file mode 100644 index 000000000000..b89f4216034f --- /dev/null +++ b/eclass/bzr.eclass @@ -0,0 +1,257 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: bzr.eclass +# @MAINTAINER: +# Ulrich Müller +# @AUTHOR: +# Jorge Manuel B. S. Vicetto +# Mark Lee +# Ulrich Müller +# Christian Faulhammer +# @SUPPORTED_EAPIS: 7 8 +# @BLURB: generic fetching functions for the Bazaar VCS +# @DESCRIPTION: +# The bzr.eclass provides functions to fetch and unpack sources from +# repositories of the Bazaar distributed version control system. +# The eclass was originally derived from git.eclass. +# +# 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}. + +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} is not supported" ;; +esac + +PROPERTIES+=" live" + +BDEPEND="dev-vcs/breezy" + +EXPORT_FUNCTIONS src_unpack + +# @ECLASS-VARIABLE: EBZR_STORE_DIR +# @USER_VARIABLE +# @DESCRIPTION: +# The directory to store all fetched Bazaar live sources. +: ${EBZR_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/bzr-src} + +# @ECLASS-VARIABLE: EBZR_UNPACK_DIR +# @DESCRIPTION: +# The working directory where the sources are copied to. +: ${EBZR_UNPACK_DIR:=${WORKDIR}/${P}} + +# @ECLASS-VARIABLE: EBZR_INIT_REPO_CMD +# @DESCRIPTION: +# The Bazaar command to initialise a shared repository. +: ${EBZR_INIT_REPO_CMD:="brz init-shared-repository --no-trees"} + +# @ECLASS-VARIABLE: EBZR_FETCH_CMD +# @DESCRIPTION: +# The Bazaar command to fetch the sources. +: ${EBZR_FETCH_CMD:="brz branch --no-tree"} + +# @ECLASS-VARIABLE: EBZR_UPDATE_CMD +# @DESCRIPTION: +# The Bazaar command to update the sources. +: ${EBZR_UPDATE_CMD:="brz pull --overwrite-tags"} + +# @ECLASS-VARIABLE: EBZR_EXPORT_CMD +# @DESCRIPTION: +# The Bazaar command to export a branch. +: ${EBZR_EXPORT_CMD:="brz export"} + +# @ECLASS-VARIABLE: EBZR_CHECKOUT_CMD +# @DESCRIPTION: +# The Bazaar command to checkout a branch. +: ${EBZR_CHECKOUT_CMD:="brz checkout --lightweight -q"} + +# @ECLASS-VARIABLE: EBZR_REVNO_CMD +# @DESCRIPTION: +# The Bazaar command to list a revision number of the branch. +: ${EBZR_REVNO_CMD:="brz revno"} + +# @ECLASS-VARIABLE: EBZR_OPTIONS +# @DEFAULT_UNSET +# @DESCRIPTION: +# The options passed to the fetch and update commands. + +# @ECLASS-VARIABLE: EBZR_REPO_URI +# @DEFAULT_UNSET +# @REQUIRED +# @DESCRIPTION: +# The repository URI for the source package. + +# @ECLASS-VARIABLE: EBZR_PROJECT +# @DESCRIPTION: +# The project name of your ebuild. Normally, the branch will be stored +# in the ${EBZR_STORE_DIR}/${EBZR_PROJECT} directory. +# +# If EBZR_BRANCH is set (see below), then a shared repository will be +# created in that directory, and the branch will be located in +# ${EBZR_STORE_DIR}/${EBZR_PROJECT}/${EBZR_BRANCH}. +: ${EBZR_PROJECT:=${PN}} + +# @ECLASS-VARIABLE: EBZR_BRANCH +# @DEFAULT_UNSET +# @DESCRIPTION: +# The directory where to store the branch within a shared repository, +# relative to ${EBZR_STORE_DIR}/${EBZR_PROJECT}. +# +# This variable should be set if there are several live ebuilds for +# different branches of the same upstream project. The branches can +# then share the same repository in EBZR_PROJECT, which will save both +# data traffic volume and disk space. +# +# If there is only a live ebuild for one single branch, EBZR_BRANCH +# needs not be set. In this case, the branch will be stored in a +# stand-alone repository directly in EBZR_PROJECT. + +# @ECLASS-VARIABLE: EBZR_REVISION +# @DEFAULT_UNSET +# @DESCRIPTION: +# Revision to fetch, defaults to the latest (see brz help revisionspec). + +# @ECLASS-VARIABLE: EBZR_OFFLINE +# @USER_VARIABLE +# @DESCRIPTION: +# Set this variable to a non-empty value to disable automatic updating +# of a bzr source tree. This is intended to be set outside the ebuild +# by users. +: ${EBZR_OFFLINE=${EVCS_OFFLINE}} + +# @ECLASS-VARIABLE: EVCS_UMASK +# @USER_VARIABLE +# @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: +# If this variable is set to a non-empty value, EBZR_CHECKOUT_CMD will +# be used instead of EBZR_EXPORT_CMD to copy the sources to WORKDIR. + +# @FUNCTION: _bzr_initial_fetch +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Internal function, retrieves the source code from a repository for the +# first time, using ${EBZR_FETCH_CMD}. +_bzr_initial_fetch() { + local repo_uri=$1 branch_dir=$2 + + if [[ -n ${EBZR_OFFLINE} ]]; then + die "EBZR_OFFLINE cannot be used when there is no local branch yet." + fi + + # fetch branch + einfo "bzr branch start -->" + einfo " repository: ${repo_uri} => ${branch_dir}" + + ${EBZR_FETCH_CMD} ${EBZR_OPTIONS} "${repo_uri}" "${branch_dir}" \ + || die "${ECLASS}: can't branch from ${repo_uri}" +} + +# @FUNCTION: _bzr_update +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Internal function, updates the source code from a repository, using +# ${EBZR_UPDATE_CMD}. +_bzr_update() { + local repo_uri=$1 branch_dir=$2 + + if [[ -n ${EBZR_OFFLINE} ]]; then + einfo "skipping bzr pull -->" + einfo " repository: ${repo_uri}" + else + # update branch + einfo "bzr pull start -->" + einfo " repository: ${repo_uri}" + + pushd "${branch_dir}" > /dev/null \ + || die "${ECLASS}: can't chdir to ${branch_dir}" + ${EBZR_UPDATE_CMD} ${EBZR_OPTIONS} "${repo_uri}" \ + || die "${ECLASS}: can't pull from ${repo_uri}" + popd > /dev/null || die "${ECLASS}: popd failed" + fi +} + +# @FUNCTION: bzr_fetch +# @DESCRIPTION: +# Wrapper function to fetch sources from a Bazaar repository with +# bzr branch or bzr pull, depending on whether there is an existing +# working copy. +bzr_fetch() { + local repo_dir branch_dir save_umask + + [[ -n ${EBZR_REPO_URI} ]] || die "${ECLASS}: EBZR_REPO_URI is empty" + + if [[ ! -d ${EBZR_STORE_DIR} ]]; then + ( + addwrite / + mkdir -p "${EBZR_STORE_DIR}" \ + || die "${ECLASS}: can't mkdir ${EBZR_STORE_DIR}" + ) + fi + + pushd "${EBZR_STORE_DIR}" > /dev/null \ + || die "${ECLASS}: can't chdir to ${EBZR_STORE_DIR}" + + repo_dir=${EBZR_STORE_DIR}/${EBZR_PROJECT} + branch_dir=${repo_dir}${EBZR_BRANCH:+/${EBZR_BRANCH}} + + if [[ -n ${EVCS_UMASK} ]]; then + save_umask=$(umask) || die + umask "${EVCS_UMASK}" || die + fi + addwrite "${EBZR_STORE_DIR}" + + if [[ ! -d ${branch_dir}/.bzr ]]; then + if [[ ${repo_dir} != "${branch_dir}" && ! -d ${repo_dir}/.bzr ]]; then + einfo "creating shared bzr repository: ${repo_dir}" + ${EBZR_INIT_REPO_CMD} "${repo_dir}" \ + || die "${ECLASS}: can't create shared repository" + fi + _bzr_initial_fetch "${EBZR_REPO_URI}" "${branch_dir}" + else + _bzr_update "${EBZR_REPO_URI}" "${branch_dir}" + fi + + if [[ -n ${save_umask} ]]; then + umask "${save_umask}" || die + fi + + cd "${branch_dir}" || die "${ECLASS}: can't chdir to ${branch_dir}" + + # Save revision number in environment. #311101 + export EBZR_REVNO=$(${EBZR_REVNO_CMD}) + + if [[ -n ${EBZR_WORKDIR_CHECKOUT} ]]; then + einfo "checking out ..." + ${EBZR_CHECKOUT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \ + . "${EBZR_UNPACK_DIR}" || die "${ECLASS}: checkout failed" + else + einfo "exporting ..." + ${EBZR_EXPORT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \ + "${EBZR_UNPACK_DIR}" . || die "${ECLASS}: export failed" + fi + einfo \ + "revision ${EBZR_REVISION:-${EBZR_REVNO}} is now in ${EBZR_UNPACK_DIR}" + + popd > /dev/null || die "${ECLASS}: popd failed" +} + +# @FUNCTION: bzr_src_unpack +# @DESCRIPTION: +# Default src_unpack(), calls bzr_fetch. +bzr_src_unpack() { + bzr_fetch +} diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 1326809a8bc1..3513a74c4db4 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -369,8 +369,11 @@ distutils_enable_sphinx() { # of RDEPEND to test?-BDEPEND. The test-runner argument must be one of: # # - nose: nosetests (dev-python/nose) +# # - pytest: dev-python/pytest +# # - setup.py: setup.py test (no deps included) +# # - unittest: for built-in Python unittest module # # Additionally, if --install is passed as the first parameter, @@ -618,6 +621,7 @@ _distutils-r1_handle_pyproject_toml() { } # @FUNCTION: _distutils-r1_check_all_phase_mismatch +# @INTERNAL # @DESCRIPTION: # Verify whether *_all phase impls is not called from from non-*_all # subphase. diff --git a/eclass/mozcoreconf-v6.eclass b/eclass/mozcoreconf-v6.eclass index 95fce0f0258d..250f49bd58bd 100644 --- a/eclass/mozcoreconf-v6.eclass +++ b/eclass/mozcoreconf-v6.eclass @@ -4,7 +4,7 @@ # @ECLASS: mozcoreconf-v6.eclass # @MAINTAINER: # Mozilla team -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: core options and configuration functions for mozilla # @DESCRIPTION: # @@ -28,7 +28,7 @@ case "${EAPI:-0}" in inherit multilib versionator DEPEND+=" ${BDEPEND}" ;; - 7) + 7|8) ;; *) die "EAPI ${EAPI} is not supported, contact eclass maintainers" @@ -120,7 +120,8 @@ moz_pkgsetup() { # workaround to set python3 into PYTHON3 until mozilla doesn't need py2 if [[ "${PYTHON_COMPAT[@]}" != "${PYTHON_COMPAT[@]#python3*}" ]]; then export PYTHON3=${PYTHON} - python_export python2_7 PYTHON EPYTHON + export PYTHON=python2.7 + export EPYTHON="${EPREFIX}"/usr/bin/python2.7 fi } diff --git a/eclass/mozextension.eclass b/eclass/mozextension.eclass index 3966dfd9f53f..53f27ed782c3 100644 --- a/eclass/mozextension.eclass +++ b/eclass/mozextension.eclass @@ -17,8 +17,6 @@ if [[ ! ${_MOZEXTENSION} ]]; then # paths specified in the eclass. : ${MOZEXTENSION_TARGET:=""} -inherit eutils - DEPEND="app-arch/unzip" mozversion_extension_location() { diff --git a/eclass/mozlinguas-v2.eclass b/eclass/mozlinguas-v2.eclass index f8e3c95d8824..5063445ae933 100644 --- a/eclass/mozlinguas-v2.eclass +++ b/eclass/mozlinguas-v2.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Nirbheek Chauhan # Ian Stakenvicius -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: Handle language packs for mozilla products # @DESCRIPTION: # Sets IUSE according to MOZ_LANGS (language packs available). Also exports @@ -19,7 +19,7 @@ inherit mozextension case "${EAPI:-0}" in 6) inherit eapi7-ver ;; - 7) + 7|8) ;; *) die "EAPI ${EAPI} is not supported, contact eclass maintainers" ;; diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass index 7652a8625184..0d7a1aa50f39 100644 --- a/eclass/postgres.eclass +++ b/eclass/postgres.eclass @@ -28,7 +28,7 @@ esac # @DESCRIPTION: # List of versions to reverse sort POSTGRES_COMPAT slots -_POSTGRES_ALL_VERSIONS=( 9999 13 12 11 10 9.6 9.5 9.4 9.3 9.2 ) +_POSTGRES_ALL_VERSIONS=( 9999 14 13 12 11 10 9.6 9.5 9.4 9.3 9.2 ) diff --git a/eclass/savedconfig.eclass b/eclass/savedconfig.eclass index e90a9b618d6b..c4fd0c492f45 100644 --- a/eclass/savedconfig.eclass +++ b/eclass/savedconfig.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: savedconfig.eclass @@ -146,14 +146,10 @@ restore_config() { treecopy . "${dest}" || die "Failed to restore ${found} to $1" popd > /dev/null else - # maybe the user is screwing around with perms they shouldnt #289168 - if [[ ! -r ${base} ]] ; then - eerror "Unable to read ${base} -- please check its permissions." - die "Reading config files failed" - fi ewarn "No saved config to restore - please remove USE=savedconfig or" ewarn "provide a configuration file in ${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PN}" - ewarn "Your config file(s) will not be used this time" + ewarn "and ensure the build process has permission to access it." + ewarn "Your config file(s) will not be used this time." fi } -- cgit v1.2.3