Subject: pkg/24921: hot-babe should be more modest :-)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <toddpw@netbsd.org>
List: pkgsrc-bugs
Date: 03/26/2004 08:34:22
>Number:         24921
>Category:       pkg
>Synopsis:       hot-babe should be more modest :-)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 26 08:35:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Todd Whitesel
>Release:        NetBSD 1.6.1
>Organization:
	NetBSD Developer
>Environment:
System: NetBSD homeworld.netbsd.org 1.6.1 NetBSD 1.6.1 (HOMEWORLD) #2: Fri Jul 25 09:05:09 CDT 2003 root@aurora.ait.iastate.edu:/usr/NetBSD/kernels/compile/HOMEWORLD i386
Architecture: i386
Machine: i386
>Description:
	The hot-babe load meter is pleasantly amusing and (from a distance) is
	easier to interpret than xload because of its color shifts. However, it
	reacts too quickly to light and moderate system loads, from 0.0 to 2.0.
>How-To-Repeat:
	Install and run hot-babe. Notice how even light system activity causes
	the girl to "flash" you and how running a modestly complicated process
	(for example, ripping a CD with 'abcde') causes her to be completely
	naked most of the time which gets boring fast.
>Fix:
	The included patch makes the getloadavg() adjustment less sensitive to
	low and moderate system loads, spanning the range 0.5 to 4.5 instead.
	I have found that this change makes hot-babe truly useful and more than
	just an amusing diversion.

Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/x11/hot-babe/distinfo,v
retrieving revision 1.2
diff -u -r1.2 distinfo
--- distinfo	24 Oct 2002 19:04:23 -0000	1.2
+++ distinfo	26 Mar 2004 08:12:43 -0000
@@ -2,5 +2,5 @@
 
 SHA1 (hot-babe-0.1.2.tar.gz) = 53410a9f5590250ba862ee220ac9140014c39114
 Size (hot-babe-0.1.2.tar.gz) = 708450 bytes
-SHA1 (patch-aa) = 4b8a239530edb4c144eacf61061bad030d7cb3d6
+SHA1 (patch-aa) = fdee9709d63b28d888abfa59ffe087d6917e5717
 SHA1 (patch-ab) = ebb9a0fae24c0ad6719fe99b34c77e49f91e02bc
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/x11/hot-babe/patches/patch-aa,v
retrieving revision 1.2
diff -u -r1.2 patch-aa
--- patches/patch-aa	24 Oct 2002 19:04:23 -0000	1.2
+++ patches/patch-aa	26 Mar 2004 08:12:43 -0000
@@ -2,20 +2,26 @@
 
 --- hot-babe.c.orig	Sat Sep 21 16:53:24 2002
 +++ hot-babe.c
-@@ -74,6 +74,12 @@
+@@ -74,6 +74,18 @@
  /* returns current CPU load in percent, 0 to 256 */
  static int system_cpu(void)
  {
 +#ifdef __NetBSD__
 +	double l;
++	int i;
 +	if (getloadavg(&l, 1) < 0)
-+		return 256;
-+	return (int)(256 * (l>2.0? 2.0 : l) / 2.0);
++		return 0;
++	i = (l - 0.5) * (256/4);
++	if (i < 0)
++	    i = 0;
++	if (i > 256)
++	    i = 256;
++	return i;
 +#else
    unsigned int  cpuload;
    u_int64_t     load, total, oload, ototal;
    u_int64_t     ab, ac, ad, ae;
-@@ -111,6 +117,7 @@
+@@ -111,6 +123,7 @@
      cpuload = (256 * (load - oload)) / (total - ototal);
  
    return cpuload;

>Release-Note:
>Audit-Trail:
>Unformatted: