Date: Wed, 21 May 2014 20:06:17 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r354762 - in head/java: openjdk8 openjdk8-jre openjdk8/files Message-ID: <201405212006.s4LK6H14086398@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Wed May 21 20:06:16 2014 New Revision: 354762 URL: http://svnweb.freebsd.org/changeset/ports/354762 QAT: https://qat.redports.org/buildarchive/r354762/ Log: Fix printing services. When CUPS is used, ${LOCALBASE}/bin/lpr must be used to print a generated PostScript file. When lpd(8) is used, lpr(1) from base must be used. Also, status command for lpc(8) requires a printer name. If no argument is specified, i.e., "/usr/sbin/lpc status", then it displays the command usage, i.e., "usage: status {all | printer ...}". Unfortunately, "usage" is interpreted as a printer name because ":" is included. Add "all" and adjust an expression for grep(1). Added: head/java/openjdk8/files/patch-jdk-src-share-classes-sun-print-PSPrinterJob.java (contents, props changed) Modified: head/java/openjdk8-jre/Makefile head/java/openjdk8/Makefile head/java/openjdk8/files/patch-bsd Modified: head/java/openjdk8-jre/Makefile ============================================================================== --- head/java/openjdk8-jre/Makefile Wed May 21 20:03:14 2014 (r354761) +++ head/java/openjdk8-jre/Makefile Wed May 21 20:06:16 2014 (r354762) @@ -1,6 +1,6 @@ # $FreeBSD$ -PORTREVISION= 2 +PORTREVISION= 3 PKGNAMESUFFIX= ${JDK_MAJOR_VERSION}-jre COMMENT= Java Runtime Environment ${JDK_MAJOR_VERSION} Modified: head/java/openjdk8/Makefile ============================================================================== --- head/java/openjdk8/Makefile Wed May 21 20:03:14 2014 (r354761) +++ head/java/openjdk8/Makefile Wed May 21 20:06:16 2014 (r354762) @@ -2,7 +2,7 @@ PORTNAME= openjdk PORTVERSION= ${JDK_MAJOR_VERSION}.${JDK_UPDATE_VERSION}.${JDK_BUILD_NUMBER:S/^0//} -PORTREVISION?= 6 +PORTREVISION?= 7 CATEGORIES= java devel MASTER_SITES= http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}/promoted/b${JDK_BUILD_NUMBER}/:jdk \ https://adopt-openjdk.ci.cloudbees.com/job/jtreg/${JTREG_JENKINS_BUILD}/artifact/:jtreg \ @@ -195,6 +195,7 @@ post-patch: ${WRKSRC}/common/autoconf/toolchain.m4 \ ${WRKSRC}/configure \ ${WRKSRC}/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java \ + ${WRKSRC}/jdk/src/share/classes/sun/print/PSPrinterJob.java \ ${WRKSRC}/jdk/src/solaris/classes/sun/nio/fs/BsdFileSystemProvider.java @${REINPLACE_CMD} -e 's|/usr/local/java/classes|${LOCALBASE}/share/java/classes|' \ ${WRKSRC}/jdk/src/bsd/doc/man/*.1 Modified: head/java/openjdk8/files/patch-bsd ============================================================================== --- head/java/openjdk8/files/patch-bsd Wed May 21 20:03:14 2014 (r354761) +++ head/java/openjdk8/files/patch-bsd Wed May 21 20:06:16 2014 (r354762) @@ -8328,7 +8328,19 @@ /* * Prevent recursions. Since LD_LIBRARY_PATH is the one which will be set by -@@ -928,9 +934,13 @@ +@@ -900,8 +906,9 @@ + * onwards the filename returned in DL_info structure from dladdr is + * an absolute pathname so technically realpath isn't required. + * On Linux we read the executable name from /proc/self/exe. +- * As a fallback, and for platforms other than Solaris and Linux, +- * we use FindExecName to compute the executable name. ++ * On FreeBSD we read the executable name from /proc/curproc/file. ++ * As a fallback, and for platforms other than Solaris, Linux, and ++ * FreeBSD, we use FindExecName to compute the executable name. + */ + const char* + SetExecname(char **argv) +@@ -928,9 +935,13 @@ } } } @@ -8343,7 +8355,7 @@ char buf[PATH_MAX+1]; int len = readlink(self, buf, PATH_MAX); if (len >= 0) { -@@ -938,7 +948,7 @@ +@@ -938,7 +949,7 @@ exec_path = JLI_StringDup(buf); } } @@ -8352,7 +8364,7 @@ { /* Not implemented */ } -@@ -1000,7 +1010,7 @@ +@@ -1000,7 +1011,7 @@ int ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void * args) { int rslt; @@ -8361,7 +8373,7 @@ pthread_t tid; pthread_attr_t attr; pthread_attr_init(&attr); -@@ -1025,7 +1035,7 @@ +@@ -1025,7 +1036,7 @@ } pthread_attr_destroy(&attr); @@ -8370,7 +8382,7 @@ thread_t tid; long flags = 0; if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) { -@@ -1036,7 +1046,7 @@ +@@ -1036,7 +1047,7 @@ /* See above. Continue in current thread if thr_create() failed */ rslt = continuation(args); } @@ -8379,7 +8391,7 @@ return rslt; } -@@ -1044,13 +1054,13 @@ +@@ -1044,13 +1055,13 @@ #define MAX_PID_STR_SZ 20 void SetJavaLauncherPlatformProps() { @@ -8571,6 +8583,21 @@ osname.contains("OS X")); } +@@ -140,12 +141,12 @@ + static int cmdIndex = UNINITIALIZED; + + String[] lpcFirstCom = { +- "/usr/sbin/lpc status | grep : | sed -ne '1,1 s/://p'", ++ "/usr/sbin/lpc status all | grep ':$' | sed -ne '1,1 s/://p'", + "/usr/sbin/lpc status | grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}'" + }; + + String[] lpcAllCom = { +- "/usr/sbin/lpc status all | grep : | sed -e 's/://'", ++ "/usr/sbin/lpc status all | grep ':$' | sed -e 's/://'", + "/usr/sbin/lpc status all | grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}' | sort" + }; + --- jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java +++ jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java @@ -266,7 +266,7 @@ Added: head/java/openjdk8/files/patch-jdk-src-share-classes-sun-print-PSPrinterJob.java ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/java/openjdk8/files/patch-jdk-src-share-classes-sun-print-PSPrinterJob.java Wed May 21 20:06:16 2014 (r354762) @@ -0,0 +1,34 @@ +--- jdk/src/share/classes/sun/print/PSPrinterJob.java ++++ jdk/src/share/classes/sun/print/PSPrinterJob.java +@@ -1588,8 +1588,30 @@ + + String osname = System.getProperty("os.name"); + if (osname.equals("Linux") || osname.endsWith("BSD") || osname.contains("OS X")) { ++ String lprPath = "/usr/bin/lpr"; ++ if (osname.endsWith("BSD")) { ++ final PrintService pservice = getPrintService(); ++ Boolean isIPPPrinter = ++ (Boolean)java.security.AccessController.doPrivileged( ++ new java.security.PrivilegedAction() { ++ public Object run() { ++ try { ++ Class psClass = ++ Class.forName("sun.print.IPPPrintService"); ++ if (psClass.isInstance(pservice)) { ++ return Boolean.TRUE; ++ } ++ } catch (Throwable t) { ++ } ++ return Boolean.FALSE; ++ } ++ }); ++ if (isIPPPrinter) { ++ lprPath = "%%LOCALBASE%%/bin/lpr"; ++ } ++ } + execCmd = new String[ncomps]; +- execCmd[n++] = "/usr/bin/lpr"; ++ execCmd[n++] = lprPath; + if ((pFlags & PRINTER) != 0) { + execCmd[n++] = "-P" + printer; + }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405212006.s4LK6H14086398>