[151473] trunk/dports/sysutils/python2_select/Portfile

larryv at macports.org larryv at macports.org
Tue Aug 16 14:50:06 PDT 2016


Revision: 151473
          https://trac.macports.org/changeset/151473
Author:   larryv at macports.org
Date:     2016-08-16 14:50:05 -0700 (Tue, 16 Aug 2016)
Log Message:
-----------
python2_select: Refactor to reduce repetition

Modified Paths:
--------------
    trunk/dports/sysutils/python2_select/Portfile

Modified: trunk/dports/sysutils/python2_select/Portfile
===================================================================
--- trunk/dports/sysutils/python2_select/Portfile	2016-08-16 21:38:53 UTC (rev 151472)
+++ trunk/dports/sysutils/python2_select/Portfile	2016-08-16 21:50:05 UTC (rev 151473)
@@ -30,43 +30,34 @@
 #   select.entries  [list python2 python2-$pythonNoDot $pythonNoDot]
 
 # install all files
-select.entries              {python2 base} \
-                            {python2 none}
+select.entries      {python2 base} \
+                    {python2 none}
 
-platform darwin 8 {
-    select.entries-append   {python2 python23-apple}
+platform darwin {
+    set apple_pythons [
+        if {${os.major} == 8} {
+            list python23-apple
+        } elseif {${os.major} == 9} {
+            list python25-apple
+        } elseif {${os.major} == 10} {
+            list python25-apple \
+                 python26-apple
+        } elseif {${os.major} == 11} {
+            list python25-apple \
+                 python26-apple \
+                 python27-apple
+        } elseif {${os.major} == 12 || ${os.major} == 13} {
+            list {python25-apple.mtln python25-apple} \
+                 {python26-apple.mtln python26-apple} \
+                 {python27-apple.mtln python27-apple}
+        } elseif {${os.major} == 14} {
+            list {python26-apple.mtln python26-apple} \
+                 {python27-apple.mtln python27-apple}
+        }
+    ]
+    foreach python $apple_pythons {
+        select.entries-append [list python2 {*}$python]
+    }
 }
 
-platform darwin 9 {
-    select.entries-append   {python2 python25-apple}
-}
-
-platform darwin 10 {
-    select.entries-append   {python2 python25-apple} \
-                            {python2 python26-apple}
-}
-
-platform darwin 11 {
-    select.entries-append   {python2 python25-apple} \
-                            {python2 python26-apple} \
-                            {python2 python27-apple}
-}
-
-platform darwin 12 {
-    select.entries-append   {python2 python25-apple.mtln python25-apple} \
-                            {python2 python26-apple.mtln python26-apple} \
-                            {python2 python27-apple.mtln python27-apple}
-}
-
-platform darwin 13 {
-    select.entries-append   {python2 python25-apple.mtln python25-apple} \
-                            {python2 python26-apple.mtln python26-apple} \
-                            {python2 python27-apple.mtln python27-apple}
-}
-
-platform darwin 14 {
-    select.entries-append   {python2 python26-apple.mtln python26-apple} \
-                            {python2 python27-apple.mtln python27-apple}
-}
-
 livecheck.type     none
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160816/31bc762e/attachment.html>


More information about the macports-changes mailing list