128
  ;   +ˆl–Ü4ý(”Ëm
qAàCq§ÔÅ£“þDëË8Ûd•Ù ¥hMìÕÿ?ÙÑÐØ‚d!ËÃÖ 7    +‹      }R]KÃ0}Ï¯8¾¬®HûÆ@p >	º7›v·[F›[’t:Æþ»íné:ßÂùºç&1uÃ. àæøšï©(×ˆ’ôëŠ%{-”é–Âû±Î¹ò/ö*ž¢"WicEA2‰pÐÎè¼"dÛŠs]­wÆgˆSU°õ¢y	,Žq‰í["âK£³Ù”¹ë(ÛVÕ-œ+uäpº¡¥£BŒ'nyð·…¶»#gmàe't=2Ï­+(C`dÒ"K:sïlœ9è@rÖN×8ÉÄ3Ä†õŽ ®> ¿Û1¼¿Ää/ë‡–§óçþÀâvZgýÕÿ6 Óº©*[[Ãö2>Ú½ô|†ÌqR€$N~Ç¨š¾÷ ÎGïB�•¢ŸËwÙP©Û*Ü[¨_`wZNx    8   -ˆl—Ým_JÕ4Ò‚ ™PLÜleLZ7ÿ�þ\eÑ,Ü±‰–A£üÿÚ„m6÷ÙÄ× ?÷     -#!/usr/bin/perl

#
#  Check installed files against package md5sums or debs.
#

use strict;
use warnings;

use File::Find 'find';
use File::Temp 'tempdir';
use File::Path 'rmtree';
use File::Copy 'copy';
use Fcntl qw/O_RDONLY O_NONBLOCK O_NOATIME/;
use Getopt::Long qw/:config bundling/;
use Digest::MD5;
use constant ELF_MAGIC => "\177ELF";
use Errno;
use POSIX;
use File::Basename;
use File::Spec;
use Dpkg::Conf;
use File::FnMatch qw(:fnmatch);

sub version {
    my $changelog = File::Spec->catfile(dirname($0), "debian", "changelog");
    my $cmd;
    if (-f $changelog) {
        $cmd = qq(dpkg-parsechangelog -SVersion '-l$changelog');
    } else {
        $cmd = q(dpkg-query -W -f '${Version}' debsums);
    }
    my $res = `$cmd`;
    chomp($res);
    if ($res !~ /^[0-9.~a-z+]+$/) {
        $res = "";
    }
    return $res;
}

(my $self = $0) =~ s!.*/!!;

sub version_info {
    my $version_number = version();
    my $version = <<"EOT";
$self $version_number

Copyright (c) 2002, 2004, 2005, 2006, 2007  Brendan O'Dea <bod\@debian.org>
This is free software, licensed under the terms of the GNU General Public
License.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Written by Brendan O'Dea <bod\@debian.org>, based on a program by
Christoph Lameter <clameter\@debian.org> and Petr Cech <cech\@debian.org>.
EOT
    return $version;
}

my $help = <<"EOT";
$self checks the MD5 sums of installed debian packages.

Usage: $self [OPTIONS] [PACKAGE|DEB] ...

Options:
 -a, --all                    check configuration files (normally excluded)
 -e, --config                 check only configuration files
 -c, --changed                report changed files (implies -s)
 -l, --list-missing           list packages which don't have an md5sums file
 -s, --silent                 only report errors
 -m, --md5sums=FILE           read list of deb checksums from FILE
 -x, --report-mismatches      report errors and print the md5sums mismatch
 -r, --root=DIR               root directory to check (default /)
 -d, --admindir=DIR           dpkg admin directory (default /var/lib/dpkg)
 -p, --deb-path=DIR[:DIR...]  search path for debs
 -g, --generate=[all][,keep[,nocheck]]
                              generate md5sums from deb contents
     --no-locale-purge        report missing locale files even if localepurge
                              is configured
     --no-prelink             report changed ELF files even if prelink is
                              configured
     --ignore-obsolete        ignore obsolete conffiles.
     --help                   print this help, then exit
     --version                print version number, then exit
EOT

my $gen_opt;
GetOptions (
    'a|all'		=> \my $all,
    'e|config'		=> \my $config,
    'c|changed'		=> \my $changed,
    'l|list-missing'    => \my $missing,
    's|silent'		=> \my $silent,
    'x|report-mismatches'   => \my $report,
    'm|md5sums=s'	=> \my $md5sums,
    'r|root=s'		=> \my $root,
    'd|admindir=s'	=> \my $admindir,
    'p|deb-path=s'	=> \my $debpath,
    'generate=s'	=> \$gen_opt,
    'locale-purge!'	=> \my $localepurge,
    'prelink!'		=> \my $prelink,
    'ignore-permissions' => \my $ignore_permissions,
    'ignore-obsolete!'  => \my $ignore_obsolete,
    g			=> sub { $gen_opt = 'missing' },
    help		=> sub { print $help; exit },
    version		=> sub { print version_info(); exit },
) or die "Try '$self --help' for more information.\n";

sub can_ignore {
  return $!{EACCES} && $ignore_permissions && getuid();
}

my $my_noatime = 0;
eval { $my_noatime = O_NOATIME };

sub warn_or_die {
    if (ca