pkgsrc-WIP-discuss archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkglint -Wall



On Sun, 5 Feb 2006, Roland Illig wrote:

> In general, use the :Q operator. But pay attention if the variable appears in
> 'single quotes', "double quotes" or `backticks`. There are subtle differences
> in the way the shell interprets those strings, and I'm not sure yet how to do
> it right. One popular example where pkglint could issue a warning but
> suppresses it are sed(1) replacements:
>
> SUBST_SED.foo+=       -e 's,@PREFIX@,${PREFIX},g'

btw in the package I was twiddling, I used something akin to

SUBST_SED.foo+=         s,@PREFIX@,${PREFIX},g

as I determined that in this case (a single editing command) the -e is not
needed, which makes the quotes not needed either.

> Here, PREFIX is first interpreted by the shell. For that, it would suffice to
> write ${PREFIX:Q}. But after that, the string gets further interpreted by
> sed(1), which handles backslashes and & specially. As long as we don't have
> backslashes and & in the ${PREFIX}, this doesn't matter. But if you replace
> PREFIX with CPPFLAGS in this example, things look different. It is not
> uncommon to say CPPFLAGS += -DLLONG=long\ long, and there you have a
> backslash. Of course, one could write
> s,@CPPFLAGS@,${CPPFLAGS:C/\\/\\\\/g:C/&/\\\&/:Q},g, but this looks terribly
> complicated, and casual packagers should not be required to write, read and
> understand this.

since the place where the command line is built is in fact in subst.mk,
can this construct not be included there rather than in the package
Makefile?

iain


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
pkgsrc-wip-discuss mailing list
pkgsrc-wip-discuss%lists.sourceforge.net@localhost
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-discuss



Home | Main Index | Thread Index | Old Index