[Git][java-team/jython][master] 4 commits: Fix d/watch for rc releases

Gilles Filippini gitlab at salsa.debian.org
Mon Mar 9 21:38:17 GMT 2020



Gilles Filippini pushed to branch master at Debian Java Maintainers / jython


Commits:
669b17aa by Gilles Filippini at 2020-03-08T10:10:25+01:00
Fix d/watch for rc releases

- - - - -
70b68ad5 by Gilles Filippini at 2020-03-08T10:10:53+01:00
New upstream version 2.7.2~rc1+repack1
- - - - -
837fe8c1 by Gilles Filippini at 2020-03-08T10:11:33+01:00
Update upstream source from tag 'upstream/2.7.2_rc1+repack1'

Update to upstream version '2.7.2~rc1+repack1'
with Debian dir cbc885d7db8d486e8758e329fb2ef54ab96ef36a
- - - - -
711c99cc by Gilles Filippini at 2020-03-08T10:36:30+01:00
Drop patch 03-default-cachedir.patch

Fixed upstream.

- - - - -


25 changed files:

- .gitignore
- .hgignore
- .hgtags
- Lib/test/test_httpservers.py
- Lib/test/test_import.py
- NEWS
- build.gradle
- build.xml
- debian/changelog
- debian/patches/00-missing-dep.patch
- debian/patches/01-classpath.patch
- − debian/patches/03-default-cachedir.patch
- debian/patches/08-java-backward-compatibility.patch
- debian/patches/javadoc-classpath.patch
- debian/patches/reproducible-builds.patch
- debian/patches/series
- debian/watch
- installer/src/java/org/python/util/install/JarInstaller.java
- registry
- src/org/python/core/PyStringMap.java
- src/org/python/core/PySystemState.java
- src/org/python/core/imp.java
- src/org/python/core/packagecache/CachedJarsPackageManager.java
- src/org/python/expose/generate/ExposeTask.java
- src/org/python/modules/posix/PythonPOSIXHandler.java


Changes:

=====================================
.gitignore
=====================================
@@ -33,13 +33,18 @@ nbbuild.xml
 .DS_Store
 .settings
 __pycache__
-ant.properties
 bin
 
+# Jython specific
+ant.properties
 build
 build2
 cachedir
+.jython_cache
 dist
-target
+publications
+reports
+jffi*.dll
 
 profile.txt
+out


=====================================
.hgignore
=====================================
@@ -35,9 +35,11 @@ ant.properties
 build
 build2
 cachedir
+.jython_cache
 dist
 publications
 reports
+jffi*.dll
 
 profile.txt
 out


=====================================
.hgtags
=====================================
@@ -112,3 +112,4 @@ dd7e191d4c90d9f5d5fe8f0840f186697ecf272a v2.7.1
 dfc49bafbe79566bd54c8d417829e001ff2316ea v2.7.2a1
 328e162ec1178fb38b81b342f84c1268bf21d7fb v2.7.2b1
 b9b60766cabebf007b7584ec21a69b3f58587525 v2.7.2b2
+6d3659465010fd2a8fb11a93953bae5bf9e9db80 v2.7.2b3


=====================================
Lib/test/test_httpservers.py
=====================================
@@ -417,10 +417,7 @@ class CGIHTTPServerTestCase(BaseTestCase):
             os.chdir(self.cwd)
             if self.pythonexe != sys.executable:
                 os.remove(self.pythonexe)
-            os.remove(self.file1_path)
-            os.remove(self.file2_path)
-            os.rmdir(self.cgi_dir)
-            os.rmdir(self.parent_dir)
+            test_support.rmtree(self.parent_dir)
         finally:
             BaseTestCase.tearDown(self)
 


=====================================
Lib/test/test_import.py
=====================================
@@ -142,9 +142,9 @@ class ImportTests(unittest.TestCase):
             # Write a Python file, make it read-only and import it
             with open(fname, 'w') as f:
                 f.write("x = 'original'\n")
-            # Tweak the mtime of the source to ensure pyc gets updated later
+            # Tweak the mtime of the source 10s later to ensure compiled looks out of date
             s = os.stat(fname)
