eclass/git-r3: Sync with Gentoo

It's from Gentoo commit 0dbbdfc6c6485614f2f84914dec2326cdb2a08e9.
This commit is contained in:
Flatcar Buildbot 2023-03-20 07:24:27 +00:00
parent 52344a97d7
commit de985a5696

View File

@ -1,27 +1,26 @@
# Copyright 1999-2021 Gentoo Authors # Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# @ECLASS: git-r3.eclass # @ECLASS: git-r3.eclass
# @MAINTAINER: # @MAINTAINER:
# Michał Górny <mgorny@gentoo.org> # Michał Górny <mgorny@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7 8 # @SUPPORTED_EAPIS: 6 7 8
# @BLURB: Eclass for fetching and unpacking git repositories. # @BLURB: Eclass for fetching and unpacking git repositories.
# @DESCRIPTION: # @DESCRIPTION:
# Third generation eclass for easing maintenance of live ebuilds using # Third generation eclass for easing maintenance of live ebuilds using
# git as remote repository. # git as remote repository.
case ${EAPI:-0} in case ${EAPI} in
5|6|7|8) ;; 6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac esac
EXPORT_FUNCTIONS src_unpack if [[ -z ${_GIT_R3_ECLASS} ]]; then
_GIT_R3_ECLASS=1
if [[ ! ${_GIT_R3} ]]; then
PROPERTIES+=" live" PROPERTIES+=" live"
if [[ ${EAPI} != [56] ]]; then if [[ ${EAPI} != 6 ]]; then
BDEPEND=">=dev-vcs/git-1.8.2.1[curl]" BDEPEND=">=dev-vcs/git-1.8.2.1[curl]"
else else
DEPEND=">=dev-vcs/git-1.8.2.1[curl]" DEPEND=">=dev-vcs/git-1.8.2.1[curl]"
@ -559,8 +558,6 @@ git-r3_fetch() {
local commit_id=${2:-${EGIT_COMMIT}} local commit_id=${2:-${EGIT_COMMIT}}
local commit_date=${4:-${EGIT_COMMIT_DATE}} local commit_date=${4:-${EGIT_COMMIT_DATE}}
# support new override API for EAPI 6+
if [[ ${EAPI} != 5 ]]; then
# get the name and do some more processing: # get the name and do some more processing:
# 1) kill .git suffix, # 1) kill .git suffix,
# 2) underscore (remaining) non-variable characters, # 2) underscore (remaining) non-variable characters,
@ -602,7 +599,6 @@ git-r3_fetch() {
done done
einfo einfo
fi fi
fi
# set final variables after applying overrides # set final variables after applying overrides
local branch=${branch_name:+refs/heads/${branch_name}} local branch=${branch_name:+refs/heads/${branch_name}}
@ -1079,5 +1075,6 @@ git-r3_pkg_needrebuild() {
# 'export' locally until this gets into EAPI # 'export' locally until this gets into EAPI
pkg_needrebuild() { git-r3_pkg_needrebuild; } pkg_needrebuild() { git-r3_pkg_needrebuild; }
_GIT_R3=1
fi fi
EXPORT_FUNCTIONS src_unpack