Skip to content

Commit 7ecf6e9

Browse files
authored
fix(repository.lic): v2.70 check for proper version format (elanthia-online#2193)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Fixes version format check in `repository.lic` to handle `Gem::Version` format with error handling, updates version to 2.70. > > - **Behavior**: > - Fixes version format check in `repository.lic` to handle `Gem::Version` format with optional 'v' prefix and additional suffixes. > - Adds error handling for invalid version formats in `check_lich_requirement()` and `sort_versions()`. > - **Versioning**: > - Updates version to 2.70 in `repository.lic`. > - Adds changelog entry for version 2.70 noting the fix for version format check. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=elanthia-online%2Fscripts&utm_source=github&utm_medium=referral)<sup> for c34591b. You can [customize](https://app.ellipsis.dev/elanthia-online/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent 9db5fe0 commit 7ecf6e9

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

scripts/repository.lic

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
game: any
1111
tags: core
1212
required: Lich > 5.0.1
13-
version: 2.69
13+
version: 2.70
1414

1515
changelog:
16+
2.70 (2026-01-17):
17+
Fix check for incompatible Gem::Version format in version checks
1618
2.69 (2025-12-05):
1719
Major refactoring to proper module/class architecture
1820
Removed proc usage in favor of instance methods
@@ -357,10 +359,14 @@ module RepositoryTillmen
357359
next unless line =~ /^[\s\t#]*require(?:s|d):[\s\t]*(.+)/i
358360

359361
$1.split(',').each do |req|
360-
if req.strip =~ /^[\s\t]*Lich[\s\t]*(>|<|=|>=|<=)[\s\t]*([\-\w\.]+)/i
362+
if req.strip =~ /^[\s\t]*Lich[\s\t]*(>|<|=|>=|<=)[\s\t]*v?((?:\d+\.){0,2}\d+(?:[.-][a-zA-Z][\w.]*)?)/i
361363
op = $1
362364
version = $2
363-
needed_version = Gem::Version.new(version)
365+
begin
366+
needed_version = Gem::Version.new(version)
367+
rescue StandardError
368+
needed_version = version.split('.').collect { |num| num.rjust(5, '0') }.join('.')
369+
end
364370

365371
case op
366372
when '<'
@@ -2839,9 +2845,15 @@ module RepositoryTillmen
28392845
end
28402846

28412847
def sort_versions(versions_string)
2842-
versions_string.split(';')
2843-
.sort_by { |v| Gem::Version.new(v) }
2844-
.join(', ')
2848+
begin
2849+
versions_string.split(';')
2850+
.sort_by { |v| Gem::Version.new(v) }
2851+
.join(', ')
2852+
rescue StandardError
2853+
versions_string.split(';')
2854+
.sort_by { |v| v }
2855+
.join(', ')
2856+
end
28452857
end
28462858

28472859
def should_skip_update?(filename)

0 commit comments

Comments
 (0)