-            os.utime(fname, (s.st_atime, s.st_mtime-100000000))
+            os.utime(fname, (s.st_atime, s.st_mtime+10000))
             os.chmod(fname, 0400)
             m1 = __import__(TESTFN)
             self.assertEqual(m1.x, 'original')


=====================================
NEWS
=====================================
@@ -6,6 +6,12 @@ of that version.
 For more details of issue [ n ], please see https://hg.python.org/jython, or for tags [ GH-n ] see
 https://github.com/jythontools/jython
 
+Jython 2.7.2rc1
+  Bugs fixed
+    - [ 2858 ] test_ssl failure due to embedding Bouncy Castle (doc change only)
+    - [ GH-156 ] Race condition in PyStringMap keys method
+    - [ 2862 ] Jython fails on Linux for normal user when installed by root
+
 Jython 2.7.2b3
   Bugs fixed
     - [ 2810 ] NoSuchMethodError in test_jython_initializer (Java 10+)
@@ -118,6 +124,14 @@ Jython 2.7.2b1
     - There is much improved support for locale, but as a backward-incompatible change, it is
       provided as an opt-in. Define property python.locale.control=settable on the command line
       or via the Jython registry, to enable. This  may become the default in a later version.
+    - The default location of the Jython package cache has moved from the installation directory
+      to the current working directory and is called ".jython_cache". Previously, Jython installed
+      system-wide either exposed the cache as world read-write (a security risk) or disabled it.
+    - BouncyCastle SSL support is incomplete as bundled. The Jython JAR is not signed, and may not
+      be trusted by your JVM as a security provider. This manifests as a PEMException: "Unable to
+      create OpenSSL PBDKF: PBKDF-OpenSSL SecretKeyFactory not available" during certain
+      operations. If this is a problem, place genuine BouncyCastle JARs on the class path, and
+      Jython will use those in preference to the classes we include. The slim JAR is not affected.
 
 Jython 2.7.2a1
   Bugs fixed


=====================================
build.gradle
=====================================
@@ -45,7 +45,7 @@ import java.text.SimpleDateFormat
 // Versions are specified in this grammar:
 // <major> . <minor> ( . <micro> )? ( <release> <serial> )? ( - <word> )?
 
-version = '2.7.2b3'
+version = '2.7.2rc1'
 
 // Valid examples (please preserve in comments):
 //version = '2.7.2a2'


=====================================
build.xml
=====================================
@@ -106,10 +106,10 @@ informix.jar = ../support/jdbc-4.10.12.jar
         <property name="jython.major_version" value="2"/>
         <property name="jython.minor_version" value="7"/>
         <property name="jython.micro_version" value="2"/>
-        <property name="jython.release_level" value="${PY_RELEASE_LEVEL_BETA}"/>
+        <property name="jython.release_level" value="${PY_RELEASE_LEVEL_GAMMA}"/>
 
         <!-- Zero at full release: one-up number for alpha, beta and candidate versions. -->
-        <property name="jython.release_serial" value="3"/>
+        <property name="jython.release_serial" value="1"/>
     </target>
 
     <target name="common-constants">
@@ -157,6 +157,9 @@ informix.jar = ../support/jdbc-4.10.12.jar
         <property name="python.lib" value="${basedir}/lib-python/2.7" />
         <property name="extlibs.dir" value="${basedir}/extlibs" />
 
+        <!-- Cache we need to clean (now it is not in dist.dir) -->
+        <property name="cache.dir" value="${basedir}/.jython_cache" />
+
         <!-- Source specifically for test: -->
         <property name="test.source.dir" value="${basedir}/tests/java" />
         <property name="bugtests.dir" value="${basedir}/bugtests" />
@@ -413,12 +416,14 @@ informix.jar = ../support/jdbc-4.10.12.jar
     <target name="clean" depends="common-dirs, clean-test"
         description="Delete contents of working directories">
         <delete includeemptydirs="true" failonerror="false">
