Bug 246735 - [PATCH] Do not restrict fortune(6) to only searching for files named "fortunes" by default
Summary: [PATCH] Do not restrict fortune(6) to only searching for files named "fortune...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Ed Maste
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2020-05-26 04:30 UTC by Ruby Lazuli Lord
Modified: 2020-05-28 20:43 UTC (History)
1 user (show)

See Also:


Attachments
Patch to allow fortune(6) to look for all fortune files in the fortune directory (1.85 KB, patch)
2020-05-26 04:30 UTC, Ruby Lazuli Lord
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ruby Lazuli Lord 2020-05-26 04:30:05 UTC
Created attachment 214860 [details]
Patch to allow fortune(6) to look for all fortune files in the fortune directory

Currently, fortune(6) by default looks in the fortune directory for a data file named "fortunes", and if none are found, displays "No fortunes found". Any fortune file must be explicitly specified; ex. to display a fortune from the file "freebsd-tips" one must use the command "fortune freebsd-tips". Previously, this behaviour would be acceptable, as a "fortunes" data file used to be packaged with the base system, but as of base r325828, FreeBSD does not distribute such a data file. This may be unexpected to users who expect "fortune" to generate a fortune from "freebsd-tips", which is distributed with the base system.

This patch removes this restriction on fortune(6). The new default behaviour would be to look for any file within the default fortunes directory, regardless of name. By default, this will result in fortune(6) yielding fortunes from freebsd-tips, with fortunes being yielded from various sources as more are installed (either locally or via ports/pkg). This behaviour may be somewhat unexpected to users who are used to the old behaviour of fortune(6), but is not likely to cause breaking issues. Users who wish to return to the old behaviour will be able to use the command "fortune fortunes" to replicate it.

This patch fixes bug #237768 and was originally posted on that bug's thread by me two months ago. I am terribly sorry if this isn't the correct procedure for submitting a patch to a preexisting bug; I'm new to contributing to FreeBSD and I'm not entirely certain if the wording found in the "Contributing to FreeBSD" handbook suggests that a new bug report should be opened for patches which fix bugs which already have reports filed.