]> git.donarmstrong.com Git - bin.git/blob - check_packages
add reset usb bus command
[bin.git] / check_packages
1 #!/usr/bin/perl
2 # check_packages checks debian packages, and is released
3 # under the terms of the GPL version 2, or any later version, at your
4 # option. See the file README and COPYING for more information.
5 # Copyright 2007 by Don Armstrong <don@donarmstrong.com>.
6
7 use warnings;
8 use strict;
9
10 use Getopt::Long;
11 use Pod::Usage;
12
13 =head1 NAME
14
15 check_packages - Checks packages
16
17 =head1 SYNOPSIS
18
19  [options]
20
21  Options:
22   --verbose, -v verbose level (Default 0)
23   --debug, -d debugging level (Default 0)
24   --help, -h display this help
25   --man, -m display manual
26
27 =head1 OPTIONS
28
29 =over
30
31 =item B<--verbose,-v>
32
33 Verbosity (Default 0)
34
35 =item B<--debug, -d>
36
37 Debug verbosity. (Default 0)
38
39 =item B<--help, -h>
40
41 Display brief useage information.
42
43 =item B<--man, -m>
44
45 Display this manual.
46
47 =back
48
49 =cut
50
51
52 use vars qw($DEBUG);
53
54 my %options = (debug           => 0,
55                help            => 0,
56                man             => 0,
57                );
58
59 GetOptions(\%options,'verbose|v+','debug|d+','help|h|?','man|m');
60
61 pod2usage() if $options{help};
62 pod2usage({verbose=>2}) if $options{man};
63
64 $DEBUG = $options{debug};
65
66
67 use File::Basename qw(basename);
68
69 for my $file (glob($ENV{HOME}.'/deb_pkgs/*')) {
70      chomp $file;
71      my $base = basename($file);
72      next unless -d "$ENV{HOME}/deb_pkgs/$base/$base/.svn" and -x "$ENV{HOME}/deb_pkgs/$base/$base/debian/rules";
73      print "Checking $base\n" if $options{verbose};
74      my $olddir = chdir("$ENV{HOME}/deb_pkgs/$base/");
75      system('uscan',$base);
76      chdir($olddir);
77 }
78
79 __END__
80