From 7067c015bcd8a22c9e69f5526799731c0df15868 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Tue, 21 Apr 2026 23:21:14 +0200 Subject: [PATCH] exclude existing experiments when archiving --- scripts/menu.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/menu.pl b/scripts/menu.pl index a58af4a..8c1b36f 100644 --- a/scripts/menu.pl +++ b/scripts/menu.pl @@ -43,9 +43,19 @@ my %handlers = ( # Download ran experiments from mars my @dirs = Mars::find_remote_subdirs($remote_builds_dir); + + my @existing = Util::find_subdirs($local_archive_dir); + my @new_dirs; + foreach (@dirs) { + my $dir = $_ =~ s/:/-/gr; + unless ( grep { /$dir/ } @existing ) { + push @new_dirs, $_; + } + } + my @selected_dirs = TUI::select_from_list( "Select Experiments to Download from Mars", - 1, @dirs ); + 1, @new_dirs ); die "No experiment selected" unless @selected_dirs; Mars::download_dir( "$remote_builds_dir/$_", "$local_archive_dir/" . $_ =~ s/:/-/gr )