|
From: Heiko Z. <he...@zu...> - 2005-11-03 20:42:31
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, November 2, 2005 05:57, Serge Leschinsky wrote: > Dear Heiko, Bruce > > > I've done it. The intermediate file was created... > This diff is an example only. > > > The syntax of config/perl-ext is the following: > > >> Convert-ASN1 >> DBI >> DBI-DBD-mysql "$CONFIG_MYSQL_CLIENT" = "y" >> "$CONFIG_MYSQL_CLIENT" = "y" Looks good to me. > --- build-1/scripts/perl 2005-10-18 11:42:58.000000000 +0400 > +++ build/scripts/perl 2005-11-02 14:46:32.000000000 +0300 > @@ -65,8 +65,27 @@ > do bzcat $PATCH | patch -p0 || exit 1 done + > +# Do the list with checked dependencies > + if [ -f $DL_DIR/tmp/perl-ext.tmp ]; then > + rm -f $DL_DIR/tmp/perl-ext.tmp > + fi > + > + while read line > + do > + f=`echo $line | cut -d' ' -f1 ` > + s=`echo $line | cut -d' ' -f2- ` > + > + if [ "$f" = "$s" ]; then > + echo $fi >> > $DL_DIR/tmp/perl-ext.tmp > + else > + if `eval test $s` ; then > + echo $f >> > $DL_DIR/tmp/perl-ext.tmp Instead of doing the echo here and then parsing the file in the for statement below, it would make sense to cimbine everything and compile the module right here. > + fi > + fi > + done < $MYDIR/config/perl-ext > > > - for EXT in $(cat $MYDIR/config/perl-ext) > + for EXT in $(cat $DL_DIR/tmp/perl-ext.tmp | grep > -v "^#") > do pushd $DL_DIR/tmp/perl-*/$EXT* echo "******** compiling perl extension > $EXT ********" - -- Regards Heiko Zuerker http://www.devil-linux.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFDanYqUcytMSbs+YURAobQAJ9Swyk9Afg/3Cp0LQJRmL6451MNUQCfeQ0B Z8pty+kvanBmKxoACZPH/os= =5hgt -----END PGP SIGNATURE----- |
|
From: Serge L. <fi...@in...> - 2005-11-04 14:39:52
|
Dear Heiko, Thursday, November 3, 2005, 11:42:18 PM, you wrote: >> + if [ "$f" = "$s" ]; then >> + echo $fi >> $DL_DIR/tmp/perl-ext.tmp >> + else >> + if `eval test $s` ; then >> + echo $f >> $DL_DIR/tmp/perl-ext.tmp > Instead of doing the echo here and then parsing the file in the for > statement below, it would make sense to cimbine everything and compile the > module right here. There are 2 places for the compile code. Code doubling is bad form and therefore I should write a function... But in this case I have to save parameters ($1) from parent script. Or haven't? Am I right ? Could you please advise me a write way? -- Best regards, Serge mailto:fi...@in... |
|
From: Heiko Z. <he...@zu...> - 2005-11-04 14:46:32
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hey,
On Fri, November 4, 2005 08:39, Serge Leschinsky wrote:
> Dear Heiko,
>
>
> Thursday, November 3, 2005, 11:42:18 PM, you wrote:
>
>
>
>>> + if [ "$f" = "$s" ]; then
>>> + echo $fi >> $DL_DIR/tmp/perl-ext.tmp
>>> + else
>>> + if `eval test $s` ; then
>>> + echo $f >> $DL_DIR/tmp/perl-ext.tmp
>>>
>
>> Instead of doing the echo here and then parsing the file in the for
>> statement below, it would make sense to cimbine everything and compile
>> the module right here.
> There are 2 places for the compile code. Code doubling is bad form and
> therefore I should write a function... But in this case I have to save
> parameters ($1) from parent script. Or haven't? Am I right ? Could you
> please advise me a write way?
There's actually only 1 place for compiling the perl extensions:
for EXT in $(cat $MYDIR/config/perl-ext | grep -v
"^#")
do
pushd $WORKDIR/perl-ext/$EXT*
echo "******** compiling perl extension
$EXT ********"
yes "" | perl Makefile.PL PREFIX=/usr ||
exit 1
strip_debug
make install || exit 1
popd
done
- --
Regards
Heiko Zuerker
http://www.devil-linux.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDa3Q6UcytMSbs+YURArEDAJ9JrBI+wuOg2oK7nHOCRFn1UZmEgwCgkLH/
r32iG6BWtE9cdyGeYl/17z8=
=WfPq
-----END PGP SIGNATURE-----
|
|
From: Serge L. <fi...@in...> - 2005-11-04 15:01:07
|
Dear Heiko, Friday, November 4, 2005, 5:46:19 PM, you wrote: >>>> + if [ "$f" = "$s" ]; then >>>> + echo $fi >> $DL_DIR/tmp/perl-ext.tmp >>>> + else >>>> + if `eval test $s` ; then >>>> + echo $f >> $DL_DIR/tmp/perl-ext.tmp >>>> >> >>> Instead of doing the echo here and then parsing the file in the for >>> statement below, it would make sense to cimbine everything and compile >>> the module right here. >> There are 2 places for the compile code. Code doubling is bad form and >> therefore I should write a function... But in this case I have to save >> parameters ($1) from parent script. Or haven't? Am I right ? Could you >> please advise me a write way? > There's actually only 1 place for compiling the perl extensions: It was the one place . But wrote the code with 2 places (see echo $fi). And therefore exactly I use intermediate file. -- Best regards, Serge mailto:fi...@in... |
|
From: Heiko Z. <he...@zu...> - 2005-11-07 22:58:40
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hey, I finally had a chance to look over the code and you're right, it is in 2 places. I guess I was blind before. I'd say do to changes the way you proposed it (the bash version). On Fri, November 4, 2005 09:01, Serge Leschinsky wrote: > Dear Heiko, > > > Friday, November 4, 2005, 5:46:19 PM, you wrote: > >>>>> + if [ "$f" = "$s" ]; then >>>>> + echo $fi >> $DL_DIR/tmp/perl-ext.tmp >>>>> + else >>>>> + if `eval test $s` ; then >>>>> + echo $f >> $DL_DIR/tmp/perl-ext.tmp >>>>> >>>>> >>> >>>> Instead of doing the echo here and then parsing the file in the for >>>> statement below, it would make sense to cimbine everything and >>>> compile the module right here. >>> There are 2 places for the compile code. Code doubling is bad form >>> and therefore I should write a function... But in this case I have to >>> save parameters ($1) from parent script. Or haven't? Am I right ? >>> Could you >>> please advise me a write way? > >> There's actually only 1 place for compiling the perl extensions: >> > > It was the one place . But wrote the code with 2 places (see > echo $fi). And therefore exactly I use intermediate file. - -- Regards Heiko Zuerker http://www.devil-linux.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD4DBQFDb9wPUcytMSbs+YURAoJ9AJ4hkXiR8n4ZDDTchph859oXo97IAgCYidGq RsVdh0VFX3KyXypElWwhiA== =w+b5 -----END PGP SIGNATURE----- |
|
From: Serge L. <fi...@in...> - 2005-11-08 09:14:40
|
Dear Heiko,
> I finally had a chance to look over the code and you're right, it is in 2
> places. I guess I was blind before.
> I'd say do to changes the way you proposed it (the bash version).
I've done it in another way. But it is very dirty yet - I haven't had time for
cleaning (really, I can't write a working "if" with 2 conditions (
logical AND) for some reason, so have to do it by adding return codes
:-\
while read line
do
f=`echo $line | cut -d' ' -f1 `
s=`echo $line | cut -d' ' -f2- `
# This is the logical AND :-(
ff=`test "$f" = "$s"`
ff=$?
ss=`eval test $s`
ss=$?
sum=`expr $ss + $ff`
if [ "$sum" -le "1" ]; then
echo $f
fi
done < ./perl-ext.1
I haven't investigated yet why something like this
if [ `test "$f" = "$s"` -a `eval test $s` ]; then
doesn't work.
--
Best regards,
Serge mailto:fi...@in...
|
|
From: Heiko Z. <he...@zu...> - 2005-11-08 15:47:30
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tue, November 8, 2005 03:16, Serge Leschinsky wrote:
> Dear Heiko,
>
>
>
>> I finally had a chance to look over the code and you're right, it is in
>> 2
>> places. I guess I was blind before. I'd say do to changes the way you
>> proposed it (the bash version).
>
> I've done it in another way. But it is very dirty yet - I haven't had
> time for cleaning (really, I can't write a working "if" with 2 conditions
> (
> logical AND) for some reason, so have to do it by adding return codes :-\
>
>
> while read line do f=`echo $line | cut -d' ' -f1 ` s=`echo $line | cut
- -d' '
> -f2- `
>
>
> # This is the logical AND :-(
> ff=`test "$f" = "$s"` ff=$? ss=`eval test $s` ss=$? sum=`expr $ss + $ff`
>
> if [ "$sum" -le "1" ]; then echo $f fi done < ./perl-ext.1
>
> I haven't investigated yet why something like this
> if [ `test "$f" = "$s"` -a `eval test $s` ]; then doesn't work.
Maybe because $s is not a valid test statement, when $f=$s , since it's
only the name of the perl extension.
What you could do is (very loose syntax):
- ----------------
do_compile=0
if "$f" = "$s"
do_compile=1
else
if `eval test $s`
do_compile=1
fi
fi
if $do_compile = 1
; compile
fi
- ----------------
It looks a bit cleaner and is easier to understand.
- --
Regards
Heiko Zuerker
http://www.devil-linux.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDcMiGUcytMSbs+YURAiPGAJ9bWvKS8IPaSQoAZ14WV2HMdgU+dQCgm38n
G5Sv/WWiPvSuRDNFZ9iK/JY=
=erJF
-----END PGP SIGNATURE-----
|