[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: get_recent_list and future dsa-1xxx



Matt Kraai <kraai@ftbfs.org> (21/11/2005):
> On Thu, Nov 17, 2005 at 04:08:03PM +0100, Thomas Huriaux wrote:
> > In a few months, the DSAs will have four digits. With the current
> > sorting method (lexically), we will have the following sorting scheme:
> >   dsa-1000 dsa-1001 dsa-998 dsa-999
> > Can somebody confirm that there is no problem if I apply the attached
> > patch? (it sorts numerically instead of lexically).
> 
> In my quick testing,
> 
>  "dsa-1001" <=> "dsa-999"
> 
> returns 0, not 1.  Doesn't this cause your patch to break?

Indeed, it does not give at all the expected results (I don't know
exactly why I got what I wanted the first time I tried).
Please have a look at the attached patch, it seems to work better but
it is a little bit hackish.

Cheers,

-- 
Thomas Huriaux
Index: recent_list.wml
===================================================================
RCS file: /cvs/webwml/webwml/english/template/debian/recent_list.wml,v
retrieving revision 1.130
diff -u -r1.130 recent_list.wml
--- recent_list.wml	15 Sep 2005 11:19:17 -0000	1.130
+++ recent_list.wml	2 Dec 2005 11:58:01 -0000
@@ -183,7 +183,9 @@
 	@files = ( @files, @new_files );
     }
 
-    @files = sort {$a cmp $b} @files;
+    @files = sort {
+	($a =~ /dsa-(\d+)/)[0] <=> ($b =~ /dsa-(\d+)/)[0] || $a cmp $b
+    } @files;
 
     #warn "files: " . join " ", @files; warn "\n";
     #warn "years: " . join " ", @years; warn "\n";

Attachment: signature.asc
Description: Digital signature


Reply to: