freebsd-ports/java/openjdk7/files/patch-src-solaris-classes-sun-print-UnixPrintServiceLookup.java
Jung-uk Kim d7cffff692 - 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). [1]
- Use /proc/curproc/file to find its executable path if available.  It fixes
java/icedtea-web, for example. [2]

PR:		ports/178856 [1]
PR:		java/189905 [2]
2014-05-21 20:03:14 +00:00

17 lines
727 B
Java

--- jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
+++ jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
@@ -140,12 +140,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"
};