Subject: Re: unportable code in check/check-subr.awk
To: None <tech-pkg@NetBSD.org>
From: Jan Schaumann <jschauma@netmeister.org>
List: tech-pkg
Date: 12/30/2006 18:35:49
--BXVAT5kNtrzKuDFl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Klaus Heinz <k.heinz.dez.sechs@kh-22.de> wrote:
=20
> Cannot open /dev/stderr: Permission denied
> Input record number 55
> Source line number 47
>=20
> due to the permissions
> -rw-r--r-- 1 root sys 46 Dec 18 04:16 /dev/stderr
>=20
> And as I look at this file, I notice that it is not a character device
> file and that /dev/stdin and /dev/stdout are missing on IRIX. Obviously
> the file was created by user 'root' (added to Bcc:) during some package
> installation.
>=20
> It looks like the check for portability needs to be more... what can I
> say :-).. more portable.
Index: check-portability.sh
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/pkgsrc/mk/check/check-portability.sh,v
retrieving revision 1.4
diff -b -u -r1.4 check-portability.sh
--- check-portability.sh 12 Dec 2006 21:10:41 -0000 1.4
+++ check-portability.sh 31 Dec 2006 02:44:57 -0000
@@ -22,7 +22,7 @@
CK_PROGNAME=3D"check-portability.awk" \
awk -f "$PKGSRCDIR/mk/check/check-subr.awk" \
-f "$PKGSRCDIR/mk/check/check-portability.awk" \
- < "$1" \
+ < "$1" >&2 \
|| cs_exitcode=3D1
}
=20
Index: check-subr.awk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/pkgsrc/mk/check/check-subr.awk,v
retrieving revision 1.2
diff -b -u -r1.2 check-subr.awk
--- check-subr.awk 11 Nov 2006 23:59:56 -0000 1.2
+++ check-subr.awk 31 Dec 2006 02:44:57 -0000
@@ -39,16 +39,16 @@
}
=20
function cs_error_msg(msg) {
- printf("ERROR: [%s] %s\n", cs_progname, msg) > "/dev/stderr";
+ printf("ERROR: [%s] %s\n", cs_progname, msg);
cs_exitcode =3D 1;
}
=20
function cs_warning_msg(msg) {
- printf("WARNING: [%s] %s\n", cs_progname, msg) > "/dev/stderr";
+ printf("WARNING: [%s] %s\n", cs_progname, msg);
}
=20
function cs_explain(msg) {
- printf("\nExplanation:\n%s\n%s%s\n\n", cs_hline, msg, cs_hline) > "/dev/s=
tderr";
+ printf("\nExplanation:\n%s\n%s%s\n\n", cs_hline, msg, cs_hline);
}
=20
function cs_exit() {
??
-Jan
--=20
"When it's fall in New York, the air smells as if someone's been frying
goats in it, and if you are keen to breathe the best plan is to open a
window and stick your head in a building."
--BXVAT5kNtrzKuDFl
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (NetBSD)
iD8DBQFFlyIFfFtkr68iakwRAlPKAJwM3kt5tzrY8CtKbQ+Rr0iwFoUqXQCfRTH1
FFBFaZ9QJwdS/yPY4aQY824=
=WoNB
-----END PGP SIGNATURE-----
--BXVAT5kNtrzKuDFl--