File: Utils.pm

package info (click to toggle)
devscripts 2.25.30
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 9,504 kB
  • sloc: perl: 27,293; sh: 12,873; python: 4,466; makefile: 382
file content (44 lines) | stat: -rw-r--r-- 834 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package Devscripts::Utils;

use strict;
use Devscripts::Output;
use Dpkg::IPC;
use Exporter 'import';

our @EXPORT = qw(ds_exec ds_exec_no_fail);

sub ds_exec_no_fail {
    {
        local $, = ' ';
        ds_debug "Execute: @_...";
    }
    spawn(
        exec       => [@_],
        to_file    => '/dev/null',
        wait_child => 1,
        no_check   => 1,
        # XXX: Backwards compatibility, remove after dpkg 1.24.0.
        nocheck => 1,
    );
    return $?;
}

sub ds_exec {
    {
        local $, = ' ';
        ds_debug "Execute: @_...";
    }
    spawn(
        exec       => [@_],
        wait_child => 1,
        no_check   => 1,
        # XXX: Backwards compatibility, remove after dpkg 1.24.0.
        nocheck => 1,
    );
    if ($?) {
        local $, = ' ';
        ds_die "Command failed (@_)";
    }
}

1;