dev-lang/perl: Use modulo arithmetic to determine subslot from version
authorKent Fredric <kentnl@gentoo.org>
Sun, 21 May 2017 13:54:15 +0000 (01:54 +1200)
committerKent Fredric <kentnl@gentoo.org>
Sun, 21 May 2017 15:05:01 +0000 (03:05 +1200)
Package-Manager: Portage-2.3.5, Repoman-2.3.2

dev-lang/perl/perl-5.26.9999.ebuild

index 58540d5d313e38af818958b201e753a675047f6f..5cc952c7498a9457b068b5b355b6444316a6246f 100644 (file)
@@ -19,15 +19,17 @@ PERL_BIN_OLDVERSEN=""
 PERL_OLDVERSEN="5.26.0-RC1 5.25.12 5.25.11 5.24.2 5.24.1 5.24.0 5.22.3 5.22.2 5.22.1 5.22.0"
 if [[ "${PV##*.}" == "9999" ]]; then
        DIST_VERSION=5.26.0-RC1
-       # Devel Releases are not ABI-intercompatible
-       # remove only trailing RC
-       SUBSLOT="${DIST_VERSION%-RC*}"
 else
        DIST_VERSION="${PV/_rc/-RC}"
-       # First 2 digits only
-       SUBSLOT="${DIST_VERSION%.*}"
 fi
 SHORT_PV="${DIST_VERSION%.*}"
+# Even numbered major versions are ABI intercompatible
+# Odd numbered major versions are not
+if [[ $(( "${SHORT_PV#*.}" % 2 )) == 1 ]]; then
+       SUBSLOT="${DIST_VERSION%-RC*}"
+else
+       SUBSLOT="${DIST_VERSION%.*}"
+fi
 # Used only in tar paths
 MY_P="perl-${DIST_VERSION}"
 # Used in library paths