Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > 59b739394320736958cb89b551854d0d > files > 2

perl-MDV-Repsys-0.08-4mdv2007.0.src.rpm

Index: lib/MDV/Repsys/Remote.pm
===================================================================
--- lib/MDV/Repsys/Remote.pm	(révision 57742)
+++ lib/MDV/Repsys/Remote.pm	(révision 57743)
@@ -224,6 +224,9 @@
                 }
             );
         } else {
+            if (!@cl) {
+                push(@cl, { header => 1, text => '', 'time' => 0 });
+            }
             $cl[-1]->{text} .= "$line\n";
         }
     }
@@ -267,6 +270,7 @@
 
 sub _fmt_cl_entry {
     my ($cl) = @_;
+    $cl->{'time'} or return $cl->{text};
     my @gti = gmtime($cl->{'time'});
     my $text = $cl->{text};
     $text =~ s/^\*/-/gm;
@@ -324,7 +328,11 @@
  
     print $handle "\%changelog\n";
 
-    foreach my $cl (sort { $b->{'time'} <=> $a->{'time'} } grep { $_ } @cls) {
+    foreach my $cl (sort {
+            $b->{'time'} && $a->{'time'} ?
+            $b->{'time'} <=> $a->{'time'} :
+            $a->{'time'} <=> $b->{'time'}
+        } grep { $_ } @cls) {
         print $handle _fmt_cl_entry($cl);
     }
     1;