[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH 2/2] use different approach to tweak gconf settings in the image (#642358).



On 10/14/2010 03:55 PM, Chris Lumens wrote:
-</gconfentryfile>
-EOF
-gconftool-2 --direct --config-source="xml:readwrite:$DEST/etc/gconf/gconf.xml.defaults" --load $GCONF_RULES_FILE
+GCONF_CONFIG_SOURCE="xml:readwrite:$DEST/etc/gconf/gconf.xml.defaults"
+echo "Updating gconf at $GCONF_CONFIG_SOURCE"
+gconf_update() {
+    path=$1
+    entry_type=$2
+    value=$3
+    CMD="gconftool-2 --direct --config-source=$GCONF_CONFIG_SOURCE -s -t $entry_type $path $value"
+    ${CMD}
+}
+gconf_update /apps/metacity/general/button_layout string :

The colon is a valid piece of shell syntax

    chris pyramid:~$ help :
    :: :
        Null command.

        No effect; the command does nothing.

        Exit Status:
        Always succeeds.

So you likely want to escape that or put it in quotes or something.

- Chris

We talked this over on IRC, but for the record:

When used with the quotes and called through ${CMD}, the quotes were passed to gconftool-2 and ended up (translated to &quot;) in the final .xml.

I changed the line for a proper command substitution:
$($CMD)

but even then the quotes stay as explained by 'man bash':
When using the $(command) form, all characters between the parentheses make up the command; none are treated specially.

So we should be safe with $($CMD). Famous last words.

Ales


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]