From 06b696b1acfc926f90e2c2727fbeff09911f9d10 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 2 Feb 2026 09:47:38 +0100 Subject: [PATCH] Bug 41746: Do not overwrite atomic file if exists --- misc/devel/add_syspref.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/misc/devel/add_syspref.pl b/misc/devel/add_syspref.pl index 99c3824cf75..9197a038c82 100755 --- a/misc/devel/add_syspref.pl +++ b/misc/devel/add_syspref.pl @@ -116,6 +116,13 @@ my $new_pref_content = sprintf q{$dbh->do( ( defined $pref->{options} ? qq{'$pref->{options}'} : 'NULL' ), $pref->{explanation}, $pref->{type}, $pref->{variable}; my $atomic_filepath = "installer/data/mysql/atomicupdate/bug_${bug_number}.pl"; +while ( -e $atomic_filepath ) { + my $input = prompt("Atomic update file already exists, overwrite it? [y/N]"); + last if $input =~ /^y$/i; + $atomic_filepath = prompt("New atomic update filename? "); + $atomic_filepath = "installer/data/mysql/atomicupdate/$atomic_filepath"; +} + say "Adding syspref to sysprefs.sql and creating new atomicupdate file ($atomic_filepath)"; qx{cp installer/data/mysql/atomicupdate/skeleton.pl $atomic_filepath}; my $content = read_file($atomic_filepath); -- 2.43.0