]> git.donarmstrong.com Git - debhelper.git/commitdiff
Less code in the build system classes to call enforce_out_of_source_building().
authorModestas Vainius <modestas@vainius.eu>
Wed, 17 Jun 2009 21:56:57 +0000 (00:56 +0300)
committerModestas Vainius <modestas@vainius.eu>
Wed, 17 Jun 2009 21:56:57 +0000 (00:56 +0300)
Signed-off-by: Modestas Vainius <modestas@vainius.eu>
Debian/Debhelper/Buildsystem.pm
Debian/Debhelper/Buildsystem/cmake.pm
Debian/Debhelper/Buildsystem/python_distutils.pm
t/buildsystems/buildsystem_tests

index da43b7d76ee86f544bd7c3e01df6b2dca9e402ff..3ee37a5f84e1686de558ff858cbbf7005958356c 100644 (file)
@@ -119,13 +119,15 @@ sub enforce_in_source_building {
 
 # Derived class can call this method in its constructor to enforce
 # out of source building even if the user didn't request it. However,
-# if $builddir is specified, accept it even if it matches the source
-# directory (i.e. out of source is prefered to in source).
+# if 'builddir' named parameter is passed, accept its value as the
+# build directory even if it matches the source directory (meaning out
+# of source is only prefered to in source, not enforced).
 sub enforce_out_of_source_building {
-       my ($this, $builddir) = @_;
+       my $this=shift;
+       my %args=@_;
        if (!defined $this->get_builddir()) {
-               $this->_set_builddir($builddir);
-               if (!defined $this->get_builddir() && !$builddir) {
+               $this->_set_builddir($args{builddir});
+               if (!defined $this->get_builddir() && !$args{builddir}) {
                        # If we are here, DEFAULT_BUILD_DIRECTORY matches
                        # the source directory, building might fail.
                        error("default build directory is the same as the source directory." .
index c2a3769dd37ce78de15eb22ae3b58bcba51a7130..1ccab10ec72ca9b46460e942725d90107e3a2200 100644 (file)
@@ -24,9 +24,8 @@ sub check_auto_buildable {
 sub new {
        my $class=shift;
        my $this=$class->SUPER::new(@_);
-       my %args=@_;
        # Prefer out of source tree building.
-       $this->enforce_out_of_source_building($args{builddir});
+       $this->enforce_out_of_source_building(@_);
        return $this;
 }
 
index d05e381527655587aa0a1d4aee64bb8482560b23..ad4ea877598cd1db34c71cd59bc271bad0c3eef8 100644 (file)
@@ -24,9 +24,8 @@ sub DEFAULT_BUILD_DIRECTORY {
 sub new {
        my $class=shift;
        my $this=$class->SUPER::new(@_);
-       my %args=@_;
        # Out of source tree building is prefered.
-       $this->enforce_out_of_source_building($args{builddir});
+       $this->enforce_out_of_source_building(@_);
        return $this;
 }
 
index 42d7f5848a7f7e6c78cec8a580b27d79f5a467bd..82d8c1005daf7271c0002a72a99a31522fdbd5a9 100755 (executable)
@@ -162,8 +162,8 @@ test_buildsystem_paths_api($bs, "no builddir, sourcedir=autoconf", \%tmp);
 
 # Prefer out of source tree building when
 # sourcedir=builddir=autoconf hence builddir should be dropped.
-$bs->enforce_out_of_source_building("autoconf");
-test_buildsystem_paths_api($bs, "soft out of source enforced, sourcedir=builddir", \%tmp);
+$bs->enforce_out_of_source_building(builddir => "autoconf");
+test_buildsystem_paths_api($bs, "out of source prefered, sourcedir=builddir", \%tmp);
 
 # builddir=bld/dir, sourcedir=autoconf. Should be the same as sourcedir=autoconf.
 $bs = $BS_CLASS->new(builddir => "bld/dir", sourcedir => "autoconf");