From: b Date: Sun, 2 Mar 2025 15:23:32 +0000 (+0000) Subject: new update options X-Git-Tag: v1.2.10~4 X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=a976fc88db58cd53b78e88ff375eb150bb26e065;p=ott%2Fbsta new update options --- diff --git a/bsta_lib.1.pm b/bsta_lib.1.pm index ce8dd21..c8dc266 100644 --- a/bsta_lib.1.pm +++ b/bsta_lib.1.pm @@ -2686,7 +2686,7 @@ sub write_goto { } sub read_attachment { - (my $f, my $default) = @_; + (my $f) = @_; my $file; my %data; diff --git a/settings.txt b/settings.txt index e5dd710..1d57063 100644 --- a/settings.txt +++ b/settings.txt @@ -1,6 +1,6 @@ # settings.txt # -# Copyright (C) 2023, 2024 Balthasar Szczepański +# Copyright (C) 2023, 2024, 2025 Balthasar Szczepański # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -15,7 +15,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -_version: 1.2.9 +_version: 1.2.10 _SHEBANG: #!$0 diff --git a/update.1.pl b/update.1.pl index 8cfba90..1397e7c 100644 --- a/update.1.pl +++ b/update.1.pl @@ -1,10 +1,10 @@ -#!/usr/bin/perl +###RUN_PERL: #!/usr/bin/perl # update.pl is generated from update.1.pl. # # update already ONGed frames & stuff # -# Copyright (C) 2016, 2017, 2023, 2024 Balthasar Szczepański +# Copyright (C) 2016, 2017, 2023, 2024, 2025 Balthasar Szczepański # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -60,7 +60,7 @@ my @list; my $fail = 0; -print $time."\n"; +print $time." update\n"; foreach my $id (@ARGV) { if ($id eq 'all') { @@ -72,16 +72,47 @@ foreach my $id (@ARGV) { } } elsif ($id =~ /^[0-9]+$/) { - $update_goto = 1; my $f = int($&); if ($f <= $last_frame) { - push @list, $f + $update_goto = 1; + push @list, $f; } else { print "$f > $last_frame\n"; $fail += 1; } } + elsif ($id =~ /^([0-9]*)\-([0-9]+)$/) { + my $f_start = int($1); # int('') == 0 + my $f_end = int($2); + if ($f_start > $f_end) { + print "$f_start > $f_end\n"; + $fail += 1; + next; + } + for (my $f=$f_start; $f<=$f_end; $f+=1) { + if ($f <= $last_frame) { + $update_goto = 1; + push @list, $f; + } + else { + print "$f > $last_frame\n"; + $fail += 1; + } + } + } + elsif ($id =~ /^([0-9]+)\+$/) { + my $f_start = int($1); + if ($f_start > $last_frame) { + print "$f_start > $last_frame\n"; + $fail += 1; + next; + } + $update_goto = 1; + for (my $f=$f_start; $f<=$last_frame; $f+=1) { + push @list, $f; + } + } elsif ($id =~ /^[ic]$/) { push @list, $&; } @@ -145,7 +176,7 @@ if ($update_goto) { } } -print "\n"; +print (($fail > 0) ? "update FAIL\n\n" : "update OK\n\n"); sub get_frame_data {