optional_depends bug ....

Jasper Huijsmans jasper at moongroup.com
Sun May 18 13:26:41 GMT 2003


Hmm, I believe you are right.

Probably the person who wrote it meant to say 

  if ! is_depends ...

however, the problem with that is that when another module already
depends on it you can't use the optional_depends to add extra
compilation flags.

So, IMO your fix is correct and I've added it to CVS. Please yell at me
if it breaks anything.

	Jasper


On Fri, 16 May 2003 21:12:57 +0200
"Joel Vennin (linuxgames)" <jol at linuxgames.com> wrote:

> Hello, I think the bug is here :
> 
> In the optional_depends function of the run_depends function.
> 
> Just an example with doxygen.
> Doxygen has Textex as optional depend.
> 
> In my system Textex is not installed.
> let's comment ....
> 
> if ! in_depends "$MODULE" "$1" ; then
> 
>       if module_exiled $1 ; then  ## Tetex is not exiled
>         verbose_msg "\"$MODULE\" optionally depends on \"$1\""
>         add_depends  "$MODULE"  "$1"  "off"  "optional"  "$2"  "$3"
>       else
> 
>         if module_installed $1 || module_held $1 ; then    ## Tetex is
>         not
> insalled and no held ...
>           DEFAULT="y"
> 	else
>           DEFAULT="n"
>         fi
> 
>         if is_depends $1 ; then   <--- Problem is here
> 	  if query  "Install optional dependency $1 $4? " $DEFAULT ;
> 	  then <-- never
> here !!!!
>             lin  --deps  $1
>             add_depends  "$MODULE"  "$1"  "on"   "optional"  "$2" 
>             "$3"
>           else
> 	    add_depends  "$MODULE"  "$1"  "off"  "optional"  "$2"  "$3"
> 	  fi
>       fi
> fi
> 
> Let's explain, is_depend try to find Tetex in the depends files, but
> Tetex is not installed on my machine, so is_depend return false. And
> if is_depend return false "" if query  "Install optional dependency $1
> $4? " $DEFAULT ; "" is never called.
> 
> Just see is_depend ()
> is_depends()  {  (
>   #  Is $1 a previously selected dependency of any module.
>   EXIT_STATUS="false"
> 
>   for  DEP  in  `cut  -d :  -f2-  $DEPENDS_STATUS  |
>                  grep  "^$1:"`         <<<----- As i haven't Tetex
>                  installed
> this command return nothing and this function return false.
>   do
>     DEP_STATUS=`echo  "$DEP"  |  cut  -d :  -f2`
>     if    [  "$DEP_STATUS"  ==  "on"  ]
>     then  EXIT_STATUS="true"
>           break
>     fi
>   done
>   $EXIT_STATUS
> )  }
> 
> 
> 
> So, Some one can explain why there is the  "if is_depends $1 "
> condition ?
> 
> Thanks,
> 
> Jol
> 
> 
> 
> _______________________________________________
> Lunar-dev mailing list
> Lunar-dev at lunar-linux.org
> http://lunar-linux.org/mailman/listinfo/lunar-dev


-- 


More information about the Lunar-dev mailing list