+            <!-- the package cache (now it is not in dist.dir). -->
+            <fileset dir="${cache.dir}" includes="**/*" erroronmissingdir="false" />
             <!-- all files and subdirectories of ${build.dir}, without ${build.dir} itself. -->
             <fileset dir="${build.dir}" includes="**/*" defaultexcludes="false" />
             <!-- all files and subdirectories of ${dist.dir}, without ${dist.dir} itself. -->
             <fileset dir="${dist.dir}" includes="**/*" defaultexcludes="false" />
             <!-- all files and subdirectories of ${pubs.dir}, without ${pubs.dir} itself. -->
-            <fileset dir="${pubs.dir}" includes="**/*" />
+            <fileset dir="${pubs.dir}" includes="**/*" erroronmissingdir="false" />
         </delete>
     </target>
 
@@ -428,7 +433,7 @@ informix.jar = ../support/jdbc-4.10.12.jar
             <!-- all files and subdirectories of ${build.dir}, without ${build.dir} itself. -->
             <fileset dir="${build.dir}" includes="**/*" excludes="gensrc/**" />
             <!-- all files and subdirectories of ${dist.dir}, without ${dist.dir} itself. -->
-            <fileset dir="${dist.dir}" includes="**/*" excludes="cachedir/**, Lib/**" />
+            <fileset dir="${dist.dir}" includes="**/*" excludes="Lib/**" />
         </delete>
     </target>
 
@@ -1190,7 +1195,7 @@ The text for an official release would continue like ...
         </copy>
 
         <echo>building installer .jar file</echo>
-        <jar destfile="${dist.dir}/jython-installer.jar" update="${jar.update}">
+        <jar destfile="${dist.dir}/jython-installer.jar" update="${jar.update}" roundup="false">
             <fileset dir="${dist.dir}">
                 <exclude name="jython-installer.jar"/>
                 <exclude name="${jython.dev.jar}"/>


=====================================
debian/changelog
=====================================
@@ -1,3 +1,15 @@
+jython (2.7.2~rc1+repack1-1) unstable; urgency=medium
+
+  * New upstream release
+  * Drop patch 03-default-cachedir.patch (fixed upstream):
+    The default location of the Jython package cache has moved from the
+    installation directory to the current working directory and is called
+    ".jython_cache"
+  * Refresh other patches
+
+
+ -- Gilles Filippini <pini at debian.org>  Sun, 08 Mar 2020 10:35:11 +0100
+
 jython (2.7.2~b3+repack1-1) unstable; urgency=medium
 
   * New upstream release


=====================================
debian/patches/00-missing-dep.patch
=====================================
@@ -4,7 +4,7 @@ Index: jython/build.xml
 ===================================================================
 --- jython.orig/build.xml
 +++ jython/build.xml
-@@ -245,7 +245,10 @@ informix.jar = ../support/jdbc-4.10.12.j
+@@ -248,7 +248,10 @@ informix.jar = ../support/jdbc-4.10.12.j
  
              <!-- Other JARs (alphabetical) -->
              <filelist dir="${extlibs.dir}">
@@ -16,7 +16,7 @@ Index: jython/build.xml
                  <file name="asm-7.1.jar" />
                  <file name="asm-commons-7.1.jar" />
                  <file name="asm-util-7.1.jar" />
-@@ -266,6 +269,7 @@ informix.jar = ../support/jdbc-4.10.12.j
+@@ -269,6 +272,7 @@ informix.jar = ../support/jdbc-4.10.12.j
                  <file name="netty-handler-4.1.45.Final.jar"/>
                  <file name="netty-resolver-4.1.45.Final.jar"/>
                  <file name="netty-transport-4.1.45.Final.jar"/>


=====================================
debian/patches/01-classpath.patch
=====================================
@@ -1,11 +1,11 @@
 Description: patch build.xml to extract, re-arrange and re-inject
  classpaths. See debian/rules.
 Author: Gilles Filippini <pini at deian.org>
-Index: jython-2.7.2~b2+repack1/build.xml
+Index: jython/build.xml
 ===================================================================
