• [gentoo-dev] [PATCH v2 1/6] bzr.eclass: Reinstate eclass

    From =?UTF-8?q?Ulrich=20M=C3=BCller?=@21:1/5 to All on Sat Sep 25 14:40:01 2021
    Taken from commit 320fcf034f5e860454e0d2a28ed405c5b843c60c.

    Signed-off-by: Ulrich Müller <ulm@gentoo.org>
    ---
    eclass/bzr.eclass | 289 ++++++++++++++++++++++++++++++++++++++++++++++
    1 file changed, 289 insertions(+)
    create mode 100644 eclass/bzr.eclass

    diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass
    new file mode 100644
    index 000000000000..fc1de9dc9ccc
    --- /dev/null
    +++ b/eclass/bzr.eclass
    @@ -0,0 +1,289 @@
    +# Copyright 1999-2019 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# @ECLASS: bzr.eclass
    +# @MAINTAINER:
    +# Ulrich Müller <ulm@gentoo.org>
    +# @AUTHOR:
    +# Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
    +# Mark Lee <bzr-gentoo-overlay@lazymalevolence.com>
    +# Ulrich Müller <ulm@gentoo.org>
    +# Christian Faulhammer <fauli@gentoo.org>
    +# @SUPPORTED_EAPIS: 2 3 4 5 6 7
    +# @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.
    +#
    +# N
  • From =?UTF-8?q?Ulrich=20M=C3=BCller?=@21:1/5 to All on Sat Sep 25 14:40:02 2021
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>
    ---
    eclass/bzr.eclass | 39 +++++++++++++++------------------------
    1 file changed, 15 insertions(+), 24 deletions(-)

    diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass
    index fc1de9dc9ccc..e76af5d41d57 100644
    --- a/eclass/bzr.eclass
    +++ b/eclass/bzr.eclass
    @@ -1,4 +1,4 @@
    -# Copyright 1999-2019 Gentoo Authors
    +# Copyright 1999-2021 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # @ECLASS: bzr.eclass
    @@ -9,7 +9,7 @@
    # Mark Lee <bzr-gentoo-overlay@lazymalevolence.com>
    # Ulrich Müller <ulm@gentoo.org>
    # Christian Faulhammer <fauli@gentoo.org>
    -# @SUPPORTED_EAPIS: 2 3 4 5 6 7
    +# @SUPPORTED_EAPIS: 7 8
    # @BLURB: generic fetching functions for the Bazaar VCS
    # @DESCRIPTION:
    # The bzr.eclass provides functions to fetch and unpack sources from
    @@ -21,20 +21,15 @@

    EBZR="bzr.eclass"

    -PROPERTIES+=" live"
    -
    -if [[ ${EBZR_REPO_URI%%:*} = sftp ]]; then
    - DEPEND=">=dev-vcs/bzr-2.6.0[sftp]"
    -else
    - DEPEND=">=dev-vcs/bzr-2.6.0"
    -fi
    -
    -case ${E
  • From =?UTF-8?q?Ulrich=20M=C3=BCller?=@21:1/5 to All on Sat Sep 25 14:40:02 2021
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>
    ---
    eclass/bzr.eclass | 7 +++----
    1 file changed, 3 insertions(+), 4 deletions(-)

    diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass
    index d5ac999aeb8c..de73aed7f676 100644
    --- a/eclass/bzr.eclass
    +++ b/eclass/bzr.eclass
    @@ -158,8 +158,8 @@ EXPORT_FUNCTIONS src_unpack
    _bzr_initial_fetch() {
    local repo_uri=$1 branch_dir=$2

    - if [[ -n "${EBZR_OFFLINE}" ]]; then
    - ewarn "EBZR_OFFLINE cannot be used when there is no local branch yet."
    + if [[ -n ${EBZR_OFFLINE} ]]; then
    + die "EBZR_OFFLINE cannot be used when there is no local branch yet."
    fi

    # fetch branch
    @@ -179,7 +179,7 @@ _bzr_initial_fetch() {
    _bzr_update() {
    local repo_uri=$1 branch_dir=$2

    - if [[ -n "${EBZR_OFFLINE}" ]]; then
    + if [[ -n ${EBZR_OFFLINE} ]]; then
    einfo "skipping bzr pull -->"
    einfo " repository: ${repo_uri}"
    else
    @@ -241,7 +241,6 @@ bzr_fetch() {
    _bzr_initial_fetch "${EBZR_INITIAL_URI}" "${branch_dir}"
    if [[ ${EBZR_REPO_URI} != "${EBZR_INITIAL_URI}" ]]; then
    EBZR_UPDATE
  • From =?UTF-8?q?Ulrich=20M=C3=BCller?=@21:1/5 to All on Sat Sep 25 14:40:02 2021
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>
    ---
    eclass/bzr.eclass | 18 ++++++++----------
    1 file changed, 8 insertions(+), 10 deletions(-)

    diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass
    index de73aed7f676..5dd5d40c13fa 100644
    --- a/eclass/bzr.eclass
    +++ b/eclass/bzr.eclass
    @@ -201,16 +201,16 @@ _bzr_update() {
    # bzr branch or bzr pull, depending on whether there is an existing
    # working copy.
    bzr_fetch() {
    - local repo_dir branch_dir
    - local save_sandbox_write=${SANDBOX_WRITE} save_umask
    + 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}"
    - SANDBOX_WRITE=${save_sandbox_write}
    + 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 \
    @@ -220,7 +220,7 @@ bzr_fetch() {
  • From =?UTF-8?q?Ulrich=20M=C3=BCller?=@21:1/5 to All on Sat Sep 25 14:40:02 2021
    This should not make any functional difference.

    Signed-off-by: Ulrich Müller <ulm@gentoo.org>
    ---
    eclass/bzr.eclass | 47 +++++++++++++++++++++++++----------------------
    1 file changed, 25 insertions(+), 22 deletions(-)

    diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass
    index e76af5d41d57..d5ac999aeb8c 100644
    --- a/eclass/bzr.eclass
    +++ b/eclass/bzr.eclass
    @@ -19,11 +19,9 @@
    # 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}.

    -EBZR="bzr.eclass"
    -
    case ${EAPI} in
    7|8) ;;
    - *) die "${EBZR}: EAPI ${EAPI:-0} is not supported" ;;
    + *) die "${ECLASS}: EAPI ${EAPI:-0} is not supported" ;;
    esac

    PROPERTIES+=" live"
    @@ -33,6 +31,7 @@ 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}
    @@ -125,6 +124,7 @@ EXPORT_FUNCTIONS src_unpack
    # Revision to fetch, defaults to the latest (see brz help revi