From efe47381c599b07e4c7bbdb2e91e8090a541c887 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:53:52 +0200 Subject: Adding upstream version 2.23.4+deb12u1. Signed-off-by: Daniel Baumann --- lib/Devscripts/Utils.pm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lib/Devscripts/Utils.pm (limited to 'lib/Devscripts/Utils.pm') diff --git a/lib/Devscripts/Utils.pm b/lib/Devscripts/Utils.pm new file mode 100644 index 0000000..8495ce4 --- /dev/null +++ b/lib/Devscripts/Utils.pm @@ -0,0 +1,31 @@ +package Devscripts::Utils; + +use strict; +use Devscripts::Output; +use Exporter 'import'; +use IPC::Run qw(run); + +our @EXPORT = qw(ds_exec ds_exec_no_fail); + +sub ds_exec_no_fail { + { + local $, = ' '; + ds_debug "Execute: @_..."; + } + run \@_, '>', '/dev/null'; + return $?; +} + +sub ds_exec { + { + local $, = ' '; + ds_debug "Execute: @_..."; + } + run \@_; + if ($?) { + local $, = ' '; + ds_die "Command failed (@_)"; + } +} + +1; -- cgit v1.2.3