mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-28 00:51:41 +02:00
eclass/git-r3: Sync with Gentoo
It's from Gentoo commit 0dbbdfc6c6485614f2f84914dec2326cdb2a08e9.
This commit is contained in:
parent
52344a97d7
commit
de985a5696
@ -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
|
||||
|
||||
# @ECLASS: git-r3.eclass
|
||||
# @MAINTAINER:
|
||||
# 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.
|
||||
# @DESCRIPTION:
|
||||
# Third generation eclass for easing maintenance of live ebuilds using
|
||||
# git as remote repository.
|
||||
|
||||
case ${EAPI:-0} in
|
||||
5|6|7|8) ;;
|
||||
case ${EAPI} in
|
||||
6|7|8) ;;
|
||||
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
||||
esac
|
||||
|
||||
EXPORT_FUNCTIONS src_unpack
|
||||
|
||||
if [[ ! ${_GIT_R3} ]]; then
|
||||
if [[ -z ${_GIT_R3_ECLASS} ]]; then
|
||||
_GIT_R3_ECLASS=1
|
||||
|
||||
PROPERTIES+=" live"
|
||||
|
||||
if [[ ${EAPI} != [56] ]]; then
|
||||
if [[ ${EAPI} != 6 ]]; then
|
||||
BDEPEND=">=dev-vcs/git-1.8.2.1[curl]"
|
||||
else
|
||||
DEPEND=">=dev-vcs/git-1.8.2.1[curl]"
|
||||
@ -559,8 +558,6 @@ git-r3_fetch() {
|
||||
local commit_id=${2:-${EGIT_COMMIT}}
|
||||
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:
|
||||
# 1) kill .git suffix,
|
||||
# 2) underscore (remaining) non-variable characters,
|
||||
@ -602,7 +599,6 @@ git-r3_fetch() {
|
||||
done
|
||||
einfo
|
||||
fi
|
||||
fi
|
||||
|
||||
# set final variables after applying overrides
|
||||
local branch=${branch_name:+refs/heads/${branch_name}}
|
||||
@ -1079,5 +1075,6 @@ git-r3_pkg_needrebuild() {
|
||||
# 'export' locally until this gets into EAPI
|
||||
pkg_needrebuild() { git-r3_pkg_needrebuild; }
|
||||
|
||||
_GIT_R3=1
|
||||
fi
|
||||
|
||||
EXPORT_FUNCTIONS src_unpack
|
||||
|
Loading…
x
Reference in New Issue
Block a user