Subject: pkg/34982: sysutils/xentools30-hvm fails "test ==" portability checks
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <kre@munnari.OZ.AU>
List: pkgsrc-bugs
Date: 11/03/2006 11:45:00
>Number:         34982
>Category:       pkg
>Synopsis:       sysutils/xentools30-hvm fails "test ==" portability checks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 03 11:45:00 +0000 2006
>Originator:     Robert Elz
>Release:        NetBSD 3.99.15   (pkgsrc current within past few hours)
>Organization:
	Prince of Songkla University
>Environment:
System: NetBSD jade.coe.psu.ac.th 3.99.15 NetBSD 3.99.15 (GENERIC-1.696-20060125) #8: Wed Jan 25 04:59:39 ICT 2006 kre@jade.coe.psu.ac.th:/usr/obj/current/kernels/JADE_ASUS i386
Architecture: i386
Machine: i386
>Description:
	sysutils/xentools30-hvm contains stcripts that use "==' as a
	test operator instead of the correct '='

	Note that this is essentially a duplicate of PR 34976 which
	applied to sysutils/xentools30 and was fixed last night (my
	timezone...).   The identical fix - even the same patch files -
	will work for this one.

>How-To-Repeat:
	Attempt to build sysutils/xentools30-hvm with PKG_DEVELOPER=yes
	(the default when using pkg_comp).

	Expect to see ...

=> Fixing hardcoded paths.
=> Replacing python interpreter in ioemu/keymaps/convert-map.
WARNING: [replace-interpreter] Skipping non-existent file "ioemu/keymaps/convert-map".
=> Checking for portability problems in extracted files
ERROR: [check-portability.sh] => Found test ... == ...:
ERROR: [check-portability.sh] examples/blktap: if [ "$command" == 'add' ]
ERROR: [check-portability.sh] examples/block: if [ "$mode" == 'w' ]
ERROR: [check-portability.sh] examples/block: if [ "$d" == "$devmm" ]
ERROR: [check-portability.sh] examples/block: if [ "$d" == "$devmm" ]
ERROR: [check-portability.sh] examples/block: if [ "$mode" == 'w' ]
ERROR: [check-portability.sh] examples/block: if [ "$m" == 'w' ]
ERROR: [check-portability.sh] examples/block: [ "$FRONTEND_UUID" == "$othervm" ]
ERROR: [check-portability.sh] examples/block: if [ "$mode" == '!' ]
ERROR: [check-portability.sh] examples/block: if [ "$result" == 'guest' ]
ERROR: [check-portability.sh] examples/block: if [ "$mode" == 'w' ]
ERROR: [check-portability.sh] examples/block: if [ "$mode" == 'w' ] && ! stat "$file" -c %A | grep -q w
ERROR: [check-portability.sh] examples/block: if [ "$mode" == '!' ]
ERROR: [check-portability.sh] examples/block: if [ "$d" == "$dev" ]
ERROR: [check-portability.sh] examples/block: if [ "$f" == "$file" ]
ERROR: [check-portability.sh] examples/block: if [ "$loopdev" == '' ]
ERROR: [check-portability.sh] examples/block: if [ "$loopdev" == '' ]
ERROR: [check-portability.sh] examples/vif-route: if [ "$command" == "online" ]
ERROR: [check-portability.sh] examples/vif-nat: if [ "$ip" == "" ]
ERROR: [check-portability.sh] examples/vif-nat: if [ "$command" == "online" ]
ERROR: [check-portability.sh] examples/external-device-migrate: if [ "$1" == "-step" ]; then
ERROR: [check-portability.sh] examples/external-device-migrate: elif [ "$1" == "-host" ]; then
ERROR: [check-portability.sh] examples/external-device-migrate: elif [ "$1" == "-domname" ]; then
ERROR: [check-portability.sh] examples/external-device-migrate: elif [ "$1" == "-type" ]; then
ERROR: [check-portability.sh] examples/external-device-migrate: elif [ "$1" == "-subtype" ]; then
ERROR: [check-portability.sh] examples/external-device-migrate: elif [ "$1" == "-recover" ]; then
ERROR: [check-portability.sh] examples/external-device-migrate: elif [ "$1" == "-help" ]; then
ERROR: [check-portability.sh] examples/external-device-migrate: if [ "$step"    == "" -o             "$host"    == "" -o             "$typ"     == "" -o            "$domname" == "" ]; then
ERROR: [check-portability.sh] examples/external-device-migrate: if [ "$recover" == "1" ]; then
ERROR: [check-portability.sh] examples/vif-bridge: if [ "$command" == "online" ]
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/sysutils/xentools30-hvm
*** Error code 1

>Fix:
	Add patches to convert the '==' to '='

	And yes Manuel, this should be done - if these were simply
	totally unused scripts buried somewhere in the sources that
	no-one ever sees, and aren't used, then I might agree that simplly
	ignoring them would be adequate.   But they're not, they're in the
	examples directory - an obvious place for people to look to see
	how things should be done.   It doesn't matter that none of these
	scripts happens to get installed into /usr/pkg on NetBSD - not
	everyone does a "make clean" after building packages, and we really
	should have the examples showing the sane syntax and not the
	linux/bash nonsense.

	So, Rolland, thanks for fixing PR 34976 so quickly.  If you feel
	inclined, please copy the new patch file(s) [patch-e?] from
	sysutils/xentools30 to sysutils/xentools30-hvm - I have verified
	that they work unchanged (after updating distinfo naturaly).