[pkg-perl-tools] 01/03: Apply patch using Git::Repository->run

Alex Muntada alexm-guest at moszumanska.debian.org
Thu Nov 3 00:55:17 UTC 2016


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

alexm-guest pushed a commit to branch master
in repository pkg-perl-tools.

commit cb59e3255b9d10ab2babde6a4214d566b6a73fb5
Author: Alex Muntada <alexm at alexm.org>
Date:   Thu Nov 3 01:39:53 2016 +0100

    Apply patch using Git::Repository->run
    
    Thanks: gregor herrmann
---
 lib/Debian/PkgPerl/GitHub.pm | 2 +-
 t/github.t                   | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/Debian/PkgPerl/GitHub.pm b/lib/Debian/PkgPerl/GitHub.pm
index a2396df..3d90f92 100644
--- a/lib/Debian/PkgPerl/GitHub.pm
+++ b/lib/Debian/PkgPerl/GitHub.pm
@@ -157,7 +157,7 @@ sub clone_branch_patch_push {
     $r->run( checkout => '-b', $branch, { quiet => 1 } );
 
     # Patch
-    my $patched = system("cat $patch|(cd $workdir && patch -p1 --silent)") == 0;
+    $r->run( apply => '-p1', $patch, { quiet => 1 } );
 
     # Push
     $r->run( add => '.' );
diff --git a/t/github.t b/t/github.t
index 4752546..3bb91f8 100644
--- a/t/github.t
+++ b/t/github.t
@@ -7,8 +7,9 @@ use Test::More;
 
 BEGIN {
     plan skip_all
-        => "Set AUTHOR_TESTING to perform this test"
-        unless $ENV{AUTHOR_TESTING};
+        => "Set AUTHOR_TESTING and DPT_PACKAGES to perform this test"
+        unless $ENV{AUTHOR_TESTING}
+        and -d $ENV{DPT_PACKAGES};
 
     plan skip_all
         => "GitHub tests require DPT_GITHUB_OAUTH token"
@@ -26,7 +27,7 @@ my $owner   = 'alexm';
 my $repo    = 'pkg-perl-dummy';
 my $orgname = 'pkg-perl-tools';
 my $branch  = "pkg-perl-$^T";
-my $patch   = 't/dummy.txt.patch';
+my $patch   = "$ENV{DPT_PACKAGES}/pkg-perl-tools/t/dummy.txt.patch";
 my $comment = "Test patch $^T";
 my $body    = 'Pull request by Debian pkg-perl team.';
 my $base    = 'master';

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/pkg-perl-tools.git



More information about the Pkg-perl-cvs-commits mailing list