Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 180460 - Make bluetooth init script in bluez-utils-3* warn when old variables are used
Summary: Make bluetooth init script in bluez-utils-3* warn when old variables are used
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Petteri Räty (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-31 15:06 UTC by Petteri Räty (RETIRED)
Modified: 2010-07-21 06:19 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
check_bluetooth.sh (check_bluetooth.sh,1.46 KB, text/plain)
2007-05-31 18:30 UTC, Dick Marinus
Details
check_bluetooth.sh (check_bluetooth.sh,1.31 KB, text/plain)
2007-05-31 20:24 UTC, Dick Marinus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petteri Räty (RETIRED) gentoo-dev 2007-05-31 15:06:27 UTC
Dick: Could you please write a patch for the current init script to warn about the old variables being used in the conf.d file?

I am talking about things like ${RFCOMM_ENABLE}. The init script could also check if the matching services are set to Autostart=true in /etc/bluetooth/*.service.
Comment 1 Dick Marinus 2007-05-31 18:30:15 UTC
Created attachment 120806 [details]
check_bluetooth.sh

Petteri please review; I think we should add some helper scripts for rfcomm, hid and pand. The new services can/ should only be configured using the DBUS interface.
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2007-05-31 19:23:56 UTC
(In reply to comment #1)
> Created an attachment (id=120806) [edit]
> check_bluetooth.sh
> 
> Petteri please review; I think we should add some helper scripts for rfcomm,
> hid and pand. The new services can/ should only be configured using the DBUS
> interface.
> 

if [ "$(eval echo \${${CONF}})" ]

what's wrong with  [  "${CONF}" ] ?

		if [ -x /etc/init.d/hidd ] ; then
			ewarn "hidd is not started by default via udev so" \
				"please add it to the required runlevels"
			ewarn "using rc-update <runlevel> add hidd."

This needs to say to remove  ${HIDD_ENABLE} from conf.d  to remove this warning
Same applies to all the other variables.

	if [ "${PAND_ENABLE}" ] ; then
		if grep -q "^Autostart=false" /etc/bluetooth/serial.service
		then

s/serial/network/

probably PAND and RFCOMM should share code

About the helper scripts please take a look at what's here:
http://websvn.kde.org/branches/work/kdebluetooth-dbus-integration/
Comment 3 Dick Marinus 2007-05-31 20:24:16 UTC
Created attachment 120819 [details]
check_bluetooth.sh

Thanks for the feedback, I've updated the function. The eval is required to get the value of a variable variable. Consider:

YKSI=1
ONE=YKSI

$ echo ${YKSI}
1

$ echo ${ONE}
YKSI

$ eval echo \$${ONE}
1

The KDE works seem promising! What do you suggest? Depend on kdebluetooth? Maybe we can ask upstream to include some simple python / shell dbus scripts.
Comment 4 Petteri Räty (RETIRED) gentoo-dev 2007-06-07 11:23:03 UTC
(In reply to comment #3)
> 
> The KDE works seem promising! What do you suggest? Depend on kdebluetooth?
> Maybe we can ask upstream to include some simple python / shell dbus scripts.
> 

Not really on option to depend on it but the upstream maintainer was saying that he would do a release some time soon so we could then package that stuff.
Comment 5 Dan A. Dickey 2007-10-23 18:22:18 UTC
(In reply to comment #3)

This has always seemed an odd (and poor) way to recurse.

TWO=1
YKSI=TWO
ONE=YKSI

$ eval echo \$${ONE}
TWO

So, playing the devil's advocate - does this really help?
Is this just known as a variable variable variable then?
What about the variable variable variable variable ... ?
Comment 6 Gustavo F. Padovan 2010-07-21 04:09:22 UTC
bluez-utils-3 was removed from portage, so we can close this bug.
Comment 7 Petteri Räty (RETIRED) gentoo-dev 2010-07-21 06:19:30 UTC
(In reply to comment #6)
> bluez-utils-3 was removed from portage, so we can close this bug.
> 

Ok. Thanks.