On Sat, 30 Jul 2016 07:37:08 +0200 Michał Górny wrote:
> > @@ -116,7 +123,8 @@ ESVN_PROJECT="${ESVN_PROJECT:-${PN/-svn}}"
> >  
> >  # @ECLASS-VARIABLE: ESVN_BOOTSTRAP
> >  # @DESCRIPTION:
> > -# bootstrap script or command like autogen.sh or etc..
> > +# Bootstrap script or command like autogen.sh or etc..
> > +# Removed in EAPI 6 and later.
> >  ESVN_BOOTSTRAP="${ESVN_BOOTSTRAP:-}"
> >  
> >  # @ECLASS-VARIABLE: ESVN_PATCHES
> > @@ -127,6 +135,8 @@ ESVN_BOOTSTRAP="${ESVN_BOOTSTRAP:-}"
> >  #
> >  # Patches are searched both in ${PWD} and ${FILESDIR}, if not found in 
> > either
> >  # location, the installation dies.
> > +#
> > +# Removed in EAPI 6 and later, use PATCHES instead.
> >  ESVN_PATCHES="${ESVN_PATCHES:-}"
> 
> It would be a good idea to check if the variables are set and die if
> they are, so people don't accidentally use them.

Impossible to implement. These variables (as well as all other
ESVN_* variables) are usually set after subversion eclass is
inherited. And even if I'll duplicate this check in all available
functions (which is ridiculous by itself), it still will not help,
since several functions are removed from EAPI 6 and people may
rely on default behaviour of src_prepare() alone.

> >  # @ECLASS-VARIABLE: ESVN_RESTRICT
> > @@ -355,7 +365,10 @@ subversion_fetch() {
> >  # @FUNCTION: subversion_bootstrap
> >  # @DESCRIPTION:
> >  # Apply patches in ${ESVN_PATCHES} and run ${ESVN_BOOTSTRAP} if specified.
> > +# Removed in EAPI 6 and later.
> >  subversion_bootstrap() {
> > +   has "${EAPI:-0}" 6 && die "${FUNCNAME[1]} is removed from 
> > subversion.eclass in EAPI 6 and later"
> > +
> 
> Reverse the logic. This will require updating in every EAPI while it is
> rather unlikely the next EAPIs will return to previous behavior.

Done.

Best regards,
Andrew Savchenko
diff --git a/eclass/subversion.eclass b/eclass/subversion.eclass
index c45c725..766c3f7 100644
--- a/eclass/subversion.eclass
+++ b/eclass/subversion.eclass
@@ -21,10 +21,17 @@ case "${EAPI:-0}" in
 		EXPORT_FUNCTIONS src_unpack pkg_preinst
 		DEPEND="dev-vcs/subversion"
 		;;
-	*)
+	2|3|4|5)
 		EXPORT_FUNCTIONS src_unpack src_prepare pkg_preinst
 		DEPEND="|| ( dev-vcs/subversion[http] dev-vcs/subversion[webdav-neon] dev-vcs/subversion[webdav-serf] )"
 		;;
+	6)
+		EXPORT_FUNCTIONS src_unpack pkg_preinst
+		DEPEND="|| ( dev-vcs/subversion[http] dev-vcs/subversion[webdav-neon] dev-vcs/subversion[webdav-serf] )"
+		;;
+	*)
+		die "EAPI ${EAPI} is not supported in subversion.eclass"
+		;;
 esac
 
 DEPEND+=" net-misc/rsync"
@@ -116,7 +123,8 @@ ESVN_PROJECT="${ESVN_PROJECT:-${PN/-svn}}"
 
 # @ECLASS-VARIABLE: ESVN_BOOTSTRAP
 # @DESCRIPTION:
-# bootstrap script or command like autogen.sh or etc..
+# Bootstrap script or command like autogen.sh or etc..
+# Removed in EAPI 6 and later.
 ESVN_BOOTSTRAP="${ESVN_BOOTSTRAP:-}"
 
 # @ECLASS-VARIABLE: ESVN_PATCHES
@@ -127,6 +135,8 @@ ESVN_BOOTSTRAP="${ESVN_BOOTSTRAP:-}"
 #
 # Patches are searched both in ${PWD} and ${FILESDIR}, if not found in either
 # location, the installation dies.
+#
+# Removed in EAPI 6 and later, use PATCHES instead.
 ESVN_PATCHES="${ESVN_PATCHES:-}"
 
 # @ECLASS-VARIABLE: ESVN_RESTRICT
@@ -355,7 +365,10 @@ subversion_fetch() {
 # @FUNCTION: subversion_bootstrap
 # @DESCRIPTION:
 # Apply patches in ${ESVN_PATCHES} and run ${ESVN_BOOTSTRAP} if specified.
+# Removed in EAPI 6 and later.
 subversion_bootstrap() {
+	[[ ${EAPI} == [012345] ]] || die "${FUNCNAME[1]} is removed from subversion.eclass in EAPI 6 and later"
+
 	if has "export" ${ESVN_RESTRICT}; then
 		return
 	fi
@@ -432,7 +445,9 @@ subversion_src_unpack() {
 # @FUNCTION: subversion_src_prepare
 # @DESCRIPTION:
 # Default src_prepare. Bootstrap.
+# Removed in EAPI 6 and later.
 subversion_src_prepare() {
+	[[ ${EAPI} == [012345] ]] || die "${FUNCNAME[1]} is removed from subversion.eclass in EAPI 6 and later"
 	subversion_bootstrap || die "${ESVN}: unknown problem occurred in subversion_bootstrap."
 }
 

Attachment: pgpBtSNIhNOFL.pgp
Description: PGP signature

Reply via email to