public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Escaping+Quoting notes for linux-mod.eclass
@ 2008-03-23 21:59 Robin H. Johnson
  0 siblings, 0 replies; only message in thread
From: Robin H. Johnson @ 2008-03-23 21:59 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1725 bytes --]

Hi folks,

Just a quick note about Escaping+Quoting stuff relevant to the usage of
linux-mod.eclass.

Up until recently, linux-mod.eclass had a bug where if you passed
variables inside the $BUILD_PARAMS variable, AND those inner variables
contained spaces, they would not be passed to Make correctly. This would
manifest itself as Make trying to compile strange targets (words from
contents of the inner variable).

After fixing this in linux-mod, alonbl pointed out to me that it was
causing some other breakages, for usages of BUILD_PARAMS that did not
have correct quoting - and thus the eclass fix now passed some newline
characters from the ebuilds to the Make, which also caused failures.

Here's the change blob from bestcrypt, as it illustrates how to fix the
issue very nicely:
> @@ -40,10 +40,10 @@ pkg_setup() {
>  	BUILD_TARGETS="all"
> -	BUILD_PARAMS="
> -		CPP=\"$(tc-getCXX)\"
> -		KERNEL_DIR=\"${KV_DIR}\"
> -		VER=${KV_MAJOR}.${KV_MINOR}
> +	BUILD_PARAMS=" \
> +		CPP=\"$(tc-getCXX)\" \
> +		KERNEL_DIR=\"${KV_DIR}\" \
> +		VER=${KV_MAJOR}.${KV_MINOR} \
>  		KEXT=${KV_OBJ}"

I have fixed the following builds in the tree, but there may be others
in overlays out there:
app-crypt/bestcrypt
app-emulation/mol
sys-fs/redirfs
sys-fs/fuse

x11-drivers/nvidia-drivers and sys-fs/loop-aes were already safe.

If your BUILD_PARAMS does not span multiple lines you won't have issues
with the newlines, however you should probably check it anyway, test it
by having a KV_DIR that contains a space in the pathname.

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Infra Guy
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

[-- Attachment #2: Type: application/pgp-signature, Size: 329 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-23 21:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-23 21:59 [gentoo-dev] Escaping+Quoting notes for linux-mod.eclass Robin H. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox