|
From: Bruce S. <bw...@ar...> - 2005-11-01 14:46:31
|
> In compliance with syntax offered by Heiko I try to do the following: > 1. "take a bite" the name of module and its dependencies (in form of > condition for test command ) from the line. ($f - name, $s - condition) > > 2. if $f is equivalent of $s then it means that no dependencies for this > module, > otherwise we should check condition: > if $s is true, then use this module. > > Well, I have a trouble in the condition checking. There is true > (if [ "$s" ]; then ) > or false ( if [ $s ]; then ) > _always_. > > Really I've done a lot of modifications of this simple line but > unsuccessful. What's the output of this script supposed to produce? Are you echoing the extensions that should be included due to dependencies? > There is my concept in bash (not working yet) > -----------------8<-------------------- > #!/bin/sh > > export CONFIG_MYSQL_CLIENT=y > export CONFIG_POSTGRESQL_CLIENT=y > > while read line > do > f=`echo $line | cut -d' ' -f1 ` > s=`echo $line | cut -d' ' -f2- ` > if [ "$f" = "$s" ]; then > echo $f > else > if [ "$s" ]; then > echo $f > fi > fi > done < ./perl-ext.2 > > exit 0 > -----------------8<-------------------- > > where /perl-ext.2 is: > > -----------------8<-------------------- > Carp-Clan > Bit-Vector-6.4 > Convert-ASN1 > DBI > DBD-mysql "$CONFIG_MYSQL_CLIENT" = "y" > DBI-DBD-Pg "$CONFIG_POSTGRESQL_CLIENT" = "y" > DBI-DBD-mysql "$CONFIG_MYSQL_CLIENT" = "y" > DB_File > Date-Calc > libwww-perl > perl-ldap "$CONFIG_OPENLDAPLIB" = "y" > Crypt-SmbHash > IP-Country > -----------------8<-------------------- Is the syntax of perl-ext.2 required to be that way? Can't you simplify it by only listing the variable names? Like this: -----------------8<-------------------- Carp-Clan Bit-Vector-6.4 Convert-ASN1 DBI DBD-mysql CONFIG_MYSQL_CLIENT DBI-DBD-Pg CONFIG_POSTGRESQL_CLIENT DBI-DBD-mysql CONFIG_MYSQL_CLIENT DB_File Date-Calc libwww-perl perl-ldap CONFIG_OPENLDAPLIB Crypt-SmbHash IP-Country -----------------8<-------------------- - BS |