initial commit

This commit is contained in:
Jordan Evans 2015-06-15 10:17:20 -07:00
commit 08d9495a72
47 changed files with 6983 additions and 0 deletions

View file

@ -0,0 +1,76 @@
--- ./bwbar.c 2001-09-21 17:33:35.000000000 -0500
+++ ../bwbar-1.2/bwbar.c 2003-12-10 20:43:59.000000000 -0600
@@ -147,6 +147,7 @@
const struct option longopts[] = {
{ "input", 0, 0, 'i' },
{ "output", 0, 0, 'o' },
+ { "directory", 1, 0, 'd' },
{ "text-file", 1, 0, 'f' },
{ "png-file", 1, 0, 'p' },
{ "interval", 1, 0, 't' },
@@ -169,6 +170,7 @@
"Options: (defaults in parenthesis)\n"
" --input -i Measure input bandwidth\n"
" --output -o Measure output bandwidth (default)\n"
+ " --directory -d Output directory\n"
" --text-file <file> -f The name of the text output file (ubar.txt)\n"
" --png-file <file> -p The name of the graphical bar file (ubar.png)\n"
" --interval <seconds> -t The poll interval in seconds (15)\n"
@@ -205,6 +207,8 @@
int measure_input = 0; /* Input instead of output */
char *text_file = "ubar.txt"; /* Text filename */
char *graphics_file = "ubar.png"; /* Graphics filename */
+ char *directory = ""; /* Directory name */
+ char *tmp_char;
char *unit_name = "Mbit/s"; /* Unit name */
double unit = 1.0e+6; /* Unit multiplier */
int interval = 15; /* Interval between measurements (s) */
@@ -214,7 +218,7 @@
program = argv[0];
- while ( (opt = getopt_long(argc, argv, "iof:p:t:x:y:b:kMGh", longopts, NULL)) != -1 ) {
+ while ( (opt = getopt_long(argc, argv, "iof:p:t:x:y:b:kMGhd:", longopts, NULL)) != -1 ) {
switch ( opt ) {
case 'i':
measure_input = 1;
@@ -228,6 +232,9 @@
case 'p':
graphics_file = optarg;
break;
+ case 'd':
+ directory = optarg;
+ break;
case 't':
interval = atoi(optarg);
break;
@@ -264,6 +271,18 @@
if ( argc-optind != 2 )
usage(1);
+ tmp_char = text_file;
+ text_file = malloc(strlen(text_file) + strlen(directory) + 5);
+ strcpy(text_file, directory);
+ strcat(text_file, "/");
+ strcat(text_file, tmp_char);
+
+ tmp_char = graphics_file;
+ graphics_file = malloc(strlen(graphics_file) + strlen(directory) + 5);
+ strcpy(graphics_file, directory);
+ strcat(graphics_file, "/");
+ strcat(graphics_file, tmp_char);
+
t_tmp = malloc(strlen(text_file) + 5);
g_tmp = malloc(strlen(graphics_file) + 5);
if ( !t_tmp || !g_tmp ) {
diff -u bwbar-1.2.orig/README bwbar-1.2/README
--- bwbar-1.2.orig/README 2004-05-19 16:36:16.000000000 +0200
+++ bwbar-1.2/README 2004-05-19 16:38:14.000000000 +0200
@@ -59,6 +59,7 @@
Options: (defaults in parenthesis)
--input -i Measure input bandwidth
--output -o Measure output bandwidth (default)
+ --directory -d Output directory
--text-file <file> -f The name of the text output file (ubar.txt)
--png-file <file> -p The name of the graphical bar file (ubar.png)
--interval <seconds> -t The poll interval in seconds (15)

View file

@ -0,0 +1,11 @@
--- bwbar.c 2004-06-01 14:54:12.000000000 -0500
+++ ../tmp/bwbar-1.2/bwbar.c 2004-05-12 00:58:50.000000000 -0500
@@ -315,7 +315,7 @@
/* Get interface info */
do {
- if ( fscanf(pnd, " %6[^:]:%u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u",
+ if ( fscanf(pnd, " %8[^:]:%u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u",
ifc.name,
&ifc.r_bytes, &ifc.r_pkt, &ifc.r_err, &ifc.r_drop,
&ifc.r_fifo, &ifc.r_frame, &ifc.r_compr, &ifc.r_mcast,

55
debian/patches/030_newunits.diff vendored Normal file
View file

@ -0,0 +1,55 @@
diff -u bwbar-1.2.orig/bwbar.c bwbar-1.2/bwbar.c
--- bwbar-1.2.orig/bwbar.c 2004-05-19 16:36:16.000000000 +0200
+++ bwbar-1.2/bwbar.c 2004-05-19 16:38:12.000000000 +0200
@@ -157,6 +157,9 @@
{ "kbps", 0, 0, 'k' },
{ "Mbps", 0, 0, 'M' },
{ "Gbps", 0, 0, 'G' },
+ { "KBps", 0, 0, 'K' },
+ { "MBps", 0, 0, 'm' },
+ { "GBps", 0, 0, 'g' },
{ "help", 0, 0, 'h' },
{ 0, 0, 0, 0 }
};
@@ -180,6 +183,9 @@
" --kbps -k Bandwidth is measured in kbit/s\n"
" --Mbps -M Bandwidth is measured in Mbit/s (default)\n"
" --Gbps -G Bandwidth is measured in Gbit/s\n"
+ " --KBps -K Bandwidth is measured in KB/s\n"
+ " --MBps -m Bandwidth is measured in MB/s\n"
+ " --GBps -g Bandwidth is measured in GB/s\n"
" --help -h Display this text\n",
program);
exit(err);
@@ -259,6 +265,18 @@
unit = 1.0e+9;
unit_name = "Gbit/s";
break;
+ case 'K':
+ unit = 8.0e+3;
+ unit_name = "KB/s";
+ break;
+ case 'm':
+ unit = 8.0e+6;
+ unit_name = "MB/s";
+ break;
+ case 'g':
+ unit = 8.0e+9;
+ unit_name = "GB/s";
+ break;
case 'h':
usage(0);
break;
Common subdirectories: bwbar-1.2.orig/debian and bwbar-1.2/debian
diff -u bwbar-1.2.orig/README bwbar-1.2/README
--- bwbar-1.2.orig/README 2004-05-19 16:36:16.000000000 +0200
+++ bwbar-1.2/README 2004-05-19 16:38:14.000000000 +0200
@@ -68,4 +71,8 @@
--kbps -k Bandwidth is measured in kbit/s
--Mbps -M Bandwidth is measured in Mbit/s (default)
--Gbps -G Bandwidth is measured in Gbit/s
+ --KBps -K Bandwidth is measured in KB/s
+ --MBps -m Bandwidth is measured in MB/s
+ --GBps -g Bandwidth is measured in GB/s
--help -h Display this text
+