debian/0000755000000000000000000000000011647376274007207 5ustar debian/compat0000644000000000000000000000000211123456036010365 0ustar 5 debian/control0000644000000000000000000000150711647376052010607 0ustar Source: discus Section: utils Priority: extra Maintainer: Debian QA Group Build-Depends: debhelper (>= 5.0) Standards-Version: 3.9.2 Homepage: http://www.raincrazy.com/software/discus/ Vcs-Svn: svn://svn.debian.org/svn/python-apps/packages/discus/trunk/ Vcs-Browser: http://svn.debian.org/viewsvn/python-apps/packages/discus/trunk/ Package: discus Architecture: all Depends: ${misc:Depends}, python Description: pretty version of df(1) command Discus aims to make df prettier, with features such as color, graphs, and smart formatting of numbers (automatically choosing the most suitable size from kilobytes, megabytes, gigabytes, or terabytes). If you don't want Discus deciding the best sizes, you can also choose your own increments, along with specifying the number of decimal places you'd like to see. debian/patches/0000755000000000000000000000000011647376274010636 5ustar debian/patches/30_bts-224393_exclude_fs.diff0000644000000000000000000000070711647367536015534 0ustar Description: Exclude /dev, /sys and /proc/usb filesystems. Author: Sandro Tosi Bug-Debian: http://bugs.debian.org/224393 Forwarded: no Last-Update: 2011-10-18 --- a/discusrc +++ b/discusrc @@ -26,7 +26,7 @@ opts["places"] = 1 ## Filesystems to ignore. -opts["skip_list"] = ["/dev/pts", "/proc"] +opts["skip_list"] = ["/dev/pts", "/proc", "/dev", "/proc/usb", "/sys"] ## Use smart formatting of numbers. opts["smart"] = 1 debian/patches/20_bts-312262_reserved_space.diff0000644000000000000000000000601211647367536016370 0ustar Descriptio: Take into account space reserved for root. Author: Sandro Tosi Bug-Debian: http://bugs.debian.org/312262 Forwarded: no Last-Update: 2011-10-18 --- a/discus +++ b/discus @@ -28,7 +28,7 @@ ## Define version number and create options object with internal settings. VERSION = "0.2.9" -opts = {"placing": 0, "vfsing": 1} +opts = {"placing": 0, "vfsing": 1, "reserved": 0} ## Import modules used. @@ -156,7 +156,7 @@ def percentage(self): try: - percent = (1.0 - (1.0 * self.free_root / self.total)) * 100 + percent = (1.0 - (1.0 * self.free / self.total)) * 100 except ZeroDivisionError: percent = 0.0 @@ -209,8 +209,14 @@ stats = os.statvfs(mount) blocksize = int(stats[F_FRSIZE]) self.total = int(stats[F_BLOCKS]) * (blocksize / 1024.0) - self.free_root = int(stats[F_BFREE]) * (blocksize / 1024.0) - self.free = int(stats[F_BAVAIL]) * (blocksize / 1024.0) + # if we have to take care of reserved space for root, then use + # available blocks (but keep counting free space with all free blocks) + if opts["reserved"]: + self.free = int(stats[F_BAVAIL]) * (blocksize / 1024.0) + self.used = self.total - int(stats[F_BFREE]) * (blocksize / 1024.0) + else: + self.free = int(stats[F_BFREE]) * (blocksize / 1024.0) + self.used = self.total - int(stats[F_BFREE]) * (blocksize / 1024.0) else: ## External stat program. @@ -223,10 +229,12 @@ stats = string.split(stats) blocksize = int(stats[8]) self.total = int(stats[5]) * (blocksize / 1024.0) - self.free_root = int(stats[6]) * (blocksize / 1024.0) - self.free = int(stats[7]) * (blocksize / 1024.0) - - self.used = self.total - self.free_root + if opts["reserved"]: + self.free = int(stats[7]) * (blocksize / 1024.0) + self.used = self.total - int(stats[7]) * (blocksize / 1024.0) + else: + self.free = int(stats[6]) * (blocksize / 1024.0) + self.used = self.total - int(stats[7]) * (blocksize / 1024.0) ## Don't let long names mess up the display: shorten them @@ -266,6 +274,7 @@ assumes -s -d show device instead of graph -c disable color + -r count reserved space as used """ % VERSION else: @@ -282,7 +291,7 @@ ## Read the command line options provided by the user. try: - options, args = getopt.getopt(sys.argv[1:], "p:tgmksdcvh", + options, args = getopt.getopt(sys.argv[1:], "p:tgmksdcrvh", ["help", "version"]) except: help() @@ -356,6 +365,9 @@ if option in ["-h", "--help"]: help() + + if option == "-r": + opts["reserved"] = 1 @@ -429,7 +441,7 @@ mount, "Total", "Used", - "Free", + "Avail", "Prcnt", graph ) + color("clear") --- a/discus.1 +++ b/discus.1 @@ -52,6 +52,10 @@ .TP .B \-v, \-\-version Show version of program. +.TP +.B \-r +Takes into account even the reserved space to root; it will be counted in percentage and in available columns only (Used is for real used space). +.SH FILES .SH FILES .BR /etc/discusrc, .BR $HOME/.discusrc debian/patches/03_discusrc_labels.diff0000644000000000000000000000074311647367536015140 0ustar Description: Add more unit prefixes. Author: Marga Manterola Bug-Debian: http://bugs.debian.org/225750 Forwarded: no Last-Update: 2011-10-18 --- a/discusrc +++ b/discusrc @@ -10,7 +10,7 @@ ## commas. String values must be quoted. ## Labels to display next to numbers. Thanks to Frank Elsner. -opts["akabytes"] = ["KB", "meg", "gig", "TB"] +opts["akabytes"] = ["KB", "MB", "GB", "TB", "PB", "EB"] opts["color"] = 1 opts["divisor"] = 1 opts["graph"] = 1 debian/patches/10_bts-291276_space_mountpoint.diff0000644000000000000000000000156311647367536017005 0ustar Description: Convert escaped octal values from /etc/mtab (or /proc/mounts) into real characters. Author: Sandro Tosi Bug-Debian: http://bugs.debian.org/291276 Forwarded: no Last-Update: 2011-10-18 --- a/discus +++ b/discus @@ -33,7 +33,7 @@ ## Import modules used. -import commands, getopt, os, string, sys +import commands, getopt, os, string, sys, re try: from statvfs import * except ImportError: @@ -383,6 +383,13 @@ entry = string.split(entry) device = entry[0] mount = entry[1] + + # Sandro Tosi - to fix Debian bug 291276, convert escaped octal values + # from /etc/mtab (or /proc/mounts) to real characters + mount = mount.encode('utf-8') + for octc in re.findall(r'\\(\d{3})', mount): + mount = mount.replace(r'\%s' % octc, chr(int(octc, 8))) + mount = mount.decode('utf8') ## Skip entries we aren't interested in. debian/patches/series0000644000000000000000000000032311647364453012045 0ustar 01_readme_change_url.diff 02_manpage_pre-adoption.diff 03_discusrc_labels.diff 04_discus_correct_mail_url.diff 10_bts-291276_space_mountpoint.diff 20_bts-312262_reserved_space.diff 30_bts-224393_exclude_fs.diff debian/patches/02_manpage_pre-adoption.diff0000644000000000000000000000272011647367642016062 0ustar Description: Various updates to the manual page. Author: Sandro Tosi Forwarded: no Last-Update: 2011-10-18 --- a/discus.1 +++ b/discus.1 @@ -2,7 +2,7 @@ .\" DISCUS .\" 1 .\" other parameters are allowed: see man(7), man(1) -.TH DISCUS 1 "September 12, 2000" +.TH DISCUS 1 "October 20, 2003" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -26,11 +26,9 @@ and smart formatting of numbers (automatically choosing the most suitable size from kilobytes, megabytes, gigabytes, or terabytes). Or choose your own size, along with specifying the number of decimal places you'd like to -see. +see. You may also copy /etc/discusrc to $HOME/.discusrc and customize things to +your preference. -Updates may be found at the Discus home page: -.br -http://www.futuresouth.com/~stormy/discus.shtml .SH OPTIONS .TP .B \-h, \-\-help @@ -50,7 +48,7 @@ .TP .B \-t, \-g, \-m, \-k Display sizes in terabytes, gigabytes, megabytes, or kilobytes, respectively. -Assumes -s. +Assumes \-s. .TP .B \-v, \-\-version Show version of program. @@ -62,5 +60,6 @@ .BR pydf (1). .br .SH AUTHOR -This manual page was written by Stormy Henderson , -for the Debian GNU/Linux system (but may be used by others). +This manual page was adapted by Ron Farrer from one +written by Stormy Henderson for the Debian +GNU/Linux system (but may be used by others). debian/patches/01_readme_change_url.diff0000644000000000000000000000057311647367642015420 0ustar Description: Update URL in the README file. Author: Sandro Tosi Forwarded: no Last-Update: 2011-10-18 --- a/README +++ b/README @@ -17,4 +17,4 @@ no, I didn't misspell discuss. A discus is a round thingie people throw. Newest versions of Discus may be found at: -http://www.futuresouth.com/~stormy/discus.shtml +http://www.raincrazy.com/software/discus/ debian/patches/04_discus_correct_mail_url.diff0000644000000000000000000000105411647367536016673 0ustar Description: Update homepage URL and author's e-mail address in the code. Author: Sandro Tosi Forwarded: no Last-Update: 2011-10-18 --- a/discus +++ b/discus @@ -243,9 +243,9 @@ ## Print version. def version(): - print "Discus version %s by Stormy Henderson (stormy@futuresouth.com)." % \ + print "Discus version %s by Stormy Henderson (stormy@raincrazy.com)." % \ VERSION - print "Home page: http://www.futuresouth.com/~stormy/discus.shtml" + print "Home page: http://www.raincrazy.com/software/discus/" raise SystemExit debian/copyright0000644000000000000000000000166711123456036011134 0ustar This package was debianized by Ron Farrer on Mon, 20 Oct 2003 23:48:27 -0800. It is now maintained by Sandro Tosi It was downloaded from http://www.raincrazy.com/software/discus/ Upstream Author: Stormy Henderson Copyright: Copyright 2000 Stormy Henderson License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A full copy of the GPL can be found at /usr/share/common-licenses/GPL-2 on any Debian GNU system. debian/etc0000644000000000000000000000355011123456036007670 0ustar ## Discus configuration file. ## ## To make personal modifications, copy this file to your home directory ## with the name .discusrc ## An option is enabled if its value is 1, disabled if 0. Multiple entries, ## where applicable, must be enclosed in square brackets and separated with ## commas. String values must be quoted. ## Labels to display next to numbers. Thanks to Frank Elsner. opts["akabytes"] = ["KB", "meg", "gig", "TB"] opts["color"] = 1 opts["divisor"] = 1 opts["graph"] = 1 opts["graph_char"] = "*" opts["graph_fill"] = "-" ## Example mtab entry that uses a shell command (always use a ! as ## first character) rather than a file: ## opts["mtab"] = "!/bin/mount |awk '{print $1, $3}'" opts["mtab"] = "/etc/mtab" ## Number of decimal places to display, same as -p opts["places"] = 1 ## Filesystems to ignore. opts["skip_list"] = ["/dev/pts", "/proc"] ## Use smart formatting of numbers. opts["smart"] = 1 ## Location of stat program in lieu of Python's statvfs module. opts["stat_prog"] = "stat -ft" ## These colors should work on VT100-type displays. Change them if you use ## something else. black = "\033[30m" red = "\033[31m" green = "\033[32m" yellow = "\033[33m" blue = "\033[34m" magenta = "\033[35m" cyan = "\033[36m" white = "\033[37m" on_black = "\033[40m" on_red = "\033[41m" on_green = "\033[42m" on_yellow = "\033[43m" on_blue = "\033[44m" on_magenta = "\033[45m" on_cyan = "\033[46m" on_white = "\033[47m" normal = "\033[0m" bold = "\033[1m" underline = "\033[4m" blink = "\033[5m" reverse = "\033[7m" dim = "\033[8m" opts["color_header"] = blue opts["color_normal"] = normal opts["color_safe"] = normal ## 0%- 70% full opts["color_warning"] = bold + yellow ## 70%- 85% full opts["color_danger"] = bold + red ## 85%-100% full ## EOF debian/README.source0000644000000000000000000000023111124535503011340 0ustar This package uses dpatch to handle patches against upstream source code; you can find additional information about dpatch at /usr/share/doc/dpatch/ debian/watch0000644000000000000000000000026011123456036010216 0ustar version=3 opts=uversionmangle=s/\.(tar.*|tgz|zip|gz|bz2)$// \ http://www.raincrazy.com/software/discus/ (?:.*/)?discus-?_?([\d+\.]+|\d+)\.(tar.*|tgz|zip|gz|bz2) debian uupdate debian/changelog0000644000000000000000000001053011647376260011053 0ustar discus (0.2.9-6) unstable; urgency=low * QA upload. + Set Maintainer to Debian QA Group. + Remove Uploaders. * Add build-arch, build-indep and binary-arch targets to debian/rules. * Convert to source format 3.0 (quilt). * Exclude more filesystems by default (closes: #224393; 04_bts-224393_exclude_fs.diff). * Make patch headers DEP-3 compliant. * Bump standards version to 3.9.2 (no changes needed). -- Jakub Wilk Wed, 19 Oct 2011 00:22:40 +0200 discus (0.2.9-5) unstable; urgency=low * debian/control - added to PAPT team (setting it as maintainer) - set me as uploaders, updating my email address - bump Standards-Version to 3.8.0 + added debian/README.source - added ${misc:Depends} to Depends - removed extra space from description (used to justify text) - added Vcs-{Browser,Svn} fields - removed python from b-d-i since not needed to build the package * debian/TODO.Debian - removed since no more needed * debian/rules - left an empty 'build' target, since we are not building anything - no need to touch 'install-stamp', it's PHONY * debian/patches/20_bts-312262_reserved_space.dpatch - added description -- Sandro Tosi Wed, 24 Dec 2008 23:41:23 +0100 discus (0.2.9-4) unstable; urgency=low * debian/control - bump Standard-Version to 3.7.3 - moved Homepage from binary to source stanza * debian/copyright - clear separation of upstream author, copyright and license * debian/rules - removed commented lines and unneeded dh scripts - removed binary-arch since it's an Arch: all package * debian/patches/10_bts-291276_space_mountpoint.dpatch - converts octal values to chars (Closes: #291276) * debian/patches/02_manpage_pre-adoption.dpatch - updated to fix a lintian warning about minus sign * debian/patches/20_bts-312262_reserved_space.dpatch - taking into account even reserved space to root (Closes: #312262) * debian/watch - added, as suggested by DDPO -- Sandro Tosi Sat, 22 Dec 2007 17:54:02 +0100 discus (0.2.9-3) unstable; urgency=low * New maintainer. (Closes: #388650) * moved to a non-native package fashion * debian/control - new maintainer - dependency against debhelper >= 5.0 - added Homepage meta-field - reformat long description - removed full stop (".") at the end of short description - moved python dependency on Build-Depends-Indep field - add dependency against dpatch * debian/compat - bump to compatibility 5 * debian/README.Debian - removed, since it was of no use * debian/copyright - add original packager - new maintainer - add upstream homepage - add copyright note - add right path to GPL2, since this is the license under which the software is licensed * debian/docs - removed * debian/rules - add docs to install as parameters to dh_installdocs - now uses dh_installmanp instead of dh_installmanpages; then add discus.1 as its param - add dpatch support * debian/conffiles - removed since debhelper already knows about conffiles installed * debian/patches/01_readme_change_url.dpatch - changes to README file are now done via dpatch * debian/patches/02_manpage_pre-adoption.dpatch - changes to discus.1 file are now done via dpatch * debian/patches/03_discusrc_labels.dpatch - changes to discusrc are now done via dpatch * debian/patches/04_bts-224393_exclude_fs.dpatch - Additional filesystems to be excluded by default (Closes: #224393) * debian/patches/04_discus_correct_mail_url.dpatch - correct upstream mail and url -- Sandro Tosi Mon, 9 Oct 2006 20:56:45 +0200 discus (0.2.9-2) unstable; urgency=low * QA upload. * Set QA group as Maintainer. * Acknowledge NMU, thanks Blars Blarson. * Update Standards-Version to 3.7.2. * Set to debhelper compatibility 4. -- Mohammed Adnène Trojette Thu, 21 Sep 2006 21:48:49 +0200 discus (0.2.9-1.1) unstable; urgency=low * Non-maintainer upload. * Add additional unit prefixes, patch from Marga Manterola (closes: #225750) -- Blars Blarson Sun, 30 Oct 2005 03:17:10 +0000 discus (0.2.9-1) unstable; urgency=low * Initial release. (closes: #217478) -- Ron Farrer Mon, 20 Oct 2003 23:48:27 -0800 debian/source/0000755000000000000000000000000011647376274010507 5ustar debian/source/format0000644000000000000000000000001411647363746011715 0ustar 3.0 (quilt) debian/rules0000755000000000000000000000151411647363637010267 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 build build-arch build-indep: ; clean: dh_testdir dh_testroot dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs usr/bin etc # Add here commands to install the package into debian/tmp. install -m 755 -o root -g root discus debian/discus/usr/bin/discus install -m 644 -o root -g root discusrc debian/discus/etc # Build architecture-independent files here. binary-indep: build install dh_testdir dh_testroot dh_installdocs changelog README TODO dh_installman discus.1 dh_installchangelogs dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary-arch: ; binary: binary-indep binary-arch .PHONY: build build-arch build-indep clean binary binary-arch binary-indep install