---- jython-2.7.2~b2+repack1.orig/build.xml
-+++ jython-2.7.2~b2+repack1/build.xml
-@@ -232,7 +232,7 @@ informix.jar = ../support/jdbc-4.10.12.j
+--- jython.orig/build.xml
++++ jython/build.xml
+@@ -235,7 +235,7 @@ informix.jar = ../support/jdbc-4.10.12.j
              <istrue value="${oracle.present}"/>
          </condition>
  
@@ -14,7 +14,7 @@ Index: jython-2.7.2~b2+repack1/build.xml
              <!-- The non-free database driver JARs, if not present. -->
              <filelist files="${informix.location} ${oracle.location}" />
  
-@@ -272,9 +272,13 @@ informix.jar = ../support/jdbc-4.10.12.j
+@@ -275,9 +275,13 @@ informix.jar = ../support/jdbc-4.10.12.j
                  <file name="jaxb-api.jar"/>
              </filelist>
          </path>
@@ -30,7 +30,7 @@ Index: jython-2.7.2~b2+repack1/build.xml
              <filelist dir="${extlibs.dir}">
                  <!-- Pin to 4.10 until dependency on hamcrest classes resolved. -->
                  <file name="junit-4.10.jar" />
-@@ -283,6 +287,10 @@ informix.jar = ../support/jdbc-4.10.12.j
+@@ -286,6 +290,10 @@ informix.jar = ../support/jdbc-4.10.12.j
              <pathelement location="${compile.dir}" />
              <pathelement location="${cpptasks.jar.dir}" />
          </path>
@@ -41,7 +41,7 @@ Index: jython-2.7.2~b2+repack1/build.xml
      </target>
  
      <target name="init"
-@@ -349,6 +357,13 @@ informix.jar = ../support/jdbc-4.10.12.j
+@@ -352,6 +360,13 @@ informix.jar = ../support/jdbc-4.10.12.j
          <fail unless="${hg.present}" message="A Mercurial repository is required" />
      </target>
  
@@ -55,7 +55,7 @@ Index: jython-2.7.2~b2+repack1/build.xml
      <target name="dump-env" depends="init, dump"
              description="dump the properties computed for a regular build without running it" />
  
-@@ -964,6 +979,7 @@ The text for an official release would c
+@@ -969,6 +984,7 @@ The text for an official release would c
                   excludes="org/python/expose/generate/**,org/python/version.properties"/>
            </nameunion>
            <manifest>
@@ -63,7 +63,7 @@ Index: jython-2.7.2~b2+repack1/build.xml
                <attribute name="Main-Class" value="org.python.util.jython" />
                <attribute name="Built-By" value="${user.name}" />
                <attribute name="Implementation-Vendor" value="Python Software Foundation"/>
