snek-tech-blog/content/posts/fortune-cleanup.md

4.1 KiB

title date draft showSummary summary
Cleaning up fortune and friends 2022-11-20T22:22:22+11:00 true true As it turns out, fortune-mod has an -o option for "offensive" fortunes, which range from vaguely off-colour to wildly homophobic and outright racist. We figured someone should clean up and reorganise the program to get rid of anything vile, and replace the offensive category with an NSFW category.

Background

(Selene) Hi there. Unlike most of the blogs on here, I'll be narrating this one. This topic is closer to my heart, and requires less technical expertise than most of the others. I'll still defer to Ashe for any code changes, though. The gods know I can't grok C to save my life.

The original fortune package was written in 1979, a good 43 years ago. Obviously, times have changed since than, and the package itself has gone through several revisions and re-writes. Fortunes have also been added, removed, and moved around.

There currently exist two maintained distributions. The original BSD version, repackaged to run on Alpine Linux, and fortune-mod, which is a re-write in C.

Why is this a problem?

Three Reasons:

  1. A lot of the "offensive" fortunes are simply insensitive, mocking, or degrading by today's standards. Even were they not, it sets a bad example to have a fortunes package that spits out slurs or homophobia1 at people by default, even if it is gated behind a flag. If people truly want these fortunes, they should be contained in their own package that distros can opt and out of as they please, instead of everything being clubbed together.
  2. Sensibilities have changed since the 1970s, and while some fortunes have been removed, a lot of the fortunes in these packages would get you a stern talking-to if your manager saw it. These should live in an NSFW category. While this overlaps with an "offensive" category, it is not the same thing.
  3. As fortunes have been written, added, modified, and removed, the categories have gotten blurry and indistinct. The fortunes themselves need a re-organisation and trim.

How do we fix this?

There's a number of problems here, but fundamentally, they are all organisational problems. As such, our first task is to tag each fortune as NSFW, a candidate for removal, or inaccurate in its category.

From there we can restructure the packages and propose these changes upstream.

Where do we start?

We'll start with BSD's fortune package, as used in Alpine, for two reasons. For one, it is smaller than fortunes-mod. For two, the Alpine Linux maintainers tend to be relatively sensible, so this will be a good proving ground.

Let's get to it

We started by mirroring the fortune package used on Alpine.

First steps

The very first thing we'll do is move the default branch from master to main. This is a very small thing, but if we should be thorough if we're going to do this.

Scanning through the fortunes

In the BSD/Alpine version, the fortunes are located in the datfiles directory, and the files we care about are:

  • fortunes-o
  • fortunes2-o
  • limerick

These are noted as having the "offensive" fortunes, however we'll also give the non-offensive fortunes a scan. Since the fortunes in this version aren't categorised, we'll leave them uncategorised for now. Maybe a project for later.

(Doll) Doll will remind Miss Selene about this another time!

(Selene) Thanks Doll.

We've created a [full breakdown]({{< ref "lists/fortunes-cleanup" >}}) of each fortune that was removed, moved, or altered, and why, if you're interested. Content Notices for that page are everything. This is not a joke. I try to provide a summary near the top of the kinds of content present, but it is not exhaustive, and fortunes are not individually marked and spoilered.

By the by, huge thanks to the Treehouse Systems community for helping us out with screening these.


  1. Or Hitler quotes, for that matter. ↩︎