[csw-devel] SF.net SVN: gar:[2649] csw/mgar/gar

wbonnet at users.sourceforge.net wbonnet at users.sourceforge.net
Thu Dec 18 01:02:12 CET 2008


Revision: 2649
          http://gar.svn.sourceforge.net/gar/?rev=2649&view=rev
Author:   wbonnet
Date:     2008-12-18 00:02:12 +0000 (Thu, 18 Dec 2008)

Log Message:
-----------
Fix loop when parsing file version in sf download page

Modified Paths:
--------------
    csw/mgar/gar/v1/bin/upstream_watch
    csw/mgar/gar/v2/bin/upstream_watch

Modified: csw/mgar/gar/v1/bin/upstream_watch
===================================================================
--- csw/mgar/gar/v1/bin/upstream_watch	2008-12-17 23:58:36 UTC (rev 2648)
+++ csw/mgar/gar/v1/bin/upstream_watch	2008-12-18 00:02:12 UTC (rev 2649)
@@ -140,7 +140,7 @@
 	$url = "http://downloads.sourceforge.net" . $filename;
 	open ($FH, "$wget_command -qO- $url 2>/dev/null | grep $filename | grep package_id= | grep release_id | ");
 
-	if (my $line = <$FH>) {
+	while (my $line = <$FH>) {
 		my @cols = split (/>/, $line);
 		my $filename = $cols[2];
 		chomp ($filename);
@@ -149,10 +149,6 @@
 		chomp ($filename);
 		push (@file_list, $filename);
 	}
-	else {
-		close ($FH);
-		return \@file_list;
-	}
 
 	close ($FH);
 
@@ -186,7 +182,7 @@
 			$file_list = get_file_list_wget_sourceforge ($url);
 		} else {	
 			$file_list = get_file_list_lftp ($url);
-	}
+		}
 
 		foreach my $file (@{$file_list}) {			
 			if ($file =~ /^$file_pattern$/) {

Modified: csw/mgar/gar/v2/bin/upstream_watch
===================================================================
--- csw/mgar/gar/v2/bin/upstream_watch	2008-12-17 23:58:36 UTC (rev 2648)
+++ csw/mgar/gar/v2/bin/upstream_watch	2008-12-18 00:02:12 UTC (rev 2649)
@@ -140,7 +140,7 @@
 	$url = "http://downloads.sourceforge.net" . $filename;
 	open ($FH, "$wget_command -qO- $url 2>/dev/null | grep $filename | grep package_id= | grep release_id | ");
 
-	if (my $line = <$FH>) {
+	while (my $line = <$FH>) {
 		my @cols = split (/>/, $line);
 		my $filename = $cols[2];
 		chomp ($filename);
@@ -149,10 +149,6 @@
 		chomp ($filename);
 		push (@file_list, $filename);
 	}
-	else {
-		close ($FH);
-		return \@file_list;
-	}
 
 	close ($FH);
 
@@ -186,7 +182,7 @@
 			$file_list = get_file_list_wget_sourceforge ($url);
 		} else {	
 			$file_list = get_file_list_lftp ($url);
-	}
+		}
 
 		foreach my $file (@{$file_list}) {			
 			if ($file =~ /^$file_pattern$/) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list