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

Bug#642396: live-config: In function Cmdline file existence is ignored during _SCRIPTS list construction.



Here is the better patch.

2011/9/22 Daniel Baumann <daniel.baumann@progress-technologies.net>:
> On 09/22/2011 10:31 AM, Stanislav Bogatyrev wrote:
>> If I don't have *-upstart packages installed, config.sh fails.
>
> indeed.
>
>> 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
>
> the ls just needs a guarding with || true then.
>
> --
> Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
> Email:          daniel.baumann@progress-technologies.net
> Internet:       http://people.progress-technologies.net/~daniel.baumann/
>



-- 
WBR realloc()
commit db6d02169fc7ac17e78535fe81121c4e3e88f9a3
Author: Stanislav Bogatyrev <realloc@realloc.spb.ru>
Date:   Thu Sep 22 16:42:57 2011 +0400

    Better fix for non-existent scripts

diff --git a/scripts/config.sh b/scripts/config.sh
index a8c1c00..4c86551 100755
--- a/scripts/config.sh
+++ b/scripts/config.sh
@@ -91,7 +91,7 @@ Cmdline ()
 	then
 		for _CONFIG in $(echo ${LIVE_CONFIGS} | sed -e 's|,| |g')
 		do
-			_SCRIPTS="${_SCRIPTS} $(ls /lib/live/config/???-${_CONFIG})"
+      _SCRIPTS="${_SCRIPTS} $(ls /lib/live/config/???-${_CONFIG} 2>/dev/null || true)"
 		done
 	fi
 
@@ -100,7 +100,7 @@ Cmdline ()
 	then
 		for _NOCONFIG in $(echo ${LIVE_NOCONFIGS} | sed -e 's|,| |g')
 		do
-			_SCRIPTS="$(echo ${_SCRIPTS} | sed -e "s|$(ls /lib/live/config/???-${_NOCONFIG})||")"
+      _SCRIPTS="$(echo ${_SCRIPTS} | sed -e "s|$(ls /lib/live/config/???-${_NOCONFIG} 2>/dev/null || echo none)||")"
 		done
 	fi
 }

Reply to: