Subject: pkg/25255: devel/cvsup{,-gui}-bin has absurd DISTSUBDIR
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kre@munnari.OZ.AU>
List: pkgsrc-bugs
Date: 04/20/2004 18:57:25
>Number:         25255
>Category:       pkg
>Synopsis:       devel/cvsup{,-gui}-bin has absurd DISTSUBDIR
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 20 11:59:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Robert Elz
>Release:        NetBSD 1.6X   --- pkgsrc as of now (2004-04-20)
>Organization:
	Prince of Songkla University
>Environment:
System: NetBSD jade.coe.psu.ac.th 1.6X NetBSD 1.6X (JADE) #17: Wed Sep 24 20:25:35 ICT 2003 kre@jade.coe.psu.ac.th:/usr/src/real-sys/arch/i386/compile/JADE i386
Architecture: i386
Machine: i386
>Description:
	devel/cvsup-bin (and devel/cvsup-gui-bin) has

	   DIST_SUBDIR=    cvsup-${MACHINE_ARCH}-${OS_VERSION:C/(...).*/\1/}

	which is all very fancy, but totally bogus, and causes the pkg to
	fail to build on anything which isn't NetBSD 1.6*.

	The "anything which isn't NetBSD" isn't a problem, as it also has

	   ONLY_FOR_PLATFORM=      NetBSD-1.[5-9]*-i386 NetBSD-[2-9]*-i386

	which is OK, but that implies that NetBSD-1.5* and netBSD-2.0*
	should be OK.

	The DIST_SUBDIR setting breaks them however.   The ${MACHINE_ARCH}
	part of it is harmless (but totally useless, as the ONLY_FOR_PLATFORM
	guarantees that it will always be i386) 

	However, the fancy OS_VERSION expression gets the current
	system's OS version and uses that as part of the DIST_SUBDIR
	which is totally bogus.   The distinfo file expects the
	DIST_SUBDIR to be cvsup-i386-1.6 (and nothing else), if it
	is cvsup-i386-2.0 or cvsup-i386-1.5 then the digest check of
	the distfile fails (no cvsup-i386-1.6/* file exists).

	This looks to be a bogus attempt to plan for future extensibility
	to other architectures and OS's - at the minute that cannot work,
	there's exactly one distfile, and it is for NetBSD i386, not
	for anything else.   Don't write code to handle cases that cannot
	be tested.

>How-To-Repeat:
	Try installing (of even just doing "make checksum" of cvsup-bin
	(or cvsup-gui-bin) on NetBSD-1.5.x or NetBSD-2.0B (or whatever)
	-- anything that doesn't have 1.6 in its version ID (2.0B was
	where I noticed this).

>Fix:
	change DIST_SUBDIR to

		DIST_SUBDIR=    cvsup-i386-1.6

	A better fix (in the cleanest way) would be to do away with
	DIST_SUBDIR altogether, it isn't needed for either of these packages,
	each has just one distfile, which correctly identifies its pkg name
	and has a good version identifier.

	However, to make life easier for all the people who are using 1.6
	based NetBSD versions (most I'd expect) and who have already fetched
	the distfiles into a cvsup-i386-1.6 DIST_SUBDIR, leaving it set that
	way will avoid needlessly fetching the distfiles again.

	Add a note to remove the DIST_SUBDIR the next time the package is
	upgraded.

	No PKGREVISION change is needed for this fix.

	Remember to fix both cvsup-bin and cvsup-gui-bin (in the same way).
>Release-Note:
>Audit-Trail:
>Unformatted: