#! /usr/bin/perl use strict; use warnings; use Dpkg; use Dpkg::Gettext; use Dpkg::ErrorHandling qw(warning warnerror error failure unknown internerr syserr subprocerr usageerr $warnable_error $quiet_warnings); use Dpkg::Arch qw(debarch_eq); use Dpkg::Deps qw(@src_dep_fields %dep_field_type); use Dpkg::Fields qw(:list capit); use Dpkg::Compression; use Dpkg::Cdata; use Dpkg::Control; use Dpkg::Substvars; use Dpkg::Version qw(check_version); use Dpkg::Vars; use Dpkg::Changelog qw(parse_changelog); my @filesinarchive; my %dirincluded; my %notfileobject; my $fn; my $ur; my $varlistfile; my $controlfile; my $changelogfile; my $changelogformat; my $diff_ignore_regexp = ''; my $diff_ignore_default_regexp = ' # Ignore general backup files (?:^|/).*~$| # Ignore emacs recovery files (?:^|/)\.#.*$| # Ignore vi swap files (?:^|/)\..*\.swp$| # Ignore baz-style junk files or directories (?:^|/),,.*(?:$|/.*$)| # File-names that should be ignored (never directories) (?:^|/)(?:DEADJOE|\.cvsignore|\.arch-inventory|\.bzrignore|\.gitignore)$| # File or directory names that should be ignored (?:^|/)(?:CVS|RCS|\.deps|\{arch\}|\.arch-ids|\.svn|\.hg|_darcs|\.git| \.shelf|_MTN|\.bzr(?:\.backup|tags)?)(?:$|/.*$) '; # Take out comments and newlines $diff_ignore_default_regexp =~ s/^#.*$//mg; $diff_ignore_default_regexp =~ s/\n//sg; no warnings 'qw'; my @tar_ignore_default_pattern = qw( *.a *.la *.o *.so *.swp *~ ,,* .[#~]* .arch-ids .arch-inventory .bzr .bzr.backup .bzr.tags .bzrignore .cvsignore .deps .git .gitignore .hg .shelf .svn CVS DEADJOE RCS _MTN _darcs {arch} ); my $sourcestyle = 'X'; my $min_dscformat = 1; my $max_dscformat = 2; my $def_dscformat = "1.0"; # default format for -b my $expectprefix; # Compression my $compression = 'gzip'; my $comp_level = '9'; my $comp_ext = $comp_ext{$compression}; # Packages my %remove; my %override; # Files my %md5sum; my %size; my %type; # used by checktype my %filepatched; # used by checkdiff my %dirtocreate; # used by checkdiff my @tar_ignore; my $substvars = Dpkg::Substvars->new(); use POSIX; use Fcntl qw (:mode); use English; use File::Temp qw (tempfile); use Cwd; textdomain("dpkg-dev"); my @dsc_fields = (qw(Format Source Binary Architecture Version Origin Maintainer Uploaders Dm-Upload-Allowed Homepage Standards-Version Vcs-Browser Vcs-Arch Vcs-Bzr Vcs-Cvs Vcs-Darcs Vcs-Git Vcs-Hg Vcs-Mtn Vcs-Svn), @src_dep_fields); # Make sure patch doesn't get any funny ideas delete $ENV{'POSIXLY_CORRECT'}; my @exit_handlers = (); sub exit_handler { &$_ foreach ( reverse @exit_handlers ); exit(127); } $SIG{'INT'} = \&exit_handler; $SIG{'HUP'} = \&exit_handler; $SIG{'QUIT'} = \&exit_handler; sub version { printf _g("Debian %s version %s.\n"), $progname, $version; print _g(" Copyright (C) 1996 Ian Jackson and Klee Dienes."); print _g(" This is free software; see the GNU General Public Licence version 2 or later for copying conditions. There is NO warranty. "); } sub usage { printf _g( "Usage: %s [