From andrew@ugh.net.au  Thu May 21 08:57:53 1998
Received: from beebite.ugh.net.au (andrew@dialin127.worldlink.com.au [210.8.184.76] (may be forged))
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA28872
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 May 1998 08:57:46 -0700 (PDT)
          (envelope-from andrew@ugh.net.au)
Received: from localhost (andrew@localhost)
	by beebite.ugh.net.au (8.8.8/8.8.8) with SMTP id BAA02318
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 May 1998 01:58:04 +1000 (EST)
	(envelope-from andrew@ugh.net.au)
Message-Id: <Pine.BSF.3.96.980522015721.2294B-100000@beebite.ugh.net.au>
Date: Fri, 22 May 1998 01:58:04 +1000 (EST)
From: andrew@ugh.net.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: I've seen that fortune before

>Number:         6711
>Category:       conf
>Synopsis:       [PATCH ?] I've seen that fortune before
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 21 09:00:02 PDT 1998
>Closed-Date:    Fri Jun 11 12:12:39 PDT 1999
>Last-Modified:  Fri Jun 11 12:18:35 PDT 1999
>Originator:     Andrew
>Release:        FreeBSD 2.2.6-STABLE i386
>Organization:
UgH!
>Environment:

Running a csh based shell (tcsh)

>Description:

fortune (if installed) is run from .login by default. After a while you start to
see the same old fortunes being presented even though there are many fortune
files installed in /usr/share/games/fortune.

I would suggest we make the line in .login 'fortune all' so a fortune is picked
from any of the files.

The only problem I could see from this was that some limericks seemed to have
been misfiled and really belong in limericks-o. Not having time to sort through
them all just yet I moved them all to limerick-o. Better to err with safety I
felt.

Quiting PPP paniced my machine
>How-To-Repeat:

Login in lots :-)

>Fix:
	
Patch to /usr/src/share/skel/dot.login:


--- dot.login.orig	Thu May 21 22:17:28 1998
+++ dot.login	Thu May 21 22:17:38 1998
@@ -17,4 +17,4 @@
 # A rightous umask
 umask 22
 
-[ -x /usr/games/fortune ] && /usr/games/fortune
+[ -x /usr/games/fortune ] && /usr/games/fortune all


Patch to  /usr/src/games/fortune/datfiles/Makefile:


--- Makefile.orig	Thu May 21 22:04:33 1998
+++ Makefile	Thu May 21 22:14:35 1998
@@ -8,8 +8,8 @@
 # LINES AND COMMENT OUT THE FOURTH LINE.
 
 # THE THREE LINES
-FILES+=	fortunes2-o limerick
-BLDS+=	fortunes2-o.dat limerick.dat
+FILES+=	fortunes2-o limerick-o
+BLDS+=	fortunes2-o.dat limerick-o.dat
 TYPE=	real
 
 # THE FOURTH LINE
@@ -41,7 +41,7 @@
 	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} ${BLDS} \
 	    ${DESTDIR}${SHAREDIR}/games/fortune
 
-fortunes.dat fortunes2.dat fortunes2-o.dat limerick.dat startrek.dat zippy.dat:
+fortunes.dat fortunes2.dat fortunes2-o.dat limerick-o.dat startrek.dat zippy.dat:
 	${STRFILE} -rs ${.CURDIR}/${.TARGET:R} ${.TARGET}
 
 fortunes-o.dat: fortunes-o


Also required is:

mv /usr/src/games/fortune/datfiles/limerick /usr/src/games/fortune/datfiles/limerick-o

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: phk 
State-Changed-When: Sat May 23 00:48:18 PDT 1998 
State-Changed-Why:  
A little too draconian maybe, but otherwise... 
awaiting committer 
State-Changed-From-To: suspended->closed 
State-Changed-By: hoek 
State-Changed-When: Fri Jun 11 12:12:39 PDT 1999 
State-Changed-Why:  
Using "fortune all" won't really cause a decrease in the number of fortunes 
that you read twice.  Examine the following, 

b$ fortune -f 
___% /usr/share/games/fortune 
___% fortunes 
___% fortunes2 
b$ fortune -f all 
___% /usr/share/games/fortune 
___% fortunes 
___% fortunes2 
___% startrek 
___% zippy 
___% limerick 
b$ ls -l fortunes fortunes2 startrek zippy limerick 
-r--r--r--  1 root  games   582273 May 28 04:31 fortunes 
-r--r--r--  1 root  games  2063664 May 28 04:31 fortunes2 
-r--r--r--  1 root  games   144252 May 28 04:31 limerick 
-r--r--r--  1 root  games    27502 May 28 04:31 startrek 
-r--r--r--  1 root  games    38744 May 28 04:31 zippy 
b$ 

The problem of repeated fortunes is/was most likely a result of poor randomness, 
which was fixed in FreeBSD 3 by using /dev/random to get better 
randomness. 

[Besides, I like to keep my star-trek and zippy quotes for special days - 
].   

[Note that especially once limerick is moved to limeric-o, the additional 
two fortune files make almost no difference to the total number of fortunes 
available.]. 

>Unformatted:
