mirror of
https://git.freebsd.org/ports.git
synced 2025-07-17 17:29:23 -04:00
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
This commit is contained in:
parent
e17751e9cf
commit
a763513dab
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=354759
3 changed files with 62 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= java devel
|
CATEGORIES= java devel
|
||||||
PKGNAMESUFFIX= -jre
|
PKGNAMESUFFIX= -jre
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
PORTNAME= openjdk6
|
PORTNAME= openjdk6
|
||||||
PORTVERSION= b31
|
PORTVERSION= b31
|
||||||
PORTREVISION?= 2
|
PORTREVISION?= 3
|
||||||
PORTEPOCH= 1
|
PORTEPOCH= 1
|
||||||
CATEGORIES= java devel
|
CATEGORIES= java devel
|
||||||
MASTER_SITES= ${MASTER_SITE_APACHE:S,%SUBDIR%/,ant/binaries/:ant,} \
|
MASTER_SITES= ${MASTER_SITE_APACHE:S,%SUBDIR%/,ant/binaries/:ant,} \
|
||||||
|
@ -245,7 +245,8 @@ post-patch:
|
||||||
${WRKSRC}/jdk/make/tools/freetypecheck/Makefile
|
${WRKSRC}/jdk/make/tools/freetypecheck/Makefile
|
||||||
@${REINPLACE_CMD} -e "s|%%LOCALBASE%%|${LOCALBASE}|" \
|
@${REINPLACE_CMD} -e "s|%%LOCALBASE%%|${LOCALBASE}|" \
|
||||||
${WRKSRC}/hotspot/src/os/bsd/vm/os_bsd.cpp \
|
${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}
|
.if ${PORT_OPTIONS:MPOLICY}
|
||||||
@${REINPLACE_CMD} -e 's|%%POLICY%%|unlimited|' \
|
@${REINPLACE_CMD} -e 's|%%POLICY%%|unlimited|' \
|
||||||
${WRKSRC}/jdk/make/javax/crypto/Makefile
|
${WRKSRC}/jdk/make/javax/crypto/Makefile
|
||||||
|
|
|
@ -5272,17 +5272,42 @@
|
||||||
+}
|
+}
|
||||||
--- jdk/src/share/classes/sun/print/PSPrinterJob.java
|
--- jdk/src/share/classes/sun/print/PSPrinterJob.java
|
||||||
+++ 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;
|
pFlags |= NOSHEET;
|
||||||
ncomps+=1;
|
ncomps+=1;
|
||||||
}
|
}
|
||||||
- if (System.getProperty("os.name").equals("Linux")) {
|
- if (System.getProperty("os.name").equals("Linux")) {
|
||||||
+
|
+
|
||||||
+ String osname = System.getProperty("os.name");
|
+ 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 = new String[ncomps];
|
||||||
execCmd[n++] = "/usr/bin/lpr";
|
- execCmd[n++] = "/usr/bin/lpr";
|
||||||
|
+ execCmd[n++] = lprPath;
|
||||||
if ((pFlags & PRINTER) != 0) {
|
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
|
||||||
+++ jdk/src/share/classes/sun/security/jgss/GSSManagerImpl.java
|
+++ jdk/src/share/classes/sun/security/jgss/GSSManagerImpl.java
|
||||||
@@ -49,8 +49,12 @@
|
@@ -49,8 +49,12 @@
|
||||||
|
@ -9279,19 +9304,43 @@
|
||||||
+}
|
+}
|
||||||
--- jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
|
--- jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
|
||||||
+++ 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() {
|
static boolean isBSD() {
|
||||||
- return osname.equals("Linux");
|
- return osname.equals("Linux");
|
||||||
+ return (osname.equals("Linux") ||
|
+ return (osname.equals("Linux") ||
|
||||||
+ osname.equals("FreeBSD") ||
|
+ osname.endsWith("BSD") ||
|
||||||
+ osname.equals("Darwin") ||
|
+ osname.contains("OS X"));
|
||||||
+ osname.equals("NetBSD") ||
|
|
||||||
+ osname.equals("OpenBSD"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static final int UNINITIALIZED = -1;
|
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
|
||||||
+++ jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java
|
+++ jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java
|
||||||
@@ -38,9 +38,6 @@
|
@@ -38,9 +38,6 @@
|
||||||
|
|
Loading…
Add table
Reference in a new issue