From 3c631379d341e3087953ac3fa9ec1185d5a9a0c3 Mon Sep 17 00:00:00 2001 From: ngcp-config Date: Tue, 15 Mar 2022 11:27:04 +0100 Subject: [PATCH] TT#160855 tt2-process: warn if there's no base file for customtt * use default permissions for the built file in this case Change-Id: I3f58269484ee3def943586fcbcfed17328807c1e --- helper/tt2-process | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/helper/tt2-process b/helper/tt2-process index 03ae4c78..30b33c43 100755 --- a/helper/tt2-process +++ b/helper/tt2-process @@ -120,10 +120,16 @@ sub process_template { $input_for_perms =~ s/\.customtt\.tt2/.tt2/ig; $input_for_perms =~ s/\.tt2.*/.tt2/ig; + if (! -e $input_for_perms) { + warn("base filename:${input_for_perms} for:${input} not found\n"); + } + # Set permissions for generated config based on the ones of the # template, plus dropping all write permissions. my $old_umask = umask 0222; - my $mode = (stat $input_for_perms)[2]; + # base file does not exist, default perms + ## no critic (ValuesAndExpressions::ProhibitLeadingZeros) + my $mode = (stat $input_for_perms)[2] // 0644; my $newfile = "$output.ngcpcfg-new";