|
|
@@ -1,4 +1,4 @@
|
|
|
-# Copyright © 2010 Raphaël Hertzog <hertzog@debian.org>
|
|
|
+# Copyright © 2010-2011 Raphaël Hertzog <hertzog@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
|
|
|
@@ -18,11 +18,12 @@ package Dpkg::BuildFlags;
|
|
|
use strict;
|
|
|
use warnings;
|
|
|
|
|
|
-our $VERSION = "1.00";
|
|
|
+our $VERSION = "1.01";
|
|
|
|
|
|
use Dpkg::Gettext;
|
|
|
use Dpkg::BuildOptions;
|
|
|
use Dpkg::ErrorHandling;
|
|
|
+use Dpkg::Path qw(find_build_file);
|
|
|
use Dpkg::Vendor qw(run_vendor_hook);
|
|
|
|
|
|
=encoding utf8
|
|
|
@@ -134,11 +135,26 @@ sub load_environment_config {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+=item $bf->load_package_config()
|
|
|
+
|
|
|
+Update flags based on directives stored in debian/buildflags
|
|
|
+and associated arch-specific variants.
|
|
|
+
|
|
|
+=cut
|
|
|
+
|
|
|
+sub load_package_config {
|
|
|
+ my ($self) = @_;
|
|
|
+ my $config = find_build_file("debian/buildflags");
|
|
|
+ if (defined $config) {
|
|
|
+ $self->update_from_conffile($config, undef);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
=item $bf->load_config()
|
|
|
|
|
|
-Call successively load_system_config(), load_user_config() and
|
|
|
-load_environment_config() to update the default build flags
|
|
|
-defined by the vendor.
|
|
|
+Call successively load_system_config(), load_user_config(),
|
|
|
+load_environment_config() and load_package_config() to update the default
|
|
|
+build flags defined by the vendor.
|
|
|
|
|
|
=cut
|
|
|
|
|
|
@@ -147,24 +163,26 @@ sub load_config {
|
|
|
$self->load_system_config();
|
|
|
$self->load_user_config();
|
|
|
$self->load_environment_config();
|
|
|
+ $self->load_package_config();
|
|
|
}
|
|
|
|
|
|
=item $bf->set($flag, $value, $source)
|
|
|
|
|
|
-Update the build flag $flag with value $value and record its origin as $source.
|
|
|
+Update the build flag $flag with value $value and record its origin as
|
|
|
+$source (if defined).
|
|
|
|
|
|
=cut
|
|
|
|
|
|
sub set {
|
|
|
my ($self, $flag, $value, $src) = @_;
|
|
|
$self->{flags}->{$flag} = $value;
|
|
|
- $self->{origin}->{$flag} = $src;
|
|
|
+ $self->{origin}->{$flag} = $src if defined $src;
|
|
|
}
|
|
|
|
|
|
=item $bf->append($flag, $value, $source)
|
|
|
|
|
|
Append the options listed in $value to the current value of the flag $flag.
|
|
|
-Record its origin as $source.
|
|
|
+Record its origin as $source (if defined).
|
|
|
|
|
|
=cut
|
|
|
|
|
|
@@ -175,7 +193,7 @@ sub append {
|
|
|
} else {
|
|
|
$self->{flags}->{$flag} = $value;
|
|
|
}
|
|
|
- $self->{origin}->{$flag} = $src;
|
|
|
+ $self->{origin}->{$flag} = $src if defined $src;
|
|
|
}
|
|
|
|
|
|
=item $bf->update_from_conffile($file, $source)
|
|
|
@@ -183,7 +201,7 @@ sub append {
|
|
|
Update the current build flags based on the configuration directives
|
|
|
contained in $file. See dpkg-buildflags(1) for the format of the directives.
|
|
|
|
|
|
-$source is the origin recorded for any build flag set or modified.
|
|
|
+If defined, $source is the origin recorded for any build flag set or modified.
|
|
|
|
|
|
=cut
|
|
|
|
|
|
@@ -261,6 +279,13 @@ sub list {
|
|
|
|
|
|
=back
|
|
|
|
|
|
+=head1 CHANGES
|
|
|
+
|
|
|
+=head2 Version 1.01
|
|
|
+
|
|
|
+New method: $bf->load_package_config(). This method is called last as part
|
|
|
+of load_config().
|
|
|
+
|
|
|
=head1 AUTHOR
|
|
|
|
|
|
Raphaël Hertzog <hertzog@debian.org>
|