The following commit has been merged in the master branch:
commit 8db43e1c6cf8c77d1f49f42f0ec4bb67cbf0e86c
Author: Guillem Jover <[email protected]>
Date: Sun Apr 21 07:04:35 2013 +0200
Dpkg: Use identifiers as key names whenever possible
The fixed key names are either inside unstable modules, internal to
them or for keys in code never released, so should not cause much of
an issue.
diff --git a/scripts/Dpkg/BuildFlags.pm b/scripts/Dpkg/BuildFlags.pm
index 934ae94..f999eb5 100644
--- a/scripts/Dpkg/BuildFlags.pm
+++ b/scripts/Dpkg/BuildFlags.pm
@@ -71,7 +71,7 @@ sub load_vendor_defaults {
$self->{'source'} = {};
$self->{'features'} = {};
my $build_opts = Dpkg::BuildOptions->new();
- $self->{'build-options'} = $build_opts;
+ $self->{'build_options'} = $build_opts;
my $default_flags = $build_opts->has("noopt") ? "-g -O0" : "-g -O2";
$self->{flags} = {
CPPFLAGS => '',
diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm
index d641b7d..4fe39d2 100644
--- a/scripts/Dpkg/Deps.pm
+++ b/scripts/Dpkg/Deps.pm
@@ -1219,7 +1219,7 @@ sub add_installed_package {
"package" => $pkg,
"version" => $ver,
"architecture" => $arch,
- "multi-arch" => $multiarch || "no",
+ "multiarch" => $multiarch || "no",
};
$self->{pkg}{"$pkg:$arch"} = $p if defined $arch;
push @{$self->{pkg}{$pkg}}, $p;
@@ -1277,7 +1277,7 @@ sub _find_package {
my $build_arch = $dep->{build_arch};
foreach my $p (@{$self->{pkg}{$pkg}}) {
my $a = $p->{"architecture"};
- my $ma = $p->{"multi-arch"};
+ my $ma = $p->{"multiarch"};
if (not defined $a) {
$$lackinfos = 1;
next;
diff --git a/scripts/Dpkg/Source/Package/V3/git.pm
b/scripts/Dpkg/Source/Package/V3/git.pm
index 998fdb8..b1e4a0d 100644
--- a/scripts/Dpkg/Source/Package/V3/git.pm
+++ b/scripts/Dpkg/Source/Package/V3/git.pm
@@ -76,10 +76,10 @@ sub parse_cmdline_option {
my ($self, $opt) = @_;
return 1 if $self->SUPER::parse_cmdline_option($opt);
if ($opt =~ /^--git-ref=(.*)$/) {
- push @{$self->{'options'}{'git-ref'}}, $1;
+ push @{$self->{'options'}{'git_ref'}}, $1;
return 1;
} elsif ($opt =~ /^--git-depth=(\d+)$/) {
- $self->{'options'}{'git-depth'} = $1;
+ $self->{'options'}{'git_depth'} = $1;
return 1;
}
return 0;
@@ -138,7 +138,7 @@ sub do_build {
# bundle that.
my $tmp;
my $shallowfile;
- if ($self->{'options'}{'git-depth'}) {
+ if ($self->{'options'}{'git_depth'}) {
chdir($old_cwd) ||
syserr(_g("unable to chdir to `%s'"), $old_cwd);
$tmp = tempdir("$dirname.git.XXXXXX", DIR => $updir);
@@ -147,8 +147,8 @@ sub do_build {
# file:// is needed to avoid local cloning, which does not
# create a shallow clone.
info(_g("creating shallow clone with depth %s"),
- $self->{'options'}{'git-depth'});
- system("git", "clone", "--depth=".$self->{'options'}{'git-depth'},
+ $self->{'options'}{'git_depth'});
+ system("git", "clone", "--depth=" . $self->{'options'}{'git_depth'},
"--quiet", "--bare", "file://" . abs_path($dir), $clone_dir);
$? && subprocerr("git clone");
chdir($clone_dir) ||
@@ -160,8 +160,8 @@ sub do_build {
# Create the git bundle.
my $bundlefile = "$basenamerev.git";
- my @bundle_arg=$self->{'options'}{'git-ref'} ?
- (@{$self->{'options'}{'git-ref'}}) : "--all";
+ my @bundle_arg = $self->{'options'}{'git_ref'} ?
+ (@{$self->{'options'}{'git_ref'}}) : "--all";
info(_g("bundling: %s"), join(" ", @bundle_arg));
system("git", "bundle", "create", "$old_cwd/$bundlefile",
@bundle_arg,
diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm
b/scripts/Dpkg/Source/Package/V3/quilt.pm
index b41c64d..dee4c17 100644
--- a/scripts/Dpkg/Source/Package/V3/quilt.pm
+++ b/scripts/Dpkg/Source/Package/V3/quilt.pm
@@ -38,10 +38,10 @@ our $CURRENT_MINOR_VERSION = "0";
sub init_options {
my ($self) = @_;
- $self->{'options'}{'single-debian-patch'} = 0
- unless exists $self->{'options'}{'single-debian-patch'};
- $self->{'options'}{'allow-version-of-quilt-db'} = []
- unless exists $self->{'options'}{'allow-version-of-quilt-db'};
+ $self->{'options'}{'single_debian_patch'} = 0
+ unless exists $self->{'options'}{'single_debian_patch'};
+ $self->{'options'}{'allow_version_of_quilt_db'} = []
+ unless exists $self->{'options'}{'allow_version_of_quilt_db'};
$self->SUPER::init_options();
}
@@ -50,12 +50,12 @@ sub parse_cmdline_option {
my ($self, $opt) = @_;
return 1 if $self->SUPER::parse_cmdline_option($opt);
if ($opt =~ /^--single-debian-patch$/) {
- $self->{'options'}{'single-debian-patch'} = 1;
+ $self->{'options'}{'single_debian_patch'} = 1;
# For backwards compatibility.
$self->{'options'}{'auto_commit'} = 1;
return 1;
} elsif ($opt =~ /^--allow-version-of-quilt-db=(.*)$/) {
- push @{$self->{'options'}{'allow-version-of-quilt-db'}}, $1;
+ push @{$self->{'options'}{'allow_version_of_quilt_db'}}, $1;
return 1;
}
return 0;
@@ -80,7 +80,7 @@ sub can_build {
sub get_autopatch_name {
my ($self) = @_;
- if ($self->{'options'}{'single-debian-patch'}) {
+ if ($self->{'options'}{'single_debian_patch'}) {
return "debian-changes";
} else {
return "debian-changes-" . $self->{'fields'}{'Version'};
@@ -178,7 +178,7 @@ sub do_build {
if (defined($version) and $version != 2) {
if (scalar grep { $version eq $_ }
- @{$self->{'options'}{'allow-version-of-quilt-db'}})
+ @{$self->{'options'}{'allow_version_of_quilt_db'}})
{
warning(_g("unsupported version of the quilt metadata: %s"),
$version);
} else {
diff --git a/scripts/Dpkg/Source/Quilt.pm b/scripts/Dpkg/Source/Quilt.pm
index 6c0d439..f5304fc 100644
--- a/scripts/Dpkg/Source/Quilt.pm
+++ b/scripts/Dpkg/Source/Quilt.pm
@@ -82,7 +82,7 @@ sub load_db {
my ($self) = @_;
my $pc_applied = $self->get_db_file("applied-patches");
- $self->{'applied-patches'} = [ $self->read_patch_list($pc_applied) ];
+ $self->{'applied_patches'} = [ $self->read_patch_list($pc_applied) ];
}
sub write_db {
@@ -92,7 +92,7 @@ sub write_db {
my $pc_applied = $self->get_db_file("applied-patches");
open(my $applied_fh, ">", $pc_applied) or
syserr(_g("cannot write %s"), $pc_applied);
- foreach my $patch (@{$self->{'applied-patches'}}) {
+ foreach my $patch (@{$self->{'applied_patches'}}) {
print $applied_fh "$patch\n";
}
close($applied_fh);
@@ -112,19 +112,19 @@ sub series {
sub applied {
my ($self) = @_;
- return @{$self->{'applied-patches'}};
+ return @{$self->{'applied_patches'}};
}
sub top {
my ($self) = @_;
- my $count = scalar @{$self->{'applied-patches'}};
- return $self->{'applied-patches'}[$count - 1] if $count;
+ my $count = scalar @{$self->{'applied_patches'}};
+ return $self->{'applied_patches'}[$count - 1] if $count;
return;
}
sub next {
my ($self) = @_;
- my $count_applied = scalar @{$self->{'applied-patches'}};
+ my $count_applied = scalar @{$self->{'applied_patches'}};
my $count_series = scalar @{$self->{'series'}};
return $self->{'series'}[$count_applied] if ($count_series >
$count_applied);
return;
@@ -158,7 +158,7 @@ sub push {
erasedir($self->get_db_file($patch));
die $@;
}
- CORE::push @{$self->{'applied-patches'}}, $patch;
+ CORE::push @{$self->{'applied_patches'}}, $patch;
$self->write_db();
}
@@ -189,7 +189,7 @@ sub pop {
}
erasedir($backup_dir);
- pop @{$self->{'applied-patches'}};
+ pop @{$self->{'applied_patches'}};
$self->write_db();
}
diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index fcfce17..8db8bbd 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -135,7 +135,7 @@ sub add_hardening_flags {
}
# Mask features that might be influenced by other flags.
- if ($flags->{'build-options'}->has('noopt')) {
+ if ($flags->{'build_options'}->has('noopt')) {
# glibc 2.16 and later warn when using -O0 and _FORTIFY_SOURCE.
$use_feature{'fortify'} = 0;
}
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]