From 1e0ad6d08155b666197186fa854ad468042f8249 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 25 Jul 2019 08:24:07 +0200 Subject: vcs-snapshot.eclass: Detect unnecessary usage and complain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- eclass/vcs-snapshot.eclass | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'eclass') diff --git a/eclass/vcs-snapshot.eclass b/eclass/vcs-snapshot.eclass index d3f7025fbb35..05d963917e25 100644 --- a/eclass/vcs-snapshot.eclass +++ b/eclass/vcs-snapshot.eclass @@ -58,6 +58,7 @@ EXPORT_FUNCTIONS src_unpack vcs-snapshot_src_unpack() { debug-print-function ${FUNCNAME} "${@}" + local renamed_any= local f for f in ${A} @@ -82,6 +83,7 @@ vcs-snapshot_src_unpack() { done die "${FUNCNAME}: Invalid directory structure in archive ${f}" fi + [[ ${topdirs[0]} != ${f%.tar*} ]] && renamed_any=1 mkdir "${destdir}" || die # -o (--no-same-owner) to avoid restoring original owner @@ -97,4 +99,14 @@ vcs-snapshot_src_unpack() { ;; esac done + + if [[ ! ${renamed_any} ]]; then + local w=eerror + [[ ${EAPI} == [0123456] ]] && 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." + + [[ ${w} == eerror ]] && die "${FUNCNAME}: Unnecessary usage detected" + fi } -- cgit v1.2.3-65-gdbad