#!/usr/bin/perl # # dpkg-genchanges # # Copyright © 1996 Ian Jackson # Copyright © 2000,2001 Wichert Akkerman # Copyright © 2006-2014 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 Carp; use Encode; use POSIX qw(:errno_h :locale_h); use Dpkg (); use Dpkg::Gettext; use Dpkg::Util qw(:list); use Dpkg::File; use Dpkg::Checksums; use Dpkg::ErrorHandling; use Dpkg::BuildProfiles qw(get_build_profiles parse_build_profiles evaluate_restriction_formula); use Dpkg::Arch qw(get_host_arch debarch_eq debarch_is); use Dpkg::Compression; use Dpkg::Control::Info; use Dpkg::Control::Fields; use Dpkg::Control; use Dpkg::Substvars; use Dpkg::Vars; use Dpkg::Changelog::Parse; use Dpkg::Dist::Files; use Dpkg::Version; textdomain('dpkg-dev'); my $controlfile = 'debian/control'; my $changelogfile = 'debian/changelog'; my $changelogformat; my $fileslistfile = 'debian/files'; my $uploadfilesdir = '..'; my $sourcestyle = 'i'; my $quiet = 0; my $host_arch = get_host_arch(); my @profiles = get_build_profiles(); my $changes_format = '1.8'; my %p2f; # - package to file map, has entries for "packagename" my %f2seccf; # - package to section map, from control file my %f2pricf; # - package to priority map, from control file my %sourcedefault; # - default values as taken from source (used for Section, # Priority and Maintainer) my @descriptions; my $checksums = Dpkg::Checksums->new(); my %remove; # - fields to remove my %override; my %archadded; my @archvalues; my $changesdescription; my $forcemaint; my $forcechangedby; my $since; my $substvars_loaded = 0; my $substvars = Dpkg::Substvars->new(); $substvars->set_as_auto('Format', $changes_format); use constant BUILD_SOURCE => 1; use constant BUILD_ARCH_DEP => 2; use constant BUILD_ARCH_INDEP => 4; use constant BUILD_BINARY => BUILD_ARCH_DEP | BUILD_ARCH_INDEP; use constant BUILD_SOURCE_DEP => BUILD_SOURCE | BUILD_ARCH_DEP; use constant BUILD_SOURCE_INDEP => BUILD_SOURCE | BUILD_ARCH_INDEP; use constant BUILD_ALL => BUILD_BINARY | BUILD_SOURCE; my $include = BUILD_ALL; sub build_is_default() { return ($include & BUILD_ALL) == BUILD_ALL; } sub build_opt { if ($include == BUILD_BINARY) { return '-b'; } elsif ($include == BUILD_ARCH_DEP) { return '-B'; } elsif ($include == BUILD_ARCH_INDEP) { return '-A'; } elsif ($include == BUILD_SOURCE) { return '-S'; } elsif ($include == BUILD_SOURCE_DEP) { return '-G'; } elsif ($include == BUILD_SOURCE_INDEP) { return '-g'; } else { croak "build_opt called with include=$include"; } } sub set_build_type { my ($build_type, $build_option) = @_; usageerr(g_('cannot combine %s and %s'), build_opt(), $build_option) if not build_is_default and $include != $build_type; $include = $build_type; } 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 [