[jenkins] 07/09: More changes to remain compatible with jnr-posix in Debian

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Tue Sep 2 20:42:32 UTC 2014


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository jenkins.

commit ff81b59cb32909709d527ee473d717a0941b0211
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Tue Sep 2 18:47:56 2014 +0200

    More changes to remain compatible with jnr-posix in Debian
---
 debian/maven.rules                                 |   1 +
 .../0012-jnr-posix-upgrade.patch                   | 101 +++++++++++++++++++--
 2 files changed, 93 insertions(+), 9 deletions(-)

diff --git a/debian/maven.rules b/debian/maven.rules
index 7a734ec..0c04aca 100644
--- a/debian/maven.rules
+++ b/debian/maven.rules
@@ -57,6 +57,7 @@ s/org.jvnet.hudson/org.jenkins-ci/ task-reactor * s/.*/debian/ * *
 javax.servlet jstl * s/1\.1\..*/1.1/ * *
 # Remap for rename jna->jnr in Debian
 org.jruby.ext.posix s/jna-posix/jnr-posix/ * s/.*/debian/ * *
+s/com.github.jnr/org.jruby.ext.posix/ jnr-posix * s/.*/debian/ * *
 # Update to servlet2.5
 javax.servlet servlet-api * s/.*/2.5/ * *
 # Updates for 1.424.6
diff --git a/debian/patches/dependency-upgrades/0012-jnr-posix-upgrade.patch b/debian/patches/dependency-upgrades/0012-jnr-posix-upgrade.patch
index 2a2613c..c67613d 100644
--- a/debian/patches/dependency-upgrades/0012-jnr-posix-upgrade.patch
+++ b/debian/patches/dependency-upgrades/0012-jnr-posix-upgrade.patch
@@ -39,26 +39,85 @@ Subject: jnr-posix-upgrade
  
  /**
   * POSIX API wrapper.
-@@ -59,7 +59,7 @@
+@@ -16,59 +16,28 @@
+  * @author Kohsuke Kawaguchi
+  */
+ public class PosixAPI {
+-
+-    private static POSIX posix;
+-    
+-    /**
+-     * Load the JNR implementation of the POSIX APIs for the current platform.
+-     * Runtime exceptions will be of type {@link PosixException}.
+-     * @return some implementation (even on Windows or unsupported Unix)
+-     * @since 1.518
+-     */
+-    public static synchronized POSIX jnr() {
+-        if (posix == null) {
+-            posix = POSIXFactory.getPOSIX(new DefaultPOSIXHandler() {
+-                @Override public void error(Errno error, String extraData) {
+-                    throw new PosixException("native error " + error.description() + " " + extraData, convert(error));
+-                }
+-                @Override public void error(Errno error, String methodName, String extraData) {
+-                    throw new PosixException("native error calling " + methodName + ": " + error.description() + " " + extraData, convert(error));
+-                }
+-                private org.jruby.ext.posix.POSIX.ERRORS convert(Errno error) {
+-                    try {
+-                        return org.jruby.ext.posix.POSIX.ERRORS.valueOf(error.name());
+-                    } catch (IllegalArgumentException x) {
+-                        return org.jruby.ext.posix.POSIX.ERRORS.EIO; // PosixException.message has real error anyway
+-                    }
+-                }
+-            }, true);
+-        }
++    public static POSIX jnr() {
+         return posix;
+     }
+ 
+     /**
+-     * @deprecated use {@link #jnr} and {@link POSIX#isNative}
++     * @deprecated as of 1.448
++     *      Use {@link #supportsNative()}.
       */
-     @Deprecated
+-    @Deprecated
+     public boolean isNative() {
+         return supportsNative();
+     }
+ 
+     /**
+-     * @deprecated use {@link #jnr} and {@link POSIX#isNative}
++     * Determine if the jna-posix library could not provide native support, and
++     * used a fallback java implementation which does not support many operations.
+      */
+-    @Deprecated
      public static boolean supportsNative() {
 -        return !(jnaPosix instanceof org.jruby.ext.posix.JavaPOSIX);
 +        return posix.isNative();
      }
- 
-     private static org.jruby.ext.posix.POSIX jnaPosix;
-@@ -67,8 +67,8 @@
-     @Deprecated
-     public static synchronized org.jruby.ext.posix.POSIX get() {
-         if (jnaPosix == null) {
+-
+-    private static org.jruby.ext.posix.POSIX jnaPosix;
+-    /** @deprecated Use {@link #jnr} instead. */
+-    @Deprecated
+-    public static synchronized org.jruby.ext.posix.POSIX get() {
+-        if (jnaPosix == null) {
 -            jnaPosix = org.jruby.ext.posix.POSIXFactory.getPOSIX(new org.jruby.ext.posix.POSIXHandler() {
 -        public void error(org.jruby.ext.posix.POSIX.ERRORS errors, String s) {
-+            jnaPosix = POSIXFactory.getPOSIX(new POSIXHandler() {
++    
++    private static final POSIX posix = POSIXFactory.getPOSIX(new POSIXHandler() {
 +        public void error(Errno errors, String s) {
              throw new PosixException(s,errors);
          }
  
+@@ -116,9 +85,6 @@
+             return System.err;
+         }
+     }, true);
+-        }
+-        return jnaPosix;
+-    }
+ 
+     private static final Logger LOGGER = Logger.getLogger(PosixAPI.class.getName());
+ }
 --- a/core/src/main/java/hudson/os/PosixException.java
 +++ b/core/src/main/java/hudson/os/PosixException.java
 @@ -1,6 +1,6 @@
@@ -89,3 +148,27 @@ Subject: jnr-posix-upgrade
          return errors;
      }
  
+--- a/core/src/main/java/hudson/util/jna/GNUCLibrary.java
++++ b/core/src/main/java/hudson/util/jna/GNUCLibrary.java
+@@ -31,7 +31,7 @@
+ import com.sun.jna.NativeLong;
+ import com.sun.jna.ptr.IntByReference;
+ import hudson.os.PosixAPI;
+-import jnr.posix.POSIX;
++import org.jruby.ext.posix.POSIX;
+ import org.jvnet.libpam.impl.CLibrary.passwd;
+ 
+ /**
+--- a/core/src/main/java/hudson/Util.java
++++ b/core/src/main/java/hudson/Util.java
+@@ -41,8 +41,8 @@
+ import org.apache.tools.ant.taskdefs.Chmod;
+ import org.apache.tools.ant.taskdefs.Copy;
+ import org.apache.tools.ant.types.FileSet;
+-import jnr.posix.FileStat;
+-import jnr.posix.POSIX;
++import org.jruby.ext.posix.FileStat;
++import org.jruby.ext.posix.POSIX;
+ import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
+ import org.kohsuke.stapler.Stapler;
+ 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jenkins.git



More information about the pkg-java-commits mailing list