Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 548068 - games-misc/fortune-mod offensive fortune not working right
Summary: games-misc/fortune-mod offensive fortune not working right
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-28 21:15 UTC by Don Wilburn
Modified: 2015-04-30 16:18 UTC (History)
0 users

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


Attachments
emerge --info amd64 (fortune,4.66 KB, text/plain)
2015-04-28 21:18 UTC, Don Wilburn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Don Wilburn 2015-04-28 21:15:02 UTC
The specific offensive fortunes do not show up right with the -o flag.  They _are_ installed.  
I'll elaborate in the additional information.

Reproducible: Always

Steps to Reproduce:
1.fortune -o limerick
2.
3.
Actual Results:  
No fortunes found

Expected Results:  
a dirty limerick

This happens on this amd64 and my old DEC Alpha running Gentoo.
If you change directories to /usr/share/fortune/off and execute 
fortune limerick (with or without -o) it will work.
The offensive fortunes are there, but the program doesn't seem to know where to look by default.  
I could copy the offensive foartunes to /usr/share/fortune, which lets them work, but doesn't keep them segregated.
Oh, a simple fortune -o DOES give a random offensive fortune.  The problem is specifying the database, e.g. fortune -o limerick.
I could attach the emerge --info as a file before.  I don't see that option now.  I'll work on getting that info to you.  Cut/paste is not practical.
Comment 1 Don Wilburn 2015-04-28 21:18:05 UTC
Created attachment 402198 [details]
emerge --info amd64

Here is the emerge --info from this amd64 machine.
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2015-04-29 02:26:35 UTC
That's not how the code works.  If you give it anything after the -o option, the -o option is ignored.  It's documented (poorly?) in the man page:

"The -o option is ignored if a fortune directory is specified."

What it means is that if any non-option argument appears with the -o option, the -o option is ignored.

The only way to do what you're trying to do is point at the file directly:

fortune /usr/share/fortune/off/limerick
Comment 3 Don Wilburn 2015-04-29 15:25:35 UTC
(In reply to Mr. Bones. from comment #2)
> That's not how the code works.  If you give it anything after the -o option,
> the -o option is ignored.  It's documented (poorly?) in the man page:
> 
> "The -o option is ignored if a fortune directory is specified."
> 
> What it means is that if any non-option argument appears with the -o option,
> the -o option is ignored.
> 
> The only way to do what you're trying to do is point at the file directly:
> 
> fortune /usr/share/fortune/off/limerick

Slackware's fortune man page says "...1994 BSD..." and it works as I described.  But it doesn't say netbsd like Gentoo...  I don't know their source for code.

The Gentoo man page says that you can append -o to the end of a simple database name, e.g. fortune limerick-o, and it will strip off the -o and search for the name in the offensive directory.
That doesn't work either

Maybe that's where you got your idea about the -o being ignored?  I don't see what you mean about -o being ignored.  The top of the man page says it should be run:  fortune [-o] [name]

This is obviously low priority, and offensive fortunes can be made to work with extra effort, but something isn't working right.
Comment 4 Don Wilburn 2015-04-30 05:48:21 UTC
(In reply to Mr. Bones. from comment #2)
> That's not how the code works.  If you give it anything after the -o option,
> the -o option is ignored.  It's documented (poorly?) in the man page:
> 
> "The -o option is ignored if a fortune directory is specified."
> 
> What it means is that if any non-option argument appears with the -o option,
> the -o option is ignored.
> 
> The only way to do what you're trying to do is point at the file directly:
> 
> fortune /usr/share/fortune/off/limerick

I disagree with your interpretation.
The -o is not necessary if you specify the path to a set of offensive fortunes.  So, it can be ignored. It does not say you must specify the explicit (heh) path to use a set of offensive fortunes.  

Your quote says "...directory is specified."  I'd say the directory is /usr/share/fortune/off/.  My example of fortune -o limerick does not specify a "directory."  

It doesn't make sense to force users to enter entire pathnames to get offensive fortunes from particular sets.  The job of the -o option should be simply to tell the program to look in the offensive directory for sets of fortunes.

I'm afraid that your (Mr. Bones) mind may be set already.  I hope I'm wrong about that.  I doubt the Gentoo forums would get a response.  

Thanks for the attention,  DW
Comment 5 Mr. Bones. (RETIRED) gentoo-dev 2015-04-30 06:15:38 UTC
The problem is that the code doesn't match your expectations.  What you're trying to do is just not supported by the code.  It just doesn't work like how you think it does.
Comment 6 Don Wilburn 2015-04-30 15:26:18 UTC
(In reply to Mr. Bones. from comment #5)
> The problem is that the code doesn't match your expectations.  What you're
> trying to do is just not supported by the code.  It just doesn't work like
> how you think it does.

OpenBSD and Slackware's fortune program man page reads the same as Gentoo, more or less.  The command line syntax works exactly as I am trying with Gentoo's version.  
Their programs segregate offensive fortunes by appending "-o" to the filename and not by using a separate directory.  Gentoo credits NetBSD as the source of their code.  
So, I believe Gentoo's code is working as written.  I don't know why NetBSD would make the command line work differently because they chose to store the databases differently.  I give up.  I'll close the bug.  

Thanks, DW

P.S.  Debian seems to use the same code as Gentoo.  I don't have FreeBSD handy to break the tie as to what's the "typical" method of operation in my universe.
Comment 7 Don Wilburn 2015-04-30 15:29:24 UTC
I don't want to call it "invalid," so I'll mark it "wontfix."
Comment 8 Mr. Bones. (RETIRED) gentoo-dev 2015-04-30 16:18:51 UTC
Normally I would say this is an upstream bug but there doesn't seem to be an upstream for fortune-mod anymore.  Too bad it seems to be unmaintained.