* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild [not found] <E1Ibx0a-00013X-7e@stork.gentoo.org> @ 2007-09-30 20:59 ` Donnie Berkholz 2007-10-01 5:58 ` Alin Năstac 0 siblings, 1 reply; 10+ messages in thread From: Donnie Berkholz @ 2007-09-30 20:59 UTC (permalink / raw To: gentoo-dev, mrness On 11:30 Sun 30 Sep , Alin Nastac (mrness) wrote: > 1.1 mail-filter/dspam/dspam-3.8.0-r7.ebuild > > file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/dspam/dspam-3.8.0-r7.ebuild?rev=1.1&view=markup > plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/dspam/dspam-3.8.0-r7.ebuild?rev=1.1&content-type=text/plain > use large-domain && myconf="${myconf} --enable-large-scale" || \ > myconf="${myconf} --enable-domain-scale" > > use user-homedirs && myconf="${myconf} --enable-homedir" > > use debug && myconf="${myconf} --enable-debug --enable-bnr-debug" > > if use virtual-users ; then > if use mysql || use postgres ; then > myconf="${myconf} --enable-virtual-users" > fi > fi > > if use mysql || use postgres ; then > myconf="${myconf} --enable-preferences-extension" > fi I think you could use use_enable() or use_with() for many of these. $(use_enable large-domain large-scale) $(use_enable !large-domain domain-scale) $(use_enable user-homedirs homedir) $(use_enable debug) $(use_enable debug bnr-debug) $(use mysql || use postgres && use_enable virtual-users) ... Thanks, Donnie -- gentoo-dev@gentoo.org mailing list ^ permalink raw reply [flat|nested] 10+ messages in thread
* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild 2007-09-30 20:59 ` [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild Donnie Berkholz @ 2007-10-01 5:58 ` Alin Năstac 2007-10-01 6:23 ` Mike Frysinger 2007-10-01 6:26 ` Donnie Berkholz 0 siblings, 2 replies; 10+ messages in thread From: Alin Năstac @ 2007-10-01 5:58 UTC (permalink / raw To: Donnie Berkholz; +Cc: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 898 bytes --] Donnie Berkholz wrote: > On 11:30 Sun 30 Sep , Alin Nastac (mrness) wrote: > >> 1.1 mail-filter/dspam/dspam-3.8.0-r7.ebuild >> >> file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/dspam/dspam-3.8.0-r7.ebuild?rev=1.1&view=markup >> plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/dspam/dspam-3.8.0-r7.ebuild?rev=1.1&content-type=text/plain >> if use mysql || use postgres ; then >> myconf="${myconf} --enable-preferences-extension" >> fi >> > > I think you could use use_enable() or use_with() for many of these. > > $(use mysql || use postgres && use_enable virtual-users) > According to bash manual, && has a greater precedence than ||. That would translate in: $(use mysql || (use postgres && use_enable virtual-users)) which will result in use_enable virtual-users being enabled only when USE="-mysql postgres". [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 252 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild 2007-10-01 5:58 ` Alin Năstac @ 2007-10-01 6:23 ` Mike Frysinger 2007-10-01 6:26 ` Donnie Berkholz 1 sibling, 0 replies; 10+ messages in thread From: Mike Frysinger @ 2007-10-01 6:23 UTC (permalink / raw To: gentoo-dev; +Cc: Alin Năstac, Donnie Berkholz [-- Attachment #1: Type: text/plain, Size: 1192 bytes --] On Monday 01 October 2007, Alin Năstac wrote: > Donnie Berkholz wrote: > > On 11:30 Sun 30 Sep , Alin Nastac (mrness) wrote: > >> 1.1 mail-filter/dspam/dspam-3.8.0-r7.ebuild > >> > >> file : > >> http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/dspam/dspam- > >>3.8.0-r7.ebuild?rev=1.1&view=markup plain: > >> http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/dspam/dspam- > >>3.8.0-r7.ebuild?rev=1.1&content-type=text/plain if use mysql || use > >> postgres ; then > >> myconf="${myconf} --enable-preferences-extension" > >> fi > > > > I think you could use use_enable() or use_with() for many of these. > > > > $(use mysql || use postgres && use_enable virtual-users) > > According to bash manual, && has a greater precedence than ||. That > would translate in: i think i buy into Don Libes' philosophy ... use proper parentheses and operator precedence be damned ... if you have to look up the relationship of operators to make sure things are kosher, then chances are someone else wont and will screw it up. whatever precedence language $x has, chances are it wont match exactly language $y, so break out the () loving. -mike [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 827 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild 2007-10-01 5:58 ` Alin Năstac 2007-10-01 6:23 ` Mike Frysinger @ 2007-10-01 6:26 ` Donnie Berkholz 2007-10-01 7:11 ` Alin Năstac 1 sibling, 1 reply; 10+ messages in thread From: Donnie Berkholz @ 2007-10-01 6:26 UTC (permalink / raw To: Alin Năstac; +Cc: gentoo-dev On 08:58 Mon 01 Oct , Alin Năstac wrote: > According to bash manual, && has a greater precedence than ||. That > would translate in: Where'd you see that? Here's my man page: A list is a sequence of one or more pipelines separated by one of the operators ;, &, &&, or ||, and optionally terminated by one of ;, &, or <newline>. Of these list operators, && and || have equal precedence, followed by ; and &, which have equal precedence. Oh, now I see. You're reading about precedence in [[ ]] blocks, which aren't being used here. [[ expression ]] ... Expressions may be combined using the following operators, listed in decreasing order of precedence: ( expression ) Returns the value of expression. This may be used to override the normal precedence of operators. ! expression True if expression is false. expression1 && expression2 True if both expression1 and expression2 are true. expression1 || expression2 True if either expression1 or expression2 is true. Thanks, Donnie -- gentoo-dev@gentoo.org mailing list ^ permalink raw reply [flat|nested] 10+ messages in thread
* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild 2007-10-01 6:26 ` Donnie Berkholz @ 2007-10-01 7:11 ` Alin Năstac 2007-10-01 7:22 ` Donnie Berkholz 0 siblings, 1 reply; 10+ messages in thread From: Alin Năstac @ 2007-10-01 7:11 UTC (permalink / raw To: Donnie Berkholz; +Cc: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 1619 bytes --] Donnie Berkholz wrote: > On 08:58 Mon 01 Oct , Alin Năstac wrote: > >> According to bash manual, && has a greater precedence than ||. That >> would translate in: >> > > Where'd you see that? Here's my man page: > > A list is a sequence of one or more pipelines separated by one of the > operators ;, &, &&, or ||, and optionally terminated by one of ;, &, or > <newline>. > > Of these list operators, && and || have equal precedence, followed by ; > and &, which have equal precedence. > > Oh, now I see. You're reading about precedence in [[ ]] blocks, which > aren't being used here. > > OK, I misread the manual, but even if && and || have same precedence, bash manual says: The control operators && and || denote AND lists and OR lists, respectively. An AND list has the form command1 && command2 command2 is executed if, and only if, command1 returns an exit status of zero. An OR list has the form command1 || command2 command2 is executed if and only if command1 returns a non-zero exit status. The return status of AND and OR lists is the exit status of the last com- mand executed in the list. In this case, $(use mysql || use postgres && use_enable virtual-users) will result in use_enable virtual-users being executed if and only if USE="-mysql postgres". See this pseudocode: if use mysql do nothing else if use postgres use_enable virtual Wouldn't be best to die in pkg_setup if USE="virtual-users -mysql -postgres" ? [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 252 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild 2007-10-01 7:11 ` Alin Năstac @ 2007-10-01 7:22 ` Donnie Berkholz 2007-10-01 7:43 ` Alin Năstac 0 siblings, 1 reply; 10+ messages in thread From: Donnie Berkholz @ 2007-10-01 7:22 UTC (permalink / raw To: Alin Năstac; +Cc: gentoo-dev On 10:11 Mon 01 Oct , Alin Năstac wrote: > In this case, $(use mysql || use postgres && use_enable virtual-users) > will result in use_enable virtual-users being executed if and only if > USE="-mysql postgres". See this pseudocode: No .... if use mysql succeeds, || use postgres is skipped entirely and we go straight to the && use_enable. It's considered directly in order with no precedence. To stretch it out: if use mysql; then # skip || use postgres enable virtual-users if ! use mysql; then # run OR: use postgres if use postgres; then enable virtual-users fi fi > if use mysql do nothing > else if use postgres > use_enable virtual > > Wouldn't be best to die in pkg_setup if USE="virtual-users -mysql > -postgres" ? It's better to do something smart than to force interactivity. In this case, you as the maintainer would decide whether this USE combo meant the user wanted virtual-users (if so, forcibly enable one of mysql or postgres), or whether the user definitely did not want to pull in a database (if so, force off virtual-users). Thanks, Donnie -- gentoo-dev@gentoo.org mailing list ^ permalink raw reply [flat|nested] 10+ messages in thread
* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild 2007-10-01 7:22 ` Donnie Berkholz @ 2007-10-01 7:43 ` Alin Năstac 2007-10-01 8:04 ` Donnie Berkholz 0 siblings, 1 reply; 10+ messages in thread From: Alin Năstac @ 2007-10-01 7:43 UTC (permalink / raw To: Donnie Berkholz; +Cc: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 1396 bytes --] Donnie Berkholz wrote: > On 10:11 Mon 01 Oct , Alin Năstac wrote: > >> In this case, $(use mysql || use postgres && use_enable virtual-users) >> will result in use_enable virtual-users being executed if and only if >> USE="-mysql postgres". See this pseudocode: >> > > No .... if use mysql succeeds, || use postgres is skipped entirely and > we go straight to the && use_enable. It's considered directly in order > with no precedence. > > You're right again. :-[ >> if use mysql do nothing >> else if use postgres >> use_enable virtual >> >> Wouldn't be best to die in pkg_setup if USE="virtual-users -mysql >> -postgres" ? >> > > It's better to do something smart than to force interactivity. In this > case, you as the maintainer would decide whether this USE combo meant > the user wanted virtual-users (if so, forcibly enable one of mysql or > postgres), or whether the user definitely did not want to pull in a > database (if so, force off virtual-users). > I cannot force mysql or postgres dependency just because user enabled virtual-users flag. IMO this case would definitely qualify for a pkg_setup die because virtual-users is a local useflag. By selecting virtual-users without enabling mysql or postgres storage backend, the user proved to be clueless and ebuild should provide the much needed clue. [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 252 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild 2007-10-01 7:43 ` Alin Năstac @ 2007-10-01 8:04 ` Donnie Berkholz 2007-10-01 8:27 ` Alin Năstac 0 siblings, 1 reply; 10+ messages in thread From: Donnie Berkholz @ 2007-10-01 8:04 UTC (permalink / raw To: gentoo-dev On 10:43 Mon 01 Oct , Alin Năstac wrote: > Donnie Berkholz wrote: > > It's better to do something smart than to force interactivity. In this > > case, you as the maintainer would decide whether this USE combo meant > > the user wanted virtual-users (if so, forcibly enable one of mysql or > > postgres), or whether the user definitely did not want to pull in a > > database (if so, force off virtual-users). > > > I cannot force mysql or postgres dependency just because user enabled > virtual-users flag. > IMO this case would definitely qualify for a pkg_setup die because > virtual-users is a local useflag. By selecting virtual-users without > enabling mysql or postgres storage backend, the user proved to be > clueless and ebuild should provide the much needed clue. One way to proceed is to not have both mysql and postgres as USE flags. Have one as a flag, and have negation of that flag mean to use the other. Does that make sense for this package, or can they both reasonably be used at the same time? I strongly discourage dying here; do something smart and log a warning to the user about it. Thanks, Donnie -- gentoo-dev@gentoo.org mailing list ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild 2007-10-01 8:04 ` Donnie Berkholz @ 2007-10-01 8:27 ` Alin Năstac 2007-10-01 8:41 ` Donnie Berkholz 0 siblings, 1 reply; 10+ messages in thread From: Alin Năstac @ 2007-10-01 8:27 UTC (permalink / raw To: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 1845 bytes --] Donnie Berkholz wrote: > On 10:43 Mon 01 Oct , Alin Năstac wrote: > >> Donnie Berkholz wrote: >> >>> It's better to do something smart than to force interactivity. In this >>> case, you as the maintainer would decide whether this USE combo meant >>> the user wanted virtual-users (if so, forcibly enable one of mysql or >>> postgres), or whether the user definitely did not want to pull in a >>> database (if so, force off virtual-users). >>> >>> >> I cannot force mysql or postgres dependency just because user enabled >> virtual-users flag. >> IMO this case would definitely qualify for a pkg_setup die because >> virtual-users is a local useflag. By selecting virtual-users without >> enabling mysql or postgres storage backend, the user proved to be >> clueless and ebuild should provide the much needed clue. >> > > One way to proceed is to not have both mysql and postgres as USE flags. > Have one as a flag, and have negation of that flag mean to use the > other. Does that make sense for this package, or can they both > reasonably be used at the same time? > > sqlite, mysql and postgres useflags controls the storage backend drivers installed by this package. dspam can be installed with multiple storage drivers, but only one can be active and it is selected through its configuration file. > I strongly discourage dying here; do something smart and log a warning > to the user about it. > okay, how about this code: if use mysql || use postgres; then myconf="${myconf} $(use_enable virtual-users)" else myconf="${myconf} --disable-virtual-users" use virtual-users && ewarn "virtual-users support has been disabled because none of the compatible storage drivers who support that are enabled" fi [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 252 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild 2007-10-01 8:27 ` Alin Năstac @ 2007-10-01 8:41 ` Donnie Berkholz 0 siblings, 0 replies; 10+ messages in thread From: Donnie Berkholz @ 2007-10-01 8:41 UTC (permalink / raw To: gentoo-dev On 11:27 Mon 01 Oct , Alin Năstac wrote: > okay, how about this code: > if use mysql || use postgres; then > myconf="${myconf} $(use_enable virtual-users)" > else > myconf="${myconf} --disable-virtual-users" > use virtual-users && ewarn "virtual-users support has been > disabled because none of the compatible storage drivers who support that > are enabled" > fi Great! Thanks, Donnie -- gentoo-dev@gentoo.org mailing list ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-10-01 8:54 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <E1Ibx0a-00013X-7e@stork.gentoo.org> 2007-09-30 20:59 ` [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in mail-filter/dspam: ChangeLog dspam-3.8.0-r7.ebuild Donnie Berkholz 2007-10-01 5:58 ` Alin Năstac 2007-10-01 6:23 ` Mike Frysinger 2007-10-01 6:26 ` Donnie Berkholz 2007-10-01 7:11 ` Alin Năstac 2007-10-01 7:22 ` Donnie Berkholz 2007-10-01 7:43 ` Alin Năstac 2007-10-01 8:04 ` Donnie Berkholz 2007-10-01 8:27 ` Alin Năstac 2007-10-01 8:41 ` Donnie Berkholz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox