From cbffab246997fb5a06211dfb706b54e5ae5bb59f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:58:51 +0200 Subject: Adding upstream version 1.21.22. Signed-off-by: Daniel Baumann --- scripts/dpkg-scansources.pl | 326 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 326 insertions(+) create mode 100755 scripts/dpkg-scansources.pl (limited to 'scripts/dpkg-scansources.pl') diff --git a/scripts/dpkg-scansources.pl b/scripts/dpkg-scansources.pl new file mode 100755 index 0000000..da19ba7 --- /dev/null +++ b/scripts/dpkg-scansources.pl @@ -0,0 +1,326 @@ +#!/usr/bin/perl +# +# Copyright © 1999 Roderick Schertler +# Copyright © 2002 Wichert Akkerman +# Copyright © 2006-2009, 2011-2015 Guillem Jover +# +# 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 . + +use strict; +use warnings; + +use Getopt::Long qw(:config posix_default bundling_values no_ignorecase); +use List::Util qw(any); +use File::Find; + +use Dpkg (); +use Dpkg::Gettext; +use Dpkg::ErrorHandling; +use Dpkg::Control; +use Dpkg::Checksums; +use Dpkg::Compression::FileHandle; +use Dpkg::Compression; + +textdomain('dpkg-dev'); + +# Hash of lists. The constants below describe what is in the lists. +my %override; +use constant { + O_PRIORITY => 0, + O_SECTION => 1, + O_MAINT_FROM => 2, # undef for non-specific, else listref + O_MAINT_TO => 3, # undef if there's no maint override +}; + +my %extra_override; + +my %priority = ( + 'extra' => 1, + 'optional' => 2, + 'standard' => 3, + 'important' => 4, + 'required' => 5, +); + +# Switches + +my $debug = 0; +my $no_sort = 0; +my $src_override = undef; +my $extra_override_file = undef; +my @sources; + +my @option_spec = ( + 'debug!' => \$debug, + 'help|?' => sub { usage(); exit 0; }, + 'version' => sub { version(); exit 0; }, + 'no-sort|n' => \$no_sort, + 'source-override|s=s' => \$src_override, + 'extra-override|e=s' => \$extra_override_file, +); + +sub version { + printf g_("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; +} + +sub usage { + printf g_( +"Usage: %s [