#!/usr/bin/perl # # Copyright © 1999 Roderick Schertler # Copyright © 2002 Wichert Akkerman # Copyright © 2006-2009 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 no_ignorecase); use Dpkg; use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Control; use Dpkg::Checksums; use Dpkg::Compression::FileHandle; use Dpkg::Compression; textdomain("dpkg-dev"); # Errors with a single package are warned about but don't affect the # exit code. Only errors which affect everything cause a non-zero exit. my $Exit = 0; # %Override is a hash of lists. The subs following describe what's in # the lists. my %Override; sub O_PRIORITY () { 0 } sub O_SECTION () { 1 } sub O_MAINT_FROM () { 2 } # undef for non-specific, else listref sub 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 @Option_spec = ( 'debug!' => \$Debug, 'help!' => \&usage, 'no-sort|n' => \$No_sort, 'source-override|s=s' => \$Src_override, 'extra-override|e=s' => \$Extra_override_file, 'version' => \&version, ); sub debug { print @_, "\n" if $Debug; } sub version { printf _g("Debian %s version %s.\n"), $progname, $version; exit; } sub usage { printf _g( "Usage: %s [