File: Utils.pm

package info (click to toggle)
devscripts 2.25.15
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 8,528 kB
  • sloc: perl: 26,530; sh: 11,698; python: 4,428; makefile: 363
file content (40 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (3)
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
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,
        nocheck    => 1,
    );
    return $?;
}

sub ds_exec {
    {
        local $, = ' ';
        ds_debug "Execute: @_...";
    }
    spawn(
        exec       => [@_],
        wait_child => 1,
        nocheck    => 1,
    );
    if ($?) {
        local $, = ' ';
        ds_die "Command failed (@_)";
    }
}

1;