-@@ -1147,9 +1163,6 @@ The text for an official release would c
+@@ -1152,9 +1168,6 @@ The text for an official release would c
               $dist.dir/javalib/*, to be available when using jython-dev.jar
          -->
          <copy todir="${dist.dir}/javalib">


=====================================
debian/patches/03-default-cachedir.patch deleted
=====================================
@@ -1,29 +0,0 @@
-Index: jython/src/org/python/core/PySystemState.java
-===================================================================
---- jython.orig/src/org/python/core/PySystemState.java
-+++ jython/src/org/python/core/PySystemState.java
-@@ -1270,8 +1270,7 @@ public class PySystemState extends PyObj
-         }
-         cachedir = new File(props.getProperty(PYTHON_CACHEDIR, CACHEDIR_DEFAULT_NAME));
-         if (!cachedir.isAbsolute()) {
--            String prefixString = Py.fileSystemDecode(prefix);
--            cachedir = new File(prefixString, cachedir.getPath());
-+            cachedir = new File(System.getProperty("user.home") == null ? null : System.getProperty("user.home"), cachedir.getPath());
-         }
-     }
- 
-Index: jython/registry
-===================================================================
---- jython.orig/registry
-+++ jython/registry
-@@ -15,8 +15,8 @@
- 
- # Set the directory to use for caches (currently just package information)
- #   This directory should be writable by the user. If this is an absolute path it is used as given,
--#   otherwise it is interpreted relative to sys.prefix (typically the directory of this file).
--python.cachedir = cachedir
-+#   Otherwise it is interpreted relative to $HOME
-+python.cachedir = .jython-cache
- 
- # Setting this property to true disables the package scan for the cachedir.
- # Please be aware that disabling this will break importing * from java packages


=====================================
debian/patches/08-java-backward-compatibility.patch
=====================================
@@ -5,7 +5,7 @@ Index: jython/build.xml
 ===================================================================
 --- jython.orig/build.xml
 +++ jython/build.xml
-@@ -688,6 +688,7 @@ The text for an official release would c
+@@ -693,6 +693,7 @@ The text for an official release would c
                  destdir="${compile.dir}"
                  target="${jdk.target.version}"
                  source="${jdk.source.version}"
@@ -13,7 +13,7 @@ Index: jython/build.xml
                  debug="${debug}"
                  deprecation="${deprecation}"
                  nowarn="${nowarn}"
-@@ -753,6 +754,7 @@ The text for an official release would c
+@@ -758,6 +759,7 @@ The text for an official release would c
          <javac destdir="${compile.dir}"
                 target="${jdk.target.version}"
                 source="${jdk.source.version}"
@@ -21,7 +21,7 @@ Index: jython/build.xml
                 debug="${debug}"
                 deprecation="${deprecation}"
                 nowarn="${nowarn}"
-@@ -773,6 +775,7 @@ The text for an official release would c
+@@ -778,6 +780,7 @@ The text for an official release would c
                 destdir="${compile.dir}"
                 target="${jdk.target.version}"
                 source="${jdk.source.version}"
@@ -29,7 +29,7 @@ Index: jython/build.xml
                 debug="${debug}"
                 deprecation="${deprecation}"
                 nowarn="${nowarn}"
-@@ -785,6 +788,7 @@ The text for an official release would c
+@@ -790,6 +793,7 @@ The text for an official release would c
                 destdir="${compile.dir}"
                 target="${jdk.target.version}"
                 source="${jdk.source.version}"
@@ -37,7 +37,7 @@ Index: jython/build.xml
                 debug="${debug}"
                 deprecation="${deprecation}"
                 nowarn="${nowarn}"
-@@ -1192,6 +1196,7 @@ The text for an official release would c
+@@ -1197,6 +1201,7 @@ The text for an official release would c
                 destdir="${compile.dir}"
                 target="${jdk.target.version}"
                 source="${jdk.source.version}"


=====================================
debian/patches/javadoc-classpath.patch
=====================================
@@ -1,8 +1,8 @@
-Index: jython-2.7.2~b2+repack1/build.xml
+Index: jython/build.xml
 ===================================================================
---- jython-2.7.2~b2+repack1.orig/build.xml
-+++ jython-2.7.2~b2+repack1/build.xml
-@@ -1003,6 +1003,7 @@ The text for an official release would c
+--- jython.orig/build.xml
++++ jython/build.xml
+@@ -1008,6 +1008,7 @@ The text for an official release would c
          <path id="javadoc.classpath">
              <pathelement path="${java.class.path}" />
              <pathelement path="${compile.dir}" />


=====================================
debian/patches/reproducible-builds.patch
=====================================
@@ -2,7 +2,7 @@ Index: jython/build.xml
 ===================================================================
 --- jython.orig/build.xml
 +++ jython/build.xml
-@@ -728,8 +728,12 @@ The text for an official release would c
+@@ -733,8 +733,12 @@ The text for an official release would c
              <arg path="${out}"/>
              <arg value="-lib"/>
              <arg path="${out}"/>
@@ -17,7 +17,7 @@ Index: jython/build.xml
              <classpath refid="main.classpath"/>
          </java>
  
-@@ -1127,7 +1131,10 @@ The text for an official release would c
+@@ -1132,7 +1136,10 @@ The text for an official release would c
      </target>
  
      <target name="copy-lib" depends="common-dirs, copy-cpythonlib">
@@ -29,7 +29,7 @@ Index: jython/build.xml
              <fileset dir="${basedir}/Lib">
                  <exclude name="**/*.class"/>
              </fileset>
