This file is indexed.

/usr/bin/debget-madison is in debget 1.6+nmu1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/usr/bin/perl -w

eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
    if 0; # not running under some shell
use strict;

# $Id: debget-madison,v 1.2 2005-07-11 21:22:33 roderick Exp $

# XXX
#
# - unimplemented switches
#   -a, --architecture=ARCH    only show info for ARCH(s)
#   -b, --binary-type=TYPE     only show info for binary TYPE
#   -c, --component=COMPONENT  only show info for COMPONENT(s)
#   -g, --greaterorequal       show buildd 'dep-wait pkg >= {highest version}' info
#   -G, --greaterthan          show buildd 'dep-wait pkg >> {highest version}' info
#   -h, --help                 show this help and exit
#   -r, --regex                treat PACKAGE as a regex
#   -s, --suite=SUITE          only show info for this suite
#   -S, --source-and-binary    show info for the binary children of source pkgs
#   ARCH, COMPONENT and SUITE can be comma (or space) separated lists, e.g.
#     --architecture=m68k,i386

use Debian::Debget	qw(
    $Debug
    $Exit
    $Me
    cmp_debian_versions
    getopt
    madison
    xwarn
);

my $Version	= q$Revision: 1.2 $ =~ /(\d\S+)/ ? $1 : '?';

my @Option_spec = (
    'debug|d+'	=> \$Debug,
    'help'	=> sub { usage() },
    'version'	=> sub { print "$Me version $Version\n"; exit },
);

my $Usage = <<EOF;
usage: $Me [switch]... package...
switches:
     --debug		turn debugging on (multiple times for more)
     --help		show this and then die
     --version		show the version ($Version) and exit
Use \`perldoc $Me\' to see the full documentation.
EOF

sub usage {
    warn "$Me: ", @_ if @_;
    # Use exit() rather than die(), as Getopt::Long does eval().
    print STDERR $Usage;
    exit 1;
}

sub init {
    $| = 1;
    getopt -bundle, @Option_spec or usage if @ARGV;
}

# auric% ./madison xgraph
#     xgraph |   11.3.2-2 |        stable | source, alpha, arm, hppa, i386, ia64, m68k, mips, mipsel, powerpc, s390, sparc
#     xgraph |   11.3.2-2 |       testing | source, alpha, arm, hppa, i386, ia64, m68k, mips, mipsel, powerpc, s390, sparc
#     xgraph |   11.3.2-2 |      unstable | source, alpha, arm, hppa, i386, ia64, m68k, mips, mipsel, powerpc, s390, sparc

# merkel% madison libc6
#      libc6 | 2.2.5-11.8 |     oldstable | arm, hppa, i386, m68k, mips, mipsel, powerpc, s390, sparc
#      libc6 | 2.3.2.ds1-22 |        stable | arm, hppa, i386, m68k, mips, mipsel, powerpc, s390, sparc
#      libc6 | 2.3.2.ds1-22 |       testing | arm, hppa, i386, m68k, mips, mipsel, powerpc, s390, sparc
#      libc6 | 2.3.2.ds1-22 |      unstable | arm, hppa, i386, m68k, mips, mipsel, powerpc, s390, sparc
#      libc6 |    2.3.4-2 |  experimental | mips
#      libc6 |    2.3.4-3 |  experimental | sparc
#      libc6 |    2.3.5-1 |  experimental | i386, mipsel, powerpc

sub work {
    my ($package) = @_;

    my $r = madison $package;
    if (!$r || !%$r) {
	xwarn "couldn't get version info for $package\n";
	return;
    }

    my $fmt = "%10s | %10s | %13s | %s\n";
    my %ver_dist = %$r;

    for my $ver (sort cmp_debian_versions keys %ver_dist) {
    	for my $dist (sort keys %{ $ver_dist{$ver} }) {
	    printf $fmt, $package, $ver, $dist,
		join ", ", @{ $ver_dist{$ver}{$dist} };
	}
    }

}

sub main {
    init;
    @ARGV or usage "no package specified\n";
    work $_ for @ARGV;
    return 0;
}

$Exit = main || $Exit;
$Exit = 1 if $Exit && !($Exit % 256);
exit $Exit;

__END__

=head1 NAME

debget-madison - show what versions of a package are in Debian

=head1 SYNOPSIS

B<debget-madison> [I<switch>]... I<package>...

=head1 DESCRIPTION

B<debget-madison> shows what versions of a (source or binary) package
are available in Debian.  It's similar to the B<madison> tool, but it
can be used from anywhere on the Internet.

=head1 OPTIONS

=over 4

=item B<--debug>

Turn debugging on.  Specify multiple times for more detail.

=item B<--help>

Show the usage message and die.

=item B<--version>

Show the version number and exit.

=back

=head1 SEE ALSO

debget(1), L<http://packages.debian.org>

=head1 AVAILABILITY

The code is licensed under the GNU GPL and distributed as part of Debian.

=head1 AUTHOR

Roderick Schertler <roderick@argon.org>

=cut