Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 360467 - mail-mta/postfix should check for PostgreSQL slot being set
Summary: mail-mta/postfix should check for PostgreSQL slot being set
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Net-Mail Packages
URL: http://forums.gentoo.org/viewtopic-p-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-25 19:28 UTC by Aaron W. Swenson
Modified: 2011-04-01 20:31 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron W. Swenson gentoo-dev 2011-03-25 19:28:52 UTC
When a valid slot isn't set by postgresql.eselect, funny things can happen, some of which are the fault of the current module, but that's beside the point, primarily that the emerge of mail-mta/postfix fails because configure tries to parse 'eselect to set postgresql slot' as a list of library locations or files. The failure, however, does not plainly indicate that as being the issue.

Reproducible: Always

Steps to Reproduce:
1. eselect postgresql unset <all slots>
2. emerge mail-mta/postfix



The test can be simple:
if use postgres ; then
    if [ "$(eselect postgresql show)" = "(none)" ] ; then
        eerror "You must select which slot you want to build Postfix against before emerging"
        eerror "this package, or disable the 'postgres' USE flag."
        eerror "For valid slot selections:"
        eerror "    eselect postgresql list"
        die "Default PostgreSQL slot not selected."
    fi
fi

You can get fancier, but with the module either a slot is set or it isn't, "(none)".
Comment 1 Tim Harder gentoo-dev 2011-04-01 04:07:25 UTC
I think it would be better if the default slot was set via the postgresql ebuilds when it is first installed. That way new users don't have to configure much of anything and users with postgresql already installed should know how to use eselect to update to new versions if wanted.

Actually, isn't something like this already done in the first few lines of pkg_postinst for the postgresql ebuilds?
Comment 2 Aaron W. Swenson gentoo-dev 2011-04-01 11:12:36 UTC
Yes, but it doesn't prevent people from un-setting the slot.
Comment 3 Tim Harder gentoo-dev 2011-04-01 19:23:37 UTC
(In reply to comment #2)
> Yes, but it doesn't prevent people from un-setting the slot.

Then it should be up to the postgresql eselect module to solve the problem or at least warn the user when they unset everything.

Otherwise, every ebuild that uses pg_config similar to postfix (i.e. cyrus-sasl, clisp, pgperl, and a few others) would have to add some functionality like you mentioned in comment #1.
Comment 4 Aaron W. Swenson gentoo-dev 2011-04-01 20:31:56 UTC
I really wish you folks would quit talking sense.