Signed-off-by: Michał Górny <mgo...@gentoo.org>
---
 eclass/vcs-snapshot.eclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/eclass/vcs-snapshot.eclass b/eclass/vcs-snapshot.eclass
index dbca6fd586d2..c01cf01f052c 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}
@@ -81,6 +82,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
@@ -96,4 +98,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
 }
-- 
2.22.0


Reply via email to