From owner-freebsd-java@FreeBSD.ORG Wed May 21 20:10:02 2014 Return-Path: Delivered-To: freebsd-java@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50ECDBA4 for ; Wed, 21 May 2014 20:10:02 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DE3F2B3A for ; Wed, 21 May 2014 20:10:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LKA28K088231 for ; Wed, 21 May 2014 20:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4LKA1Ce088230; Wed, 21 May 2014 20:10:01 GMT (envelope-from gnats) Date: Wed, 21 May 2014 20:10:01 GMT Message-Id: <201405212010.s4LKA1Ce088230@freefall.freebsd.org> To: freebsd-java@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: ports/189905: commit references a PR Reply-To: dfilter@FreeBSD.ORG (dfilter service) X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 20:10:02 -0000 The following reply was made to PR ports/189905; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/189905: commit references a PR Date: Wed, 21 May 2014 20:03:19 +0000 (UTC) Author: jkim Date: Wed May 21 20:03:14 2014 New Revision: 354761 URL: http://svnweb.freebsd.org/changeset/ports/354761 QAT: https://qat.redports.org/buildarchive/r354761/ 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). [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] Added: head/java/openjdk7/files/patch-src-share-classes-sun-print-PSPrinterJob.java (contents, props changed) head/java/openjdk7/files/patch-src-solaris-bin-java_md_solinux.c (contents, props changed) head/java/openjdk7/files/patch-src-solaris-classes-sun-print-UnixPrintServiceLookup.java (contents, props changed) Modified: head/java/openjdk7/Makefile Modified: head/java/openjdk7/Makefile ============================================================================== --- head/java/openjdk7/Makefile Wed May 21 19:58:46 2014 (r354760) +++ head/java/openjdk7/Makefile Wed May 21 20:03:14 2014 (r354761) @@ -3,7 +3,7 @@ PORTNAME= openjdk PORTVERSION= ${JDK_MAJOR_VERSION}.${PORT_MINOR_VERSION}.${PORT_BUILD_NUMBER} -PORTREVISION= 4 +PORTREVISION= 5 PORTEPOCH= 1 CATEGORIES= java devel MASTER_SITES= http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}u${JDK_MINOR_VERSION}/promoted/b${JDK_BUILD_NUMBER}/ \ @@ -130,7 +130,8 @@ MAKE_ENV+= EXTRA_CFLAGS=-DLIBICONV_PLUG post-patch: @${REINPLACE_CMD} "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/sun/print/PSPrinterJob.java .if empty(ICONV_LIB) @${REINPLACE_CMD} 's| -liconv||' \ ${WRKSRC}/Makefile \ Added: head/java/openjdk7/files/patch-src-share-classes-sun-print-PSPrinterJob.java ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/java/openjdk7/files/patch-src-share-classes-sun-print-PSPrinterJob.java Wed May 21 20:03:14 2014 (r354761) @@ -0,0 +1,36 @@ +--- jdk/src/share/classes/sun/print/PSPrinterJob.java ++++ jdk/src/share/classes/sun/print/PSPrinterJob.java +@@ -1568,9 +1568,31 @@ + } + + String osname = System.getProperty("os.name"); +- if (osname.equals("Linux") || osname.equals("FreeBSD") || osname.equals("NetBSD") || osname.equals("OpenBSD") || osname.equals("OS X")) { ++ 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; + } Added: head/java/openjdk7/files/patch-src-solaris-bin-java_md_solinux.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/java/openjdk7/files/patch-src-solaris-bin-java_md_solinux.c Wed May 21 20:03:14 2014 (r354761) @@ -0,0 +1,38 @@ +--- jdk/src/solaris/bin/java_md_solinux.c ++++ jdk/src/solaris/bin/java_md_solinux.c +@@ -899,8 +899,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) +@@ -927,9 +928,13 @@ + } + } + } +-#elif defined(__linux__) ++#elif defined(__linux__) || defined(__FreeBSD__) + { ++#if defined(__FreeBSD__) ++ const char* self = "/proc/curproc/file"; ++#else + const char* self = "/proc/self/exe"; ++#endif + char buf[PATH_MAX+1]; + int len = readlink(self, buf, PATH_MAX); + if (len >= 0) { +@@ -937,7 +942,7 @@ + exec_path = JLI_StringDup(buf); + } + } +-#else /* !__solaris__ && !__linux__ */ ++#else /* !__solaris__ && !__linux__ && !__FreeBSD__ */ + { + /* Not implemented */ + } Added: head/java/openjdk7/files/patch-src-solaris-classes-sun-print-UnixPrintServiceLookup.java ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/java/openjdk7/files/patch-src-solaris-classes-sun-print-UnixPrintServiceLookup.java Wed May 21 20:03:14 2014 (r354761) @@ -0,0 +1,17 @@ +--- 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" + }; + _______________________________________________ svn-ports-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-ports-all To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"