Subject: pkg/18941: lang/*-j{re,dk}1[34] needlessly fiddle with distfiles
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kre@munnari.OZ.AU>
List: netbsd-bugs
Date: 11/05/2002 19:09:56
>Number:         18941
>Category:       pkg
>Synopsis:       lang/*-j{re,dk}1[34] needlessly fiddle with distfiles
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 05 04:22:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Robert Elz
>Release:        NetBSD 1.6I   pkgsrc of 2002-11-04
>Organization:
	Prince of Songkla University
>Environment:
	
	
System: NetBSD jade.coe.psu.ac.th 1.6I NetBSD 1.6I (JADE) #4: Sun Oct 6 11:28:17 ICT 2002 kre@fuchsia.cs.mu.OZ.AU:/usr/obj/sys/JADE i386
Architecture: i386
Machine: i386
>Description:
	The various jre and jdk packages all insist that the distfiles
	be executable.   That's fine, and as ftp/http don't generally
	leave files with the 'x' bit set, "chmod +x" after fetching is
	fine to make sure the 'x' bit is correctly set.

	However, once is enough!   Doing the chmod +x every time that
	"make fetch" is run is just needless churn.  It causes the
	st_ctime field to be updated, even though nothing has changed
	(this can be viewed as a kernel bug, but it is very hard to
	fix cleanly, and also would be a definite interface change).

	That then causes dump to dump the files (which aren't small)
	when there is no actual need for that.  It also makes it hard
	to determine which distfiles have changed (or are new) and which
	are not (unless you know to ignore changes to the 6 in question).

>How-To-Repeat:
	Have the distfile already for (at least) one of the packages
	in question (any one of them, it doesn't matter).   It will be
	even more illustrative if you have them on read-only media, or
	owned by someone else, when you aren't root, if you don't use
	the sun-j*13 packages (those ignore errors on the chmod, the others
	don't)
>Fix:
	For sun-jre13 (which includes sun-jdk13 via .include in the Makefile)
	apply the patch below.   For sun-jre14 and blackdown-jre13
	make a similar change (submitting 3 PRs for this would be insane,
	and breaking apart 3 patches in this one PR would be far more work
	than just applying the trivial change by hand).

--- Makefile.common.was	Wed Oct 16 03:41:33 2002
+++ Makefile.common	Tue Nov  5 18:49:11 2002
@@ -52,7 +52,8 @@
 
 .if ${OPSYS} != "Darwin"
 post-fetch:
-	@-${CHMOD} +x ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX}
+	@-test -x ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} || \
+		${CHMOD} +x ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX}
 .endif
 
 post-build:
>Release-Note:
>Audit-Trail:
>Unformatted: