debian-goodies-0.63/0000755000000000000000000000000012165537036011211 5ustar debian-goodies-0.63/dgrep0000755000000000000000000000376012165351155012242 0ustar #!/bin/sh # dgrep -- grep through files belonging to an installed Debian package # Copyright (C) 2001 Matt Zimmerman # 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, 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. set -e prog=`echo $0 | sed 's|.*/d||'` case "$prog" in grep|egrep|fgrep|zgrep|zegrep|zfgrep) ;; *) echo >&2 "dpkg-grep: Unrecognized invocation: $0"; exit 1 ;; esac # Option parser modeled after the one in zgrep from GNU grep recursive=0 opts="" pat="" after_args="" while test $# -ne 0; do case "$1" in --recursive|--d*=recurse) echo >&2 "recursive grep not supported" exit 1 ;; --d*=skip) ;; --d*=read) echo >&2 "--directories=read not supported"; exit 1 ;; --help) echo "Usage: dgrep [most grep options] ..."; exit 0 ;; --*) ;; -*) case "$1" in -*r*) echo >&2 "recursive grep not supported"; exit 1 ;; esac ;; esac case "$after_args$1" in -[ef]) opts="$opts $1"; shift; pat=$1 ;; -[ABCdm]) opts="$opts $1 $2"; shift ;; --) opts="$opts $1"; after_args=1 ;; -*) opts="$opts $1" ;; *) if test -z "$pat"; then pat=$1 else break fi ;; esac shift done exec dglob -0f "$@" | xargs -0r $prog $opts "$pat" debian-goodies-0.63/which-pkg-broke.10000644000000000000000000000422112165351155014247 0ustar .\" which-pkg-broke.1 - find which package might have broken another .\" Copyright (C) 2006 Javier Fernandez-Sanguino .\" Everybody is allowed to distribute this manual page, .\" to modify it, and to distribute modified versions of it. .TH which-pkg-broke 1 "July 24 2006" "debian\-goodies" "debian\-goodies" .SH NAME which-pkg-broke \- find which package might have broken another .SH SYNOPSIS .B which-pkg-broke .RI package .SH DESCRIPTION The .B which-pkg-broke program will retrieve a list of the named package and all its dependencies sorted by the time they were installed on the system (as determined from the mtime information of .B /var/lib/dpkg/info/*.list \). This tool makes it possible for a system admin to obtain information that might correlate installation of package dependencies with a package breakage in order to find which package update might be responsible for the breakage. .SH EXAMPLES This tool can be useful determine which package dependencies were upgraded more recently and might be associated with the bug that is being observed. For example, if aptitude stops working properly, an administrator can run: .br \fB$ which-pkg-broke aptitude\fP .br Package has no install time info .br libdb1-compat Fri Aug 8 03:02:11 2003 .br libsigc++-1.2-5c102 Fri Aug 8 05:15:58 2003 .br aptitude Sun Jan 11 17:38:06 2004 .br libncurses5 Sun Jan 18 08:11:05 2004 .br libc6 Thu Jan 22 07:55:10 2004 .br libgcc1 Tue Jan 27 07:37:22 2004 .br gcc-3.3-base Tue Jan 27 07:37:31 2004 .br libstdc++5 Tue Jan 27 07:37:32 2004 .br So depending on exactly when the misbehaviour started, there may be a reason to point the finger at a more-recently updated library like \fBlibstdc++\fP or \fBlibncurses\fP, which are more-recently installed than aptitude itself. .SH SEE ALSO .BR rc\-alert (1) .SH AUTHOR .B which-pkg-broke was written by Bill Gribble This manual page was written by Javier Fernandez-Sanguino for the Debian GNU/Linux distribution. debian-goodies-0.63/popbugs.10000644000000000000000000000255012165351155012750 0ustar .\" popbugs.1 - find RC bugs in packages you commonly use .\" Copyright (C) 2004 Jochen Voss .\" Everybody is allowed to distribute this manual page, .\" to modify it, and to distribute modifed versions of it. .TH popbugs 1 "January 10 2004" "debian\-goodies" "debian\-goodies" .SH NAME popbugs \- find RC bugs in packages you commonly use .SH SYNOPSIS .B popbugs .RI [ options "] [" "popularity\-contest log" ] .SH DESCRIPTION The .B popbugs program fetches the list of release critical bugs from the Debian bug tracking system on the internet. It correlates the bug log with the .B popularity\-contest data from your system to obtain a list of release critical bugs in packages, which are commonly used on your system. Normally this list is displayed in a web browser. Helping to resolve these bugs is a good idea, if you want to see your favourite programs in the next stable release of Debian. .SH OPTIONS .TP .BI \-h .TP .BI \-\-help Show a very short usage message. .TP .BI \-o outputfile .TP .BI \-\-output= outputfile Place the output in .I outputfile instead of displaying it in a browser. .TP .BI \-d .TP .BI \-\-debug Output debugging information. .SH SEE ALSO .BR rc\-alert (1), .BR popularity\-contest (8) .SH AUTHOR The .B popbugs program is copyright \(co 2001 Matt Zimmerman . This manual page is copyright \(co 2004 Jochen Vo\(ss . debian-goodies-0.63/debpaste0000755000000000000000000003405412165351155012730 0ustar #!/usr/bin/perl -w # =head1 NAME debpaste - http://paste.debian.net/ XML-RPC client =cut # Author: Hanno Hecker # Licence: AGPL 3.0 (http://www.fsf.org/licensing/licenses/agpl-3.0.html) # Version: $Id: debpaste 22 2009-11-19 17:23:47Z vetinari $ # SVN: http://svn.ankh-morp.org:8080/tools/paste-dn/ # # Required: # deb: perl-base perl-modules # libtimedate-perl libfrontier-rpc-perl libtext-iconv-perl # # ToDo: # * "get" formatting? # * wishlist :) # use strict; use Getopt::Long; use Pod::Usage; my %config; my $VERSION = '1.1 ($Rev: 22 $)'; =head1 SYNOPSIS B ACTION [OPTIONS] [CODE|ID] =head1 ACTIONS =over 4 =item add Usage: debpaste add [OPTIONS] [CODE] Adds a new paste to L. If no code is given on the command line, it will read from stdin. Your paste infos are saved to I<~/.debpaste.history> =item del Usage: debpaste del [OPTIONS] ID Deletes paste with id ID. This must be an ID which you have pasted before (and is in your history file) =item get Usage: debpaste get [OPTIONS] ID Fetches the paste with id ID from L. To C a paste use something like debpaste get --noheader ID > OUTFILE =item lang Usage: debpaste lang [OPTIONS] Dumps the list of available languages for syntax highlighting, use the B<--lang=LANG> option when Bing a paste. =item edit Usage: debpaste edit [OPTIONS] ID Downloads the paste with id ID, spawns an editor, and sends the edited file as new paste. =item expire Usage: debpaste expire [OPTIONS] [ID] Removes the entry ID from history file. If no ID is given it removes all entries which are expired. =back =head1 OPTIONS =over 4 =item --user=USERNAME paste as USERNAME instead of C =item --server=URL use URL instead of http://paste.debian.net/server.pl =item --noproxy do not use the http proxy given in the environment variable C =item --lang=LANG use LANG for syntax highlight ('debpaste lang' for available languages) =item --expires=SEC expires in SEC seconds (default: 259200 = 72h) =item --encoding=ENC when adding new paste, use ENC as encoding of file, default: UTF-8 =item --noheader when Bting entries, don't print header, just dump the paste to stdout. =item --version print version and exit =back =cut binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); $0 =~ s#.*/##; =head1 FILES =over 4 =item ~/.debpaste.rc The right place for setting default options like the username or expire values. Format is C, example: User: Vetinari Expires: 86400 =item ~/.debpaste.history All info about pastes done with B are recorded here. This file is used to keep a record for Beting entries after pasting. Use B to remove old entries. =back =cut my $settings = $ENV{HOME}."/.debpaste.rc"; ## Don't change, edit $settings file: ## KeYInAnyCaSE: value ## AnoThErKey: other-value my $history = $ENV{HOME}."/.debpaste.history"; %config = ( server => "http://paste.debian.net/server.pl", user => "anonymous", lang => "", expires => 86400 * 3, # history_file => $history, no_get_header => 0, ); my $action = "help"; my %help = ( 'add' => "\n" ."Usage: $0 add [OPTIONS] [CODE]\n" ." Adds a new paste to http://paste.debian.net/\n" ." If no code is given on the command line, it will read from\n" ." stdin.\n" ." Your paste infos are saved to $history\n", 'get' => "\n" ."Usage: $0 get [OPTIONS] ID\n" ." Fetches the paste with id ID from paste.debian.net\n" ." To 'download' a paste use something like\n" ." $0 get --noheader ID > OUTFILE\n", 'del' => "\n" ."Usage: $0 del [OPTIONS] ID\n" ." Deletes paste with id ID. This must be an ID which you have\n" ." pasted before (and is in your history file)\n", 'lang' => "\n" ."Usage: $0 lang [OPTIONS]\n" ." Dumps the list of available languages for syntax highlighting\n", 'edit' => "\n" ."Usage: $0 edit [OPTIONS] ID\n" ." Downloads the paste with id ID, spawns an editor (\$EDITOR)\n" ." and sends the edited file as new paste\n", 'expire' => "\n" ."Usage: $0 expire [OPTIONS] [ID]\n" ." Removes the entry ID from history file. If no ID is given,\n" ." it removes all entries which are expired.\n", # 'help' => "FIXME: help", ); if (@ARGV and $ARGV[0] !~ /^-/) { $action = shift @ARGV; } &read_settings(); GetOptions( "user=s" => \$config{user}, "server=s" => \$config{server}, "expires=s" => \$config{expires}, "lang=s" => \$config{lang}, "encoding=s"=> \$config{encoding}, "noheader" => \$config{no_get_header}, "help" => sub { pod2usage(-exitval => 0, -verbose => 2) }, "version" => sub { print "debpaste v$VERSION\n"; exit 0; }, ) or pod2usage(-exitval => 1, -verbose => 2); if ($action and $action eq "help") { $action = shift @ARGV if (@ARGV and $ARGV[0] !~ /^-/); &help($action); exit 0; } my $paste = PasteDN->new(%config); if ($paste->can($action) and $action ne "new" and $action !~ /^_/) { $paste->$action(); } else { die "$0: err... unknown action $action...\n"; } sub read_settings { open SET, $settings or return; while (defined (my $line = )) { next unless $line =~ /^(\w+):\s+(.*)$/; my ($key, $value) = (lc $1, $2); unless (exists $config{$key}) { warn "$0: unknown config key '$key' found\n"; next; } ($config{$key} = $value) =~ s/^\s*(.*?)\s*$/$1/; } close SET; } sub help { my $msg = ""; ($msg = $help{$_[0]}."\n") if (exists $help{$_[0]}); pod2usage(-exitval => 0, -verbose => 2, -message => $msg); } ################################################################### package PasteDN; use Frontier::Client; use Date::Parse; use POSIX qw(strftime); use File::Temp qw(tempfile); use Text::Iconv; sub new { my $me = shift; my %args = @_; my $type = ref($me) || $me; my $self = {}; bless $self, $type; foreach (keys %args) { $self->{$_} = $args{$_}; } unless (exists $self->{editor}) { $self->{editor} = $ENV{EDITOR} ? $ENV{EDITOR} : ($ENV{VISUAL} ? $ENV{VISUAL} : "/usr/bin/editor"); } $self->{encoding} = "UTF-8" unless $self->{encoding}; $self->{expires} += time; my %fc = ( url => $self->{server} ); unless ($self->{noproxy}) { $fc{proxy} = $ENV{http_proxy} if $ENV{http_proxy}; } $self->{_service} = Frontier::Client->new(%fc); $self; } sub _to_utf8 { my ($self,$txt) = @_; my $enc = $self->{encoding}; return $txt if $enc eq "UTF-8"; my $i = eval { Text::Iconv->new($enc, "UTF-8"); }; die "$0: unsupported encoding $enc\n" if $@; my $new = $i->convert($txt); return $txt unless $new; return $new; } sub _error { my ($self, $msg) = @_; unlink $self->{_tempfile} if $self->{_tempfile}; die "$0: $msg\n"; } sub lang { my $self = shift; my $rc = $self->{_service}->call("paste.getLanguages"); die $rc->{statusmessage},"\n" if $rc->{rc}; ## print $rc->{statusmessage},"\n"; print "Available syntax highlights:\n"; foreach (@{$rc->{langs}}) { print " $_\n"; } } sub get { my $self = shift; my $id = shift @ARGV; die "$0: no id given\n" unless $id; my $rc = $self->{_service}->call("paste.getPaste", $id); die $rc->{statusmessage},"\n" if $rc->{rc}; # ugly, but dates are ok then... # FIXME: probably only works with paste.d.n's timezone: my $stime = str2time($rc->{submitdate}, "CET") - 3600; my $sub_date = strftime('%Y-%m-%d %H:%M:%S', localtime $stime); my $exp_date = strftime('%Y-%m-%d %H:%M:%S', localtime($stime + $rc->{expiredate})); unless ($self->{no_get_header}) { print "User: ", $rc->{submitter}, "\n", "Date: $sub_date\n", "Expires: $exp_date\n", "---------------------------------\n"; } print $rc->{code},"\n"; } sub edit { my $self = shift; my $id = shift @ARGV; die "$0: no id given\n" unless $id; my $rc = $self->{_service}->call("paste.getPaste", $id); die $rc->{statusmessage},"\n" if $rc->{rc}; my $new = $self->_spawn_editor($rc->{code}); if (!$new or ($new eq $rc->{code})) { print "$0: not changed, aborting...\n"; exit 0; } ## FIXME: text from paste.debian.net is probably UTF-8 ## $new = $self->_to_utf8($new); $rc = $self->{_service}->call("paste.addPaste", $new, $self->{user}, $self->{expires} - time, $self->{lang}); die $rc->{statusmessage},"\n" if $rc->{rc}; print $rc->{statusmessage},"\n"; print "To delete this entry, use: $0 del $rc->{id}\n"; $self->_save_entry($rc); } sub _spawn_editor { my ($self, $txt) = @_; my $fh; ($fh, $self->{_tempfile}) = tempfile("debpaste.XXXXXX", DIR => "/tmp"); $self->_error("Could not create temp file: $!") unless ($fh and $self->{_tempfile}); print $fh $txt or $self->_error("Could not print to tempfile: $!"); close $fh or $self->_error("Failed to close tempfile: $!"); if (system($self->{editor}, $self->{_tempfile}) != 0) { $self->_error("failed to execute: $!") if $? == -1; $self->_error(sprintf('child died with signal %d, %s coredump', ($? & 127), ($? & 128) ? 'with' : 'without')) if $? & 127; $self->error(sprintf('editor exited with value %d', $? >> 8)); } open FH, $self->{_tempfile} or $self->_error("Failed to open temp file: $!"); { local $/ = undef; $txt = ; }; close FH; unlink $self->{_tempfile}; return $txt; } sub delete { $_[0]->del(); } sub del { my $self = shift; my %entry = (); my $id = shift @ARGV; die "$0: no id given\n" unless $id; open FILE, $self->{history_file} or die "$0: failed to open history file: $!\n"; { local $/ = "\n\n"; while () { s#^[\n\s]+##ms; s#[\n\s]+$##ms; next unless $_; %entry = map { /^(\S+):\s*(.*?)\s*$/; ($1, $2 ? $2 : "") } split /\n/, $_; last if ($entry{Entry} and $entry{Entry} eq $id); %entry = (); } } die "$0: Entry for $id not found...\n" unless $entry{Entry}; die "$0: No Digest for $id\n" unless $entry{Digest}; die "$0: Entry $id expired at ", scalar(localtime($entry{Expires})),"\n" if ($entry{Expires} and $entry{Expires} < time); my $rc = $self->{_service}->call("paste.deletePaste", $entry{Digest}); die $rc->{statusmessage},"\n" if $rc->{rc}; print $rc->{statusmessage},"\n", "$0: deleted paste id ",$rc->{id},"\n"; $self->_expire($rc->{id}); } sub expire { my $self = shift; my $id = shift @ARGV; $self->_expire($id); } sub _expire { my ($self, $id) = @_; my @history = (); my %entry; my @ids = (); open FILE, $self->{history_file} or return; { local $/ = "\n\n"; while () { s#^[\n\s]+##ms; s#[\n\s]+$##ms; next unless $_; %entry = map { /^(\S+):\s*(.*?)\s*$/; ($1, $2 ? $2 : "") } split /\n/, $_; ## print "ID: $entry{Entry}\n"; if ($id) { if ($entry{Entry} and $entry{Entry} eq $id) { push @ids, $entry{Entry}; next; } } elsif ($entry{Expires} and $entry{Expires} < time) { push @ids, $entry{Entry}; next; } push @history, { %entry }; } } close FILE; open FILE, ">", $self->{history_file} or die "$0: Failed to open history file: $!\n"; foreach my $h (@history) { foreach (keys %{$h}) { next unless $_; print FILE "$_: $h->{$_}\n"; } print FILE "\n"; } close FILE or die "$0: failed to write: $!\n"; print "$0: expired ", scalar(@ids), " entries from history", (@ids ? ": ".join(", ", @ids) : ""), "\n"; } sub add { my $self = shift; my $code = undef; if (@ARGV) { $code = join("\n", @ARGV); } else { { local $/ = undef; $code = ; } } die "$0: no code given\n" unless $code; $code = $self->_to_utf8($code); my $rc = $self->{_service}->call("paste.addPaste", $code, $self->{user}, $self->{expires} - time, $self->{lang}); die $rc->{statusmessage},"\n" if $rc->{rc}; print $rc->{statusmessage},"\n"; print "To delete this entry, use: $0 del $rc->{id}\n"; $self->_save_entry($rc); } sub _save_entry { my ($self, $rc) = @_; # return unless $self->{save_pastes}; my $file = $self->{history_file} or return; open FILE, ">>", $file or die "$0: failed to open $file: $!\n"; seek FILE, 0, 2 or die "$0: Failed to seek: $!\n"; print FILE "Server: ", $self->{server}, "\n", "Entry: ", $rc->{id}, "\n", "Lang: ", $self->{lang}, "\n", "Expires: ", $self->{expires},"\n", "Digest: ", $rc->{digest}, "\n\n" or die "$0: Failed to save paste: $!\n"; close FILE or die "$0: Failed to save paste: $!\n"; } =head1 DOWNLOAD L or L =head1 NOTES Renamed to C at Rev. 20 =head1 AUTHOR Hanno Hecker =cut # vim: ts=4 sw=4 expandtab syn=perl debian-goodies-0.63/checkrestart.10000644000000000000000000001231712165531101013744 0ustar .\" checkrestart.1 - provide a list of processess that need to be restarted .\" Copyright (C) 2006 Javier Fernandez-Sanguino .\" Everybody is allowed to distribute this manual page, .\" to modify it, and to distribute modifed versions of it. .TH checkrestart 1 "December 19 2006" "debian\-goodies" "debian\-goodies" .SH NAME checkrestart \- check which processes need to be restarted after an upgrade .SH SYNOPSIS .B checkrestart [ -hvpa ] [ -b blacklist_file ] [ -i package_name ] .SH DESCRIPTION The .B checkrestart program tries to determine if there are processes in the system that need to be restarted after a system upgrade. This is necessary since an upgrade will usually bring new system libraries and running processes will be still using the old versions of the libraries. In \fIstable\fP Debian GNU/Linux systems this is typically needed to eliminate a system exposure to a vulnerability which might have been fixed by upgrading a library which that process makes use of. .P Consequently, .B checkrestart is sometimes used as an audit tool to find outdated versions of libraries in use, particularly after security upgrades. Administrators should not, however, rely on its output completely (see \fBBUGS\fP below). .P This script needs to run as root in order to obtain the information it needs for analysis. .SH OPTIONS .TP .BI -h, --help Show the program help and exit. .TP .BI -v, --verbose Generate detailed output. This output includes the list of all processes found using deleted files or descriptors as well as the deleted files and descriptors found. .TP .BI -p, --package Only process deleted files that belong to a package, ignoring deleted files which do not have an associated package in the package system. .TP .BI -a, --all Process all deleted files regardless of location. This makes the program analyse deleted files even if they would be discarded because they are located in locations, such as .I /tmp , which are known to produce false positives. It will take preceded if used simultaneously with the .I -p option. .TP .BI -b\ file, --blacklist=file Read a blacklist of regular expressions from .I file. Any files matching the patterns will be ignored. .TP .BI -i\ name, --ignore=name Ignore services that are associated to the package name provided in .I name. .SH EXIT STATUS The program will exit with error (1) if a non-root user tries to run it. Otherwise, it will always exit with error status 0. .SH EXAMPLE Start it as user root without parameters: # checkrestart Found 20 processes using old versions of upgraded files (15 distinct programs) (14 distinct packages) Of these, 12 seem to contain init scripts which can be used to restart them: The following packages seem to have init scripts that could be used to restart them: gpm: 3044 /usr/sbin/gpm rpcbind: 2208 /sbin/rpcbind bind9: 8463 /usr/sbin/named openssh-server: 22124 /usr/sbin/sshd ntp: 4078 /usr/sbin/ntpd tftpd-hpa: 3417 /usr/sbin/in.tftpd uptimed: 2704 /usr/sbin/uptimed cron: 3019 /usr/sbin/cron postfix: 22145 /usr/lib/postfix/qmgr 8892 /usr/lib/postfix/master hddtemp: 3174 /usr/sbin/hddtemp autofs: 2792 /usr/sbin/automount openbsd-inetd: 3254 /usr/sbin/inetd These are the init scripts: service gpm restart service rpcbind restart service bind9 restart service ssh restart service ntp restart service tftpd-hpa restart service uptimed restart service cron restart service postfix restart service hddtemp restart service autofs restart service openbsd-inetd restart These processes do not seem to have an associated init script to restart them: isc-dhcp-client: 3775 /sbin/dhclient .SH BUGS This program might fail if the output of the \fIlsof\fP utility changes since it depends on it to detect which deleted files are used by processes. It might also output some false positives depending on the processes' behaviour since it does not check yet if the (deleted) files in use are really libraries. .P If you find a false positive in .B checkrestart please provide the following information when submitting a bug report: .IP \(em The output of \fBcheckrestart\fP using the \fI-v\fP (verbose) option. .IP \(em The output of running the following command as root: .PP lsof | egrep 'delete|DEL|path inode' .PP .P .B Checkrestart is also sensitive to the kernel version in use. And might fail to work with newer (or older) versions. .P A rewrite to make it less dependent on \fIlsof\fP could improve this, however. .SH SEE ALSO .B lsof(8) .SH AUTHOR .B checkrestart was written by Matt Zimmerman for the Debian GNU/Linux distribution. .SH COPYRIGHT AND LICENCE Copyright (C) 2001 Matt Zimmerman Copyright (C) 2007,2010-2011 Javier Fernandez-Sanguino 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, or (at your option) any later version. On Debian systems, a copy of the GNU General Public License may be found in /usr/share/common-licenses/GPL. debian-goodies-0.63/check-enhancements0000755000000000000000000000706612165351677014700 0ustar #!/bin/bash # Copyright (C) 2012 George Danchev # 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, 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. SELF=$(basename "$0") VER=0.3 OPT_CHECK_INSTALLED_PACKAGES=0 OPT_SHOW_INSTALLED_ENHANCEMENTS=0 OPT_VERBOSE=0 print_version() { echo "$VER" } print_help() { cat << HLP ${SELF} ( -ip | -ie | -h | --verbose | --version ) Options: Program options start with dash or double dash, otherwise they are interpreted as package names. Only non-installed enhancement packages are printed out by default, use -ie to show them all. -ip, --ip, -installed-packages, --installed-packages Show enhancements of all installed packages (could be slow) -ie, --ie, -installed-enhancements, --installed-enhancements Show installed enhancement packages too -h, -help, --help -version, --version -verbose, --verbose Examples: # check enhancement packages of all installed packages ${SELF} -ip # check enhancement packages of selected packages ${SELF} pkg1 pkgN HLP } pkgs_enhancing_pkg_status() { # Figure out package Enhances:'ing a given package EN=`grep-dctrl -n -s Package -F Enhances -X "${1}" /var/lib/apt/lists/*Packages` case $? in 0) if test $OPT_VERBOSE != 0; then echo -e "Package <<$1>> could be Enhanced by:"; fi ;; 1) continue ;; *) echo "${SELF}: Internal Error!" exit 1 ;; esac for e in `echo "${EN}" | sort | uniq | xargs` # now sort and unify do # Figure out whether those enhancements are installed or not. # By default only output non-installed enhancements OUT="" case "${OPT_SHOW_INSTALLED_ENHANCEMENTS}" in 0) OUT=`apt-cache policy ${e} | head -3 | paste -s | grep "Installed: (none)"` ;; 1) OUT=`apt-cache policy ${e} | head -3 | paste -s` ;; esac if test x"$OUT" != x""; then printf "%2s => " "$1" && echo "${OUT}"; fi done } # main declare -a PKGS=() for op in $@ do case "${op}" in -ip|--ip|-installed-packages|--installed-packages) OPT_CHECK_INSTALLED_PACKAGES=1 ;; -ie|--ie|-installed-enhancements|--installed-enhancements) OPT_SHOW_INSTALLED_ENHANCEMENTS=1 ;; -h|-help|--help) print_help exit 0 ;; -version|--version) print_version exit 0 ;; -verbose|--verbose) OPT_VERBOSE=1 ;; -*) echo "invalid option ${op}" print_help exit 1 ;; *) # PKGS[$[${#PKGS[@]}+1]]="${op}" PKGS+=(${op}) ;; esac done # no options, just show help if test x"$1" == x""; then print_help; exit 0; fi # process package names given on the cmdline for cmdline_pkg in "${PKGS[@]}" do pkgs_enhancing_pkg_status $cmdline_pkg done # process installed packages, as well case $OPT_CHECK_INSTALLED_PACKAGES in 1) for installed in $(grep-status -FStatus "install ok installed" -n -s Package | sort | uniq) do pkgs_enhancing_pkg_status $installed done ;; esac exit 0 debian-goodies-0.63/dhomepage.10000644000000000000000000000246712165351155013231 0ustar .\" .\" Copyright (C) 2008 Thadeu Lima de Souza Cascardo .\" .\" 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, write to the Free Software Foundation, Inc., .\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. .\" .TH DHOMEPAGE 1 2008-09-27 .SH NAME dhomepage - show the homepage of a package in a browser .SH SYNOPSIS dhomepage PACKAGE .SH DESCRIPTION Shows the homepage of a Debian package using a sensible browser. .SH OPTIONS .TP \fB\-\-help\fR Print help message .TP \fB\-\-help\fR Print version message .SH EXIT STATUS Returns 0 if homepage was found, and 1 otherwise. .SH BUGS Report bugs to this man page and program to cascardo@minaslivre.org. .SH SEE ALSO .BR dgrep (1) .BR sensible-browser (1) debian-goodies-0.63/dhomepage0000644000000000000000000000314212165351155013061 0ustar #!/bin/sh # # Copyright (C) 2008 Thadeu Lima de Souza Cascardo # # 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, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # VERSION="0.1" version() { echo "dhomepage version $VERSION" echo "dhomepage is licensed under the GNU General Public License" echo "version 2 or later" } usage() { echo "dhomepage PACKAGE" echo "" echo "--version Show version information" echo "--help Show this help message" echo "" } PACKAGE="$1" if [ -z "$PACKAGE" ]; then usage exit 0 fi case "$1" in --help) usage exit 0 ;; --version) version exit 0 ;; esac HOMEPAGE=`grep-aptavail -PX $PACKAGE -s Homepage | sed 's,^Homepage: ,,' | sort -u` if [ -z "$HOMEPAGE" ]; then HOMEPAGE=`grep-aptavail -PX $PACKAGE -s Description | \ sed -n '/^ Homepage: /{s,^ Homepage: ,,;p}' | sort -u` fi if [ -z "$HOMEPAGE" ]; then echo "$PACKAGE has no homepage" exit 1 fi for URL in $HOMEPAGE; do sensible-browser "$URL" done debian-goodies-0.63/dgrep.pod0000644000000000000000000000351312165351155013014 0ustar =head1 NAME dgrep, degrep, dfgrep, dzgrep -- grep through files belonging to an installed Debian package =head1 SYNOPSIS B [I] I I... B B<--help> =head1 DESCRIPTION B invokes grep(1) on each file in one or more installed Debian packages. It passes the I argument(s) to dglob(1) to retrieve a list of files in those packages. You can use POSIX regular expressions for the package names. If B is invoked as B, B or B then egrep(1), fgrep(1) or zgrep(1) is used instead of B. =head1 OPTIONS B supports most of grep(1)'s options. Please refer to your B documentation (i.e. the manpage or the texinfo manual) for a complete listing. Only a few options are excluded because they do not conform with the intended behaviour, see the list below. =head2 Options of grep that are not supported by dgrep =over 4 =item B<-r>, B<--recursive>, B<-d> I, B<--directories>=I =item B<-d> I, B<--directories>=I B searches only in the "normal" files of a package. It skips all directories and symlinks. Therefor the options of grep that are specific to directories are not supported. =back =head1 AUTHOR Matt Zimmerman This manpage was written by Frank Lichtenheld . =head1 COPYRIGHT AND LICENCE Copyright (C) 2001 Matt Zimmerman . 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, or (at your option) any later version. On Debian systems, a copy of the GNU General Public License may be found in /usr/share/common-licenses/GPL. =head1 SEE ALSO grep(1), egrep(1), fgrep(1), zgrep(1), dglob(1), regex(7), dpkg(8) debian-goodies-0.63/debman0000755000000000000000000000557112165351155012371 0ustar #! /bin/bash -e # debman - read a man page from an uninstalled Debian package file (.deb) # Copyright (C) 2003 Colin Watson # 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, 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. usage () { if [ "$1" -eq 1 ]; then FD=2 else FD=1 fi cat >&$FD < ... Options should be exactly one of: -f package.deb read pages from package.deb archive -p package download .deb for package and read pages from there EOF exit "$1" } ARGS=`getopt -l help,filename:,package: -o hf:p: -n debman -- "$@"` eval set -- "$ARGS" FILENAME= PACKAGE= while :; do case "$1" in -h|--help) usage 0 ;; -f|--filename) FILENAME="$2" shift 2 ;; -p|--package) PACKAGE="$2" shift 2 ;; --) shift break ;; *) echo "debman: Internal error in option parsing" >&2 exit 1 ;; esac done if ( [ -n "$FILENAME" ] && [ -n "$PACKAGE" ] ) || \ ( [ -z "$FILENAME" ] && [ -z "$PACKAGE" ] ); then usage 1 fi if test $# -lt 1; then usage 1 fi # Directory names are duplicated with and without ./ in order to cope with # old .debs whose data.tar.gz components had a slightly different format. MANDIRS='usr/share/man usr/X11R6/man ./usr/share/man ./usr/X11R6/man' TEMPDIR=`mktemp -dt debman.XXXXXXXXXX` trap 'rm -rf "$TEMPDIR"' EXIT ERR HUP INT QUIT TERM if [ -n "$PACKAGE" ]; then (cd "$TEMPDIR" && debget "$PACKAGE") # There should be at most one file in $TEMPDIR now. FILENAME="`find \"$TEMPDIR\" -name \*.deb -print`" if [ -z "$FILENAME" ]; then echo "Failed to fetch package $PACKAGE; exiting." >&2 exit 1 fi fi # Ignore errors from tar (though not dpkg). They'll generally just be of the # form "tar: usr/share/man: Not found in archive". If they're something # else, then man will fail to find the page anyway. dpkg --fsys-tarfile "$FILENAME" | \ (tar -C "$TEMPDIR" -xf - $MANDIRS 2>/dev/null || true) MANPATH="$TEMPDIR/usr/share/man:$TEMPDIR/usr/X11R6/man" man "$@" # vi: expandtab debian-goodies-0.63/debian/0000755000000000000000000000000012165552460012431 5ustar debian-goodies-0.63/debian/clean0000644000000000000000000000002512165351155013431 0ustar check-enhancements.1 debian-goodies-0.63/debian/compat0000644000000000000000000000000212165351155013625 0ustar 9 debian-goodies-0.63/debian/changelog0000644000000000000000000010241612165547200014303 0ustar debian-goodies (0.63) unstable; urgency=low * [checkrestart]: - Handle programs setting $0 / argv[0] incorrectly (e.g. spamd, see https://bugzilla.redhat.com/show_bug.cgi?id=755644; Closes: #715000) Thanks Wolodja Wentland! - Add special case to recognize spamds despite their manually set $0. * Mention check-enhancements in the long description * Add example to checkrestart's man page (LP: #280793) -- Axel Beckert Fri, 05 Jul 2013 14:47:10 +0200 debian-goodies (0.62) unstable; urgency=low [ Paul Wise ] * [checkrestart] - don't get confused by deleted interpreters (Closes: #696139) [ Axel Beckert ] * [dgrep] - Support (d)zegrep and (d)zfgrep. - Fix quoting to allow patterns with blanks * [check-enhancements] - New command by George Danchev (Closes: #679927) - Optimize --help message for help2man - Add build-dependency on help2man for check-enhancements' man page * [which-pkg-broke] - Use 2x dpkg instead of dpkg-architecture (Closes: #665880) - Don't read architecture list again for each package to check (much faster now, thanks to Jakub Wilk for the idea!) * [debmany] - Use curl --location to support redirects (Closes: #679225) - No more use /dev/shm for temporary files (Closes: #679457) * [checkrestart] - Check ignorelist for package name equality, not substring match. Thanks Francesco Poli! (Closes: #696533) - Also ignore log and temp files under /var/local/ (Closes: #695151) - Ignore options between interpreter and script name (Closes: #678635) * Bump debhelper compatibility to 9 to be able to use some more recent features. Update versioned debhelper build-dependency accordingly. * Revamp debian/rules - No more remove stamp files manually. - Use debian/links instead of calling ln manually in debian/rules - Use dh_install/dh_link to install all the scripts - Use debian/manpages instead of parameters to dh_installman - Use debian/docs instead of parameters to dh_installdocs - Fix lintian warning dh-clean-k-is-deprecated and use dh_prep - Finally switch to dh v7 style debian/rules file * Bump Standards-Version to 3.9.4 (no changes) * Apply wrap-and-sort * Update copyright years in debian/copyright -- Axel Beckert Thu, 04 Jul 2013 21:59:21 +0200 debian-goodies (0.61) unstable; urgency=low * [checkrestart] - Prover fix to avoid false positives due to /drm (Closes: #548380) - Add patch provided by Tollef Fog Heen which includes a new -b (blacklist) option. This makes it possible for system administrators to prevent false positives or known issues from reports (Closes: #649168, 632032) - Fix behaviour of the -p option in several ways to both ensure that the test is done properly and that it does not consume unnecesary CPU resources. Also process STDERR instead of showing its contents to the end-user. (Closes: #657653, #513189) - The -p option now works also when libraries have been upgraded and the files in use are no longer present in the file system. - Do not abort if running in a vserver environment. In these environments the init system (i.e PID 1) is unaccessible. (Closes: 674296) - Introduce a -i option to make it possible to ignore a given set of packages from the output - Add util-linux and screen to the default ignorelist since these packages' initscripts are no-op (Closes: #673045) - Fix reading of dpkg-query process which can deadlock due to buffering when --query is given too many arguments or --listfiles returns a long list of items - Improve handling of interpreted files using patch provided by Guillaume Delacour and Michal Fiala (Closes: #657087) * [debget] - Allow error in apt calls since those are handled by the script (Closes: 676715) -- Javier Fernández-Sanguino Peña Sat, 16 Jun 2012 04:22:24 +0200 debian-goodies (0.60) unstable; urgency=low * The Handling-Multi-Arch Release * Change Vcs-* headers to new git repository (Closes: #623379) * Bump Standards-Version to 3.9.3 (no changes) * [dhomepage] - Handle multiple available packages and multiple homepage URLs (Closes: #664868) * [which-pkg-broke] - Show time info for all installed "Multi-Arch: same" packages (Closes: #658846) - No more swallows all exceptions (Closes: #654458) - Correctly handle alternative dependencies (Closes: #516904) * [debmany] - Replace less by sensible-pager, remove dependency on less. (Closes: #610563) - Fix many typos in man pages (see #610563, thanks Justin B Rye!) - Fix output from wrong package when backports are involved (Closes: #647158, thanks Kenyon Ralph) - Bump version number to 1.4 * [checkrestart] - Skip nagios spool files (Closes: #637238, thanks Guillaume Delacour) - Use service instead of direct call of initscript (Closes: #602186, #592436, thanks Jörg Sommer) * [bash_completion] - Install debmany bash completion file to /etc/bash_completion.d instead of as example. Rename it for easier use of dh_install. - Add bash package name completion for which-pkg-broke (Closes: #641877), dhomepage, and debget. (Based on devscript's package name completion which is under GPLv2+, too) * Fix the following lintian warnings: - copyright-refers-to-symlink-license - debian-rules-missing-recommended-target * Thanks Jakub Wilk for many bugfix patches! -- Axel Beckert Sun, 25 Mar 2012 17:33:42 +0200 debian-goodies (0.59) unstable; urgency=low * [checkrestart]: - Properly define variables to prevent Python errors when using the -p switch (Closes: #646513) - Pass a default environment for all subprocess calls -- Javier Fernandez-Sanguino Pen~a Tue, 25 Oct 2011 00:19:02 +0200 debian-goodies (0.58) unstable; urgency=low * [dglob] - Remove any empty lines from grep-dctrl's output (Closes: 646189) -- Javier Fernandez-Sanguino Pen~a Sun, 23 Oct 2011 13:54:27 +0200 debian-goodies (0.57) unstable; urgency=low * [checkrestart]: - Exclude /run/ from the deleted files check, this prevents false positives from some programs such as newer releases of jackd2 and chromium which use /run/shm/ instead of /dev/shm/ (Closes: #595096) -- Javier Fernandez-Sanguino Pen~a Mon, 10 Oct 2011 23:05:30 +0200 debian-goodies (0.56) unstable; urgency=low * [checkrestart]: - Use patch provided by Jörg Sommer and Piotr Kaczuba that makes the script use a set for the initscripts information, thus making the program work with Python 2.7 (Closes: #643977) - Fix behaviour of -p so that it does not consider files that do not belong to any package, thanks to Peter Eisentraut for the patch. (Closes: #608387) - Fix handling of --verbose option (Closes: #623168) - Exclude /dev/shm/ from the deleted files check, this prevents a false positive from some programs such as jackd2 (Closes: #595096) - Exclude /home from the deleted files check as these generate a number of false positives. This included: GNOME's mixer applet, dovecot, nautilus, chromium-broswer and evolution-data-server (Closes: #595096, #609454) * [checkrestart.1]: - Update the manpage to indicate what information to provide when reporting a false positive in checkrestart * /debmany/man/debmany.1: - Fix typo in manpage (Closes: #600252) -- Javier Fernandez-Sanguino Pen~a Sun, 09 Oct 2011 20:51:11 +0200 debian-goodies (0.55) unstable; urgency=low * [ dglob ] Clean up bashims (Closes: #600156) -- Javier Fernandez-Sanguino Pen~a Thu, 14 Oct 2010 21:33:18 +0200 debian-goodies (0.54) unstable; urgency=low * debian/control: Turn the lsof Depends: into Recommends for the benefit of the kfreebsd architectures (i.e. to make it possible for it to be installed in these as lsof is not available there). Unfortunately, we cannot use a Depends based on architecture as we are Arch: all (Closes: #594431) * [checkrestart]: Complain if lsof is not installed (could happen since it is now in Recommends) and abort as we do not currently have an alternative (psdel still unfinished...) * [checkrestart]: Fix false positive with Xorg in some specific Xorg servers due to the use of /drm. Thanks to Tarek Soliman for the patch. (Closes: 548380) * [dglob, dglob.pod]: Use grep-aptavail when the user requests all packages listed. Also use apt-file if available since if the package is not installed then the list of files is not available in the system (Closes: #594426) * Include a new 'debpaste' which is borrowed from http://paste.debian.net (more specifically http://ankh-morp.org/~vetinari/tools/paste-dn.pl). Adjust debian/copyright accordingly to acknowledge the author and its copyright. This script is not yet distributed as Recommends/Depends have to be adjusted to accommodate it, and a manpage needs to be written, but it will be used as a basis to coses bug #476099. -- Javier Fernandez-Sanguino Pen~a Sat, 02 Oct 2010 18:54:36 +0200 debian-goodies (0.53) unstable; urgency=low * [checkrestart] Fix numerical use of errno. Thanks Jakub Wilk! See http://lists.debian.org/debian-hurd/2010/08/msg00006.html for details. * [checkrestart] Fix Python string exception. Thanks Jakub Wilk for the patch. (Closes: #585198) * [dpigs] Fix getopt configuration for -h. Thanks Jakub Wilk for spotting this. (Closes: #584580) * Bump Standards-Version to 3.9.1 (no changes) -- Axel Beckert Wed, 04 Aug 2010 12:35:05 +0200 debian-goodies (0.52) unstable; urgency=low * Added myself as Uploader. * Added Vcs-* header to debian/control * Switch to source format "3.0 (native)" * debget now downloads the correct package if apt-get would download multiple packages due to missing dependencies. Thanks Jakub Wilk for the patch! (Closes: #536377, #522491) * dpigs: New option -H which outputs human-readable packages sizes similar to "ls -lh" or "du -h" (Closes: #307910) * Updated dpigs documentation to match current command line options. * Fixed deprecation warning in which-pkg-broke with Python 2.6 by using the subprocess instead of popen2 module. Thanks Jakub Wilk for the patch! (Closes: #582924) * Added which-pkg-broke to the package's long description (Closes: #563279) * Bumped standards version to 3.8.4 (no changes other than those mentioned elsewhere in the changelog entry) * Bumped debhelper compatibility to 5 and fixed the following related lintian warnings: + package-uses-deprecated-debhelper-compat-version + package-lacks-versioned-build-depends-on-debhelper + debian-rules-sets-DH_COMPAT * Add dependency on perl (used by dpigs) * Removed dependency without version on essential package debianutils. Fixes lintian error depends-on-essential-package-without-using-version. * Fixed the following lintian errors and warnings: + [debian/control] debhelper-but-no-misc-depends + [debian/control] clean-should-be-satisfied-by-build-depends + [checkrestart.1] spelling-error-in-manpage * Fixed typo in dglob(1) man page (Closes: #535477) -- Axel Beckert Sat, 29 May 2010 19:13:09 +0200 debian-goodies (0.51) unstable; urgency=low * Include patch from Jiri Palecek that makes checkrestart work with processes that lack a proper link /proc/$PID/exe. This seems to happen with UML processes and confused the program. (Closes: 522850) * Include patches provided by Joerg Sommer for checkrestart: (Closes: 511537) - Set locale to POSIX ('C') since the output of dpkg is localized and localisations makes the match for diversions fail. - Skip the last output line from diversions since it is a summary listing packages that are part of a diversion. - Use dpkg-query instead of dpkg since dpkg-query is the generic interface for querying the dpkg database is dpkg-query, and dpkg is only a wrapper for it. - Removed useless check in the isdeletedFile function that covers mutt in /tmp since there is already a match for /tmp * checkrestart: don't complain about processes that have deleted files in /var/tmp -- Javier Fernandez-Sanguino Pen~a Sat, 02 May 2009 17:53:57 +0200 debian-goodies (0.50) unstable; urgency=low * Use patch provided by Thadeu Lima de Souza Cascardo to: - Remove bashisms from dhomepage, thanks to Raphael Geissert. - Really install dhomepage. -- Javier Fernandez-Sanguino Pen~a Sun, 01 Mar 2009 23:49:01 +0100 debian-goodies (0.49) unstable; urgency=low * Sat which-pkg-broke's in a couch and fixed his problems with its own identity (Closes: #516434) -- Javier Fernandez-Sanguino Pen~a Sat, 21 Feb 2009 17:20:04 +0100 debian-goodies (0.48) unstable; urgency=low * Provide dhomepage application (and manual page) that can be used to open a packages' homepage. This program was provided by Thadeu Lima de Souza Cascardo (Closes: 500397) * Document degrep, dfgrep and dzgrep through the dgrep manpage by creating a symlink during package installation, thanks to Xavier Luthi for the patch. (Closes: 403845, 403844, 403843) * Add a proper (C) and license header to debget and dpigs * checkrestart: - skip deleted files in /var/cache/fontconfig/ - add a 'a' ('all') command line switch to process all deleted files, regardless of location - add a 'p' ('package') command line switch to process only files which are associated with a given package - adjust command line options in usage() (Closes: 497611) * dpigs: Use script snipet provided by Aaron M. Ucko to make it possible to group by source package, use a new (-S, --source) option. (Closes: 511349) * debget: - check the contents of /var/lib/apt/lists before executing apt to warn if there is no Release information there - document that APT's package database needs to be up-to-dat if a package is not found (might happen to aptitude users) * popbugs: adjust error message: - popularity contest is now run through cron.daily - provide the command line needed to generate the popconf data (Closes: 500432) -- Javier Fernandez-Sanguino Pen~a Sun, 25 Jan 2009 20:59:06 +0100 debian-goodies (0.47) unstable; urgency=low * debget: use 'head' instead of 'tail' when using apt-get --print-uris to get the first occurence of a package. This makes it properly download -data packages instead of the (Closes: #491588) -- Javier Fernandez-Sanguino Pen~a Mon, 21 Jul 2008 22:46:37 +0200 debian-goodies (0.46) unstable; urgency=low * Add call to dh_installexamples in debian/rules -- Javier Fernandez-Sanguino Pen~a Sat, 19 Jul 2008 01:36:25 +0200 debian-goodies (0.45) unstable; urgency=low * Fix installation of examples so now debmany's bash_completion file is installed. * checkrestart: - Apply patch provided by Piotr Kaczuba to make checkrestart reliable again by handling lsof's output when deleted libraries are referenced as 'path inode' (Closes: #491235) -- Javier Fernandez-Sanguino Pen~a Sat, 19 Jul 2008 01:12:20 +0200 debian-goodies (0.44) unstable; urgency=low * checkrestart: - Remove extra space in call to dpkg (Closes: #490399) - Prevent warnings when using mutt (it creates deleted files) -- Javier Fernandez-Sanguino Pen~a Sat, 12 Jul 2008 14:19:51 +0200 debian-goodies (0.43) unstable; urgency=low * Fix typo in checkrestart's call to dpkg (Closes: #490179) -- Javier Fernandez-Sanguino Pen~a Fri, 11 Jul 2008 17:22:50 +0200 debian-goodies (0.42) unstable; urgency=low * Updated to version 1.3 of debmany provided by Michael Arlt: - add bash_completion example into examples - add less to Depends, as it is the default viewer for other files. - add zenity to Suggests, it is a graphical alternative for dialog. * Fix popbugs to prevent it from removing temporary files before the browser has opened them, thanks to Chris Lamb for the bug report and the fix (Closes: #471752) * checkrestart: - Add /usr/lib/locale/ to the list of exceptions to prevent false positives when locales are reconfigured. - Change os.popen call to a subprocess.Popen call since python 2.5 does not seem to like lists in os.popen and because subprocess is preferable here. - Recode the utility so that the checks for deleted files and descriptors is not duplicated. - Remove the (useless) check for deleted descriptor - Rewrite the handling of lsof results to be more accurate and understandable. - Add a 'verbose' option that makes it list all the (supposedly) deleted files and descriptors used by the processes (Closes: #466811, #475397) - Add icon-theme.cache to the list of deleted files that will be flagged (Closes: #469133) - Fix properly the handling of /usr as a symlink, the code had some stuff that was used as test case and should have been replaced before uploading, oops. (Closes: #405040) * Add myself to author list in debian/copyright, and fixed a lintian warning there too. -- Javier Fernandez-Sanguino Pen~a Thu, 10 Jul 2008 00:30:39 +0200 debian-goodies (0.41) unstable; urgency=low * Make the dpkg --list query use an array to call the shell so that odd package names will not affect it. -- Javier Fernandez-Sanguino Pen~a Sat, 29 Mar 2008 21:38:20 +0100 debian-goodies (0.40) unstable; urgency=low * checkrestart: - skip deleted files under /dev/pts/ to prevent telling users to restart gpm (Closes: 468124) - support /usr being symlinked (Closes: 405040) - minor changes in output messages. -- Javier Fernandez-Sanguino Pen~a Sat, 01 Mar 2008 16:36:40 +0100 debian-goodies (0.39) unstable; urgency=low * Remove the network-test script, which now has been moved to the ifupdown-extra package. Also remove the dependencies introduced by that script. -- Javier Fernandez-Sanguino Pen~a Tue, 18 Dec 2007 21:37:18 +0100 debian-goodies (0.38) unstable; urgency=low * Fix bug in network-test which prevent it from working properly when no verbose level was set. -- Javier Fernandez-Sanguino Pen~a Sun, 14 Oct 2007 23:19:07 +0200 debian-goodies (0.37) unstable; urgency=low * checkrestart: - Do not complain about deleted files in /tmp, /var/run or /var/log when seen as descriptors (Closes: #441529) - Fix typo in checkrestart (Closes: #444473) * network-test: - Include patch provided by Federico Ceratto which adds command line support, allows the setting of a verbosity level and makes it possible to log to syslog based on that level. This patch is useful if the script is run through init, cron or other task-scheduling tool. -- Javier Fernandez-Sanguino Pen~a Sun, 14 Oct 2007 23:01:40 +0200 debian-goodies (0.36) unstable; urgency=low * Exclude /var/run contents from the deleted files check which means that apache2, when using mod_ssl should now not be reported as needing a restart (Closes: 432569, 482136) -- Javier Fernandez-Sanguino Pen~a Thu, 06 Sep 2007 23:37:03 +0200 debian-goodies (0.35) unstable; urgency=low * Make it Depend on python => 2.4 as the subprocess module used by checkrestart is not available in 2.3 * Add CVE name to previous changelog entry * Minor typo fix in debian/control -- Javier Fernandez-Sanguino Pen~a Tue, 04 Sep 2007 23:28:58 +0200 debian-goodies (0.34) unstable; urgency=high * Fix security bug that enables users to generate files in the filesystem with shell metacharacters and have the checkrestart script run external code (as root, since the script will only run as admin). This is CVE-2007-3912. (Closes: 440411) -- Javier Fernandez-Sanguino Pen~a Sun, 02 Sep 2007 23:07:30 +0200 debian-goodies (0.33) unstable; urgency=low * Added description of demany in debian/control * Added dependencies/suggestions needed for debmany -- Javier Fernandez-Sanguino Pen~a Wed, 29 Aug 2007 17:31:18 +0200 debian-goodies (0.32) unstable; urgency=low * Put debmany in the proper location (/usr/bin) * Remove vi swap file from sources * Small changes to debmany binary (typo, versiondate and a comment) * Update debmany's manpages, I was putting in a previous version. -- Javier Fernandez-Sanguino Pen~a Tue, 28 Aug 2007 23:35:26 +0200 debian-goodies (0.31) unstable; urgency=low * Introduce the debmany script written by Michael Arlt (it was actually in the sources of 0.30 but not installed in the binary package) -- Javier Fernandez-Sanguino Pen~a Mon, 27 Aug 2007 19:05:46 +0200 debian-goodies (0.30) unstable; urgency=low * checkrestart changes: * Do not warn on processes than use /dev/zero and shows up as deleted. This prevents it from warning about apache2 (Closes: #432569) * Slightly improve the messages output. * Find init.d scripts even if not provided in the package by looking for init.d scripts that match the process name (works for apache2 too) * Fix some typos in which-pkg-broke(1) (Closes: #409581) -- Javier Fernandez-Sanguino Pen~a Wed, 22 Aug 2007 22:59:27 +0200 debian-goodies (0.29) unstable; urgency=low * Network-test: use -t switch to use user's TMPDIR or /tmp instead of trying to create it under $PWD (Closes: #432311) * Add a Suggests: netcat (Closes: #400479) * popbugs: * Make it parse the new format of the RC buglist properly (Closes: #421355) * Add a debug option * Fix a typo in the output * Change maintainer's email address in debian/control -- Javier Fernandez-Sanguino Pen~a Mon, 09 Jul 2007 18:23:53 +0200 debian-goodies (0.28) unstable; urgency=low * Apply patch by Francesco Potorti that makes checkrestart list processes that should be restarted when a daemon is restarted. This helps warn users that some processes will not be restarted even though they use the init script (such as active ssh connections). And need to be restarted manually (Closes: #290265) * Be more verbose when nothing needs to be done (the user might think that the script did not do anything!) -- Javier Fernandez-Sanguino Pen~a Tue, 19 Dec 2006 11:24:57 +0100 debian-goodies (0.27) unstable; urgency=medium [ Fixes I would like to see in etch, even though we're on freeze now ] * Fix checkrestart with patch provided by Justin Pryzby, modify to reduce false positives by not complaining about deleted inodes/files under /tmp/, /var/log/ or named /SYSV. This fixes the long-standing issue that made this script rather useless (related to lsof, see bug #297029, and to changes in dpkg) (Closes: #264985) (Note I have included the code from Sam Morris, available at http://robots.org.uk/src/psdel and contributed in the BTS. But it still needs to be massaged to work as a replacement for lsof) * Write a manpage for checkrestart so administrators are aware that this tool should not be completely relied on. (Closes: #305279) * Update the version of network-test which fixes some of the bugs already fixed in the experimental 'ifupdown-extra' package: [ Note: Post-etch network-test will be removed from this package but I rather not try to introduce an experimental package such as ifupdown-extra into etch right now ] * Make network-test use bash (Closed: #401363) * Do not analyse resolv.conf lines that have been commented out. * Change network-test so it does not complain loudly if ethtool is not installed (just recommends its installation) * Fix duplicate spaces in the script as well as some typos with patch provided by Norbert Kiesel (Closed: #400463) * Change behaviour of network-test when testing ethernet link (based on ifupdown-extra's 'check-network-cable' tests) this is better (and more reliable) than just using 'ifconfig' but requires users install additional software. * Lintian error fix: FSF address -- Javier Fernandez-Sanguino Pen~a Tue, 19 Dec 2006 01:59:13 +0100 debian-goodies (0.26) unstable; urgency=low * Remove extra space from which-pkg-broke which introduced a syntax error (Closes: #396786) -- Javier Fernandez-Sanguino Pen~a Fri, 3 Nov 2006 00:53:17 +0100 debian-goodies (0.25) unstable; urgency=low * Depend on dctrl-tools since grep-dctrl is a transitional package, keep grep-dctrl to make it possible to backport this package (Closes: #385478) * which-pkg-broke now looks in Pre-Depends thanks to the patch submitted by Josh Triplett (Closes: #394950) * Network-test changes: - now uses bash only (Closes: #396324) - correctly detects an interface as UP if it has been forced to a given speed (Closes: #396336) - do not test nameservers that have been commented out from resolv.conf - fix a typo in a message -- Javier Fernandez-Sanguino Pen~a Wed, 1 Nov 2006 10:39:09 +0100 debian-goodies (0.24) unstable; urgency=low * Taking up this package as new maintainer, after talking with Matt on private mail. * Fix Frank Lichtenheld's mail in all manpages (Closes: #249818) * Changes to debget: - debget --help (or -h) now works as expected. Introduce usage in the tool to warn on errors when calling it (Closes: #251353) - Any other options are rejected (as they would be passed on to apt) - Additional error checking in debget to prevent it from going ahead when something goes wrong, this includes checking first if the apt-get dependencies are right and that the package the user asked us to retrieve exists (Closes: #283401) - Use apt-cache instead of apt-get to get the version as 'apt-get -q2 -s --reinstall install' requires, for some reason, super cower powers. This makes it possible to download packages without satisfying dependencies (Closes: #369494) - Document the fact that downloading packages from the package cache is not supported both in the manpage and in the program's output (Closes: #224857) * Fix manpage dglob typos as well as the header of the documentation generated by pod2man (Closes #228302, #305802) * Have debman use bash as a shell (Closes: #369762) * Set LC_NUMERIC to 'C' in dpigs as suggested by Bill Allombert (Closes: #368227) * Move checkrestart to /usr/sbin (Closes: #329723) * Have dglob exit with a '1' exit status if no packages match the globbing pattern (Closes: #292585) * Make popbugs properly extract the file provided by the user instead of /var/log/popularity-contest, if requested to (Closes: #263471) * Fix typo in popbugs.1 manpage (AUTOR -> AUTHOR) * Include which-pkg-broke Python script contributed by Bill Gribble and wrote its associated manpage (Closes: #231470) * Include network-test shell script contributed by myself and wrote its associated manpage (Closes: #307694) * Use debhelper compatibility version 4 -- Javier Fernandez-Sanguino Pen~a Sun, 23 Jul 2006 21:42:54 +0200 debian-goodies (0.23) unstable; urgency=low * Man page for popbugs from Jochen Voss (Closes: #227094) -- Matt Zimmerman Wed, 14 Jan 2004 21:10:42 -0800 debian-goodies (0.22) unstable; urgency=low * Fix typo, improve description in dglob(1) (Closes: #224561) -- Matt Zimmerman Fri, 19 Dec 2003 23:38:26 -0800 debian-goodies (0.21) unstable; urgency=low * Fix program name in popbugs usage message (Closes: #224490) -- Matt Zimmerman Fri, 19 Dec 2003 08:03:59 -0800 debian-goodies (0.20) unstable; urgency=low * Updated man page for dpigs, and new man page for dglob, from Frank Lichtenheld (Closes: #224394) * Enhance dglob to accept some grep-dctrl options, and update the man page appropriately -- Matt Zimmerman Thu, 18 Dec 2003 09:54:30 -0800 debian-goodies (0.19) unstable; urgency=low * Actually install those nice man pages (really Closes: #163823) -- Matt Zimmerman Wed, 17 Dec 2003 17:48:36 -0800 debian-goodies (0.18) unstable; urgency=low * Include man pages for debget, dgrep and dpigs from Frank Lichtenheld (Closes: #163823) * Implement option parsing in dpigs, because it confuses everyone to pass options to head(1) directly (Closes: #212926) * Fix checkrestart to deal with the garbage that comes from /proc/pid/exe sometimes (null bytes, etc.) * Teach checkrestart about dpkg's habit of spitting out diversion information in response to a --search query (Closes: #211785) -- Matt Zimmerman Tue, 16 Dec 2003 17:12:50 -0800 debian-goodies (0.17) unstable; urgency=low * Remove empty /usr/sbin directory (Closes: #205450) * Enhance debian-goodies to give a hint about needing popularity-contest if the data isn't present, and automatically launch sensible-browser (use "popbugs -o -" to get the old behaviour) (Closes: #205662) * Depends: python (>= 2.3), as we use NamedTemporaryFile -- Matt Zimmerman Fri, 15 Aug 2003 21:35:16 -0400 debian-goodies (0.16) unstable; urgency=low * Fix another buglet in popbugs where it would incorrectly parse bugscan's inconsistent HTML -- Matt Zimmerman Thu, 14 Aug 2003 12:26:16 -0400 debian-goodies (0.15) unstable; urgency=low * Fix a bug in popbugs where it would misparse things when the block was surrounded by a tag -- Matt Zimmerman Wed, 13 Aug 2003 17:34:56 -0400 debian-goodies (0.14) unstable; urgency=low * Minor formatting changes to checkrestart * New program, popbugs, which sorts and filters the RC bug list based on data from popularity-contest * Suggests: popularity-contest -- Matt Zimmerman Wed, 13 Aug 2003 17:30:59 -0400 debian-goodies (0.13) unstable; urgency=low * Fix checkrestart to not fail on certain types of bogus data in /proc, specifically, when readlink() gives ENOENT. -- Matt Zimmerman Mon, 19 May 2003 19:00:53 -0400 debian-goodies (0.12) unstable; urgency=low * Fix typo-bug which caused a lot of false positives in checkrestart -- Matt Zimmerman Fri, 2 May 2003 16:17:27 -0400 debian-goodies (0.11) unstable; urgency=low * s/dpkg-query/dpkg/ on dglob as well * Fix checkrestart to exclude certain common init scripts which don't actually restart a service -- Matt Zimmerman Fri, 2 May 2003 15:32:49 -0400 debian-goodies (0.10) unstable; urgency=low * Modify checkrestart to use dpkg rather than dpkg-query, so that it can be used on stable and does not require a dependency on newer dpkg -- Matt Zimmerman Fri, 2 May 2003 10:19:15 -0400 debian-goodies (0.9) unstable; urgency=low * Add dependencies on lsof and python -- Matt Zimmerman Wed, 30 Apr 2003 14:20:54 -0400 debian-goodies (0.8) unstable; urgency=low * New program, checkrestart, which informs about running processes using old versions of upgraded files (such as shared libraries) -- Matt Zimmerman Wed, 30 Apr 2003 13:53:25 -0400 debian-goodies (0.7) unstable; urgency=low * Add new program, debman, by Colin Watson (Closes: #176295) -- Matt Zimmerman Sat, 11 Jan 2003 15:12:05 -0500 debian-goodies (0.6) unstable; urgency=low * Make debget use curl instead of wget, because it supports file: URIs, which are often used in sources.list. (Closes: #176263) -- Matt Zimmerman Sat, 11 Jan 2003 12:32:28 -0500 debian-goodies (0.5) unstable; urgency=low * Add an explicit --help option for dgrep, so that it doesn't invoke grep with the --help option (Closes: #173430) -- Matt Zimmerman Tue, 17 Dec 2002 08:42:45 -0500 debian-goodies (0.4) unstable; urgency=low * Fix debget to do the right thing if the requested deb has uninstalled dependencies -- Matt Zimmerman Sun, 15 Dec 2002 19:21:32 -0500 debian-goodies (0.3) unstable; urgency=low * Switch debget from using python-apt to calling apt-get. The things that it really needs aren't exposed by the python-apt API, and this makes it possible to use the same version specifications used with apt-get install (/stable, =1.2.0-1, etc.). However, it may refuse to work if you have packages in broken states. -- Matt Zimmerman Sat, 7 Dec 2002 12:11:44 -0500 debian-goodies (0.2) unstable; urgency=low * Fix indentation of description (Closes: #162983) -- Matt Zimmerman Tue, 1 Oct 2002 10:00:32 -0400 debian-goodies (0.1) unstable; urgency=low * Initial Release. -- Matt Zimmerman Sat, 21 Sep 2002 23:19:11 -0400 debian-goodies-0.63/debian/copyright0000644000000000000000000010774412165351155014377 0ustar This package was debianized by Matt Zimmerman on Thu, 29 Aug 2002 13:51:41 -0400. It has no home other than Debian. Upstream Authors: Matt Zimmerman Javier Fernandez-Sanguino Copyright: The programs in this package hold the following copyrights: - checkrestart: Copyright (C) 2001 Matt Zimmerman Copyright (C) 2007,2010 Javier Fernandez-Sanguino - debget, dgrep, dglob, dpigs, popbugs Copyright (C) 2001-2004 Matt Zimmerman - debman Copyright (C) 2003 Colin Watson - which-pkg-broke Written by Bill Gribble and placed in the public domain. - dhomepage Copyright (C) 2008 Thadeu Lima de Souza Cascardo - debpaste Copyright (C) 2009 Hanno Hecker - check-enhancements Copyright (C) 2012 George Danchev - debian/ contents Copyright (C) 2001-2004 Matt Zimmerman Copyright (C) 2006-2012 Javier Fernandez-Sanguino Copyright (C) 2010-2013 Axel Beckert The license of all programs in this package, excluding 'which-pkg-broke' which is in the public domain, and debpaste, is: # 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, 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301 USA On Debian systems, a copy of the GNU General Public License, version 2 can be found in /usr/share/common-licenses/GPL-2. The program 'debpaste' has been retrieved (2010-10-02) from http://paste.debian.net/paste.pl?show_template=clients and is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE (AGPL 3.0) license: GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . debian-goodies-0.63/debian/docs0000644000000000000000000000000712165351155013277 0ustar README debian-goodies-0.63/debian/control0000644000000000000000000000352212165356337014043 0ustar Source: debian-goodies Section: utils Priority: optional Maintainer: Javier Fernandez-Sanguino Pen~a Uploaders: Axel Beckert Build-Depends: debhelper (>= 9~), help2man Vcs-Git: git://anonscm.debian.org/collab-maint/debian-goodies.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/debian-goodies.git Standards-Version: 3.9.4 Package: debian-goodies Architecture: all Depends: curl, dctrl-tools | grep-dctrl, perl, python (>= 2.4), whiptail | dialog, ${misc:Depends} Recommends: lsof Suggests: popularity-contest, xdg-utils, zenity Conflicts: debget Replaces: debget Description: Small toolbox-style utilities for Debian systems These programs are designed to integrate with standard shell tools, extending them to operate on the Debian packaging system. . dgrep - Search all files in specified packages for a regex dglob - Generate a list of package names which match a pattern . These are also included, because they are useful and don't justify their own packages: . debget - Fetch a .deb for a package in APT's database dpigs - Show which installed packages occupy the most space debman - Easily view man pages from a binary .deb without extracting debmany - Select manpages of installed or uninstalled packages checkrestart - Help to find and restart processes which are using old versions of upgraded files (such as libraries) popbugs - Display a customized release-critical bug list based on packages you use (using popularity-contest data) which-pkg-broke - find which package might have broken another check-enhancements - find packages which enhance installed packages debian-goodies-0.63/debian/dirs0000644000000000000000000000001012165351155013302 0ustar usr/bin debian-goodies-0.63/debian/source/0000755000000000000000000000000012165351155013727 5ustar debian-goodies-0.63/debian/source/format0000644000000000000000000000001512165351155015136 0ustar 3.0 (native) debian-goodies-0.63/debian/links0000644000000000000000000000070712165351155013476 0ustar usr/bin/dgrep usr/bin/degrep usr/bin/dgrep usr/bin/dfgrep usr/bin/dgrep usr/bin/dzgrep usr/bin/dgrep usr/bin/dzegrep usr/bin/dgrep usr/bin/dzfgrep usr/share/man/man1/dgrep.1.gz usr/share/man/man1/degrep.1.gz usr/share/man/man1/dgrep.1.gz usr/share/man/man1/dfgrep.1.gz usr/share/man/man1/dgrep.1.gz usr/share/man/man1/dzgrep.1.gz usr/share/man/man1/dgrep.1.gz usr/share/man/man1/dzegrep.1.gz usr/share/man/man1/dgrep.1.gz usr/share/man/man1/dzfgrep.1.gz debian-goodies-0.63/debian/manpages0000644000000000000000000000024612165351155014147 0ustar checkrestart.1 debget.1 debman.1 dglob.1 dgrep.1 dhomepage.1 dpigs.1 popbugs.1 which-pkg-broke.1 check-enhancements.1 debmany/man/debmany.1 debmany/man/debmany.de.1 debian-goodies-0.63/debian/install0000644000000000000000000000037012165351155014020 0ustar dgrep dglob debget dpigs debman popbugs which-pkg-broke dhomepage debmany/debmany check-enhancements usr/bin checkrestart usr/sbin bash_completion/debian-goodies.pkgnames etc/bash_completion.d debmany/bash_completion/debmany etc/bash_completion.d debian-goodies-0.63/debian/rules0000755000000000000000000000102312165351677013514 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 PODDOC=debget dglob dgrep dpigs %: dh $@ override_dh_auto_build: for prog in $(PODDOC); do pod2man -c "Debian-goodies documentation" $$prog.pod > $$prog.1; done help2man -n "check-enhancements - show enhancement packages" \ -m "Debian-goodies documentation" \ -N ./check-enhancements | \ sed -e 's/DESCRIPTION/SYNOPSIS/' > check-enhancements.1 override_dh_auto_clean: for prog in $(PODDOC); do rm -f $$prog.1; done debian-goodies-0.63/which-pkg-broke0000755000000000000000000000574412165351155014126 0ustar #! /usr/bin/python # which-pkg-broke: help find offending packages when something breaks # Placed in the public domain by Bill Gribble import sys import os import subprocess import time from string import * from stat import * def pkgdeps(pkg): apt_cache = subprocess.Popen( ['apt-cache', 'depends', pkg], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env={} # force POSIX locale ) deps = [] myline = apt_cache.stdout.readline() while(myline != ''): elts = map(strip, myline.split(':')) if len(elts) == 2: how, pkg = elts how = how.replace('|', '') if how in ('Depends', 'PreDepends'): deps.append(pkg) myline = apt_cache.stdout.readline() apt_cache.wait() return deps def alldeps(pkg, ignore): deps = {} imm_deps = pkgdeps(pkg) for i in imm_deps: if ignore.get(i) is None: deps[i] = 1 ignore[i] = 1 childeps = alldeps(i, ignore) for c in childeps: deps[c] = 1 ignore[i] = 1 dlist = deps.keys() return dlist def localarchitectures(): architectures = [] dpkg_arch = subprocess.Popen( ['dpkg', '--print-architecture'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env={} # force POSIX locale ) for arch in dpkg_arch.stdout.readlines(): architectures.append(arch.rstrip()) try: dpkg_archs = subprocess.Popen( ['dpkg', '--print-foreign-architecture'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env={} # force POSIX locale ) for arch in dpkg_archs.stdout.readlines(): architectures.append(arch.rstrip()) except OSError: pass # non-multiarchy dpkg, which is ok return architectures def pkginstalltime(pkg, architectures): times = [] for arch in architectures: listfile = '/var/lib/dpkg/info/' + pkg + ':' + arch + '.list' try: times.append([pkg + ':' + arch, os.stat(listfile)[ST_MTIME]]) except OSError: pass if not times: listfile = '/var/lib/dpkg/info/' + pkg + '.list' try: times.append([pkg, os.stat(listfile)[ST_MTIME]]) except OSError: print "Package", pkg, "has no install time info" return times def what_broke(pname): def sortfun(a, b): return cmp(a[1], b[1]) pkgs = [ pname ] pkgs.extend(alldeps(sys.argv[1], {})) architectures = localarchitectures() itimes = [] for p in pkgs: itimes.extend(pkginstalltime(p, architectures)) itimes.sort(sortfun) for i in itimes: p, t = i if t is not None: print ljust(p, 54), time.asctime(time.localtime(float(t))) if (len(sys.argv) != 2 or sys.argv[1][0] == '-'): print "Usage: which-pkg-broke " sys.exit(-1) else: what_broke(sys.argv[1]) sys.exit(0) debian-goodies-0.63/debmany/0000755000000000000000000000000012165351677012635 5ustar debian-goodies-0.63/debmany/debmany.png0000644000000000000000000000272612165351155014760 0ustar PNG  IHDR DPLTE3f3333f333ff3fffff3f3f̙3f3333f3333333333f3333333f3f33ff3f3f3f3333f3333333f3̙333333f333ff3ffffff3f33f3ff3f3f3ffff3fffffffffff3fffffff3fff̙ffff3fffff3f̙3333f33̙3ff3ffff̙f3f̙3f̙̙3f̙3f3333f333ff3fffff̙̙3̙f̙̙̙3f̙3f3f3333f333ff3fffff3f3f̙3f|1%4\٭ֿᙥύʋWG[^ڂc^NP dt@/D'cץγ֣ϝ$ftRNSA pHYs  IDAT8=z0 ܣk2^)SgMI]̊At!68L~穇}/,i,"Z79l!oR@ !!*@ BJ&c8Om4 uT; )X(3` jna-ԬUd0X= |QT޹ҠDI9Y1#RBԑ6ң 1k9x#.yE,%Z ~ޚFH\3q$m"27{|v-( yQ1=谕yPcw7sFFr3C{}Į{yUG4ࢫT@hBH>*+Yf4^R圱?"tM\.~,1ʔ6/ s6IENDB`debian-goodies-0.63/debmany/man/0000755000000000000000000000000012165351155013377 5ustar debian-goodies-0.63/debmany/man/debmany.10000644000000000000000000001154412165351155015105 0ustar .TH "DEBMANY" "1" "1.3" "Michael Arlt" "User Commands" .SH "NAME" debmany \- select manpages or documentation files from installed packages, packages from the repository or .deb\-files for viewing using "man", "sensible-pager" or an alternative viewer. .SH "SYNOPSIS" .B debmany \fI\-\-help .br .B debmany \fI[\-v[v]] [\-k|\-g|\-x] [\-m manpageviewer] [\-o otherviewer] [\-L limit] [\-l lang1[,...]] package|package.deb\fR .br .B debmany \fI[\-v[v]] [\-k|\-g|\-x] [\-m manpageviewer] [\-o otherviewer] [\-L limit] [\-l lang1[,...]] \-z [package|package.deb]\fR .SH "DESCRIPTION" .\" Add any additional description here .PP Select a manpage or files in /usr/share/doc from a Debian package for viewing with "man", "sensible-pager" or an alternative viewer. The list of files is displayed in a dialog. Supported locations for Debian packages are: local .deb\-file, a package in the repository or an installed package. .TP \fB\-\-help\fR display a short usage guide and exit .TP \fB\-k\fR Display the manpage using your preferred viewer (must support .gz files) if you use KDE \- this is the short form of \-m 'kfmclient exec man:%s'. "kfmclient" is a part of the package "konqueror" (at least in Debian Etch). .TP \fB\-g\fR Display the manpage using your preferred viewer (must support .gz files) if you use GNOME \- this is the short form of \-m 'gnome\-open man:%s'. "gnome\-open" is a part of the package "libgnome2\-0" (at least in Debian Etch). .TP \fB\-x\fR Display the manpage using your preferred viewer (must support .gz files) if you use KDE/GNOME/Xfce \- this is the short form of \-m 'xdg\-open man:%s'. "xdg\-open" is a part of the package "xdg\-utils" (at least in Debian Etch). .TP \fB\-m manpageviewer\fR Optionally set a manpage viewer. The viewer must support .gz files. You must define the complete request. "%s" gets replaced with the path to the manpage. If "%s" is missing " %s" is appended to the manpageviewer. The manpageviewer must be enclosed with "" or '' \- see examples. If you use a graphical viewer you must ensure that you have access to your desktop (if necessary: sux or ssh with X\-forwarding) .TP \fB\-o otherviewer\fR Optionally set a viewer for other files (/use/share/doc). .TP \fB\-L limit\fR If a file which must be downloaded exceeds this limit, you are asked if the download should start. Without unit the value is in bytes. You can append K, M, G or T to the value to change the unit. .TP \fB\-l lang1[,...]\fR English manpages are displayed always. If you want more languages you can specify them here. Provide a comma separated list of the folder names in the manpage folders (/usr/share/man) \- e.g. de,fr or "zh*" if you want to see all Chinese manpages (Simplified and Traditional Chinese as well). It is safe always to use "*" at the end of your language. Character set versions automatically generated during installation are not available for selection. .TP \fB\-z\fR Zenity (a graphical dialog) is used to select the files and if necessary to enter the package name. You must have the rights to start X programs. This option combined with the parameters \-k, \-g, \-x or \-m and \-o make it possible to use debmany without console. .PP The manpages are temporarily extracted to /dev/shm (if the directory exists) or /tmp . You can override the path if you set and export the environment variable TMPDIR or set it as a temporary variable. .PP You need to have the Debian package "whiptail" (preferred) or "dialog" as well as "curl" installed. .SH "EXAMPLES" .TP debmany coreutils Show all manpages from the installed Debian package "coreutils" using man. .TP debmany 3dchess Show all manpages from the package "3dchess" using man. Since it is not already installed the package is accessed from the repository \- even downloading is done if needed. .TP debmany test.deb Show all manpages from the local Debian package "./test.deb" using man. .TP debmany \-k sc Use your preferred man\-viewer (for KDE users). .TP debmany \-g sc Use your preferred man\-viewer (for GNOME users). .TP debmany \-x sc Use your preferred man\-viewer (for KDE/GNOME/XFCE users). .TP debmany \-z \-k Uses "zenity" to select files and to enter the package name. .TP TMPDIR=~/tmp debmany \-m 'konqueror man:%s' sc Use ~/tmp as temporary folder and Konqueror as viewer. .TP alias debmany='debmany \-l de \-L 5M \-k'; debmany \-m man \-l "zh*" foo Set an alias with your preferred options and override them if needed. .TP vi /usr/local/bin/ask # after saving: chmod 755 ask #!/bin/dash .br read \-p "program to use: " pgm .br eval $pgm "$1" .br .br debmany \-o ask .br Every time you select other files from a package you will be asked which program to use. .SH "AUTHOR" Written by Michael Arlt. .SH "LICENSE" This is free software. You may redistribute copies of it under the terms of the GNU General Public License . There is NO WARRANTY, to the extent permitted by law. debian-goodies-0.63/debmany/man/debmany.de.10000644000000000000000000001255612165351155015500 0ustar .TH "DEBMANY" "1" "1.3" "Michael Arlt" "Dienstprogramme fr Benutzer" .SH "NAME" debmany \- Whlen von Manpages oder Dokumentationen aus installierten Paketen, Paketen des Repositories oder .deb\-Dateien zum Betrachten mit "man" bzw. "sensible-pager" oder einem alternativen Viewer. .SH "SYNTAX" .B debmany \fI\-\-help .br .B debmany \fI[\-v[v]] [\-k|\-g|\-x] [\-m manpageviewer] [\-o otherviewer] [\-L Limit] [\-l Sprache1[,...]] Paket|Paket.deb\fR .br .B debmany \fI[\-v[v]] [\-k|\-g|\-x] [\-m manpageviewer] [\-o otherviewer] [\-L Limit] [\-l Sprache1[,...]] \-z [Paket|Paket.deb]\fR .SH "BESCHREIBUNG" .\" Add any additional description here .PP Whlen Sie eine Manpage oder Dateien aus usr/share/doc von einem Debian Paket um sie mit "man" oder "sensible-pager" bzw. einem alternativen Viewer zu betrachten. Die Liste der Dateien wird in einem Dialog dargestellt. Untersttzte Quellen fr Debian Pakete sind: Lokale .deb\-Datei, ein Paket aus dem Repository oder ein installiertes Paket. .TP \fB\-\-help\fR zeigt eine kurze Hilfe und beendet sich .TP \fB\-k\fR Zeigt die Manpage im bevorzugten Viewer (muss .gz Dateien untersttzen) an, falls Sie KDE benutzen \- Kurzform von \-m 'kfmclient exec man:%s' bzw. 'kfmclient exec %s' fr andere Dateien. "kfmclient" ist Teil des Paketes "konqueror" (zumindest in Debian Etch). .TP \fB\-g\fR Zeigt die Manpage im bevorzugten Viewer (muss .gz Dateien untersttzen) an, falls Sie GNOME benutzen \- Kurzform von \-m 'gnome\-open man:%s'. "gnome\-open" ist Teil des Paketes "libgnome2\-0" (zumindest in Debian Etch). .TP \fB\-x\fR Zeigt die Manpage im bevorzugten Viewer (muss .gz Dateien untersttzen) an, falls Sie KDE/GNOME/Xfce benutzen \- Kurzform von \-m 'xdg\-open man:%s'. "xdg\-open" ist Teil des Paketes "xdg\-utils" (zumindest in Debian Etch). .TP \fB\-m manpageviewer\fR berschreibt den Manpageviewer. Der Viewer muss .gz Dateien untersttzen. Es ist zu beachten, dass der komplette Aufruf formuliert werden muss. "%s" wird durch den Pfad zur Manpage ersetzt. Wenn "%s" fehlt wird " %s" an den Manpageviewer angehngt. Der Aufruf muss in "" oder '' gefasst werden \- siehe Beispiele. Bei der Benutzung eines grafischen Manpageviewers mssen Sie sicherstellen, dass Sie Zugriff auf den Desktop haben (ggf.: sux oder ssh mit x\-forwarding) .TP \fB\-o otherviewer\fR berschreibt den Viewer fr sonstige Dateien (/usr/share/doc). .TP \fB\-L Limit\fR berschreitet ein File, das per Download heruntergeladen werden muss, das Limit so werden Sie gefragt, ob der Download stattfinden soll. Ohne Angabe einer Einheit ist die Angabe in Bytes. Durch Anhngen der Buchstaben K, M, G oder T kann die Einheit gendert werden. .TP \fB\-l Sprache1[,...]\fR Englische Manpages werden immer angezeigt. Wenn Sie mehr Sprachen sehen wollen, so knnen Sie dies hier festlegen. Im Prinzip geben Sie hier eine mit Komma getrennte Liste der Ordner aus den Manpage Ordnern (/usr/share/man) an \- z. B. de,fr oder "zh*" wenn Sie alle chinesischen Manpages (sowohl das einfache "zh_CN" als auch das traditionelle Chinesisch "zh_TW") sehen wollen. Sicherheitshalber kann man auch immer "*" am Ende der Sprache anhngen. Bei der Installation ggf. dynamisch generierte zeichensatzbasierte Abwandlungen stehen nicht zur Auswahl. .TP \fB\-z\fR Zur Auswahl der Dateien und ggf. zur Eingabe des Paketes wird "zenity" (grafischer Dialog) verwendet. Hierzu muss man berechtigt sein, X\-Programme zu starten. Diese Option in Kombination mit den Parametern \-k, \-g, \-x bzw. \-m und \-o ermglicht es, debmany ohne Console zu verwenden. .PP Die Manpages werden temporr nach /dev/shm (sofern dieses Verzeichnis existiert), /tmp oder /var/tmp extrahiert. Durch das Setzen und Exportieren der Umgebungsvariable TMPDIR bzw. das Setzen als temporren Variable kann der Speicherort berschrieben werden. .PP Das Debian Paket "whiptail" (bevorzugt) oder "dialog" sowie "curl" muss installiert sein. .SH "BEISPIELE" .TP debmany coreutils Zeigt alle Manpages des installierten Debian Pakets "coreutils" mit "man" an. .TP debmany 3dchess Zeigt alle Manpages des Paketes "3dchess" mit "man" an. Da es noch nicht installiert ist wird es vom Repository bezogen \- wenn ntig auch per Download. .TP debmany test.deb Zeigt alle Manpages des lokalen Debian Paketes "./test.deb" mit "man" an. .TP debmany \-k sc Benutzt den bevorzugten Manviewer (fr KDE Anwender) .TP debmany \-g sc Benutzt den bevorzugten Manviewer (fr GNOME Anwender) .TP debmany \-x sc Benutzt den bevorzugten Manviewer (fr KDE/GNOME/Xfce Anwender) .TP debmany \-z \-k Benutzt "zenity" um Dateien auszuwhlen und Paketnamen einzugeben. .TP TMPDIR=~/tmp debmany \-m 'konqueror man:%s' sc Benutzt ~/tmp als temporren Ordner und Konqueror als Viewer .TP alias debmany='debmany \-l de \-L 5M \-k'; debmany \-m man \-l "zh*" foo Setzte einen Alias um die bevorzugten Optionen festzulegen. Diese knnen, wie man sieht, jederzeit berschrieben werden. .TP vi /usr/local/bin/ask # nach dem Speichern: chmod 755 ask #!/bin/dash .br read \-p "Programm zum ffnen: " pgm .br eval $pgm "$1" .br .br debmany \-o ask .br Beim ffnen einer Datei aus usr/share/doc wird man nach dem Programm, mit dem man sie ffnen mchte, gefragt. .SH "AUTOR" Geschrieben von Michael Arlt. .SH "LIZENZ" This is free software. You may redistribute copies of it under the terms of the GNU General Public License . There is NO WARRANTY, to the extent permitted by law. debian-goodies-0.63/debmany/debmany.changes0000755000000000000000000000312512165351155015601 0ustar # Changes for v1.3 ### fixed bugs # includes in manpages (".so") didn't work - example packages: bash: bash-builtins, ax25-tools:netrom-tools # solution: cd to extracted manpages before opening them # fixed detection of tmp-directory /dev/shm # working directory with space -> cd back gave an error # $TMPDIR wasn't implemented (forgotten) # corrected manpage # correct size calculation of file to download ### features # added debugging option (-v and -vv) # added usr/share/doc to view additional files # added option -o to overwrite the viewer for other files (not manpages) # added option -z to use a graphical dialog (zenity) instead of dialog or whiptail # improved bash_completion (maybe it will get in debian-goodies) # added a png-file for debmany (maybe it will get in debian-goodies) # with $TMPDIR you can specify the destination for temporary files # option -l changed: old: -l fr -> fr* new: -l fr -> fr # examples: -l de,fr -l "zh*" # improved manpages # check for parameter -k, -g and -x if kfmclient, gnome-open or xdg-open exists # added rounding for size calculation ### quality # added a checklist (comment in debmany) for new releases of debmany ### technical # removed search in usr/share/X11R6 (last seen in debian sarge) # small parts rewritten for better dash compatibility - remaining is marked "!dash" # less should be a dependency because it is the default viewer for other files # zenity should be a suggested package because it is a graphical alternative for dialog ### remaining but no reason to operate # blanks in filenames do not work - checked in debian etch: no packages found debian-goodies-0.63/debmany/readme0000644000000000000000000000035712165351155014011 0ustar copy bash_completion to ~/.bash_completion it uses functions from /etc/bash_completion completion is done for parameters (-m is not handled very good and -l could be improved, too), packages, filenames ending with .deb and folders debian-goodies-0.63/debmany/debmany0000755000000000000000000003325112165351677014206 0ustar #!/bin/bash # script: debmany # author: Michael Arlt # description: select manpages+docs of any [not] installed debian package # comment: debmany is based on the work of debman and debget # gui uses: whiptail (preferred), dialog or zenity as well # other uses: curl, $PAGER or sensible-pager (can be overwritten: -o) # optional: -k -g -x: kfmexec gnome-open xdg-open (xdg-utils) # This is free software. You may redistribute copies of it under the terms of # the GNU General Public License . # There is NO WARRANTY, to the extent permitted by law. # Tests for new releases: # -L test downloadlimit and correct display of different sizes and units (http) # -l several languages with and without "*" on installed and not installed packages # -m -o test default and using parameters # -z -k -g -x test # open manpage,other file (usr/share/doc/...),manpage,other file # check delivered debmany manpages # check and test bash_completion # check includes of installed (bash: bash-builtins) and uninstalled (ax25-tools:netrom-tools) # test additionally the next operationg system (e.g. lenny) LC_ALL=C # defaults mancmdline="man %s" # man page viewer othercmdline="sensible-pager %s" # viewer for other files curdir=`pwd` # Version of debmany version=1.5 error() { # show errorcode and quit echo "ERROR: $*" >&2 if [ "$cmd" = "zenity" ] then $cmd --error --text="$*" fi exit 1 } debug() { # show debugging test $debug && echo "$*" >&2 } usage() { echo "debmany $version Description: Display a manpage or documentation files from a Debian package. The list of files is displayed in a dialog. Supported locations for debian packages are: Local .deb-file, a package in the repository or an installed package. The default for manpages is man - sensible-pager is used for other files. Default can be overridden with -k|-g|-x and -m -o. Syntax1 : debmany [-?|-h|--help] Syntax2 : debmany [-v[v]] [-k|-g|-x] [-m manviewer] [-o otherviewer] [-L limit] [-l lang1[,...]] package[.deb] Syntax3 : debmany [-v[v]] [-k|-g|-x] [-m manviewer] [-o otherviewer] [-L limit] [-l lang1[,...]] -z [package[.deb]] Examples: debmany foo.deb show manpages from a local package file foo.deb debmany foo show manpages from a package, if the package is not installed it is retrieved from the configured repositories. debmany -k foo show files using your preferred viewer (KDE) man: kfmclient exec man:%s other: kfmclient exec %s debmany -g foo show files using your preferred viewer (GNOME) man: gnome-open man:%s other: gnome-open %s debmany -x foo show files using your preferred viewer man: xdg-open man:%s other: xdg-open %s using xdg-open from xdg-utils package (Xfce users) debmany -m 'konqueror man:%s' -l 'de*,fr*' -L 5M foo show English, German and French manpages using konqueror as man-viewer and ask if download size exceeds 5M debmany -z -k use zenity (as dialog) to select packages and files TMPDIR=~/tmp debmany -k -o 'foo.sh %s' -l de,fr -L 5M foo use ~/tmp as temporary folder use KDE-defaults but override viewer for other files debmany -v foo show some debugging information (-vv show more) alias debmany='debmany -l de -L 5M -k'; debmany -m man -l 'zh*' foo set an alias with your preferred options and override them if needed" if [ $# -eq 0 ] then exit 0 else error "$*" fi } while [ $# -gt 0 ] do case $1 in "-?"|-h|--help) usage ;; -k) mancmdline='kfmclient exec man:%s' # set kde viewers othercmdline='kfmclient exec %s';; -g) mancmdline='gnome-open man:%s' # set gnome viewers othercmdline='gnome-open %s';; -x) mancmdline='xdg-open man:%s' # set independant viewers othercmdline='xdg-open %s';; -m) # override default manpageviewer shift mancmdline="$1";; -o) # override default viewer for other data shift othercmdline="$1";; -l) shift; lang=$1;; # remember language -L) shift; asksize=$1;; # remember asksize -v) debug=1;; -vv) debug=2;; -z) cmd="zenity" # is zenity executeable? which $cmd >/dev/null 2>&1 || error "$cmd must be installed if you use parameter -z" ;; -*) usage "Unknown option '$1'.";; *) package="$1";; esac shift done mancmd=($mancmdline) # get first word !dash if which $mancmd >/dev/null 2>&1 # is the manpageviewer(first word) executeable? then echo "$mancmdline" | grep -q "%s" || mancmdline="$mancmdline %s" else usage "Manpageviewer '$mancmd' is not available or executable" fi othercmd=($othercmdline) # get first word !dash if which $othercmd >/dev/null 2>&1 # is the manpageviewer executeable? then echo "$othercmdline" | grep -q "%s" || othercmdline="$othercmdline %s" else usage "Viewer for other data '$othercmd' is not available or executable" fi # choose whiptail or dialog whiptail=/usr/bin/whiptail dialog=/usr/bin/dialog if [ "$cmd" ] then # zenity version if [ -z "$package" ] then package=`$cmd --entry --title="Debmany $version" --text="Enter package or package.deb"` || exit 0 fi else test -z "$package" && usage "You must specify one package or a Debian package file." test -x $whiptail && cmd=$whiptail || cmd=$dialog # determine the size of your terminal read y x <&2 sleep 3 fi # test upon minimum resolution if [ $x -lt 40 -o $y -lt 9 ] then error "Resolution too small ($x*$y). I need a minimum of 40*9 - recommended is more..." fi debug "Terminalsize: ${x}x$y" # comment # set the size of the dialog window and menu x=$(($x-1)) # width of the dialog y=$(($y-1)) # height of the dialog h=$(($y-7)) # height of the menu fi debug "Using '$cmd' for selection" # comment if [ "${package##*.}" = "deb" ] then debug "Mode1: You want to see manpages from a .deb-file" # comment if [ -r "$package" ] then file=`readlink -f "$package"` status=file else error "The file $package cannot be read." fi else debug "Test if the package '$package' is already installed" # comment if dpkg -l "$package" 2>/dev/null | grep -q ^i then debug "Package '$package' is already installed" # comment status=installed # create the list of all mandirs (with -e for grep) (X11R6 is only for sarge - didn't find it in etch anymore) mandirs="-e /usr/share/man/man.*/ -e /usr/share/doc/" # modify lang for grep regular expressions: fr -> fr\.* (-> fr+fr.ISO8859-1+"fr."...) for l in `echo "$lang"|sed -e "s/,/ /" -e "s/*/.*/"` do mandirs="$mandirs -e /usr/share/man/$l/" done debug "Using grep pattern '$mandirs'" # comment # list the manpage dirs set -f for man in `dpkg -L "$package" 2>/dev/null|grep $mandirs|sort` do # mode 2: add the manpages to the list test -f $man && manpages="$manpages $man ${man##*/}" done set +f if [ "$debug" = 2 ] then debug "Mode2: Found manpages/docs: $manpages" # comment else debug "Mode2: Found manpages/docs" # comment fi fi fi if [ "$status" = "installed" ] then # mode 2 cd / else # mode 1 and 3 trap 'test -n "$temp" && rm -rf "$temp"; exit' 0 2 15 # cleanup # find a directory for temporary files (you can use $TMPDIR to specify the destination) for tmp in "$TMPDIR" /tmp /var/tmp do test -d "$tmp" && break done # make a temporary folder for the manpages temp=`mktemp -d -p "$tmp" debmany.XXXXXXXXXX` || error "Unable to create a temporary folder in '$tmp'." debug "Mode1/3: Created temporary folder $temp" # comment if [ -z "$file" ] then debug "Mode3: Determining the path of '$package'" # comment aptdata=`apt-get -q2 --print-uris --reinstall install "$package" 2>/dev/null | grep "$package"_` if [ -z "$aptdata" ] then error "There is no package called '$package'." exit 1 fi url=`echo "$aptdata" | sed -e "s/^'\([^']*\)'.*$/\1/"` test -z "$url" && error "Could not obtain an URL for '$pkgspec'." debug "Mode3: Found package '$package' in the repository" # comment if [ "${url%%:*}" = "file" ] then file="${url#*:}" debug "Mode3: Access the local file '$file'" # comment if [ ! -r "$file" ] then error "Could not access '$file' from the repository." fi status=repos-file else file="$temp/tmp.deb" debug "Mode3: Preparing download of file '$url' to '$file'" # comment # if i should ask at a specific size if [ "$asksize" != "" ] then debug "Mode3: Determine the size of the file to download" # comment # determine the size of the file to download (*10 for 10,5M) size=`apt-cache show "$package"|grep ^"Size: "|head -1|cut -f2 -d" "` # determine the value of ask_size limit=`echo $asksize|tr -cd "[0-9]"` test "$limit" = "" && error "Parameter -L needs an argument - e.g. '10M'." # determine the unit of ask_size unit=`echo $asksize|tr -d "[0-9]"` debug "Mode3: Determined download limit is '$limit' '$unit'" # comment # calculate the limit !dash integer variables support < 2G case $unit in B|"") ;; K) limit=$(($limit*1024));; M) limit=$(($limit*1024*1024));; G) limit=$(($limit*1024*1024*1024));; T) limit=$(($limit*1024*1024*1024*1024));; *) error "Invalid unit '$unit' in command line." esac # calculate the human readable size and ask for download if size exceeds limit if [ $size -ge $limit ] then debug "Mode3: Size '$size' exceeds specified limit '$limit'" # comment unit=B size=$(($size*100)) # !dash 2G limit # reduce the size and correct the unit until it is human readable while [ $size -ge 10240 ] do size=$(($size/1024)) # correct the unit every time /1024 case $unit in G) unit=T;; M) unit=G;; K) unit=M;; B) unit=K;; esac done size=$((($size+5)/10)) # !dash 2G limit # set the comma (so if the file has a size of 5M we change 50 to 5,0M) commasize=`echo $size|sed "s/\(.*\)\(.\)/\1.\2/"` commasize=`printf "%.1f$unit" $commasize` # ask if the download may start - otherwise debmany exits if [ "$cmd" = "zenity" ] then if ! $cmd --question --text="Would you like to download the package with a size of $commasize?" then echo "Download undesired - $commasize is too big." exit fi else if ! $cmd --yesno "Would you like to download the package with a size of $commasize?" 9 40 then echo "Download undesired - $commasize is too big." exit fi fi fi fi # download the package debug "Mode3: Start download using curl" # comment curl --location "$url" >"$file" || error "Failed to download '$url' to '$file'." status=repos-curl fi fi cd "$temp" # extract the manpages # create the list of all mandirs (X11R6 is only for sarge - didn't find it in etch anymore) # and add language specific manpages: fr -> fr.* (-> fr+fr.ISO8859-1+"fr."...) mandirs="./usr/share/man/man*/ /usr/share/man/man*/ ./usr/share/doc/ /usr/share/doc/" for l in `echo "$lang"|tr "," " "` do mandirs="$mandirs ./usr/share/man/$l/ /usr/share/man/$l/" done debug "Using tar pattern '$mandirs'" # comment debug "Mode1/3: Extract the manpage and doc dirs from '$file'" # comment dpkg --fsys-tarfile "$file" | tar --wildcards -xf - $mandirs 2>/dev/null # find all manpage files manpages=`find usr -type f 2>/dev/null|sort|sed -e 's\([^/]*\)$\1 \1'` fi while true do # test if manpages where found test -z "$manpages" && error "No manpage exists for package '$package'." # select your manpages using dialog if [ "$cmd" = "zenity" ] then return=`$cmd --title="Debmany: $package" --text="Select a file ($status:$package)" --width=800 --height=600 --list --column=Path --column=File $manpages` else exec 3>&1 return=`$cmd --title "Select a file ($status:$package)" --menu '' $y $x $h $manpages 2>&1 1>&3` exec 3>&- fi if [ -n "$return" ] then # show the manpage if echo $return | grep -q usr/share/man then path=$(dirname `dirname "$return"`) file=`echo "$return"|sed "s^$path/"` if [ "${return##/*}" ] # test relative path then # it is a temporary extracted archive debug "Going to manpage directory: $temp/$path" # comment cd "$temp/$path" else # installed manpage debug "Going to manpage directory: $path" # comment cd "$path" fi debug "Opening manpage file: "`printf "$mancmdline" "$PWD/$file"` # comment eval $(printf "$mancmdline" "$PWD/$file") cd - >/dev/null else # other file (usr/share/doc) debug "Opening other file: "`printf "$othercmdline" "$PWD/$return"` # comment eval $(printf "$othercmdline" "$PWD/$return") fi else cd "$curdir" exit fi done debian-goodies-0.63/debmany/bash_completion/0000755000000000000000000000000012165351155015772 5ustar debian-goodies-0.63/debmany/bash_completion/debmany0000644000000000000000000000350112165351155017333 0ustar # debmany(1) completion # # Copy this file to ~/.bash_completion. # To activate bash completion for new logins configure ~/.bashrc # or simply source /etc/bash_completion to test it. # After a new login completion is done for # all parameters, # packages or filenames and folders. # have debmany && _debmany() { local cur prev setf COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} case "$prev" in -L) if echo "$cur" | grep -q ^"[0-9][0-9]*[KMGT]*"; then COMPREPLY=( $( compgen -W '`echo ${cur/[KMGT]/}{K,M,G,T}`' -- "$cur" ) ) else COMPREPLY=("100K" "50M" "5G" "1T") fi ;; -l) # show all possible languages from /usr/share/i18n/SUPPORTED setf=`echo $-` # remember switch f (shell filename completion) set -f COMPREPLY=( $( compgen -W '`sed -e "s/[@_. ].*//g" -e "s/$/*/" /usr/share/i18n/SUPPORTED|sort -u`' -- "$cur" ) ) echo "$setf"|grep -q f || set +f # switch back if needed ;; -m) case "${cur:0:1}" in \"|\') local manpageviewer="${cur:1}";; *) local manpageviewer="$cur";; esac COMP_WORDS=(COMP_WORDS[0] "$manpageviewer") COMP_CWORD=1 _command ;; -o) case "${cur:0:1}" in \"|\') local otherviewer="${cur:1}";; *) local otherviewer="$cur";; esac COMP_WORDS=(COMP_WORDS[0] "$otherviewer") COMP_CWORD=1 _command ;; *) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-? -h --help -k -g -x -m -o -L -l -v -vv -z' -- "$cur" ) ) else COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null; ) ) if [ ${#COMPREPLY[@]} -eq 0 ] then _filedir fi fi ;; esac return 0 } && complete -F _debmany $filenames debmany debian-goodies-0.63/debmany/TODO0000644000000000000000000000104212165351155013311 0ustar Provide a desktop menu file that uses "debmany.png". When configuring the desktop call follow this table: kde gnome xfce required zenity zenity zenity,xdg-utils parameters -k -z -g -z -x -z It is better to use the -l parameter for ISO 639 two-letter language code and "*" at the end. Example parameters for a german Kde user: -k -z -l "de*" Optionally, Depend: on xdg-utils package, too. Then the desktop file can use the arguments -x instead of -k, -g or -x for all desktops. debian-goodies-0.63/popbugs0000755000000000000000000001111712165351155012613 0ustar #!/usr/bin/python # popbugs - Find RC bugs in packages you commonly use # Copyright (C) 2001-2004 Matt Zimmerman # 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, 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # import sys import re import os import urllib2 import tempfile import getopt usage = '''Usage: popbugs [{-o|--output=} {outputfile|-}] [popularity-contest log]\n''' popconfile = '/var/log/popularity-contest' bugurl = 'http://bugs.debian.org/release-critical/other/all.html' # For testing purposes: #bugurl = 'file:///tmp/all.html' outputfile = None debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "dho:", ["debug", "help","output="]) except getopt.GetoptError: sys.stderr.write(usage) sys.exit(2) for o, a in opts: if o in ("-h", "--help"): sys.stdout.write(usage) sys.exit() elif o in ("-o", "--output"): outputfile = a elif o in ("-d", "--debug"): debug = 1 if len(args) >= 1: popconfile = args[0] if not os.path.exists(popconfile): sys.stderr.write(''' I cannot find the popularity-contest data you pointed me to. This program requires the data collected from popularity-contest in order to work. ''') sys.exit(1) else: if not os.path.exists(popconfile): if not os.path.exists('/usr/sbin/popularity-contest'): sys.stderr.write(''' The popularity-contest package does not appear to be installed. This program requires the data collected from popularity-contest in order to work. ''') sys.exit(1) sys.stderr.write(''' There is no popularity-contest data present on your system. This probably means that popularity-contest has not yet run since it was installed. Try waiting for /etc/cron.daily/popularity-contest to to collect some data or manually run (as root user): /usr/sbin/popularity-contest >/var/log/popularity-contest ''') sys.exit(1) if outputfile == None: fd, outputfile = tempfile.mkstemp(suffix='.html') output = os.fdopen(fd, 'w') view = 1 elif outputfile == '-': output = sys.stdout view = 0 else: output = open(outputfile, 'w') view = 0 class Package: def __init__(self, name, atime): self.name = name self.atime = atime packages = {} pkglist = [] popcon = open(popconfile,'r') for line in popcon.readlines(): if len(line) == 0 or line.find(':') != -1: continue fields = line.split() if len(fields) != 4: continue if (fields[0] == 'POPULARITY-CONTEST-0' or fields[0] == 'END-POPULARITY-CONTEST-0'): continue (atime, ctime, package, pathname) = fields # if pathname == '' or pathname == '': # continue if debug: print "POPCON: Adding package " + package packages[package] = Package(package,atime) pkglist.append(packages[package]) popcon.close() page = urllib2.urlopen(bugurl).readlines() while page: line = page.pop(0) if line.startswith('Package:.*') while page: m = packagere.match(page[0]) if m: html = '' while page: line = page.pop(0) html += line if line == '\n' or (page and packagere.match(page[0])): # another paragraph started with no newline break pkgname = m.group(1) if debug: print "REGEX: Parsing package " + pkgname if pkgname in packages: if debug: print "REGEX: Package " + pkgname + "is in packages" packages[pkgname].html = html else: if page[0].startswith('
'): break page.pop(0) pkglist.sort(lambda a,b: -cmp(a.atime,b.atime)) for package in pkglist: if hasattr(package,'html'): output.write(package.html) output.write('\n') output.writelines(page) output.flush() if view: os.system('sensible-browser file://' + outputfile) debian-goodies-0.63/dglob.pod0000644000000000000000000000556612165351155013014 0ustar =head1 NAME dglob - Expand package names or files matching a pattern =head1 SYNOPSIS B [B<-a>] I B [B<-0>] B<-f> I =head1 DESCRIPTION B lists packages names matching a pattern. It can also list all the files they contain. By default B only searches installed packages; the B<-a> switch widens the search (see L<"OPTIONS">). The list is written to stdout, one name per line. grep-dctrl(1) and grep-aptavail(1) are used to search the list of packages, so you should refer to its documentation for information on how patterns are matched. By default, all packages whose name contains the given string will be matched, but several options are available to modify this behavior (see L<"OPTIONS">). If you use dglob with the B<-f> option, all files in the matched packages are listed instead of their names. If you do not use de B<-a> switch, only existing, plain (i.e. no symlinks, directories or other special ones) files are listed. If the B<-a> switch is use then all files will be listed both for installed and non-installed packages. The filenames are written to stdout, one file per line. You can use the B<-0> option to get the filenames separated by '\0' instead of a newline. =head1 OPTIONS B supports the following options: =over 4 =item B<-a> Search through all available packages, not just installed ones. If set, grep-aptavail(1) is used. =item B<-f> List all files in the matched packages. By default, this lists only installed (i.e. locally existing) files from installed packages. If used together with B<-a> then it will list all files both of installed and non-installed packages by mean of apt-file(1). If apt-file is not installed, using B<-f> together with B<-a> is rather pointless. =item B<-0> When listing files (with B<-f>) use '\0' as a separator instead of a newline. When specified without B<-f>, this options does nothing. =item B<-r>, B<-e>, B<-i>, B<-X>, B<-v> These options are passed directly to grep-dctrl(1) or to grep-aptavail(1) to modify how the pattern is matched. See grep-dctrl(1). =back =head1 FILES =over 4 =item F dpkg(8) status file, which serves as source for the list of available and installed packages. =back =head1 AUTHOR Matt Zimmerman This manpage was written by Frank Lichtenheld , and further enhanced by Javier Fernandez-Sanguino . =head1 COPYRIGHT AND LICENCE Copyright (C) 2001 Matt Zimmerman . 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, or (at your option) any later version. On Debian systems, a copy of the GNU General Public License may be found in /usr/share/common-licenses/GPL. =head1 SEE ALSO grep-dctrl(1), grep-available(1), apt-file(1), dpkg(8) debian-goodies-0.63/bash_completion/0000755000000000000000000000000012165351155014353 5ustar debian-goodies-0.63/bash_completion/debian-goodies.pkgnames0000644000000000000000000000034212165351155020752 0ustar _pkg_names() { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) return 0 } complete -F _pkg_names which-pkg-broke dhomepage debget debian-goodies-0.63/dpigs.pod0000644000000000000000000000261012165351155013016 0ustar =head1 NAME dpigs - Show which installed packages occupy the most space =head1 SYNOPSIS B [I] =head1 DESCRIPTION B sorts the installed packages by size and outputs the largest ones. Per default dpigs displays the largest 10 packages. You can change this value by using the B<-n> option (see L<"OPTIONS">). The information is taken from the dpkg status file with grep-status(1). =head1 OPTIONS =over 4 =item B<-h>, B<--help> Display some usage information and exit. =item B<-n>, B<--lines>=I Display the N largest packages on the system (default 10). =item B<-s>, B<--status>=I Use I instead of the default dpkg status file (which is F currently). =item B<-S>, B<--source> Display the largest source packages of binary packages installed on the system. =back =head1 AUTHOR Matt Zimmerman This manpage was written by Frank Lichtenheld . =head1 COPYRIGHT AND LICENCE Copyright (C) 2001 Matt Zimmerman . 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, or (at your option) any later version. On Debian systems, a copy of the GNU General Public License may be found in /usr/share/common-licenses/GPL. =head1 SEE ALSO dpkg(8), grep-status(1) debian-goodies-0.63/debget.pod0000644000000000000000000000223512165351155013145 0ustar =head1 NAME debget - Fetch a .deb for a package in APT's database =head1 SYNOPSIS B I [I ...] =head1 DESCRIPTION B fetches a .deb for one or more packages from an Debian mirror. It uses apt-get(1) to find out the URL so it will download the same version from the same server as I would do. The .deb will be downloaded with curl(1) and stored in your current working directory. =head1 KNOWN BUGS B will not work for packages that are available in I's cache. If you need that functionality please use the .I option in I. =head1 AUTHOR Matt Zimmerman This manpage was written by Frank Lichtenheld . =head1 COPYRIGHT AND LICENCE Copyright (C) 2001 Matt Zimmerman . 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, or (at your option) any later version. On Debian systems, a copy of the GNU General Public License may be found in /usr/share/common-licenses/GPL. =head1 SEE ALSO apt-get(1), curl(1) debian-goodies-0.63/debget0000755000000000000000000000546512165351155012377 0ustar #!/bin/sh -e # debget - Fetch a .deb for a package in APT's database # Copyright (C) 2001,2002 Matt Zimmerman # 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, 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # Set the locale so we can control apt-get errors properly LC_ALL=C usage() { echo "Usage: `basename $0` [--help] package" } if [ $# -eq 0 ] ; then usage exit 1 fi case $1 in "-h") usage; exit 0;; "--help") usage; exit 0;; -*) echo "Unknown option $1"; usage; exit 1;; esac # First check if apt-get is sane enough before proceeding set +e apt-get -q2 --print-uris --reinstall install "dpkg" 2>/dev/null >/dev/null if [ $? -ne 0 ] ; then echo "ERROR: There was an error calling apt-get. Check that the database is in a consistent state and try again" exit 1 fi if ! ls /var/lib/apt/lists/ |grep Release >/dev/null; then echo "ERROR: Your apt lists are empty. Update your package database" echo "using 'apt-get update'" fi set -e for pkgspec in $*; do set +e apt-get -q2 --print-uris --reinstall install "$pkgspec" 2>/dev/null >/dev/null if [ $? -ne 0 ] ; then echo "ERROR: There is no '$pkgspec' package. Sorry." echo "If you believe the package exists then consider updating your." echo "package database using 'apt-get update'" continue fi set -e # This provides only one version, but it's better than the apt-get # call which will not work in packages not available locally apt-cache show "$pkgspec" 2>/dev/null | grep ^Ver | while read version; do version=`echo $version | sed -ne '$s/^.*: \(.*\).*$/\1/p'` echo "($pkgspec -> $version)" done aptdata=$(apt-get -q2 --print-uris --reinstall install "$pkgspec" 2>/dev/null | grep -F "/${pkgspec}_") if [ -z "$aptdata" ] ; then echo "ERROR: No APT data returned for '$pkgspec'. Sorry." echo "This is probably because the package is in the local apt cache" echo "Tip: Use 'aptitude download'" continue fi url=$(echo "$aptdata" | sed -e "s/^'\([^']*\)'.*$/\1/") file=$(echo "$aptdata" | sed -e "s/^'[^']*' \([^ ]*\).*$/\1/") if [ -z "$url" ] ; then echo "ERROR: Cound not obtain an URL for $pkgspec" else echo "Downloading $pkgspec from $url" curl "$url" > "$file" fi done debian-goodies-0.63/checkrestart0000755000000000000000000005606512165537036013635 0ustar #!/usr/bin/python # Copyright (C) 2001 Matt Zimmerman # Copyright (C) 2007,2011 Javier Fernandez-Sanguino # - included patch from Justin Pryzby # to work with the latest Lsof - modify to reduce false positives by not # complaining about deleted inodes/files under /tmp/, /var/log/, # /var/run or named /SYSV. # - introduced a verbose option # PENDING: # - included code from 'psdel' contributed by Sam Morris to # make the program work even if lsof is not installed # (available at http://robots.org.uk/src/psdel) # - make it work with a whitelist of directories instead of a blacklist # (might make it less false positive prone) # # # 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, 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301 USA # # On Debian systems, a copy of the GNU General Public License may be # found in /usr/share/common-licenses/GPL. import sys import os, errno import re import pwd import sys import string import subprocess import getopt from stat import * if os.getuid() != 0: sys.stderr.write('ERROR: This program must be run as root in order to obtain information\n') sys.stderr.write('about all open file descriptors in the system.\n') sys.exit(1) def find_cmd(cmd): dirs = [ '/', '/usr/', '/usr/local/', sys.prefix ] for d in dirs: for sd in ('bin', 'sbin'): location = os.path.join(d, sd, cmd) if os.path.exists(location): return location return 1 def usage(): sys.stderr.write('usage: checkrestart [-vhpa] [-bblacklist] [-iignore]\n') def main(): global lc_all_c_env, file_query_check process = None toRestart = {} lc_all_c_env = os.environ lc_all_c_env['LC_ALL'] = 'C' file_query_check = {} blacklistFiles = [] blacklist = [] ignorelist = [ 'util-linux', 'screen' ] # Process options try: opts, args = getopt.getopt(sys.argv[1:], "hvpab:i:", ["help", "verbose", "packages", "all", "blacklist", "ignore"]) except getopt.GetoptError, err: # print help information and exit: print str(err) # will print something like "option -x not recognized" usage() sys.exit(2) # Global variables set through the command line global verbose, onlyPackageFiles, allFiles verbose = False # Only look for deleted files that belong to packages onlyPackageFiles = False # Look for any deleted file allFiles = False for o, a in opts: if o in ("-v", "--verbose"): verbose = True elif o in ("-h", "--help"): usage() sys.exit() elif o in ("-p", "--packages"): onlyPackageFiles = True elif o in ("-a", "--all"): allFiles = True onlyPackageFiles = False elif o in ("-b", "--blacklist"): blacklistFiles.append(a) onlyPackageFiles = False elif o in ("-i", "--ignore"): ignorelist.append(a) else: assert False, "unhandled option" for f in blacklistFiles: for line in file(f, "r"): if line.startswith("#"): continue blacklist.append(re.compile(line.strip())) # Start checking if find_cmd('lsof') == 1: sys.stderr.write('ERROR: This program needs lsof in order to run.\n') sys.stderr.write('Please install the lsof package in your system.\n') sys.exit(1) # Check if we have lsof, if not, use psdel # if find_cmd('lsof'): # toRestart = lsofcheck() # else: # TODO - This does not work yet: # toRestart = psdelcheck() toRestart = lsofcheck(blacklist = blacklist) print "Found %d processes using old versions of upgraded files" % len(toRestart) if len(toRestart) == 0: sys.exit(0) programs = {} for process in toRestart: programs.setdefault(process.program, []) programs[process.program].append(process) if len(programs) == 1: print "(%d distinct program)" % len(programs) else: print "(%d distinct programs)" % len(programs) # Verbose information if verbose: for process in toRestart: print "Process %s (PID: %d) " % (process.program, process.pid) process.listDeleted() packages = {} diverted = None dpkgQuery = ["dpkg-query", "--search"] + programs.keys() dpkgProc = subprocess.Popen(dpkgQuery, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env = lc_all_c_env) if verbose: print "Running:%s" % dpkgQuery while True: line = dpkgProc.stdout.readline() if not line: break if verbose: print "Reading line: %s" % line if line.startswith('local diversion'): continue if not ':' in line: continue m = re.match('^diversion by (\S+) (from|to): (.*)$', line) if m: if m.group(2) == 'from': diverted = m.group(3) continue if not diverted: raise Exception('Weird error while handling diversion') packagename, program = m.group(1), diverted else: packagename, program = line[:-1].split(': ') if program == diverted: # dpkg prints a summary line after the diversion, name both # packages of the diversion, so ignore this line # mutt-patched, mutt: /usr/bin/mutt continue packages.setdefault(packagename,Package(packagename)) try: packages[packagename].processes.extend(programs[program]) except KeyError: sys.stderr.write ('checkrestart (program not found): %s: %s\n' % (packagename, program)) sys.stdout.flush() # Close the pipe dpkgProc.stdout.close() print "(%d distinct packages)" % len(packages) if len(packages) == 0: print "No packages seem to need to be restarted." print "(please read checkrestart(1))" sys.exit(0) for package in packages.values(): skip = False if ignorelist: for i in ignorelist: if i == package.name: skip = True if skip: continue dpkgQuery = ["dpkg-query", "--listfiles", package.name] dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env = lc_all_c_env) while True: line = dpkgProc.stdout.readline() if not line: break path = line[:-1] if path.startswith('/etc/init.d/'): if path.endswith('.sh'): continue package.initscripts.add(path[12:]) sys.stdout.flush() dpkgProc.stdout.close() # Alternatively, find init.d scripts that match the process name if len(package.initscripts) == 0: for process in package.processes: proc_name = os.path.basename(process.program) if os.path.exists('/etc/init.d/' + proc_name): package.initscripts.add(proc_name) restartable = [] nonrestartable = [] restartCommands = [] for package in packages.values(): if len(package.initscripts) > 0: restartable.append(package) restartCommands.extend(map(lambda s: 'service ' + s + ' restart',package.initscripts)) else: nonrestartable.append(package) if len(restartable) > 0: print print "Of these, %d seem to contain init scripts which can be used to restart them:" % len(restartable) # TODO - consider putting this in a --verbose option print "The following packages seem to have init scripts that could be used\nto restart them:" for package in restartable: print package.name + ':' for process in package.processes: print "\t%s\t%s" % (process.pid,process.program) print print "These are the init scripts:" print '\n'.join(restartCommands) print if len(nonrestartable) == 0: sys.exit(0) # TODO - consider putting this in a --verbose option print "These processes do not seem to have an associated init script to restart them:" for package in nonrestartable: skip = False if ignorelist: for i in ignorelist: if i == package.name: skip = True if skip: continue print package.name + ':' for process in package.processes: print "\t%s\t%s" % (process.pid,process.program) def lsofcheck(blacklist = None): processes = {} for line in os.popen('lsof +XL -F nf').readlines(): field, data = line[0], line[1:-1] if field == 'p': process = processes.setdefault(data,Process(int(data))) elif field == 'k': process.links.append(data) elif field == 'n': # Remove the previous entry to check if this is something we should use if data.startswith('/SYSV'): # If we find SYSV we discard the previous descriptor last = process.descriptors.pop() elif data.startswith('/'): last = process.descriptors.pop() # Add it to the list of deleted files if the previous descriptor # was DEL or lsof marks it as deleted if re.compile("DEL").search(last) or re.compile("deleted").search(data) or re.compile("\(path inode=[0-9]+\)$").search(data): process.files.append(data) else: # We discard the previous descriptors and drop it last = process.descriptors.pop() elif field == 'f': # Save the descriptor for later comparison process.descriptors.append(data) toRestart = filter(lambda process: process.needsRestart(blacklist), processes.values()) return toRestart # Tells if a given file is part of a package # Returns: # - False - file does not exist in the system or cannot be found when querying the package database # - True - file is found in an operating system package def ispackagedFile (f): file_in_package = False file_regexp = False if verbose: print "Checking if file %s belongs to any package" % f # First check if the file exists if not os.path.exists(f): if ( f.startswith('/lib/') or f.startswith('/usr/lib/') ) and re.compile("\.so[\d.]+$"): # For libraries that do not exist then try to use a regular expression with the # soname # In libraries, indent characters that could belong to a regular expression first f = re.compile("\+").sub("\+", f) f = re.compile(".so[\d.]+$").sub(".so.*", f) f = re.compile("\.").sub("\.", f) file_regexp = True else: # Do not call dpkg-query if the file simply does not exist in the file system # just assume it does not belong to any package return False # If it exists, run dpkg-query dpkgQuery = ["dpkg-query", "--search", f ] dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env = lc_all_c_env, close_fds=True) dpkgProc.wait() if verbose: print "Running:%s" % dpkgQuery for line in dpkgProc.stdout.readlines(): line = line.strip() if line.find('no path found matching pattern ' + f) > 0: file_in_package = False break if line.endswith(f) or ( file_regexp and re.search(f, line)): package = re.compile(":.*$").sub("",line) file_in_package = True break if file_in_package and verbose: print "YES: File belongs to package %s" % package if not file_in_package and verbose: print "NO: File does not belongs to any package" return file_in_package # Tells if a file has to be considered a deleted file # Returns: # - 0 (NO) for known locations of files which might be deleted # - 1 (YES) for valid deleted files we are interested in def isdeletedFile (f, blacklist = None): global lc_all_c_env, file_query_check if allFiles: return 1 if blacklist: for p in blacklist: if p.search(f): return 0 # We don't care about log files if f.startswith('/var/log/') or f.startswith('/var/local/log/'): return 0 # Or about files under temporary locations if f.startswith('/var/run/') or f.startswith('/var/local/run/'): return 0 # Or about files under /tmp if f.startswith('/tmp/'): return 0 # Or about files under /dev/shm if f.startswith('/dev/shm/'): return 0 # Or about files under /run if f.startswith('/run/'): return 0 # Or about files under /drm if f.startswith('/drm'): return 0 # Or about files under /var/tmp and /var/local/tmp if f.startswith('/var/tmp/') or f.startswith('/var/local/tmp/'): return 0 # Or /dev/zero if f.startswith('/dev/zero'): return 0 # Or /dev/pts (used by gpm) if f.startswith('/dev/pts/'): return 0 # Or /usr/lib/locale if f.startswith('/usr/lib/locale/'): return 0 # Skip files from the user's home directories # many processes hold temporafy files there if f.startswith('/home/'): return 0 # Skip automatically generated files if f.endswith('icon-theme.cache'): return 0 # Skip font files if f.startswith('/var/cache/fontconfig/'): return 0 # Skip Nagios Spool if f.startswith('/var/lib/nagios3/spool/'): return 0 # Skip nagios spool files if f.startswith('/var/lib/nagios3/spool/checkresults/'): return 0 # Skip, if asked to, files that do not belong to any package if onlyPackageFiles: # Remove some lsof information from the file to ensure that it is # a proper filename file_name = re.sub(r'\(.*\)','', f) file_name = re.sub(r'\s+$','', file_name) # First check: have we checked this file before? If we have not then make the check if not file_name in file_query_check: file_query_check[file_name] = ispackagedFile(file_name) # Once we have the result then check if the file belongs to a package if not file_query_check[file_name]: return 0 # TODO: it should only care about library files (i.e. /lib, /usr/lib and the like) # build that check with a regexp to exclude others if f.endswith(' (deleted)'): return 1 if re.compile("\(path inode=[0-9]+\)$").search(f): return 1 # Default: it is a deleted file we are interested in return 1 def psdelcheck(): # TODO - Needs to be fixed to work here # Useful for seeing which processes need to be restarted after you upgrade # programs or shared libraries. Written to replace checkrestart(1) from the # debian-goodies, which often misses out processes due to bugs in lsof; see # for more information. numeric = re.compile(r'\d+') toRestart = map (delmaps, map (string.atoi, filter (numeric.match, os.listdir('/proc')))) return toRestart def delmaps (pid): processes = {} process = processes.setdefault(pid,Process(int(pid))) deleted = re.compile(r'(.*) \(deleted\)$') boring = re.compile(r'/(dev/zero|SYSV([\da-f]{8}))|/usr/lib/locale') mapline = re.compile(r'^[\da-f]{8}-[\da-f]{8} [r-][w-][x-][sp-] ' r'[\da-f]{8} [\da-f]{2}:[\da-f]{2} (\d+) *(.+)( \(deleted\))?\n$') maps = open('/proc/%d/maps' % (pid)) for line in maps.readlines (): m = mapline.match (line) if (m): inode = string.atoi (m.group (1)) file = m.group (2) if inode == 0: continue # remove ' (deleted)' suffix if deleted.match (file): file = file [0:-10] if boring.match (file): continue # list file names whose inode numbers do not match their on-disk # values; or files that do not exist at all try: if os.stat (file)[stat.ST_INO] != inode: process = processes.setdefault(pid,Process(int(pid))) except OSError, (e, strerror): if e == errno.ENOENT: process = processes.setdefault(pid,Process(int(pid))) else: sys.stderr.write ('checkrestart (psdel): %s %s: %s\n' % (SysProcess.get(pid).info (), file, os.strerror (e))) else: print 'checkrestart (psdel): Error parsing "%s"' % (line [0:-1]) maps.close () return process class SysProcess: re_name = re.compile('Name:\t(.*)$') re_uids = re.compile('Uid:\t(\d+)\t(\d+)\t(\d+)\t(\d+)$') processes = {} def get (pid): try: return Process.processes [pid] except KeyError: Process.processes [pid] = Process (pid) return Process.get (pid) # private def __init__ (self, pid): self.pid = pid status = open ('/proc/%d/status' % (self.pid)) for line in status.readlines (): m = self.re_name.match (line) if m: self.name = m.group (1) continue m = self.re_uids.match (line) if m: self.user = pwd.getpwuid (string.atoi (m.group (1)))[0] continue status.close () def info (self): return '%d %s %s' % (self.pid, self.name, self.user) class Process: def __init__(self, pid): self.pid = pid self.files = [] self.descriptors = [] self.links = [] self.program = '' try: self.program = os.readlink('/proc/%d/exe' % self.pid) # if the executable command is an interpreter such as perl/python, # we want to find the real program m = re.match("^/usr/bin/(perl|python)", self.program) if m: with open('/proc/%d/cmdline' % self.pid, 'r') as cmdline: # only match program in /usr (ex.: /usr/sbin/smokeping) # ignore child, etc. #m = re.search(r'^(([/]\w*){1,5})\s.*$', cmdline.read()) # Split by null-bytes, see proc(5) data = cmdline.read().split('\x00') # Last character should be null-byte, too, see proc(5) if not data[-1]: data.pop() # Spamd sets $0 wrongly, see # https://bugzilla.redhat.com/show_bug.cgi?id=755644 # i.e. the blank after spamd is relevant in case # this will be fixed in the future. m = re.match("^/usr/sbin/spamd |^spamd ", data[0]) if m: self.program = "/usr/sbin/spamd" else: # Strip first value, the interpreter data.pop(0) # Check if something's left after the interpreter, see #715000 if data: # Strip all options following the interpreter, e.g. python's -O m = re.match("^-", data[0]) while (m): data.pop(0) m = re.match("^-", data[0]) if data and data[0]: data = data[0] data = self.which(data) m = re.search(r'^(/usr/\S+)$', data) if m: # store the real full path of script as the program self.program = m.group(1) except OSError, e: if e.errno != errno.ENOENT: if self.pid == 1: sys.stderr.write("Found unreadable pid 1. Assuming we're under vserver and continuing.\n") else: sys.stderr.write('ERROR: Failed to read %d' % self.pid) raise self.program = self.cleanFile(self.program) def which(self, program): if os.path.isabs(program): return program path = os.environ.get("PATH", os.defpath).split(os.pathsep) seen = set() for dir in path: dir = os.path.normcase(os.path.abspath(dir)) if not dir in seen: seen.add(dir) name = os.path.join(dir, program) if os.path.exists(name) and os.access(name, os.F_OK|os.X_OK) and not os.path.isdir(name): return name return program def cleanFile(self, f): # /proc/pid/exe has all kinds of junk in it sometimes null = f.find('\0') if null != -1: f = f[:null] # Support symlinked /usr if f.startswith('/usr'): statinfo = os.lstat('/usr')[ST_MODE] # If /usr is a symlink then find where it points to if S_ISLNK(statinfo): newusr = os.readlink('/usr') if not newusr.startswith('/'): # If the symlink is relative, make it absolute newusr = os.path.join(os.path.dirname('/usr'), newusr) f = re.sub('^/usr',newusr, f) # print "Changing usr to " + newusr + " result:" +f; # Debugging return re.sub('( \(deleted\)|.dpkg-new).*$','',f) def listDeleted(self): listfiles = [] listdescriptors = [] for f in self.files: if isdeletedFile(f): listfiles.append(f) if listfiles != []: print "List of deleted files in use:" for file in listfiles: print "\t" + file # Check if a process needs to be restarted, previously we would # just check if it used libraries named '.dpkg-new' since that's # what dpkg would do. Now we need to be more contrieved. # Returns: # - 0 if there is no need to restart the process # - 1 if the process needs to be restarted def needsRestart(self, blacklist = None): for f in self.files: if isdeletedFile(f, blacklist): return 1 for f in self.links: if f == 0: return 1 return 0 class Package: def __init__(self, name): self.name = name # use a set, we don't need duplicates self.initscripts = set() self.processes = [] if __name__ == '__main__': main() debian-goodies-0.63/debman.10000644000000000000000000000145012165351155012515 0ustar .TH DEBMAN 1 "11 January 2003" .SH NAME debman \- read man pages from uninstalled packages .SH SYNOPSIS .B debman .B \-f .I filename .RB [ \-\- .IR "man(1) options" ] .I name .br .B debman .B \-p .I package .RB [ \-\- .IR "man(1) options" ] .I name .SH DESCRIPTION .B debman extracts a Debian package into a temporary directory and displays manual pages from it. If the .B \-f option is used, it will use a local .I .deb file; if the .B \-p option is used, it will download the named package using .BR debget . .SH ENVIRONMENT .B debman intentionally ignores any .RB $ MANPATH environment variable that might be set, and constructs its own such that only manual pages within the package will be displayed. .SH AUTHOR .B debman was written by Colin Watson . .SH "SEE ALSO" .BR debget (1) debian-goodies-0.63/README0000644000000000000000000000126512165351155012071 0ustar There is no substantial documentation yet. Volunteer authors are more than welcome. Here are some examples to get you started. # Search all files in specified packages for a regex $ dgrep ... # Search through all files in all installed packages for a regex $ dgrep '.*' # Same, but also search inside compressed files $ dzgrep '.*' # Calculate the total disk space usage of all files contained in all # installed packages whose names begin with 'lib' $ dglob -0f ^lib | xargs -0 du -c | awk '{sum += $1} END {print sum}' # Fetch most recent version of package $ debget # Fetch a specific version of package $ debget = debian-goodies-0.63/dpigs0000755000000000000000000000704512165351155012247 0ustar #!/bin/sh # dpigs - Show which installed packages occupy the most space # Copyright (C) 2001,2002 Matt Zimmerman # 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, 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # set -e # set locale for sorting LC_NUMERIC=C export LC_NUMERIC Usage() { echo "Usage: dpigs [options]" echo echo "Options:" echo " -n, --lines=N" echo " Display the N largest packages on the system (default 10)." echo " -s, --status=status-file" echo " Use status-file instead of the default dpkg status file." echo " -S, --source" echo " Display the largest source packages of binary packages installed" echo " on the system." echo " -H, --human-readable" echo " Display package sizes in human-readable format (like ls -lh or du -h)" echo " -h, --help" echo " Display this message." } LINES=10 # grep-status provides a default STATUS= # Default: provide binary package information SOURCE=0 # Default: display kilobytes HUMAN=0 OPTS=$(getopt -o n:s:ShH --long lines:,status:,source,help,human-readable -- "$@") eval set -- "$OPTS" while true; do case "$1" in -n|--lines) LINES="$2" shift 2 ;; -s|--status) STATUS="$2" shift 2 ;; -S|--source) SOURCE=1 shift 1 ;; -H|--human-readable) HUMAN=1 shift 1 ;; -h|--help) Usage exit 0 ;; --) shift break ;; *) Usage exit 1 ;; esac done if [ $SOURCE -eq 0 ] ; then grep-status -nsInstalled-size,Package -F Status ' installed' $STATUS \ | perl -p00l12 -e 's/\n/ /' \ | sort -rn \ | head --lines=$LINES else # Order by source package grep-status -nsInstalled-size,Source:Package -F Status ' installed' $STATUS \ | perl -n00a -e '$s{$F[1]}+=$F[0]; END { for(keys %s) {print"$s{$_} $_\n"} }' \ | sort -rn \ | head --lines=$LINES # Alternatively use this: # It adds details of which binary packages are # involved (but not how big they are), with % standing in for the source #grep-status -nsInstalled-size,Package,Source:Package -F Status ' installed' \ # $STATUS \ # | perl -n00al12 -e '$s{$F[2]} += $F[0]; # $F[1] =~ s/\Q$F[2]\E/%/; $b{$F[2]}{$F[1]} = 1; # END {$, = " "; for(keys %s) {print "$s{$_} $_:", sort keys %{$b{$_}}} }' \ # | sort -rn \ # | head --lines=$LINES fi | if [ $HUMAN -eq 1 ]; then awk '{ if ($1 > 1024*1024*1024) printf("% 6.1fT %s\n", $1/(1024*1024*1024), $2); else if ($1 > 1024*1024) printf("% 6.1fG %s\n", $1/(1024*1024), $2); else if ($1 > 1024) printf("% 6.1fM %s\n", $1/1024, $2); else printf("% 6.1ik %s\n", $1, $2); }' else cat fi debian-goodies-0.63/dglob0000755000000000000000000000456712165351155012236 0ustar #!/bin/sh -e # dglob - Expand package names matching a pattern and conditions # Copyright (C) 2001 Matt Zimmerman # 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, 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # ARGS=`getopt -o af0reiXv -n dglob -- "$@"` eval set -- "$ARGS" filter="grep-dctrl -FStatus ' installed'" expand="cat" grep_dctrl_options="" all="no" while true; do case "$1" in -a) filter="cat" ; all="yes" ; shift ;; -0) SEP=0 ; shift ;; -r|-e|-i|-X|-v) grep_dctrl_options="$grep_dctrl_options $1"; shift ;; -f) expand="xargs dpkg --listfiles | perl -nl${SEP}e 'print if -f'" if [ "$all" = "yes" ] ; then if [ -n "`which apt-file`" ] ; then # if we have apt-file use it instead expand="while read pack; do apt-file show \$pack; done | perl -ple 's/^.*?: //'" else echo "WARN: You requested information on files of all packages," >&2 echo "WARN: however, since the 'apt-file' package is not available, this" >&2 echo "WARN: information can only be provided for those packages currently installed." >&2 fi fi shift ;; --) shift ; break ;; esac done # Does the package exist? if [ "$all" = "no" ] ; then packages=`eval $filter /var/lib/dpkg/status | grep-dctrl -PnsPackage $grep_dctrl_options "$1"` if [ -z "$packages" ] ; then exit 1 fi eval $filter /var/lib/dpkg/status | grep-dctrl -PnsPackage $grep_dctrl_options "$1" | grep -v ^$ | (eval $expand) else # Use grep-available as the status file does not include all available # packages grep-aptavail -PnsPackage $grep_dctrl_options "$1" | grep -v ^$ | (eval $expand) fi