svn commit: r354759 - in head/java: openjdk6 openjdk6-jre openjdk6/files
Jung-uk Kim
jkim at FreeBSD.org
Wed May 21 19:57:12 UTC 2014
Author: jkim
Date: Wed May 21 19:57:11 2014
New Revision: 354759
URL: http://svnweb.freebsd.org/changeset/ports/354759
QAT: https://qat.redports.org/buildarchive/r354759/
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).
PR: ports/178856
Modified:
head/java/openjdk6-jre/Makefile
head/java/openjdk6/Makefile
head/java/openjdk6/files/patch-set
Modified: head/java/openjdk6-jre/Makefile
==============================================================================
--- head/java/openjdk6-jre/Makefile Wed May 21 18:49:16 2014 (r354758)
+++ head/java/openjdk6-jre/Makefile Wed May 21 19:57:11 2014 (r354759)
@@ -1,6 +1,6 @@
# $FreeBSD$
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= java devel
PKGNAMESUFFIX= -jre
Modified: head/java/openjdk6/Makefile
==============================================================================
--- head/java/openjdk6/Makefile Wed May 21 18:49:16 2014 (r354758)
+++ head/java/openjdk6/Makefile Wed May 21 19:57:11 2014 (r354759)
@@ -3,7 +3,7 @@
PORTNAME= openjdk6
PORTVERSION= b31
-PORTREVISION?= 2
+PORTREVISION?= 3
PORTEPOCH= 1
CATEGORIES= java devel
MASTER_SITES= ${MASTER_SITE_APACHE:S,%SUBDIR%/,ant/binaries/:ant,} \
@@ -245,7 +245,8 @@ post-patch:
${WRKSRC}/jdk/make/tools/freetypecheck/Makefile
@${REINPLACE_CMD} -e "s|%%LOCALBASE%%|${LOCALBASE}|" \
${WRKSRC}/hotspot/src/os/bsd/vm/os_bsd.cpp \
- ${WRKSRC}/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java
+ ${WRKSRC}/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java \
+ ${WRKSRC}/jdk/src/share/classes/sun/print/PSPrinterJob.java
.if ${PORT_OPTIONS:MPOLICY}
@${REINPLACE_CMD} -e 's|%%POLICY%%|unlimited|' \
${WRKSRC}/jdk/make/javax/crypto/Makefile
Modified: head/java/openjdk6/files/patch-set
==============================================================================
--- head/java/openjdk6/files/patch-set Wed May 21 18:49:16 2014 (r354758)
+++ head/java/openjdk6/files/patch-set Wed May 21 19:57:11 2014 (r354759)
@@ -5272,17 +5272,42 @@
+}
--- jdk/src/share/classes/sun/print/PSPrinterJob.java
+++ jdk/src/share/classes/sun/print/PSPrinterJob.java
-@@ -1531,7 +1531,9 @@
+@@ -1531,9 +1531,33 @@
pFlags |= NOSHEET;
ncomps+=1;
}
- if (System.getProperty("os.name").equals("Linux")) {
+
+ String osname = System.getProperty("os.name");
-+ if (osname.equals("Linux") || osname.equals("FreeBSD") || osname.equals("NetBSD") || osname.equals("OpenBSD") || osname.equals("Darwin")) {
++ 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++] = "/usr/bin/lpr";
++ execCmd[n++] = lprPath;
if ((pFlags & PRINTER) != 0) {
+ execCmd[n++] = new String("-P" + printer);
+ }
--- jdk/src/share/classes/sun/security/jgss/GSSManagerImpl.java
+++ jdk/src/share/classes/sun/security/jgss/GSSManagerImpl.java
@@ -49,8 +49,12 @@
@@ -9279,19 +9304,43 @@
+}
--- jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
+++ jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
-@@ -119,7 +119,11 @@
+@@ -119,7 +119,9 @@
}
static boolean isBSD() {
- return osname.equals("Linux");
-+ return (osname.equals("Linux") ||
-+ osname.equals("FreeBSD") ||
-+ osname.equals("Darwin") ||
-+ osname.equals("NetBSD") ||
-+ osname.equals("OpenBSD"));
++ return (osname.equals("Linux") ||
++ osname.endsWith("BSD") ||
++ osname.contains("OS X"));
}
static final int UNINITIALIZED = -1;
+@@ -129,13 +131,13 @@
+ 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 | grep : | sed -e 's/://'",
+- "/usr/sbin/lpc -a status | grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}' | sort"
++ "/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"
+ };
+
+ String[] lpcNameCom = {
+@@ -145,7 +147,7 @@
+
+
+ static int getBSDCommandIndex() {
+- String command = "/usr/sbin/lpc status";
++ String command = "/usr/sbin/lpc status all";
+ String[] names = execCmd(command);
+
+ if ((names == null) || (names.length == 0)) {
--- jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java
+++ jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java
@@ -38,9 +38,6 @@
More information about the svn-ports-all
mailing list