From 6077d258b500b20e1e705f5cda567400240c7804 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 11:36:25 +0200 Subject: Adding upstream version 2.21.3+deb11u1. 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