-@@ -1151,7 +1158,10 @@ The text for an official release would c
+@@ -1156,7 +1163,10 @@ The text for an official release would c
          <copy file="${basedir}/lib-python/LICENSE.txt"
                tofile="${dist.dir}/LICENSE_CPython.txt"
                preservelastmodified="true" />


=====================================
debian/patches/series
=====================================
@@ -1,6 +1,5 @@
 00-missing-dep.patch
 01-classpath.patch
-03-default-cachedir.patch
 05-no-com.carrotsearch.sizeof.patch
 javadoc-classpath.patch
 reproducible-builds.patch


=====================================
debian/watch
=====================================
@@ -1,6 +1,6 @@
 version=4
 opts="dversionmangle=s/\+repack\d*$//, \
-	uversionmangle=s/([ab]\d+)/~$1/" \
+	uversionmangle=s/(([ab]|rc)\d+)/~$1/" \
 	https://github.com/jythontools/jython/tags \
 	.*/v([\d\.]+[a-z0-9]*).tar.gz \
 	debian \


=====================================
installer/src/java/org/python/util/install/JarInstaller.java
=====================================
@@ -49,7 +49,7 @@ public class JarInstaller {
      * <li>generate the start scripts
      * <li>run ensurepip if selected
      * </ul>
-     * 
+     *
      * @param targetDirectory
      * @param installationType
      */
@@ -102,8 +102,9 @@ public class JarInstaller {
                     }
                 }
                 // exclude build.xml when not installing source
