aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MGA
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-06-26 11:02:02 +0000
committerNicolas Vigier <boklm@mageia.org>2013-06-26 11:02:02 +0000
commit9a6acf6c2be15865ff3112981135852e180ef738 (patch)
treefb0de4b4e036b4aea2cba354ec0988c0e13bd923 /lib/MGA
parent2c4440cf6fc3f70a3b65b01cab5f6ec534077efa (diff)
downloadmgaadvisories-9a6acf6c2be15865ff3112981135852e180ef738.tar
mgaadvisories-9a6acf6c2be15865ff3112981135852e180ef738.tar.gz
mgaadvisories-9a6acf6c2be15865ff3112981135852e180ef738.tar.bz2
mgaadvisories-9a6acf6c2be15865ff3112981135852e180ef738.tar.xz
mgaadvisories-9a6acf6c2be15865ff3112981135852e180ef738.zip
next_id: sort IDs numerically
Diffstat (limited to 'lib/MGA')
-rw-r--r--lib/MGA/Advisories.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm
index 9ebe35e..64c128c 100644
--- a/lib/MGA/Advisories.pm
+++ b/lib/MGA/Advisories.pm
@@ -77,7 +77,7 @@ sub get_advisories_from_dir {
sub next_id {
my $prefix = shift;
my $year = DateTime->now->year;
- my $newid = (0, sort map { m/^$prefix-$year-(\d+)$/ ? int $1 : () } @_)[-1] + 1;
+ my $newid = (0, sort { $a <=> $b } map { m/^$prefix-$year-(\d+)$/ ? int $1 : () } @_)[-1] + 1;
return sprintf("%s-%s-%.4d", $prefix, $year, $newid);
}