View Issue Details

IDProjectCategoryView StatusLast Update
0000332My infrastructureGeneralpublic2025-10-19 12:43
Reporterdvl Assigned Todvl  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Summary0000332: Negative repeat count does nothing at
DescriptionI had this fix. Where did it go?

Oct 17 10:53:30 dev-ingress01 freshports[35176]: Negative repeat count does nothing at /usr/local/lib/perl5/site_perl/FreshPorts/vuxml_parsing.pm line 745.
Oct 17 10:53:30 dev-ingress01 freshports[35176]: Negative repeat count does nothing at /usr/local/lib/perl5/site_perl/FreshPorts/vuxml_parsing.pm line 517.


The lines in question:
                print $range->[0], ": ", $range->[1],
                  " " x ( 25 - length $range->[1] );

                print $range->[0], ": ", $range->[1],
                  " " x ( 25 - length $range->[1] );


TagsNo tags attached.

Activities

dvl

2025-10-18 19:06

manager   ~0000457

Looking at https://svn.int.unixathome.org/viewvc.cgi/freshports-1/ingress/modules/branches/git/vuxml_parsing.pm?revision=6194&view=markup I see my code is up to date.

However, based on the query in the comments, I can see the data has grown:

freshports.dvl=# select max(length(version1)), max(length(version2)) from vuxml_ranges;
 max | max 
-----+-----
  28 |  19
(1 row)

freshports.dvl=# 


The max is 28, which is greater than the 25 which the code is catering for.

dvl

2025-10-18 19:20

manager   ~0000458

Let's go with readonly variables: https://perlmaven.com/constants-and-read-only-variables-in-perl

Adding this dep:

p5-Readonly>0:devel/p5-Readonly

dvl

2025-10-18 19:21

manager   ~0000459

Code change:

[19:18 dvl-ingress01 dvl ~/modules] % svn di
Index: vuxml_parsing.pm
===================================================================
--- vuxml_parsing.pm	(revision 6206)
+++ vuxml_parsing.pm	(working copy)
@@ -57,7 +57,10 @@
 use Digest::SHA qw(sha256_hex);
 
 use base qw( Class::Observable );
+use Readonly;
 
+Readonly my $MAX_RANGE_WIDTH => 35;
+
 # Class variables
 
 our ($VuXML);
@@ -515,7 +518,7 @@
                 # without that, we get Negative repeat count does nothing at /usr/local/lib/perl5/site_perl/FreshPorts/vuxml_parsing.pm line 507
                 # look for a similar '25 - length' around line 735.
                 print $range->[0], ": ", $range->[1],
-                  " " x ( 25 - length $range->[1] );
+                  " " x ( $MAX_RANGE_WIDTH - length $range->[1] );
                 if ( $range->[2] ) {
                     print $range->[2], ": ", $range->[3], "\n";
                 }
@@ -743,7 +746,7 @@
                 # without that, we get Negative repeat count does nothing at /usr/local/lib/perl5/site_perl/FreshPorts/vuxml_parsing.pm line 507
                 # look for a similar '25 - length' around line 516.
                 print $range->[0], ": ", $range->[1],
-                  " " x ( 25 - length $range->[1] );
+                  " " x ( $MAX_RANGE_WIDTH - length $range->[1] );
                 if ( $range->[2] ) {
                     print $range->[2], ": ", $range->[3], "\n";
                 }

dvl

2025-10-19 12:43

manager   ~0000460

released in p5-freshports-modules-2.2.1

Issue History

Date Modified Username Field Change
2025-10-17 12:40 dvl New Issue
2025-10-17 12:40 dvl Status new => assigned
2025-10-17 12:40 dvl Assigned To => dvl
2025-10-18 19:06 dvl Note Added: 0000457
2025-10-18 19:20 dvl Note Added: 0000458
2025-10-18 19:21 dvl Note Added: 0000459
2025-10-19 12:43 dvl Note Added: 0000460
2025-10-19 12:43 dvl Status assigned => closed
2025-10-19 12:43 dvl Resolution open => fixed