Merge pull request #5278 from nckx/ftop

Add ftop: show progress of open files and file systems

lethalman 4faed098 606a0257

+70
+37
pkgs/os-specific/linux/ftop/default.nix
··· 1 + { stdenv, fetchurl, ncurses }: 2 + 3 + stdenv.mkDerivation rec { 4 + name = "ftop-1.0"; 5 + 6 + src = fetchurl { 7 + url = "http://ftop.googlecode.com/files/${name}.tar.bz2"; 8 + sha256 = "3a705f4f291384344cd32c3dd5f5f6a7cd7cea7624c83cb7e923966dbcd47f82"; 9 + }; 10 + 11 + buildInputs = [ ncurses ]; 12 + 13 + patches = [ 14 + ./ftop-fix_buffer_overflow.patch 15 + ./ftop-fix_printf_format.patch 16 + ]; 17 + patchFlags = "-p0"; 18 + 19 + postPatch = '' 20 + substituteInPlace configure --replace "curses" "ncurses" 21 + ''; 22 + 23 + meta = with stdenv.lib; { 24 + description = "Show progress of open files and file systems"; 25 + homepage = https://code.google.com/p/ftop/; 26 + license = with licenses; gpl3Plus; 27 + longDescription = '' 28 + Ftop is to files what top is to processes. The progress of all open files 29 + and file systems can be monitored. If run as a regular user, the set of 30 + open files will be limited to those in that user's processes (which is 31 + generally all that is of interest to the user). 32 + As with top, the items are displayed in order from most to least active. 33 + ''; 34 + maintainers = with maintainers; [ nckx ]; 35 + platforms = with platforms; linux; 36 + }; 37 + }
+11
pkgs/os-specific/linux/ftop/ftop-fix_buffer_overflow.patch
··· 1 + --- src/ftop.c.orig 2010-06-15 21:42:15.000000000 +0200 2 + +++ src/ftop.c 2010-06-15 21:45:38.000000000 +0200 3 + @@ -935,7 +935,7 @@ 4 + { 5 + if (bar_used > 0) 6 + { 7 + - snprintf(rate_buf, bar_used + 1, "%s", tmp_buf); 8 + + snprintf(rate_buf, bar_used >= sizeof(rate_buf) ? sizeof(rate_buf) : bar_used + 1, "%s", tmp_buf); 9 + p_attron(p, A_REVERSE); 10 + p_printf(p, "%s", rate_buf); 11 + if (bar_used > bytes)
+20
pkgs/os-specific/linux/ftop/ftop-fix_printf_format.patch
··· 1 + --- src/ftop.c.orig 2010-06-15 23:14:50.000000000 +0200 2 + +++ src/ftop.c 2010-06-15 23:15:52.000000000 +0200 3 + @@ -222,7 +222,7 @@ 4 + p_eol(p, part); 5 + 6 + cols = snprintf(tmp_buf, sizeof(tmp_buf), 7 + - "Processes: %u total, %u unreadable", 8 + + "Processes: %zu total, %zu unreadable", 9 + s->num_processes + s->num_unreadable_processes, 10 + s->num_unreadable_processes); 11 + 12 + @@ -244,7 +244,7 @@ 13 + p_eol(p, part); 14 + 15 + snprintf(tmp_buf, sizeof(tmp_buf), 16 + - "Open Files: %u regular, %u dir, %u chr, %u blk, %u pipe, %u sock, %u misc", 17 + + "Open Files: %zu regular, %zu dir, %zu chr, %zu blk, %zu pipe, %zu sock, %zu misc", 18 + s->num_reg, s->num_dir, s->num_chr, s->num_blk, s->num_pipe, 19 + s->num_sock, s->num_misc); 20 +
+2
pkgs/top-level/all-packages.nix
··· 1226 1226 1227 1227 ftgl212 = callPackage ../development/libraries/ftgl/2.1.2.nix { }; 1228 1228 1229 + ftop = callPackage ../os-specific/linux/ftop { }; 1230 + 1229 1231 fuppes = callPackage ../tools/networking/fuppes { 1230 1232 ffmpeg = ffmpeg_0_6_90; 1231 1233 };