[debhelper-devel] [debhelper] 02/04: Add doit_in_sourcedir_noerror and doit_in_builddir_noerror in Buildsystem.pm

Niels Thykier nthykier at moszumanska.debian.org
Wed May 20 19:54:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit f581e5d4ea5ca7b22fdb9edc8b0aa77093ee60d4
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Wed May 20 14:35:08 2015 +0200

    Add doit_in_sourcedir_noerror and doit_in_builddir_noerror in Buildsystem.pm
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 Debian/Debhelper/Buildsystem.pm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/Debian/Debhelper/Buildsystem.pm b/Debian/Debhelper/Buildsystem.pm
index 3043c79..7f5819f 100644
--- a/Debian/Debhelper/Buildsystem.pm
+++ b/Debian/Debhelper/Buildsystem.pm
@@ -310,6 +310,23 @@ sub doit_in_sourcedir {
 	return 1;
 }
 
+# Changes working directory to the source directory (if needed),
+# calls print_and_doit(@_) and changes working directory back to the
+# top directory. Errors are ignored.
+sub doit_in_sourcedir_noerror {
+        my $this=shift;
+        if ($this->get_sourcedir() ne '.') {
+                my $sourcedir = $this->get_sourcedir();
+                $this->_cd($sourcedir);
+                print_and_doit_noerror(@_);
+                $this->_cd($this->_rel2rel($this->{cwd}, $sourcedir));
+        }
+        else {
+                print_and_doit_noerror(@_);
+        }
+        return 1;
+}
+
 # Changes working directory to the build directory (if needed),
 # calls print_and_doit(@_) and changes working directory back to the
 # top directory.
@@ -327,6 +344,23 @@ sub doit_in_builddir {
 	return 1;
 }
 
+# Changes working directory to the build directory (if needed),
+# calls print_and_doit(@_) and changes working directory back to the
+# top directory. Errors are ignored.
+sub doit_in_builddir_noerror {
+        my $this=shift;
+        if ($this->get_buildpath() ne '.') {
+                my $buildpath = $this->get_buildpath();
+                $this->_cd($buildpath);
+                print_and_doit_noerror(@_);
+                $this->_cd($this->_rel2rel($this->{cwd}, $buildpath));
+        }
+        else {
+                print_and_doit_noerror(@_);
+        }
+        return 1;
+}
+
 # In case of out of source tree building, whole build directory
 # gets wiped (if it exists) and 1 is returned. If build directory
 # had 2 or more levels, empty parent directories are also deleted.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list