#!/usr/bin/perl use strict; use warnings; use POSIX; use POSIX qw(:errno_h :signal_h); use English; use Dpkg; use Dpkg::Gettext; use Dpkg::Checksums; use Dpkg::ErrorHandling qw(warning error failure unknown internerr syserr subprocerr usageerr); use Dpkg::Arch qw(get_host_arch debarch_eq debarch_is); use Dpkg::Fields qw(:list capit); use Dpkg::Compression; use Dpkg::Control; use Dpkg::Cdata; use Dpkg::Substvars; use Dpkg::Vars; use Dpkg::Changelog qw(parse_changelog); use Dpkg::Version qw(parseversion compare_versions); textdomain("dpkg-dev"); my @changes_fields = qw(Format Date Source Binary Architecture Version Distribution Urgency Maintainer Changed-By Description Closes Changes Checksums-Md5 Checksums-Sha1 Checksums-Sha256 Files); my $controlfile = 'debian/control'; my $changelogfile = 'debian/changelog'; my $changelogformat; my $fileslistfile = 'debian/files'; my $varlistfile = 'debian/substvars'; my $uploadfilesdir = '..'; my $sourcestyle = 'i'; my $quiet = 0; my $host_arch = get_host_arch(); my $changes_format = "1.8"; my %f2p; # - file to package map my %p2f; # - package to file map, has entries for "packagename" my %pa2f; # - likewise, has entries for "packagename architecture" my %p2ver; # - package to version map my %p2arch; # - package to arch map my %f2sec; # - file to section map my %f2seccf; # - likewise, from control file my %f2pri; # - file to priority map my %f2pricf; # - likewise, from control file my %sourcedefault; # - default values as taken from source (used for Section, # Priority and Maintainer) my @descriptions; my @sourcefiles; my @fileslistfiles; my %checksum; # - file to checksum map my %size; # - file to size map my %remove; # - fields to remove my %override; my %archadded; my @archvalues; my $dsc; my $changesdescription; my $forcemaint; my $forcechangedby; my $since; my $substvars = Dpkg::Substvars->new(); $substvars->set("Format", $changes_format); use constant SOURCE => 1; use constant ARCH_DEP => 2; use constant ARCH_INDEP => 4; use constant BIN => ARCH_DEP | ARCH_INDEP; use constant ALL => BIN | SOURCE; my $include = ALL; sub is_sourceonly() { return $include == SOURCE; } sub is_binaryonly() { return !($include & SOURCE); } sub binary_opt() { return (($include == BIN) ? '-b' : (($include == ARCH_DEP) ? '-B' : (($include == ARCH_INDEP) ? '-A' : internerr("binary_opt called with include=$include")))); } sub version { printf _g("Debian %s version %s.\n"), $progname, $version; printf _g(" Copyright (C) 1996 Ian Jackson. Copyright (C) 2000,2001 Wichert Akkerman."); printf _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 [