NetBSD Problem Report #4341
Received: (qmail 28230 invoked by uid 1000); 25 Oct 1997 01:02:14 -0000
Message-Id: <19971025010214.28229.qmail@mail.NetBSD.ORG>
Date: 25 Oct 1997 01:02:14 -0000
From: cgd@NetBSD.ORG
Reply-To: cgd@NetBSD.ORG
To: gnats-bugs@gnats.netbsd.org
Subject: bsd.port.subdir.mk deficiencies.
X-Send-Pr-Version: 3.95
>Number: 4341
>Category: pkg
>Synopsis: bsd.port.subdir.mk deficiencies
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: agc
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Oct 24 18:05:01 +0000 1997
>Closed-Date: Fri Jan 09 13:07:47 +0000 1998
>Last-Modified: Fri Jan 09 13:09:10 +0000 1998
>Originator: Chris G. Demetriou
>Release: NetBSD-current as of right now.
>Organization:
Kernel Hackers 'r' Us
>Environment:
System: NetBSD brick.demetriou.com 1.3_ALPHA NetBSD 1.3_ALPHA (BRICK) #1: Wed Oct 22 23:26:01 PDT 1997 cgd@brick.demetriou.com:/usr/src/sys/arch/i386/compile/BRICK i386
>Description:
bsd.port.subdir.mk uses control characters unnecessarily.
This makes the file more annoying to read, edit, and cut&paste,
and is bad form for .mk templates in general.
Also, bsd.port.subdir.mk doesn't necessarily output valid
html for the README.html (in particular, doesn't turn
HTML metacharacters into the proper HTML entities).
>How-To-Repeat:
Control characters:
Take a look at the cat ${README} | sed ... expressions in the
README.html rule. At first glance, it might seem that this use
of control characters is, while perhaps not necessary, somewhat
useful, because it helps avoid complexity in escaping characters
which may show up in file names.
Note that the use of control-B is completely unnecessary.
There's just no reason to use a control character here, and
any character not otherwise used in the substitute expression
(e.g. ,) would work just as well.
The use of control-A was seemingly intended to avoid characters
used in path names. However, there's no guarantee that a
control-A won't appear in a pathname, and there _is_ one
character which is guaranteed to not appear, in this case: /.
The 'internal' sed command (the one currently using control-B's 8-)
has the purpose of producing the component name name of the
current directory, which cannot contain any slashes! Therefore,
it's 'safe' to use / as the delimiter character in this case.
Invalid HTML:
Look at the same set of sed commands. Think of what
happens if the output contains HTML metacharacters (e.g. < and >),
perhaps because the pkg DESCR contains those characters or for
other reasons. Note that they'll end up in the output html
file as-is (rathr than being converted into entities, e.g.
< and >), and that therefore the resulting file will
in all likelyhood be invalid html (or, if it's valid html, it
probably doesn't contain what was intended).
>Fix:
Control characters:
Replace the control characters used with different characters.
I'd suggest replacing the control-As with slashes, and the
control-Bs with commas.
HTML:
Post-process the html as appopriate, to convert metacharacters
to the proper HTML entities. This is probably best done by
processing in the data as it's being put into the file, rather
than afterward, so that metacharacters which really are supposed
to be there don't have to be handled specially.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->Analyzed
State-Changed-By: agc
State-Changed-When: Thu Jan 8 03:05:46 PST 1998
State-Changed-Why:
I took a look at the problem, and recent versions of the files
seem to have fixed this (fix by Bill Fenner of FreeBSD)
Responsible-Changed-From-To: gnats-admin->agc
Responsible-Changed-By: agc
Responsible-Changed-When: Thu Jan 8 03:05:46 PST 1998
Responsible-Changed-Why:
agc took over responsibility
From: "Chris G. Demetriou" <cgd@pa.dec.com>
To: agc@netbsd.org
Cc: cgd@pa.dec.com, gnats-bugs@netbsd.org
Subject: Re: pkg/4341
Date: Thu, 08 Jan 98 17:17:30 -0800
> I took a look at the problem, and recent versions of the files
> seem to have fixed this (fix by Bill Fenner of FreeBSD)
Right. I think I sent you the diffs that he sent me. 8-)
chris
State-Changed-From-To: Analyzed->closed
State-Changed-By: agc
State-Changed-When: Fri Jan 9 05:07:47 PST 1998
State-Changed-Why:
cgd agreed that the problem was now fixed.
>Unformatted:
I think that this has been fixed in the latest bsd.port.mk and bsd.port.subdir.mk,
thanks to some changes made originally by Bill Fenner of FreeBSD, and forwarded
to agc by cgd.
Specifically bsd.port.mk 1.28 (from the trunk), and bsd.port.subdir.mk 1.4
and 1.5 (from the trunk) should have these fixes in them.
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.