Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 158227 - mail-filter/dspam-3.6.8 ebuild won't work correctly with more than one database use-flag set
Summary: mail-filter/dspam-3.6.8 ebuild won't work correctly with more than one databa...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Alin Năstac (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-15 08:54 UTC by arno
Modified: 2006-12-19 01:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild lets the user choose the backend in pkg_config (dspam-3.6.8-r1.ebuild,16.27 KB, text/plain)
2006-12-17 06:37 UTC, arno
Details

Note You need to log in before you can comment on or make changes to this bug.
Description arno 2006-12-15 08:54:57 UTC
# emerge --info
Portage 2.1.1-r1 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.4-r4, 2.6.17.13 i686)
=================================================================
System uname: 2.6.17.13 i686 Pentium III (Coppermine)
Gentoo Base System version 1.12.6
Last Sync: Fri, 15 Dec 2006 04:20:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: [Not Present]
dev-lang/python:     2.3.5-r2, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium3 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/X11/xkb /usr/lib/fax /var/bind /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=pentium3 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/"
LINGUAS="de en"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://193.190.198.20/gentoo-portage"
USE="x86 acl alsa apache2 apm arts berkdb bitmap-fonts cli cracklib crypt cups dlloader dri eds elibc_glibc emboss encode esd foomaticdb fortran gdbm gif gpm gstreamer gtk2 iconv imlib input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 isdnlog jpeg kernel_linux ldap libg++ libwww linguas_de linguas_en mad mikmod mmx motif mp3 mpeg mysql ncurses nls nptl nptlonly ogg opengl oss pam pcre perl png postgres pppd python qt3 qt4 quicktime readline reflection sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts udev userland_GNU vhost video_cards_apm video_cards_ark video_cards_ati video_cards_chips video_cards_cirrus video_cards_cyrix video_cards_dummy video_cards_fbdev video_cards_glint video_cards_i128 video_cards_i740 video_cards_i810 video_cards_imstt video_cards_mga video_cards_neomagic video_cards_nsc video_cards_nv video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage video_cards_siliconmotion video_cards_sis video_cards_sisusb video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng video_cards_v4l video_cards_vesa video_cards_vga video_cards_via video_cards_vmware video_cards_voodoo vorbis xml xorg xv zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS

As you can see, both the mysql and the postgres use-flags are set (I need the mysql-database on that specific server, but postgres-support for
 other apps, like eg. ipac-ng, if you wonder why I do this). With this configuration, the ebuild will try to create a mysql-db AND a postgres-db for dspam, w/o asking which one to use. Furthermore, the dspam.cron-script won't work correctly because in line 18 /etc/mail/dspam/*.data is expanded to two files by the shell, resulting in an error (from bash -x dspam.cron):
...
+ '[' -f /etc/mail/dspam/mysql.data /etc/mail/dspam/pgsql.data ']'
dspam.cron: line 18: [: /etc/mail/dspam/mysql.data: binary operator expected

Possible solutions:
1. Cancel ebuild if more than one database use-flag is set, and maybe instruct the user how to set the use-flags right in package.use
2. Ask the use in pkg_config which database to use
Comment 1 Alin Năstac (RETIRED) gentoo-dev 2006-12-15 23:35:25 UTC
(In reply to comment #0)
> Possible solutions:
> 1. Cancel ebuild if more than one database use-flag is set, and maybe instruct
> the user how to set the use-flags right in package.use

Obviously NO. Being able to switch between backends is an important feature of dspam.
 
> 2. Ask the use in pkg_config which database to use

Sure, why not? Care to attach a patch?
Comment 2 arno 2006-12-17 06:37:11 UTC
Created attachment 104207 [details]
ebuild lets the user choose the backend in pkg_config
Comment 3 arno 2006-12-17 06:44:33 UTC
Comment on attachment 104207 [details]
ebuild lets the user choose the backend in pkg_config

It's not perfect, but it should do the job. I don't really know how to handle the unused *.data files in /etc/mail/dspam. The filename must be changed to something other than *.data, because otherwise the dspam.cron-script won't work. For now, they are renamed to *.data.not.in.use, but maybe it's a better idea to delete them.
Comment 4 Alin Năstac (RETIRED) gentoo-dev 2006-12-19 01:55:55 UTC
I've fixed in -r1 using a more robust approach:
 - now cron script is able to work even if you have multiple *.data files
 - pkg_config asks you what backend you want to configure and it does only that. Unless your variant, it doesn't accept selection of uninstalled backends.