debian/0000755000000000000000000000000012147442633007174 5ustar debian/ttyload.1.pod0000644000000000000000000000305512147441721011517 0ustar # This is manual page in Perl POD format. Read more at # http://perldoc.perl.org/perlpod.html or run command: # # perldoc perlpod | less # # To check the syntax: # # podchecker *.pod # # Create manual page with command: # # pod2man PAGE.N.pod > PAGE.N =pod =head1 NAME ttyload - Console based color-coded graphs of CPU load average =head1 SYNOPSIS ttyload [options] =head1 OPTIONS =over 4 =item B<-h> Show brief help. =item B<-v> Show version information. =item B<-m> Monochrome mode (no ANSI escapes). =item B<-c cols> Specify how many columns wide is the screen. =item B<-r rows> Specify how many rows high is the screen. These two options override the default behavior of auto-determining screen size. =item B<-i secs> Alter the number of seconds in the interval between refreshes. The default is 4, and the minimum is 1, which is silently clamped. None. =back =head1 DESCRIPTION Display fairly standard, but hard-coded, ANSI ASCII escape sequences for screen manipulation and colorization for different graphs: 1 minute, 5 minute, 15 minute load averages. Use C-c to quit. =head1 ENVIRONMENT None. =head1 FILES None. =head1 SEE ALSO htop(1) iotop(1) top(1) vmstat(8) =head1 AUTHORS Program was written by David Lindes . This manual page was written by Jari Aalto , for the Debian GNU system (but may be used by others). Released under license GNU GPL v2 or (at your option) any later version. For more information about license, visit . =cut debian/patches/0000755000000000000000000000000012147441446010624 5ustar debian/patches/20-ttyload.h-include-once.patch0000644000000000000000000000146312147441446016341 0ustar From 57ae8ac2df40e6e824e89b590d254156c092ab56 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Sat, 19 Dec 2009 19:54:33 +0200 Subject: [PATCH] ttyload.h: Add defines to include header only once Signed-off-by: Jari Aalto --- ttyload.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/ttyload.h b/ttyload.h index 0f6c04c..98a7814 100644 --- a/ttyload.h +++ b/ttyload.h @@ -8,6 +8,8 @@ * */ +#ifndef TTYLOAD_H_IDENT + #define TTYLOAD_H_IDENT "$Id: ttyload.h,v 1.6 2001/08/28 01:00:31 lindes Exp $"; #define MIN(a,b) (((a)<(b))?(a):(b)) @@ -37,3 +39,5 @@ typedef struct clock_info { /* functions in arch-specific files: */ extern void getload(load_list *); extern void gettermsize(); + +#endif /* ifndef TTYLOAD_H_IDENT */ -- 1.6.5 debian/patches/10-gnu-hurd-compile.patch0000644000000000000000000000543112147441446015245 0ustar From ede695c97af5565a1257b2fc204fb97f2aead55e Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Sat, 19 Dec 2009 19:59:11 +0200 Subject: [PATCH] arch/GNU/: add GNU/Hurd compile files Signed-off-by: Jari Aalto --- arch/GNU/getload.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ arch/GNU/terminfo.c | 28 ++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 arch/GNU/getload.c create mode 100644 arch/GNU/terminfo.c --- /dev/null +++ b/arch/GNU/getload.c @@ -0,0 +1,64 @@ +#define LOADFILE "/proc/loadavg" + +/* What the contents of the proc file look like, as an example: + * 0.00 0.00 0.00 1/59 10941 + */ + +#include "ttyload.h" + +#include /* for perror */ +#include /* for exit() */ +#include /* for sleep() */ + +void getload(load_list *loadavgs) +{ + float theload[3]; + FILE *loadfile; + int ret; + + /* just for sanity: */ + if(!loadavgs) + { + fprintf(stderr, "getload called without loadavgs pointer.\n"); + exit(2); + } + + if(!(loadfile = fopen(LOADFILE, "r"))) + { + perror("Open of " LOADFILE " failed"); + exit(1); + } + + ret = fscanf(loadfile, "%f %f %f ", &(theload[0]), &(theload[1]), &(theload[2])); + + if(fclose(loadfile) != 0) + { + perror("Close of " LOADFILE " failed?!"); + exit(1); + } + + /* so the caller _can_ (maybe not _will_) know how we did */ + loadavgs->numloads = ret; + loadavgs->one_minute = theload[0] * 1024; + loadavgs->five_minute = theload[1] * 1024; + loadavgs->fifteen_minute = theload[2] * 1024; + + /* a little warning thing... should probably be re-written + * for the Linux/fscanf stuff, this is a hold-over from the + * solaris stuff. */ + switch(ret) + { + case 2: + fprintf(stderr, "15 minute Load average is unreliable.\n"); + sleep(5); + break; + case 1: + fprintf(stderr, "5 and 15 minute load averages are unreliable.\n"); + sleep(5); + break; + case 0: + fprintf(stderr, "Sorry, couldn't get any load " + "averages. This is, therefore, pointless.\n"); + exit(1); + } +} --- /dev/null +++ b/arch/GNU/terminfo.c @@ -0,0 +1,28 @@ +/* + * arch/Linux/terminfo.c -- routines for getting terminal + * information on Linux machines. + * + * Copyright 2001, David Lindes. All rights reserved. + */ + +#include /* for ioctl() */ + +/* globals */ +extern int rows; +extern int cols; + +void gettermsize() +{ + struct winsize info; + + /* try to get data via IOCTL: */ + if (ioctl(1 /* stdout */, TIOCGWINSZ, &info) != -1) + { + /* if successful, and the data seems sane, set the + * program's globals: */ + if(info.ws_col > 0) + cols = info.ws_col; + if(info.ws_row > 0) + rows = info.ws_row; + } +} debian/patches/series0000644000000000000000000000007212147441666012044 0ustar 10-gnu-hurd-compile.patch 20-ttyload.h-include-once.patch debian/compat0000644000000000000000000000000212147441446010373 0ustar 9 debian/control0000644000000000000000000000131412147442370010574 0ustar Source: ttyload Section: utils Priority: optional Maintainer: Jari Aalto Build-Depends: debhelper (>= 9) Standards-Version: 3.9.4 Vcs-Browser: http://git.debian.org/?p=collab-maint/ttyload.git Vcs-Git: git://git.debian.org/git/collab-maint/ttyload.git Homepage: http://www.daveltd.com/src/util/ttyload Package: ttyload Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: console based color-coded graphs of CPU load average Display fairly standard, but hard-coded, ANSI ASCII escape sequences for screen manipulation and colorization for different graphs: 1 minute, 5 minute, 15 minute load averages. . See http://www.daveltd.com/src/util/ttyload/screenshots.html debian/install0000644000000000000000000000002012147441446010556 0ustar ttyload usr/bin debian/changelog0000644000000000000000000000640712147442552011055 0ustar ttyload (0.5-8) unstable; urgency=low * debian/control - (Standards-Version): Update to 3.9.4. * debian/copyright - Update years. * debian/pod2man.mk - Remove sed, use --release option. * debian/ttyload.1.pod - Fix typo (Closes: #709375). Patch thanks to Jakub Wilk . -- Jari Aalto Thu, 23 May 2013 19:35:54 +0300 ttyload (0.5-7) unstable; urgency=low * debian/patches - (10): Remove double gettermsize definition (FTBFS hurd; Closes: #670888). * debian/copyright - (LGPL, GPL-3+): Remove; unused licenses. -- Jari Aalto Mon, 30 Apr 2012 07:32:02 +0300 ttyload (0.5-6) unstable; urgency=low * debian/compat - Update to 9. * debian/control - (Build-Depends): Update to debhelper 9. - (Standards-Version): Update to 3.9.3.1. * debian/copyright - Update to format 1.0. * debian/rules - Use hardened build flags http://wiki.debian.org/ReleaseGoals/SecurityHardeningBuildFlags * debian/pod2man.mk - Minor updates. -- Jari Aalto Sat, 24 Mar 2012 01:07:34 -0400 ttyload (0.5-5) unstable; urgency=low * debian/compat - Update to 8. * debian/control - (Build-Depends): debhelper 8. - (Standards-Version): 3.9.2. * debian/debian-compile.mk - Removed due to simplification of rules file. * debian/copyright - Update to DEP5 format. * debian/install - New file. * debian/rules - Remove rules handled by dh(1). - override_dh_auto_install: New. An empty stub to prevent using Makefile. - (override_dh_auto_test): New. Prevent starting infinite running tty program during compile (FTBFS; Closes: #631623). -- Jari Aalto Tue, 28 Jun 2011 09:36:10 +0300 ttyload (0.5-4) unstable; urgency=low * debian/patches - (10): Rework GNU/Hurd patch to remove duplicate file inclusion in getload.c. -- Jari Aalto Sat, 19 Dec 2009 20:02:12 +0200 ttyload (0.5-3) unstable; urgency=low * Move to format: 3.0 (quilt). * debian/clean - Move content from debian/rules for dh(1). * debian/control - (Build-Depends): Remove dpatch. - (Standards-Version): Update to 3.8.3. * debian/copyright - Minor layout adjustment. * debian/debian-compile.mk - New file. * debian/rules - Remove rules obsoleted by dh(1). - (CFLAGS_EXTRA): New. Pass strict compiler flags. * debian/source/format - New file. * debian/ttyload.{clean,install,manpages} - Move content from debian/rules for dh(1). -- Jari Aalto Thu, 17 Dec 2009 18:27:36 +0200 ttyload (0.5-2) unstable; urgency=low * debian/copyright - Spell out GPL-2 (lintian). * debian/control - (Standards-Version): update to 3.8.2 - (Build-Depends): Add dpatch. * debian/patches - Add GNU Hurd compile patch (FTBFS; Closes: #534227). * debian/rules: - Add patch and unpatch calls. - (install): use dh_prep (lintian). * debian/patches/debian-*.mk - Upgrade files to latest versions. -- Jari Aalto Fri, 07 Aug 2009 07:43:31 +0000 ttyload (0.5-1) unstable; urgency=low * Initial release (ITP; Closes: #504204). -- Jari Aalto Sat, 01 Nov 2008 17:14:56 +0000 debian/watch0000644000000000000000000000023012147441446010221 0ustar # See uscan(1) for format version=3 # [Version [Action]] http://www.daveltd.com/src/util/ttyload/ ttyload-(.+)\.tar\.gz debian/rules0000755000000000000000000000113012147441446010250 0ustar #!/usr/bin/make -f PACKAGE = ttyload export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed man: $(MAKE) -C debian -f pod2man.mk PACKAGE=$(PACKAGE) makeman override_dh_auto_install: # DESTDIR isn't used in makefile. Use debain/install override_dh_auto_build: man # The only variable to pass more flags $(MAKE) CC="$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)" override_dh_auto_test: # Empty rule to prevent starting a TTY program. There are no # automatic tests. %: dh $@ .PHONY: man # End of file debian/docs0000644000000000000000000000002112147441446010041 0ustar BUGS README TODO debian/copyright0000644000000000000000000000462512147442317011135 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0 Upstream-Name: ttyload Upstream-Contact: David Lindes Source: http://freshmeat.net/projects/ttyload X-Upstream-Vcs: git://github.com/lindes/ttyload.git X-Upstream-Bugs: https://github.com/lindes/ttyload/issues X-Source: http://www.daveltd.com/src/util/ttyload Files: * Copyright: 1996-2008 David Lindes License: ISC Files: debian/* Copyright: 2008, 2009, 2011-2013 Jari Aalto License: GPL-2+ License: ISC [From source file "LICENSE"] . Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. . THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. . It is requested, without requirement, that any enhancements to this software be submitted back to the author, whose contact information can be found at the official web page for this software: . http://www.daveltd.com/src/util/ttyload/ . (Note: the above is a modified version of the "ISC License", as extracted from http://en.wikipedia.org/wiki/ISC_license 2008-09-16.) License: GPL-2+ This package 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 package 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. . You should have received a copy of the GNU General Public License along with this program. If not, see . . On Debian systems, the complete text of the GNU General Public License can be found in "/usr/share/common-licenses/GPL-2". debian/ttyload.manpages0000644000000000000000000000001312147441446012364 0ustar debian/*.1 debian/source/0000755000000000000000000000000012147441446010475 5ustar debian/source/format0000644000000000000000000000001412147441446011703 0ustar 3.0 (quilt) debian/ttyload.install0000644000000000000000000000002012147441446012235 0ustar ttyload usr/bin debian/pod2man.mk0000644000000000000000000000332112147442050011055 0ustar # pod2man.mk -- Makefile portion to convert *.pod files to manual pages # # Copyright information # # Copyright (C) 2008-2013 Jari Aalto # # 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. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Description # # Convert *.pod files to manual pages. Write this to 'install' # target: # # install: build $(MANPAGE) ifneq (,) This makefile requires GNU Make. endif # This variable *must* be set when calling PACKAGE ?= package RELEASE ?= $(PACKAGE) # Optional variables to set MANSECT ?= 1 PODCENTER ?= $$(date "+%Y-%m-%d") # Directories MANSRC = MANDEST = $(MANSRC) MANPOD = $(MANSRC)$(PACKAGE).$(MANSECT).pod MANPAGE = $(MANDEST)$(PACKAGE).$(MANSECT) POD2MAN = pod2man POD2MAN_FLAGS = --utf8 makeman: $(MANPAGE) $(MANPAGE): $(MANPOD) # make target - create manual page from a *.pod page podchecker $(MANPOD) LC_ALL=C $(POD2MAN) $(POD2MAN_FLAGS) \ --center="$(PODCENTER)" \ --name="$(PACKAGE)" \ --section="$(MANSECT)" \ --release="$(RELEASE)" \ $(MANPOD) \ > $(MANPAGE) && \ rm -f pod*.tmp # End of of Makefile part debian/clean0000644000000000000000000000020412147441446010176 0ustar *.o arch/Linux/*.o arch/default/*.o ttyload archtest archtest.o arch/Darwin arch/Isilon-OneFS arch/thisarch debian/*.1 arch/GNU/*.o