Bug#642396: live-config: In function Cmdline file existence is ignored during _SCRIPTS list construction.
2011/9/22 Daniel Baumann <daniel.baumann@progress-technologies.net>:
> retitle 642396 please don't fail if non-existing scripts are specified
> severity 642396 wishlist
> tag 642396 - patch
> thanks
>
> On 09/22/2011 09:48 AM, Stanislav Bogatyrev wrote:
>> In function Cmdline file existence is ignored during _SCRIPTS list construction.
>> This leaves live system in unconfigured state.
> this is a purely cosmetical problem if a user specifies a script that
> doesn't exist.
No, scripts that doesn't exist are specified not by user, but in
Cmdline itself.
live-config.noautologin|noautologin)
# Disables both console and graphical autologin.
_SCRIPTS="${_SCRIPTS:-$(ls /lib/live/config/*)}"
LIVE_NOCONFIGS="${LIVE_NOCONFIGS},sysvinit,gdm,gdm3,kdm,lightdm,lxdm,nodm,slim,upstart,xinit"
If I don't have *-upstart packages installed, config.sh fails.
>> Here is the patch to fix the issue.
> since live-config is supposed to be optimized for speed, your patch is
> suboptimal.
>
> it introduces one if check for all _SCRIPTS that get assembled, one if
> check for all _SCRIPTS that get removed. so, for those that actually get
> removed, you introduce *two* if checks, and for those who actually get
> run, you introduce one if check.
>
> it's much simpler/faster/elegant to only check the resulting scripts in
> the end, once, before sourcing them.
The error is rised by ls in _SCRIPTS="${_SCRIPTS} $(ls
/lib/live/config/???-${_CONFIG})"
live-config:ls: cannot access /lib/live/config/???-opernssh-server:
No such file or directory
So checking the list at the end will not fix the issue.
--
WBR realloc()
Reply to: