eclass/vcs-snapshot: Sync with gentoo

It's from gentoo commit 6aaf76e545af2f9489295c214673897994a4ce31.
This commit is contained in:
Krzesimir Nowak 2022-03-03 16:20:18 +01:00
parent b4d6d2916e
commit bf3e9f2eae

View File

@ -1,10 +1,10 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: vcs-snapshot.eclass
# @MAINTAINER:
# mgorny@gentoo.org
# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: support eclass for unpacking VCS snapshot tarballs
# @DESCRIPTION:
# THIS ECLASS IS NOT NECESSARY FOR MODERN GITHUB AND GITLAB SNAPSHOTS.
@ -42,12 +42,13 @@
# and however the tarballs were originally packed, all files will appear
# in ${WORKDIR}/${P} and ${WORKDIR}/${P}-otherstuff respectively.
case ${EAPI:-0} in
0|1|2|3|4|5|6|7) ;;
*) die "vcs-snapshot.eclass API in EAPI ${EAPI} not yet established."
case ${EAPI} in
6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
EXPORT_FUNCTIONS src_unpack
if [[ ! ${_VCS_SNAPSHOT_ECLASS} ]]; then
_VCS_SNAPSHOT_ECLASS=1
# @FUNCTION: vcs-snapshot_src_unpack
# @DESCRIPTION:
@ -102,7 +103,7 @@ vcs-snapshot_src_unpack() {
if [[ ! ${renamed_any} ]]; then
local w=eerror
[[ ${EAPI} == [0123456] ]] && w=eqawarn
[[ ${EAPI} == 6 ]] && w=eqawarn
"${w}" "${FUNCNAME} did not find any archives that needed renaming."
"${w}" "Please verify that its usage is really necessary, and remove"
"${w}" "the inherit if it is not."
@ -110,3 +111,7 @@ vcs-snapshot_src_unpack() {
[[ ${w} == eerror ]] && die "${FUNCNAME}: Unnecessary usage detected"
fi
}
fi
EXPORT_FUNCTIONS src_unpack