-                if (!installationType.installSources() && zipEntryName.equals("build.xml"))
+                if (!installationType.installSources() && zipEntryName.equals("build.xml")) {
                     exclude = true;
+                }
                 // handle exclusion of core Lib files
                 if (!exclude) {
                     exclude = shouldExcludeFile(installationType,
@@ -182,9 +183,9 @@ public class JarInstaller {
         try {
             String command[];
             if (Installation.isWindows()) {
-                command = new String[]{ bindir.resolve("jython.exe").toString(), "-m", "ensurepip" };
+                command = new String[] {bindir.resolve("jython.exe").toString(), "-m", "ensurepip"};
             } else {
-                command = new String[]{ Paths.get(".", "jython").toString(), "-m", "ensurepip"};
+                command = new String[] {Paths.get(".", "jython").toString(), "-m", "ensurepip"};
             }
             ChildProcess childProcess = new ChildProcess(command);
             childProcess.setCWD(bindir);


=====================================
registry
=====================================
@@ -15,8 +15,8 @@
 
 # Set the directory to use for caches (currently just package information)
 #   This directory should be writable by the user. If this is an absolute path it is used as given,
-#   otherwise it is interpreted relative to sys.prefix (typically the directory of this file).
-python.cachedir = cachedir
+#   otherwise it is interpreted relative to the current working directory (at initialisation).
+#python.cachedir = .jython_cache
 
 # Setting this property to true disables the package scan for the cachedir.
 # Please be aware that disabling this will break importing * from java packages
@@ -24,6 +24,7 @@ python.cachedir = cachedir
 
 # Properties to check for initializing and updating the package cache
 # Values shown here are those hard-coded in Jython's cache manager.
+
 #   Treat JARs on the classpath and (up to Java 8) in the JRE as a source of Python packages.
 #python.packages.paths = java.class.path, sun.boot.class.path   # up to Java 8
 #python.packages.paths = java.class.path                        # from Java 9
@@ -31,6 +32,7 @@ python.cachedir = cachedir
 #python.packages.directories = java.ext.dirs    # up to Java 8
 #python.packages.directories                    # undefined from Java 9
 
+
 # DEPRECATED way to set the verbosity of messages output by Jython. If
 # specified, "python.verbose" will set logging level for "org.python" when
 # the runtime is initialised. It is better to use java.util.logging


=====================================
src/org/python/core/PyStringMap.java
=====================================
@@ -637,9 +637,10 @@ public class PyStringMap extends AbstractDict implements Traverseproc {
 
     @ExposedMethod(doc = BuiltinDocs.dict_keys_doc)
     final PyList stringmap_keys() {
-        PyObject[] keyArray = new PyObject[table.size()];
+        Object[] keys = table.keySet().toArray();
+        PyObject[] keyArray = new PyObject[keys.length];
         int i = 0;
-        for (Object key : table.keySet()) {
+        for (Object key : keys) {
             keyArray[i++] = keyToPy(key);
         }
         return new PyList(keyArray);


=====================================
src/org/python/core/PySystemState.java
=====================================
@@ -62,7 +62,7 @@ public class PySystemState extends PyObject
 
     private static final Logger logger = Logger.getLogger("org.python.core");
 
-    protected static final String CACHEDIR_DEFAULT_NAME = "cachedir";
+    private static final String CACHEDIR_DEFAULT_NAME = ".jython_cache";
 
     public static final String JYTHON_JAR = "jython.jar";
     public static final String JYTHON_DEV_JAR = "jython-dev.jar";
@@ -1270,9 +1270,11 @@ public class PySystemState extends PyObject
         }
         cachedir = new File(props.getProperty(PYTHON_CACHEDIR, CACHEDIR_DEFAULT_NAME));
         if (!cachedir.isAbsolute()) {
-            String prefixString = Py.fileSystemDecode(prefix);
+            String prefixString = props.getProperty("user.dir", "");
             cachedir = new File(prefixString, cachedir.getPath());
+            cachedir = cachedir.getAbsoluteFile();
         }
+        logger.log(Level.CONFIG, "cache at {0}", cachedir);
     }
 
     private static void initPackages(Properties props) {


=====================================
src/org/python/core/imp.java
=====================================
@@ -7,6 +7,7 @@ import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Date;
 import java.util.Map;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.logging.Level;
@@ -396,10 +397,16 @@ public class imp {
             }
         }
 
-        // Check source-last-modified time fossilised in the class file against that expected
+        /*
+         * The source-last-modified time is fossilised in the class file. The source may have been
+         * installed from a JAR, and this will have resulted in rounding of the last-modified time
+         * down (see build.xml::jar-sources) to the nearest 2 seconds.
+         */
         if (testing && sourceLastModified != NO_MTIME) {
-            long mtime = ar.getMTime();
-            if (sourceLastModified != mtime) {
+            long diff = ar.getMTime() - sourceLastModified;
+            if (diff > 2000L) { // = 2000 milliseconds
+                logger.log(Level.FINE, "# {0} time is {1} ms later than source",
+                        new Object[] {name, diff});
                 return null;
             }
         }
@@ -925,6 +932,10 @@ public class imp {
                         if (ret != null) {
                             return ret;
                         }
+                    } else {
+                        logger.log(Level.FINE,
+                                "# {0} dated ({1,date} {1,time,long}) < ({2,date} {2,time,long})",
+                                new Object[] {name, new Date(classTime), new Date(pyTime)});
                     }
                 }
 


=====================================
src/org/python/core/packagecache/CachedJarsPackageManager.java
=====================================
@@ -841,24 +841,20 @@ public abstract class CachedJarsPackageManager extends PackageManager {
      * before {@link #initCache}. cachedir is the cache repository directory, this is eventually
      * created. Returns true if dir works.
      */
-    protected boolean useCacheDir(File aCachedir1) {
-
-        if (aCachedir1 == null) {
-            return false;
-        }
-
+    protected boolean useCacheDir(File cachedir) {
         try {
-            if (!aCachedir1.isDirectory() && aCachedir1.mkdirs() == false) {
-                warning("failed to create cache dir ''{0}''", aCachedir1);
-                return false;
+            if (cachedir != null) {
+                if (cachedir.isDirectory() || cachedir.mkdirs()) {
+                    this.cachedir = cachedir;
+                    return true;
+                } else {
+                    warning("failed to create cache dir ''{0}''", cachedir);
+                }
             }
         } catch (AccessControlException ace) {
-            warning("Not permitted to access cache ''{0}'' ({1})", aCachedir1, ace.getMessage());
-            return false;
+            warning("Not permitted to access cache ''{0}'' ({1})", cachedir, ace.getMessage());
         }
-
-        this.cachedir = aCachedir1;
-        return true;
+        return false;
     }
 
 }


=====================================
src/org/python/expose/generate/ExposeTask.java
=====================================
@@ -8,8 +8,6 @@ import java.util.Set;
 
 import org.apache.tools.ant.BuildException;
 import org.objectweb.asm.ClassWriter;
-import org.python.core.Py;
-import org.python.core.Options;
 import org.python.util.GlobMatchingTask;
 
 public class ExposeTask extends GlobMatchingTask {
@@ -32,14 +30,7 @@ public class ExposeTask extends GlobMatchingTask {
             log("Exposing 1 class");
         }
 
-        // Quiet harmless unbootstrapped warnings during the expose process
-        int verbose = Options.verbose;
-        Options.verbose = Py.ERROR;
-        try {
-            expose(toExpose);
-        } finally {
-            Options.verbose = verbose;
-        }
+        expose(toExpose);
     }
 
     private void expose(Set<File> toExpose) {


=====================================
src/org/python/modules/posix/PythonPOSIXHandler.java
=====================================
@@ -4,12 +4,14 @@ package org.python.modules.posix;
 import java.io.File;
 import java.io.InputStream;
 import java.io.PrintStream;
+import java.util.logging.Level;
 
 import jnr.constants.platform.Errno;
 import jnr.posix.POSIXHandler;
 
 import org.python.core.imp;
 import org.python.core.Options;
+import org.python.core.PrePy;
 import org.python.core.Py;
 import org.python.core.PyObject;
 
@@ -19,14 +21,17 @@ import org.python.core.PyObject;
  */
 public class PythonPOSIXHandler implements POSIXHandler {
 
+    @Override
     public void error(Errno error, String extraData) {
         throw Py.OSError(error, Py.newStringOrUnicode(extraData));
     }
 
+    @Override
     public void error(Errno error, String methodName, String extraData) {
         throw Py.OSError(error, Py.newStringOrUnicode(extraData));
     }
 
+    @Override
     public void unimplementedError(String methodName) {
         if (methodName.startsWith("stat.")) {
             // Ignore unimplemented FileStat methods
@@ -35,17 +40,22 @@ public class PythonPOSIXHandler implements POSIXHandler {
         throw Py.NotImplementedError(methodName);
     }
 
+    @Override
     public void warn(WARNING_ID id, String message, Object... data) {
     }
 
+    @Override
     public boolean isVerbose() {
-        return Options.verbose >= Py.DEBUG;
+        // Verbose if the general threshold for logging is FINE or lower..
+        return PrePy.getLoggingLevel().intValue() <= Level.FINE.intValue();
     }
 
+    @Override
     public File getCurrentWorkingDirectory() {
         return new File(Py.getSystemState().getCurrentWorkingDir());
     }
 
+    @Override
     public String[] getEnv() {
         PyObject items = imp.load("os").__getattr__("environ").invoke("items");
         String[] env = new String[items.__len__()];
@@ -56,18 +66,22 @@ public class PythonPOSIXHandler implements POSIXHandler {
         return env;
     }
 
+    @Override
     public InputStream getInputStream() {
         return System.in;
     }
 
+    @Override
     public PrintStream getOutputStream() {
         return System.out;
     }
 
+    @Override
     public int getPID() {
         return 0;
     }
 
+    @Override
     public PrintStream getErrorStream() {
         return System.err;
     }



View it on GitLab: https://salsa.debian.org/java-team/jython/-/compare/7792d3a3ddd2a1fb4ade63492964f8e711c71ceb...711c99cc1545b044053400f654870362682c1e5e

-- 
View it on GitLab: https://salsa.debian.org/java-team/jython/-/compare/7792d3a3ddd2a1fb4ade63492964f8e711c71ceb...711c99cc1545b044053400f654870362682c1e5e
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20200309/0a39d9e8/attachment.html>


More information about the pkg-java-commits mailing list