[Jython-checkins] jython: Fix so that custom installs can deselect ensurepip

jim.baker jython-checkins at python.org
Thu Apr 2 01:57:27 CEST 2015


https://hg.python.org/jython/rev/537dc308b9a1
changeset:   7638:537dc308b9a1
user:        Jim Baker <jim.baker at rackspace.com>
date:        Wed Apr 01 15:51:57 2015 -0600
summary:
  Fix so that custom installs can deselect ensurepip

files:
  installer/src/java/org/python/util/install/ChildProcess.java         |   2 -
  installer/src/java/org/python/util/install/FrameInstaller.java       |  17 +++++++--
  installer/src/java/org/python/util/install/InstallationType.java     |   8 +++-
  installer/src/java/org/python/util/install/InstallerCommandLine.java |   6 +++
  installer/src/java/org/python/util/install/TypePage.java             |   6 +++
  5 files changed, 30 insertions(+), 9 deletions(-)


diff --git a/installer/src/java/org/python/util/install/ChildProcess.java b/installer/src/java/org/python/util/install/ChildProcess.java
--- a/installer/src/java/org/python/util/install/ChildProcess.java
+++ b/installer/src/java/org/python/util/install/ChildProcess.java
@@ -1,5 +1,3 @@
-// FIXME change to ProcessBuilder so we can set environment variables (specifically LC_ALL=C)
-
 package org.python.util.install;
 
 import java.io.BufferedReader;
diff --git a/installer/src/java/org/python/util/install/FrameInstaller.java b/installer/src/java/org/python/util/install/FrameInstaller.java
--- a/installer/src/java/org/python/util/install/FrameInstaller.java
+++ b/installer/src/java/org/python/util/install/FrameInstaller.java
@@ -22,6 +22,7 @@
     private static final String INEX_DEMO_PROPERTY = "FrameInstaller.demo";
     private static final String INEX_DOC_PROPERTY = "FrameInstaller.doc";
     private static final String INEX_SRC_PROPERTY = "FrameInstaller.src";
+    private static final String INEX_ENSUREPIP_PROPERTY = "FrameInstaller.ensurepip";
     private static final String STANDALONE_PROPERTY = "FrameInstaller.standalone";
 
     private static Properties _properties = new Properties();
@@ -97,29 +98,34 @@
 
     protected static InstallationType getInstallationType() {
         InstallationType installationType = new InstallationType();
-        if (Boolean.valueOf(getProperty(STANDALONE_PROPERTY)).booleanValue()) {
+        if (Boolean.valueOf(getProperty(STANDALONE_PROPERTY))) {
             installationType.setStandalone();
         }
-        if (Boolean.valueOf(getProperty(INEX_MOD_PROPERTY)).booleanValue()) {
+        if (Boolean.valueOf(getProperty(INEX_MOD_PROPERTY))) {
             installationType.addLibraryModules();
         } else {
             installationType.removeLibraryModules();
         }
-        if (Boolean.valueOf(getProperty(INEX_DEMO_PROPERTY)).booleanValue()) {
+        if (Boolean.valueOf(getProperty(INEX_DEMO_PROPERTY))) {
             installationType.addDemosAndExamples();
         } else {
             installationType.removeDemosAndExamples();
         }
-        if (Boolean.valueOf(getProperty(INEX_DOC_PROPERTY)).booleanValue()) {
+        if (Boolean.valueOf(getProperty(INEX_DOC_PROPERTY))) {
             installationType.addDocumentation();
         } else {
             installationType.removeDocumentation();
         }
-        if (Boolean.valueOf(getProperty(INEX_SRC_PROPERTY)).booleanValue()) {
+        if (Boolean.valueOf(getProperty(INEX_SRC_PROPERTY))) {
             installationType.addSources();
         } else {
             installationType.removeSources();
         }
+        if (Boolean.valueOf(getProperty(INEX_ENSUREPIP_PROPERTY))) {
+            installationType.addEnsurepip();
+        } else {
+            installationType.removeEnsurepip();
+        }
         return installationType;
     }
 
@@ -129,6 +135,7 @@
         setProperty(INEX_DEMO_PROPERTY, Boolean.toString(installationType.installDemosAndExamples()));
         setProperty(INEX_DOC_PROPERTY, Boolean.toString(installationType.installDocumentation()));
         setProperty(INEX_SRC_PROPERTY, Boolean.toString(installationType.installSources()));
+        setProperty(INEX_ENSUREPIP_PROPERTY, Boolean.toString(installationType.ensurepip()));
     }
 
     protected static JavaVersionInfo getJavaVersionInfo() {
diff --git a/installer/src/java/org/python/util/install/InstallationType.java b/installer/src/java/org/python/util/install/InstallationType.java
--- a/installer/src/java/org/python/util/install/InstallationType.java
+++ b/installer/src/java/org/python/util/install/InstallationType.java
@@ -61,9 +61,13 @@
         _installSources = false;
     }
 
-    public void addEnsurepip() { _ensurepip = true; }
+    public void addEnsurepip() {
+        _ensurepip = true;
+    }
 
-    public void removeEnsurepip() { _ensurepip = false; }
+    public void removeEnsurepip() {
+        _ensurepip = false;
+    }
 
     public void setStandalone() {
         _isStandalone = true;
diff --git a/installer/src/java/org/python/util/install/InstallerCommandLine.java b/installer/src/java/org/python/util/install/InstallerCommandLine.java
--- a/installer/src/java/org/python/util/install/InstallerCommandLine.java
+++ b/installer/src/java/org/python/util/install/InstallerCommandLine.java
@@ -354,6 +354,9 @@
                 if (INEXCLUDE_SOURCES.equals(includeParts[i])) {
                     installationType.addSources();
                 }
+                if (INEXCLUDE_ENSUREPIP.equals(includeParts[i])) {
+                    installationType.addEnsurepip();
+                }
             }
         }
         // remove parts to exclude
@@ -372,6 +375,9 @@
                 if (INEXCLUDE_SOURCES.equals(excludeParts[i])) {
                     installationType.removeSources();
                 }
+                if (INEXCLUDE_ENSUREPIP.equals(excludeParts[i])) {
+                    installationType.removeEnsurepip();
+                }
             }
         }
         return installationType;
diff --git a/installer/src/java/org/python/util/install/TypePage.java b/installer/src/java/org/python/util/install/TypePage.java
--- a/installer/src/java/org/python/util/install/TypePage.java
+++ b/installer/src/java/org/python/util/install/TypePage.java
@@ -254,6 +254,12 @@
                     } else {
                         installationType.removeSources();
                     }
+                } else if (InstallerCommandLine.INEXCLUDE_ENSUREPIP.equals(actionCommand)) {
+                    if (selected) {
+                        installationType.addEnsurepip();
+                    } else {
+                        installationType.removeEnsurepip();
+                    }
                 }
             }
             FrameInstaller.setInstallationType(installationType);

-- 
Repository URL: https://hg.python.org/jython


More information about the Jython-checkins mailing list