Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bsd.pkg.mk

0 views
Skip to first unread message

Frederick Bruckman

unread,
Jul 24, 2000, 3:00:00 AM7/24/00
to
On Mon, 24 Jul 2000, Matthias Scheler wrote:

> revision 1.516
> date: 2000/07/23 18:42:48; author: fredb; state: Exp; lines: +3 -3
> Add 'RESTRICTED' to ${BUILD_DEFS}, so that any restrictions are recorded
> in the binary package.
>
> This causes strange effect on e.g. the "racoon" package:
>
> ===> Compressing manual pages for racoon-20000719a
> RESTRICTED= Crypto
> export-controlled: not found
>
> Obviously isn't "RESTRICTED" escaped correct.

The problem is that "RESTRICTED" is _already_ escaped with
double-quotes in the package Makefile, leading to the following
(viewed with "make -n fake-pkg")...

echo "RESTRICTED= "Crypto; export-controlled"" | ${SED}...


which exposes the semi-colon. It doesn't seem necessary to ever escape
"RESTRICTED" in the package Makefile, but it seems like a lot of work
to change all those, besides adding a non-intuitive requirement to pkgsrc
(namely, no quotes in anything in BUILD_DEFS).

Un-escaping the ${ECHO} for BUILD_DEFS in bsd.pkg.mk also seems to
work fine, here, but the general problem of arbritary characters in
the "RESTRICTED" string, or any of the BUILD_DEFS variables, remains.
Bracketing the args to ${ECHO} with a single-quote doesn't quite work,
either, because many of the restriced clauses contain single-quotes.

We can use "make" to strip the quotes before quoting (as below). I'm
concerned that this uses a feature of "make" that is not present on
older systems. It's OK for 1.4.3 and 1.5, though. Can anyone verify that
this works/doesn't work on 1.4.2? Opinions?

Frederick

Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.516
diff -c -r1.516 bsd.pkg.mk
*** bsd.pkg.mk 2000/07/23 18:42:48 1.516
--- bsd.pkg.mk 2000/07/24 18:56:12
***************
*** 2930,2936 ****
fi; \
${GREP} '\$$NetBSD' $$files | ${SED} -e 's|^${PKGSRCDIR}/||' > ${BUILD_VERSION_FILE};
.for def in ${BUILD_DEFS}
! @${ECHO} "${def}= ${${def}}" | ${SED} -e 's|PATH=[^ ]*|PATH=...|' >> ${BUILD_INFO_FILE}
.endfor
@${ECHO} "CC= ${CC}-`${CC} --version`" >> ${BUILD_INFO_FILE}
.ifdef USE_PERL5
--- 2930,2936 ----
fi; \
${GREP} '\$$NetBSD' $$files | ${SED} -e 's|^${PKGSRCDIR}/||' > ${BUILD_VERSION_FILE};
.for def in ${BUILD_DEFS}
! @${ECHO} "${def}= ${${def}:S/"//g}" | ${SED} -e 's|PATH=[^ ]*|PATH=...|' >> ${BUILD_INFO_FILE}
.endfor
@${ECHO} "CC= ${CC}-`${CC} --version`" >> ${BUILD_INFO_FILE}
.ifdef USE_PERL5


Hubert Feyrer

unread,
Jul 25, 2000, 3:00:00 AM7/25/00
to
On Mon, 24 Jul 2000, Frederick Bruckman wrote:
> > ===> Compressing manual pages for racoon-20000719a
> > RESTRICTED= Crypto
> > export-controlled: not found

lynx-current has the same problem, see
ftp://smaug.fh-regensburg.de/pub/NetBSD/pkgstat/20000718.2304/www/lynx-current/.broken.i386
I've fixed both Makefiles to not use "... ; ...".


- Hubert

--
NetBSD - because Unix isn't just #include <linux.h>, i386, ILP32, ELF, ...!


Frederick Bruckman

