[Lunar-commits] r27011 - lunar/trunk/var/lib/lunar/functions

Chad 'v3rt1g0' Kittel v3rt1g0 at lunar-linux.org
Thu Feb 28 19:25:53 CET 2008


Moe,

On Thu, Feb 28, 2008 at 11:25 AM, Moritz Heiber <moe at lunar-linux.org> wrote:
> Author: moe
>  Date: 2008-02-28 18:25:04 +0100 (Thu, 28 Feb 2008)
>  New Revision: 27011
>
>  Modified:
>    lunar/trunk/var/lib/lunar/functions/misc.lunar

I like what you did here, thanks!

I have one question though.  Why are we going through the effort to
create the temp file so soon?  Why not wait until we pass all of the
initial IF conditions?   If any of the IF conditions are false, you
are creating and destroying a temp file for no reason.  I would have
scoped that variable and temp file creation inside the "if [ `grep -s
$1 /etc/ld.so.conf` ] ; then" block.

>
>  Modified: lunar/trunk/var/lib/lunar/functions/misc.lunar
>  ===================================================================
>  --- lunar/trunk/var/lib/lunar/functions/misc.lunar      2008-02-28 07:24:53 UTC (rev 27010)
>  +++ lunar/trunk/var/lib/lunar/functions/misc.lunar      2008-02-28 17:25:04 UTC (rev 27011)
>  @@ -46,16 +46,17 @@
>
>   ld_remove() {
>         debug_msg "ld_remove ($@)"
>  +       TMP_LD_CONF=$(temp_create "ldsoconf")
>
>         if [ ! -z "$1" ] && [ -d "$1" ] ; then
>                 if [ `grep -s $1 /etc/ld.so.conf` ] ; then
>                         verbose_msg "Removing $1 from ld.so.conf"
>  -                       grep -v $1 /etc/ld.so.conf > /etc/ld.so.conf.new
>  -                       rm /etc/ld.so.conf
>  -                       mv /etc/ld.so.conf.new /etc/ld.so.conf
>  +                       grep -v $1 /etc/ld.so.conf > $TMP_LD_CONF
>  +                       cat $TMP_LD_CONF > /etc/ld.so.conf
>                         ldconfig
>                 fi
>         fi
>  +       temp_destroy $TMP_LD_CONF
>   }
>

-- 
  _
(\o/) Chad 'v3rt1g0' Kittel <chad.kittel at gmail.com>
 /_\  Beaver Dam, WI (USA)   [4 8 15 16 23 42]
"This is who we are."  //  Lunar Linux developer // عزرایل


More information about the Lunar-dev mailing list