Skip to content

Commit 98f734e

Browse files
committed
When listing versions, sort numerically
1 parent 4b2ffa5 commit 98f734e

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

modules/app.xqm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ declare function app:package-group-to-list-item($package-group as element(packag
332332
<td>
333333
<ul>{
334334
(: show links to older versions of the package that are compatible with the requested version of eXist :)
335-
for $package in reverse($older-packages)
335+
for $package in $older-packages
336336
let $download-version-url := concat($repoURL, "public/", $package/@path)
337337
return
338338
<li>
339-
<a href="{$download-version-url}">{$package/version/string()}</a>
339+
<a href="{$download-version-url}">{$package/@path/string()}</a>
340340
</li>,
341341

342342
(: show links to any other version of the package that is compatible with the requested version of eXist,
@@ -383,7 +383,7 @@ declare function app:package-group-to-list-item($package-group as element(packag
383383
for $change in $newest-package/changelog/change
384384
let $version := $change/@version/string()
385385
let $comment := $change/node()
386-
order by $version descending
386+
order by $version descending collation "http://www.w3.org/2013/collation/UCA?numeric=yes"
387387
return
388388
<tr>
389389
<td>{$version}</td>

modules/scan.xqm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ declare function scanrepo:rebuild-raw-packages() as xs:string {
223223
let $raw-packages :=
224224
element raw-packages {
225225
for $package-xar in xmldb:get-child-resources($config:packages-col)[ends-with(., ".xar")]
226-
order by $package-xar
226+
order by $package-xar collation "http://www.w3.org/2013/collation/UCA?numeric=yes"
227227
return
228228
scanrepo:extract-raw-package($package-xar)
229229
}

modules/upgrade-to-v2-storage.xq

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ declare function local:upgrade-to-public-repo-2-storage() as element()+ {
4343
(
4444
element packages {
4545
for $package in xmldb:get-child-resources("/db/apps/public-repo/public")[ends-with(., ".xar")]
46+
order by $package collation "http://www.w3.org/2013/collation/UCA?numeric=yes"
4647
return
4748
xmldb:copy-resource("/db/apps/public-repo/public", $package, "/db/apps/public-repo-data/packages", $package, true()) !
4849
(
@@ -52,6 +53,7 @@ declare function local:upgrade-to-public-repo-2-storage() as element()+ {
5253
},
5354
element icons {
5455
for $icon in xmldb:get-child-resources("/db/apps/public-repo/public")[not(matches(., "\.(xar|xml)$"))]
56+
order by $icon collation "http://www.w3.org/2013/collation/UCA?numeric=yes"
5557
return
5658
xmldb:copy-resource("/db/apps/public-repo/public", $icon, "/db/apps/public-repo-data/icons", $icon, true())
5759
!

0 commit comments

Comments
 (0)