]> bicyclesonthemoon.info Git - ott/bsta/commitdiff
new update options
authorb <rowerynaksiezycu@gmail.com>
Sun, 2 Mar 2025 15:23:32 +0000 (15:23 +0000)
committerb <rowerynaksiezycu@gmail.com>
Sun, 2 Mar 2025 15:23:32 +0000 (15:23 +0000)
bsta_lib.1.pm
settings.txt
update.1.pl

index ce8dd21c003803a1859a8ece0dad3fb9a56ff552..c8dc266739c641e0d7f7c3e66e8d9f503b9eed8a 100644 (file)
@@ -2686,7 +2686,7 @@ sub write_goto {
 }
 
 sub read_attachment {
-       (my $f, my $default) = @_;
+       (my $f) = @_;
        my $file;
        my %data;
        
index e5dd7100db443b2a3a9a4e02233f4105a0f0569e..1d57063d602d6414bcfdecd21630f40d836a27df 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
 
-_version: 1.2.9
+_version: 1.2.10
 
 _SHEBANG: #!$0
 
index 8cfba90fa447128fd0229b08e492037186888b16..1397e7c9b4d8c0e3f2d0fde508b575b5cb0b2806 100644 (file)
@@ -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 {