FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 12-10-2007, 08:23 PM
Donnie Berkholz
 
Default gentoo-x86 commit in net-wireless/hostapd: ChangeLog hostapd-0.4.9.ebuild hostapd-0.6.1.ebuild hostapd-0.6.0.ebuild

On 09:42 Mon 10 Dec , Bjarke Istrup Pedersen (gurligebis) wrote:
> 1.1 net-wireless/hostapd/hostapd-0.6.1.ebuild
>
> file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-wireless/hostapd/hostapd-0.6.1.ebuild?rev=1.1&view=markup
> plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-wireless/hostapd/hostapd-0.6.1.ebuild?rev=1.1&content-type=text/plain

> generate_config() {
> local CONFIG="${S}/.config"
>
> # toolchain setup
> echo "CC = $(tc-getCC)" > ${CONFIG}
>
> # EAP authentication methods
> echo "CONFIG_EAP=y" >> ${CONFIG}
> echo "CONFIG_EAP_MD5=y" >> ${CONFIG}
>
> if use ssl; then
> # SSL authentication methods
> echo "CONFIG_EAP_TLS=y" >> ${CONFIG}
> echo "CONFIG_EAP_TTLS=y" >> ${CONFIG}
> echo "CONFIG_EAP_MSCHAPV2=y" >> ${CONFIG}
> echo "CONFIG_EAP_PEAP=y" >> ${CONFIG}
> fi
>
> echo "CONFIG_EAP_GTC=y" >> ${CONFIG}
> echo "CONFIG_EAP_SIM=y" >> ${CONFIG}
> echo "CONFIG_EAP_AKA=y" >> ${CONFIG}
> echo "CONFIG_EAP_PAX=y" >> ${CONFIG}
> echo "CONFIG_EAP_PSK=y" >> ${CONFIG}
> echo "CONFIG_EAP_SAKE=y" >> ${CONFIG}
> echo "CONFIG_EAP_GPSK=y" >> ${CONFIG}
> echo "CONFIG_EAP_GPSK_SHA256=y" >> ${CONFIG}
>
> # drivers
> echo "CONFIG_DRIVER_HOSTAP=y" >> ${CONFIG}
> echo "CONFIG_DRIVER_WIRED=y" >> ${CONFIG}
> echo "CONFIG_DRIVER_PRISM54=y" >> ${CONFIG}

I'd probably rework this a bit to make it a little simpler. Here's a
couple of ways:

Method 1: Just use braces, so you don't need to say ' >> ${CONFIG}' 50 times

{
echo "CONFIG_EAP_GTC=y"
echo "CONFIG_EAP_SIM=y"
echo "CONFIG_EAP_AKA=y"
echo "CONFIG_EAP_PAX=y"
echo "CONFIG_EAP_PSK=y"
echo "CONFIG_EAP_SAKE=y"
echo "CONFIG_EAP_GPSK=y"
echo "CONFIG_EAP_GPSK_SHA256=y"
echo "CONFIG_EAP_GTC=y"
echo "CONFIG_EAP_SIM=y"
echo "CONFIG_EAP_AKA=y"
echo "CONFIG_EAP_PAX=y"
echo "CONFIG_EAP_PSK=y"
echo "CONFIG_EAP_SAKE=y"
echo "CONFIG_EAP_GPSK=y"
echo "CONFIG_EAP_GPSK_SHA256=y"
} >> ${CONFIG}


Method 2: Make a new function, to really reduce the code

enable_config() {
local i
for i in $@; do
echo CONFIG_${i}=y >> ${CONFIG}
done
}

enable_config
EAP_GTC
EAP_SIM
EAP_AKA
EAP_PAX
EAP_PSK
EAP_SAKE
EAP_GPSK
EAP_GPSK_SHA256
EAP_GTC
EAP_SIM
EAP_AKA
EAP_PAX
EAP_PSK
EAP_SAKE
EAP_GPSK
EAP_GPSK_SHA256

# drivers
enable_config
DRIVER_HOSTAP
DRIVER_WIRED
DRIVER_PRISM54

Thanks,
Donnie
--
gentoo-dev@gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 08:49 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org