Summary: | fortune(6): /usr/share/games/fortune is populated, No fortunes found in /usr/share/games/fortune:/usr/local/share/games/fortune. | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Trix Farrar <trix> | ||||
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
Status: | Open --- | ||||||
Severity: | Affects Some People | CC: | andyf, carson+freebsdbugs, grahamperrin, nipkraps, tatsuki_makino | ||||
Priority: | --- | Keywords: | needs-qa | ||||
Version: | 13.1-RELEASE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
URL: | https://www.freebsd.org/cgi/man.cgi?query=fortune&sektion=6&manpath=FreeBSD | ||||||
Attachments: |
|
Description
Trix Farrar
2019-05-06 23:18:34 UTC
Copying freebsd-tips to fortunes does not work: # cd /usr/share/games/fortune # cp freebsd-tips fortunes # fortune fortune:/usr/share/games/fortune/fortunes not a fortune file or directory No fortunes found in /usr/share/games/fortune:/usr/local/share/games/fortune. Created attachment 212535 [details]
Patch to allow the fortune command to look for all fortunes in the fortune directory by default
It's worth noting that copying the text-based fortune file isn't enough for fortune to recognize it; a corresponding .dat file must be made with "strfile myfortunes".
I've attached a patch based off of FreeBSD-CURRENT that should allow fortune to look in all fortune files in the directory by default (should I submit this patch as a new bug report? Contributing to FreeBSD doesn't seem to mention whether or not a new report should be filed for patches if a bug report already exists).
root@fuji:~ # freebsd-version -kru 13.1-RELEASE-p3 13.1-RELEASE-p3 13.1-RELEASE-p5 root@fuji:~ # fortune No fortunes found in /usr/share/games/fortune:/usr/local/share/games/fortune. root@fuji:~ # ls /usr/share/games/fortune freebsd-tips freebsd-tips.dat root@fuji:~ # ls /usr/local/share/games/fortune ls: /usr/local/share/games/fortune: No such file or directory root@fuji:~ # Triage: assume that this is not hardware-specific. Murphy's Law and others were removed from fortune here. https://cgit.freebsd.org/src/commit/usr.bin/fortune?id=0538d7bbe620fafcdf296305bcd8aad2cb7d24f1 When there were no arguments, one file called fortunes is automatically added here. https://cgit.freebsd.org/src/tree/usr.bin/fortune/fortune/fortune.c?id=195f1b124da4bf73d951cd251dffd9485672fe0a#n387 It seems that xxx and xxx.dat in the fortune file must be a pair, so the revert method challenged above is missing something. The following procedure will restore it. cd /usr/share/games/fortune ln -s freebsd-tips fortunes ln -s freebsd-tips.dat fortunes.dat fortune I think we should make this symlink the default to create :) My comment #4 is rescinded. 2 directories will be used by FORTDIR. It is written in /usr/src/usr.bin/fortune/fortune/pathnames.h And fortunes.dat can be installed by misc/fortune-mod-freebsd-classic of ports. Creating extra symlinks will fluctuate the odds of a fortune. |