Bug - Waiting for Info "since" with point version fails

xKiv

Active member
Ezandora's guide has
Code:
since 17.6;

Trying to activate it prints "Unexpected error, debug log printed." in the gCLI.

The exception is an outofboundsexception at net.sourceforge.kolmafia.textui.Parser.enforceSince(Parser.java:4431)

The line in question:
Code:
currentVersion = currentVersion.substring( 0, currentVersion.indexOf( " r" ) );

More context:
Code:
				String currentVersion = StaticEntity.getVersion();
				currentVersion = currentVersion.substring( currentVersion.indexOf( "v" ) + 1 );
				// Strip " rxxxx" from end
				currentVersion = currentVersion.substring( 0, currentVersion.indexOf( " r" ) );

StaticEntity.getVersion returns "KoLmafia v17.12". No " r" in it (probably because StaticEntity.getVersion calls StaticEntity.getVersion( false ), which won't enforce including revision unless it's a non-RELEASE version of mafia; calling StaticEntity.getVersion( true ) directly instead seems to fix this, at least for me).
The "strip " rxxx" from end" bit looks like it was introduced recently, in r18287.
 

Veracity

Developer
Staff member
OK, I submitted a fix to not require rXXXX in the KoLmafia version.
Can't test it. It worked for me before. It still works.
Makes me wish we had Unit Tests.

I uploaded a Stealth release to Sourceforge.
 

fronobulax

Developer
Staff member
This change makes it work for me.

(are you running builds with KolConstants.RELEASED=false? Or maybe it's something with how I build from svn ...)

Check you builds. Years ago I kept making a feature request to display version information. It eventually turned out that my build process bypassed the setting of the version. The "bad" process was something my IDE decided upon. Manually using ant ("ant daily") worked, in terms of creating and displaying the version label.
 

xKiv

Active member
Check you builds. Years ago I kept making a feature request to display version information. It eventually turned out that my build process bypassed the setting of the version. The "bad" process was something my IDE decided upon. Manually using ant ("ant daily") worked, in terms of creating and displaying the version label.

I am definitely running at least the part that sets KolConstants.REVISION (currently at "18292M"). Until I started doing that, every script using "since" would complain (unless I made it pass the check anyway).
 
Top