This is an automated email from the git hooks/post-receive script.

abe pushed a commit to branch master
in repository debsums.

commit 79431816dfa18267c12d56ece7ebd0071c2338e0
Author: Mike Forbes <m...@nothing.net.nz>
Date:   Sat Jul 5 16:59:08 2008 +1200

    Added rdebsums and its man page, set myself as maintainer
---
 debian/changelog |  8 +++++
 debian/control   |  3 +-
 debian/rules     |  2 +-
 man/rdebsums.1   | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 rdebsums         | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 185 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 545e57d..7042b7e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+debsums (2.0.36) unstable; urgency=low
+
+  * Taken this package over with permission from Francois
+  * Added rdebsums and it's man page (closes: #290277) 
+  
+
+ -- Mike Forbes <m...@nothing.net.nz>  Sat, 05 Jul 2008 16:38:32 +1200
+
 debsums (2.0.35) unstable; urgency=low
 
   * Take over this package with permission from Brendan
diff --git a/debian/control b/debian/control
index 05d968f..4278468 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,8 @@
 Source: debsums
 Section: admin
 Priority: optional
-Maintainer: Francois Marier <franc...@debian.org>
+Maintainer: Mike Forbes <m...@nothing.net.nz> 
+Uploaders: Francois Marier <franc...@debian.org>
 Build-Depends: debhelper (>= 6), po-debconf, po4a
 Standards-Version: 3.8.0
 Vcs-Git: git://git.debian.org/git/collab-maint/debsums.git
diff --git a/debian/rules b/debian/rules
index ae64834..4d0f32f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,7 +23,7 @@ binary-indep:
 
        mkdir -p $(tmp)/usr/bin $(tmp)/usr/sbin
        sed 's/#VERSION#/$(version)/' debsums.in >$(tmp)/usr/bin/debsums
-       cp debsums_gen debsums_init $(tmp)/usr/sbin
+       cp rdebsums debsums_gen debsums_init $(tmp)/usr/sbin
        chmod 755 $(tmp)/usr/bin/debsums $(tmp)/usr/sbin/debsums_gen \
            $(tmp)/usr/sbin/debsums_init
 
diff --git a/man/rdebsums.1 b/man/rdebsums.1
new file mode 100644
index 0000000..cac3560
--- /dev/null
+++ b/man/rdebsums.1
@@ -0,0 +1,92 @@
+\" Man page for rdebsums, based on the one from man(1)
+\"
+\" Copyright 2007 by Vincent Fourmond <fourm...@debian.org>
+\"
+\" 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 St, Fifth Floor, Boston, MA  02110-1301 USA
+
+.pc
+.TH RDEBSUMS 1 "2007-03-29" "Version 0.1" "Recursive debsums"
+.SH NAME
+rdebsums \- a recursive debsums
+
+.SH SYNOPSIS
+.B rdebsums --help \fR | [ \fI debsum options \fR ] [ \fB --others \fR ]
+.I package
+
+.SH DESCRIPTION
+
+.B rdebsums
+runs 
+.BR debsums (1)
+over a given package and all its dependencies. It can be used to make
+sure a problem with a package is not due to file corruption. 
+
+All but the last element of the command-line and options understood by 
+.B rdebsums
+are sent to
+.BR debsums (1).
+
+
+.SH OPTIONS
+
+.TP 
+.B --help
+Prints a short help text
+
+.TP
+.B --others
+Also runs
+.B debsums
+on Recommended and Suggested
+packages.
+
+.SH EXAMPLES
+
+Check the package
+.I aptitude
+and all its dependencies:
+
+.I rdebsums aptitude
+
+The same while being significantly less verbose
+
+.I rdebsums -s aptitude
+
+.SH BUGS
+
+.B rdebsums 
+is quite slow - essentially due to
+.B dpkg-query
+not being extremely fast.
+
+Currently, 
+.B rdebsums
+will be confused by virtual packages.
+
+.B --others
+is actually nearly useless, as you often end up checking nearly all
+packages. You'll most probably win time by running 
+.B debsums
+without arguments.
+
+.SH AUTHOR
+
+.B rdebsums
+was written by Vincent Fourmond <fourm...@debian.org>
+
+.SH SEE ALSO
+
+.BR debsums (1), \ dpkg-query (1)
+
diff --git a/rdebsums b/rdebsums
new file mode 100755
index 0000000..b8dc0c8
--- /dev/null
+++ b/rdebsums
@@ -0,0 +1,82 @@
+#! /usr/bin/perl
+
+# rdebsums: a wrapper around debsums to also check dependencies of a package
+# Copyright 2007 by Vincent Fourmond <fourm...@debian.org>
+# 
+# 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 St, Fifth Floor, Boston, MA  02110-1301 USA
+
+my $usage="rdebsums --help | --others [debsum options] package
+
+Runs debsums on package and all its dependencies. 
+\t--others\talso include Recommends and Suggests
+";
+
+
+
+if(grep(/^--others/, @ARGV)) {
+    print "Also running debsums on suggests and recommends\n";
+    $others = 1;
+    @ARGV = grep(!/^--others/, @ARGV)
+} else {
+    $others = 0;
+} 
+if(! (scalar @ARGV) || grep(/^--help/, @ARGV) ) {
+    print $usage;
+    exit 1;
+}
+
+my $pack = pop;
+my $options = join(" ", @ARGV);
+
+for my $p (dependencies($pack, $others)) {
+    print "\nRunning debsums $options $p:\n";
+    system "debsums $options $p";
+}
+
+# Gets all the installed dependencies of a package, including
+# recommends and suggests if the second argument is true.
+sub dependencies {
+    my $pack = shift;
+    my $also_not_depends = shift || 0;
+    my $ignore = shift || {};
+
+    # We first sanitize $pack:
+    if($pack =~ /([a-z0-9+.-]+)/) {
+        $pack = $1;
+    } else {
+        return ();
+    }
+    # We first get direct children:
+    my @direct_children;
+    my $dpkg_query_cmd = "dpkg-query -W -f '\${Depends}".
+        ($also_not_depends ? ' ${Recommends} ${Suggests}' : "").
+        "' $pack 2> /dev/null";
+    my $dpkg_query = `$dpkg_query_cmd`;
+    while($dpkg_query =~ /\([^)]+\)|([a-z0-9+.-]+)/g) {
+        if($1) {
+            push @direct_children, $1;
+        }
+    }
+        
+    $ignore->{$pack} = 1;
+    # Then, we add their dependencies
+    for my $subp (@direct_children) {
+        dependencies($subp, $also_not_depends, $ignore) unless 
+            $ignore->{$subp};
+        $ignore{$subp} = 1;
+    }
+    return (keys %{$ignore});
+}
+

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/debsums.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to