0
  6   -ˆl–Ü4ý(TÐ;â�À·q ©‹Fÿ�þD7Æ³�ÂˆFÚóÝ„ŸÜÈÚ *š    -#!/usr/bin/perl
#
# dpkg-gensymbols
#
# Copyright Â© 2007 RaphaÃ«l Hertzog
# Copyright Â© 2007-2013 Guillem Jover <guillem@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 strict;
use warnings;

use Dpkg ();
use Dpkg::Arch qw(get_host_arch);
use Dpkg::Package;
use Dpkg::Shlibs qw(get_library_paths);
use Dpkg::Shlibs::Objdump;
use Dpkg::Shlibs::SymbolFile;
use Dpkg::Gettext;
use Dpkg::ErrorHandling;
use Dpkg::Control::Info;
use Dpkg::Changelog::Parse;
use Dpkg::Path qw(check_files_are_the_same find_command);

textdomain('dpkg-dev');

my $packagebuilddir = 'debian/tmp';

my $sourceversion;
my $stdout;
my $oppackage;
my $compare = 1; # Bail on missing symbols by default
my $quiet = 0;
my $input;
my $output;
my $template_mode = 0; # non-template mode by default
my $verbose_output = 0;
my $debug = 0;
my $host_arch = get_host_arch();

sub version {
    printf g_("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION;

    printf g_('
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
');
}

sub usage {
    printf g_(
'Usage: %s [<option>...]')
    . "\n\n" . g_(
'Options:
  -l<library-path>         add directory to private shared library search list.
  -p<package>              generate symbols file for package.
  -P<package-build-dir>    temporary build directory instead of debian/tmp.
  -e<library>              explicitly list libraries to scan.
  -v<version>              version of the packages (defaults to
                           version extracted from debian/changelog).
  -c<level>                compare generated symbols file with the reference
                           template in the debian directory and fail if
                           difference is too important; level goes from 0 for
                           no check, to 4 for all checks (default level is 1).
  -q                       keep quiet and never emit any warnings or
                           generate a diff between generated symbols
                           file and the reference template.
  -I<file>                 force usage of <file> as reference symbols
                           file instead of the default file.
  -O[<file>]               write to stdout (or <file>), not .../DEBIAN/symbols.
  -t                       write in template mode (tags are not
                           processed and included in output).
  -V                       verbose output; write deprecated symbols and pattern
                           matching symbols as comments (in template mode only).
  -a<arch>                 assume <arch> as host architecture when processing
                           symbol files.
  -d                       display debug information during work.
  -?, --help               show this help message.
      --version            show the version.
'), $Dpkg::PROGNAME;
}

my @files;
while (@ARGV) {
    $_ = shift(@ARGV);
    if (m/^-p/p) {
	$oppackage = ${^POSTMATCH};
	my $err = pkg_name_is_illegal($oppackage);
	error(g_("illegal package name '%s': %s"), $oppackage, $err) if $err;
    } elsif (m/^-l(.*)$/) {
        Dpkg::Shlibs::add_library_dir($1);
    } elsif (m/^-c(\d)?$/) {
	$compare = $1 // 1;
    } elsif (m/^-q$/) {
	$quiet = 1;
    } elsif (m/^-d$/) {
	$debug = 1;
    } elsif (m/^-v(.+)$/) {
	$sourceversion = $1;
    } elsif (m/^-e(.+)$/) {
	my $file = $1;
	if (-e $file) {
	    push @fil