Debian Bug report logs - #56844
[patch] Add --histogram switch to df.c (documented also)

Package: coreutils; Maintainer for coreutils is Michael Stone <[email protected]>; Source for coreutils is src:coreutils (PTS, buildd, popcon).

Reported by: [email protected] (Karl M. Hegbloom)

Date: Wed, 2 Feb 2000 00:18:10 UTC

Severity: wishlist

Tags: wontfix

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected]:
Bug#56844; Package fileutils-4.0l-5. (full text, mbox, link).


Acknowledgement sent to [email protected] (Karl M. Hegbloom):
New Bug report received and forwarded. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: [email protected] (Karl M. Hegbloom)
To: [email protected]
Subject: [patch] Add --histogram switch to df.c (documented also)
Date: 01 Feb 2000 16:13:17 -0800
Package: fileutils-4.0l-5
Severity: wishlist

 A guy I know wrote a patch to `df' that gives it a histogram switch.
 Here's the tested diff against `fileutils-4.0l-5'.


2000-02-01  W. Reilly Cooley, Esq.  <[email protected]>

	* doc/fileutils.texi: Document `--histogram' switch.

	* src/df.c (enum): Add HISTOGRAM_OPTION.
	(long_options): Add `histogram'.
	(show_dev): Support `show_histogram'.
	(usage): Display `--histogram' option.
	(main): Add HISTOGRAM_OPTION to switch.


--- doc/fileutils.texi.orig	Wed Dec 15 00:56:55 1999
+++ doc/fileutils.texi	Tue Feb  1 15:22:25 2000
@@ -2924,6 +2924,11 @@
 type ``ignore'' or ``auto'', supported by some operating systems, are
 only included if this option is specified.
 
+@itemx --histogram
+@opindex --histogram
+@cindex draw a histogram
+Draw a histogram for each filesystem.
+
 @item -h
 @itemx --human-readable
 @opindex -h
--- src/df.c.orig	Thu Dec  9 07:42:04 1999
+++ src/df.c	Tue Feb  1 16:07:11 2000
@@ -17,7 +17,8 @@
 
 /* Written by David MacKenzie <[email protected]>.
    --human-readable and --megabyte options added by [email protected].
-   --si and large file support added by [email protected].  */
+   --si and large file support added by [email protected].  
+   --histogram added by [email protected]. */
 
 #include <config.h>
 #if HAVE_INTTYPES_H
@@ -75,6 +76,9 @@
    SunOs4.1.3, for one.  It is *not* necessary on Linux.  */
 static int require_sync = 0;
 
+/* If nonzero, print a histogram for each filesystem. */
+static int show_histogram;
+
 /* Nonzero if errors have occurred. */
 static int exit_status;
 
@@ -116,7 +120,8 @@
 {
   SYNC_OPTION = CHAR_MAX + 1,
   NO_SYNC_OPTION,
-  BLOCK_SIZE_OPTION
+  BLOCK_SIZE_OPTION,
+  HISTOGRAM_OPTION
 };
 
 static struct option const long_options[] =
@@ -135,6 +140,7 @@
   {"no-sync", no_argument, NULL, NO_SYNC_OPTION},
   {"type", required_argument, NULL, 't'},
   {"exclude-type", required_argument, NULL, 'x'},
+  {"histogram", no_argument, NULL, HISTOGRAM_OPTION},
   {GETOPT_HELP_OPTION_DECL},
   {GETOPT_VERSION_OPTION_DECL},
   {NULL, 0, NULL, 0}
@@ -397,6 +403,25 @@
       printf (" %s", mount_point);
     }
   putchar ('\n');
+
+  if (show_histogram)
+    {
+      int i;
+      printf ("0%% |") ;
+      /* Use 20 chars */
+      for ( i = 1 ; i <= 50 ; i++) 
+	{
+	  double blocks_percent_used = posix_format
+	    ? ceil_percent (used, nonroot_total)
+	    : used * 100.0 / nonroot_total;
+	  if (blocks_percent_used - (i*2) >= 0)
+	    putchar ('#') ;
+	  else
+	    putchar (' ') ;
+	}
+      printf ("| 100%%\n") ;
+    }
+
 }
 
 /* Identify the directory, if any, that device
@@ -638,6 +663,7 @@
 \n\
   -a, --all             include filesystems having 0 blocks\n\
       --block-size=SIZE use SIZE-byte blocks\n\
+      --histogram       show histogram of percentage\n\
   -h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)\n\
   -H, --si              likewise, but use powers of 1000 not 1024\n\
   -i, --inodes          list inode information instead of block usage\n\
@@ -726,6 +752,10 @@
 
 	case BLOCK_SIZE_OPTION:
 	  human_block_size (optarg, 1, &output_block_size);
+	  break;
+
+	case HISTOGRAM_OPTION:
+	  show_histogram = 1 ;
 	  break;
 
 	case 'F':


Bug reassigned from package `fileutils-4.0l-5' to `fileutils'. Request was from Ben Harris <[email protected]> to [email protected]. (full text, mbox, link).


Tags added: wontfix Request was from Thomas Hood <[email protected]> to [email protected]. (full text, mbox, link).


Reply sent to Niels Thykier <[email protected]>:
You have taken responsibility. (Sat, 08 May 2010 06:06:36 GMT) (full text, mbox, link).


Notification sent to [email protected] (Karl M. Hegbloom):
Bug acknowledged by developer. (Sat, 08 May 2010 06:06:36 GMT) (full text, mbox, link).


Message #14 received at [email protected] (full text, mbox, reply):

From: Niels Thykier <[email protected]>
To: [email protected]
Subject: Package fileutils has been removed from Debian
Date: Sat, 8 May 2010 08:02:51 +0200 (CEST)
Version: 4.1.11-3+rm

You filed the bug http://bugs.debian.org/56844 in Debian BTS
against the package fileutils. I'm closing it at *unstable*, but it will
remain open for older distributions.

I was unable to find a bug that explains the reason for its removal,
but it appears to have been superceded by coreutils (which is an
essential package) on Mon, 30 Sep 2002 12:24:37 -0400.
  I have decided not forward these bugs to coreutils, since a lot
could have been changed in these 8 years. If your issue is still
reproducible or still valid, do not hesitate to reopen and reassign
it or reply to this email.

Don't hesitate to reply to this mail if you have any question.

Thank you for your contribution to Debian.

--
Niels Thykier




Bug No longer marked as fixed in versions 4.1.11-3+rm and reopened. Request was from Debbugs Internal Request <[email protected]> to [email protected]. (Sat, 08 May 2010 06:27:02 GMT) (full text, mbox, link).


Bug reassigned from package 'fileutils' to 'coreutils'. Request was from Paul Wise <[email protected]> to [email protected]. (Sat, 08 May 2010 06:27:03 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 09:17:27 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.