unread,
Jul 25, 2000, 3:00:00 AM7/25/00
to
On Tue, 25 Jul 2000, Hubert Feyrer wrote:

> On Mon, 24 Jul 2000, Frederick Bruckman wrote:
> > > ===> Compressing manual pages for racoon-20000719a
> > > RESTRICTED= Crypto
> > > export-controlled: not found
>
> lynx-current has the same problem, see
> ftp://smaug.fh-regensburg.de/pub/NetBSD/pkgstat/20000718.2304/www/lynx-current/.broken.i386
> I've fixed both Makefiles to not use "... ; ...".

Unfortunately there's quite a few more. Do you want to change them
all, or strip the quotes in bsd.pkg.mk, or what?

Frederick


Hubert Feyrer

unread,
Jul 25, 2000, 3:00:00 AM7/25/00
to
On Mon, 24 Jul 2000, Frederick Bruckman wrote:
> Unfortunately there's quite a few more. Do you want to change them
> all, or strip the quotes in bsd.pkg.mk, or what?

No idea, I've fixed the ones that I knew.
Maybe using ${RESTRICTED:Q} would help (or IGNORE instead of
RESTRICTED...)

Frederick Bruckman

unread,
Jul 25, 2000, 3:00:00 AM7/25/00
to
On Tue, 25 Jul 2000, Hubert Feyrer wrote:

> On Mon, 24 Jul 2000, Frederick Bruckman wrote:
> > Unfortunately there's quite a few more. Do you want to change them
> > all, or strip the quotes in bsd.pkg.mk, or what?
>
> No idea, I've fixed the ones that I knew.
> Maybe using ${RESTRICTED:Q} would help (or IGNORE instead of
> RESTRICTED...)

Ahh... :Q is what I was looking for. I've committed a change to
bsd.pkg.mk based on using :Q to escape the metacharacters. I don't
understand what you mean by using IGNORE instead of RESTRICTED.

The only thing is, "RESTRICTED" isn't referred to explicitly, it's
{${def}:Q} where ${def} expands to RESTRICTED. I seem to recall the
recursive expansions weren't supported until recently, but it works
fine on my one year old 1.4.1 system, so maybe it's OK. If it turns
out to be a problem, we can make a special case of "RESTRICTED", but
I think it's better if every BUILD_DEF is escaped properly.

Maybe it would be good to revisit other occurences of ${ECHO} in
bsd.pkg.mk. ``${ECHO} "${foo} ${bar}"'' is pretty lame--the quotes
don't escape very much, especially not exclamation points or quotes,
so why bother? If there's a concern that "${foo}" contains arbitrary
characters, ${foo} should become ${foo:Q}, and if there's no concern,
${ECHO} doesn't need the quotes.

On another note, the export restrictions don't hold anymore. Maybe
it's about time we garbage collected all the RESTRICTED=Crypto...

Hubert Feyrer

unread,
Jul 25, 2000, 3:00:00 AM7/25/00
to
On Tue, 25 Jul 2000, Frederick Bruckman wrote:
> I don't
> understand what you mean by using IGNORE instead of RESTRICTED.

RESTRICTED is not only used to put into BUILD_DEFS, but the IGNORE
variable is set to it's value as well at some point. Maybe check if that
one needs quoting in the appropriate places, too.


> Maybe it would be good to revisit other occurences of ${ECHO} in
> bsd.pkg.mk. ``${ECHO} "${foo} ${bar}"'' is pretty lame--the quotes
> don't escape very much, especially not exclamation points or quotes,
> so why bother? If there's a concern that "${foo}" contains arbitrary
> characters, ${foo} should become ${foo:Q}, and if there's no concern,
> ${ECHO} doesn't need the quotes.

See above - the reason why i found lynx-current having a problem in the
first place was because the build failed, not because i noticed a broken
build-def noted in the pkg.


> On another note, the export restrictions don't hold anymore. Maybe
> it's about time we garbage collected all the RESTRICTED=Crypto...

Go for it. :-)

0 new messages