MAJOR=4
MINOR=58
DEVNAME=tty58
  7   ˆl–äY>”Ên-ji@¿pB¸ÈÅ£�þYf1¬à„ãñŒBy÷�üÿÌ„"h_ËÀÉ 3º    #!/usr/bin/perl
# vim: set ai shiftwidth=4 tabstop=4 expandtab:
# Grep debian testing excuses file.
#
# Copyright 2002 Joey Hess <joeyh@debian.org>
# Small mods Copyright 2002 Julian Gilbey <jdg@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, see <https://www.gnu.org/licenses/>.

use 5.006;
use strict;
use warnings;
use Data::Dumper;
use File::Basename;
use File::HomeDir;

sub require_friendly ($) {
    my ($mod) = @_;
    return if eval "require $mod;";
    my $pkg = lc $mod;
    $pkg =~ s/::/-/g;
    $pkg = "lib$pkg-perl";
    die <<END;
$@
grep-excuses: We need $mod.  Try installing $pkg.
END
}

# Needed for --wipnity option

open DEBUG, ">/dev/null" or die $!;
my $do_autoremovals = 1;
my $do_autopkgtests;

my $term_size_broken;

sub have_term_size {
    return ($term_size_broken ? 0 : 1) if defined $term_size_broken;
    pop @INC                           if $INC[-1] eq '.';
    # Load the Term::Size module safely
    eval { require Term::Size; };
    if ($@) {
        if ($@ =~ /^Can\'t locate Term\/Size\.pm/) {
            $term_size_broken
              = "the libterm-size-perl package is not installed";
        } else {
            $term_size_broken = "couldn't load Term::Size: $@";
        }
    } else {
        $term_size_broken = 0;
    }

    return ($term_size_broken ? 0 : 1);
}

my $progname = basename($0);
my $modified_conf_msg;

my $url = 'https://release.debian.org/britney/excuses.yaml';
my $url_experimental
  = 'https://release.debian.org/britney/pseudo-excuses-experimental.yaml';

my $rmurl      = 'https://udd.debian.org/cgi-bin/autoremovals.cgi';
my $rmurl_yaml = 'https://udd.debian.org/cgi-bin/autoremovals.yaml.cgi';

my $wipnityurl = 'https://qa.debian.org/excuses.php?package=';
my $wipnityurl_experimental
  = 'https://qa.debian.org/excuses.php?experimental=1&package=';

# No longer use these - see bug#309802
my $cachedir  = File::HomeDir->my_home . "/.devscripts_cache/";
my $cachefile = $cachedir . basename($url);
unlink $cachefile if -f $cachefile;

sub usage {
    print <<"EOF";
Usage: $progname [options] [<maintainer>|<package>]
  Grep the Debian update_excuses file to find out about the packages
  of <maintainer> or <package>.  If neither are given, use the configuration
  file setting or the environment variable DEBFULLNAME to determine the
  maintainer name.
Options:
  --no-conf, --noconf Don\'t read devscripts config files;
                      must be the first option given
  --wipnity, -w       Check <https://qa.debian.org/excuses.php>.  A package
                      name must be given when using this option.
  --autopkgtests      Investigate and show autopkgtest (ci.debian.net) failures
  --no-autoremovals   Do not investigate and report autoremovals
  --experimental, -e  Print pseudo-excuses for experimental
  --help              Show this help
  --version           Give version information
  --debug             Print debugging output to stderr

Default settings modified by devscripts configuration files:
$modified_conf_msg
EOF
}

my $version = <<"EOF";
This is $progname, from the Debian devscripts package, version 2.23.4+deb12u2
This code is copyright 2002 by Joey Hess <joeyh\@debian.org>,
and modifications are copyright 2002 by Julian Gilbey <jdg\@debian.org>
This program comes with ABSOLUTELY NO WARRANTY.
You are free to redistribute this code under the terms of the
GNU General Public License, version 2 or later.
EOF

sub wipni