[dh-make-perl] 01/04: run 'dpkg -i pkg.deb' with sudo if we aren't root

Damyan Ivanov dmn at moszumanska.debian.org
Sun May 24 09:34:19 UTC 2015


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

dmn pushed a commit to branch master
in repository dh-make-perl.

commit 1eaadd589f489e7033af0c1f0ca7094d4e8336b8
Author: Damyan Ivanov <dmn at debian.org>
Date:   Sun May 24 09:29:07 2015 +0000

    run 'dpkg -i pkg.deb' with sudo if we aren't root
    
    otherwise it is necessary to run dh-make-perl as root, which seems
    a bit of an overkill (and uses root's CPAN config)
---
 lib/DhMakePerl/Command/make.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/DhMakePerl/Command/make.pm b/lib/DhMakePerl/Command/make.pm
index 92a6152..2bb8c8a 100644
--- a/lib/DhMakePerl/Command/make.pm
+++ b/lib/DhMakePerl/Command/make.pm
@@ -439,7 +439,9 @@ sub install_package {
         $archspec );
 
     my $deb = $self->main_dir . "/../$debname";
-    system("dpkg -i $deb") == 0
+    my $dpkg_cmd = "dpkg -i $deb";
+    $dpkg_cmd = "sudo $dpkg_cmd" if $>;
+    system($dpkg_cmd) == 0
         || die "Cannot install package $deb\n";
 }
 

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



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