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

Bug#488672: live-helper: Buggy variable interpolation in functions/defaults.sh (LH_BOOTAPPEND_*)



Package: live-helper
Version: 1.0~a47-1
Severity: normal

Hi,

I've started storing my config/ directory into git, and I've noticed the
following, after several calls to the lh_config command (note that it's
achieved even with no parameters, so reproducibility should be trivial):
| $ git log -p HEAD~5..HEAD~ config/binary |filterdiff 
| --- a/config/binary
| +++ b/config/binary
| @@ -18,7 +18,7 @@ LH_BOOTAPPEND_LIVE=""
|  
|  # $LH_BOOTAPPEND_INSTALL: set boot parameters
|  # (Default: empty)
| -LH_BOOTAPPEND_INSTALL="-- }}}"
| +LH_BOOTAPPEND_INSTALL="-- }}}}}"
|  
|  # $LH_BOOTLOADER: set bootloader
|  # (Default: syslinux)
| --- a/config/binary
| +++ b/config/binary
| @@ -18,7 +18,7 @@ LH_BOOTAPPEND_LIVE=""
|  
|  # $LH_BOOTAPPEND_INSTALL: set boot parameters
|  # (Default: empty)
| -LH_BOOTAPPEND_INSTALL="-- }}"
| +LH_BOOTAPPEND_INSTALL="-- }}}"
|  
|  # $LH_BOOTLOADER: set bootloader
|  # (Default: syslinux)
| --- a/config/binary
| +++ b/config/binary
| @@ -18,7 +18,7 @@ LH_BOOTAPPEND_LIVE=""
|  
|  # $LH_BOOTAPPEND_INSTALL: set boot parameters
|  # (Default: empty)
| -LH_BOOTAPPEND_INSTALL="-- }"
| +LH_BOOTAPPEND_INSTALL="-- }}"
|  
|  # $LH_BOOTLOADER: set bootloader
|  # (Default: syslinux)
| --- a/config/binary
| +++ b/config/binary
| @@ -18,7 +18,7 @@ LH_BOOTAPPEND_LIVE=""
|  
|  # $LH_BOOTAPPEND_INSTALL: set boot parameters
|  # (Default: empty)
| -LH_BOOTAPPEND_INSTALL="-- ${LH_BOOTAPPEND_LIVE}"
| +LH_BOOTAPPEND_INSTALL="-- }"
|  
|  # $LH_BOOTLOADER: set bootloader
|  # (Default: syslinux)

I traced it down to functions/defaults.sh, especially the following
line:
|         LH_BOOTAPPEND_INSTALL="${LH_BOOTAPPEND_INSTALL:--- \${LH_BOOTAPPEND_LIVE}}"

Demo:
| cyril at exoticus:~$ unset A B
| cyril at exoticus:~$ B=${B:- \${A}}
| cyril at exoticus:~$ echo $B
| ${A}
| cyril at exoticus:~$ B=${B:- \${A}}
| cyril at exoticus:~$ echo $B
| ${A}}

And since A (LH_BOOTAPPEND_LIVE in my case) is empty, the behaviour
shown in my git log history. I'm not sure what the best course of action
is the best here to solve that.

Cheers,

-- 
Cyril Brulebois

-- System Information:
Shell: /bin/sh linked to /bin/bash

Versions of packages live-helper depends on:
ii  debootstrap                   1.0.9      Bootstrap a basic Debian system






Reply to: