Le samedi 17 avril 2010 à 14:32 +0200, Stevan Bajić a écrit :
> On Sat, 17 Apr 2010 11:04:35 +0200
> Julien Valroff <jul...@kirya.net> wrote:
[...@
> I am an idiot! I did not looked properly how the dspam.conf file is
> separating each section. The script from below should work better and
> will modify the created files to be like the one you have in that
> archive I downloaded from your page:
> ----------------------
> for foo in Hash=hash ExtLookup=extlookup SQLite=sqlite MySQL=mysql 
> PostgreSQL=pgsql;
> do
>       sed -n -e "/^#[\t ]\{1,99\}\-\{2,3\}[\t ]\{1,99\}${foo%=*}[\t 
> ]\{1,99\}\-\{2,3\}[\t ]*$/,/^#[\t ]\{1,99\}\-\{2,3\}[\t 
> ]\{1,99\}[^-]\{1,99\}\-\{2,3\}[\t ]*$/p" src/dspam.conf.in > 
> debian/config/${foo#*=}.conf;
>       sed -i -e '$d' debian/config/${foo#*=}.conf;
>       if [ "${foo%=*}" == "MySQL" ];
>       then
>               # Activate MySQL database configuration
>               sed -e "s:^#*\(MySQLServer[\t 
> ]\{1,\}\).*:\1/var/run/mysqld/mysqld.sock:gI" \
>                       -e "s:^#*\(MySQLPort[\t ]\{1,\}\).*:#\13306:gI" \
>                       -e "s:^#*\(MySQLUser[\t ]\{1,\}\).*:\1_DBC_DBUSER_:gI" \
>                       -e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1_DBC_DBPASS_:gI" \
>                       -e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1_DBC_DBNAME_:gI" \
>                       -e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1true:gI" \
>                       -e "s:^#*\(MySQLReconnect[\t ]\{1,\}\).*:\1true:gI" \
>                       -i debian/config/${foo#*=}.conf;
>       elif [ "${foo%=*}" == "PostgreSQL" ];
>       then
>               # Activate PostgreSQL database configuration
>               sed -e "s:^#*\(PgSQLServer[\t ]\{1,\}\).*:\1127.0.0.1:gI" \
>                       -e "s:^#*\(PgSQLPort[\t ]\{1,\}\).*:\15432:gI" \
>                       -e "s:^#*\(PgSQLUser[\t ]\{1,\}\).*:\1_DBC_DBUSER_:gI" \
>                       -e "s:^#*\(PgSQLPass[\t ]\{1,\}\).*:\1_DBC_DBPASS_:gI" \
>                       -e "s:^#*\(PgSQLDb[\t ]\{1,\}\).*:\1_DBC_DBNAME_:gI" \
>                       -i debian/config/${foo#*=}.conf;
>       fi;
> done;
> ----------------------

Thanks again for your work.

The calls to sed for MySQL and PgSQL aren't needed, as they are already
in a patch which sets the default configuration for Debian (only minor
adjustments).

Your script runs fine, but I don't manage transforming it so that it
works in the debian/rules file (in order to avoid calling an external
shell script). rules is actually a Makefile.

Here is what I get in the build log:
#for foo in ExtLookup=extlookup SQLite=sqlite MySQL=mysql PostgreSQL=pgsql 
Hash=hash;
#do
#       sed -n -e "/^# \-\-  \-\-[\t ]*,/^# \-\- [^-]\{1,99\}\-\-[\t ]*p" 
src/dspam.conf.in > debian/config/.conf;
#       sed -i -e '' debian/config/.conf;
#done;

I've tried the $${foo} variable format, but still doesn't work.

Any hint on his?

Cheers,
Julien


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Dspam-devel mailing list
Dspam-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspam-devel

Reply via email to