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

wbonnet at users.sourceforge.net wbonnet at users.sourceforge.net
Fri Dec 12 00:02:13 CET 2008


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

Log Message:
-----------
Add detection of path in the the file name to check for updates
If a web page contains filenames with directory path, only the filename is kept for comparison. Otherwise cookie cretion fails

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-11 22:46:03 UTC (rev 2549)
+++ csw/mgar/gar/v1/bin/upstream_watch	2008-12-11 23:02:13 UTC (rev 2550)
@@ -129,8 +129,14 @@
 	foreach my $url (@urls) {
 		my $file_list = get_file_list ($url);
 		
-		foreach my $file (@{$file_list}) {
+		foreach my $file (@{$file_list}) {			
 			if ($file =~ /^$file_pattern$/) {
+				my $char = '/';
+				my $result = rindex($file, $char);
+				if ($result != -1) {
+					$file = substr $file , $result +1 ;
+				}
+
 				# we only keep the newest file for a given $file_pattern
 				if (compare_versions ($1, $newest_version) > 0) {
 					$newest_version = $1;

Modified: csw/mgar/gar/v2/bin/upstream_watch
===================================================================
--- csw/mgar/gar/v2/bin/upstream_watch	2008-12-11 22:46:03 UTC (rev 2549)
+++ csw/mgar/gar/v2/bin/upstream_watch	2008-12-11 23:02:13 UTC (rev 2550)
@@ -129,8 +129,14 @@
 	foreach my $url (@urls) {
 		my $file_list = get_file_list ($url);
 		
-		foreach my $file (@{$file_list}) {
+		foreach my $file (@{$file_list}) {			
 			if ($file =~ /^$file_pattern$/) {
+				my $char = '/';
+				my $result = rindex($file, $char);
+				if ($result != -1) {
+					$file = substr $file , $result +1 ;
+				}
+
 				# we only keep the newest file for a given $file_pattern
 				if (compare_versions ($1, $newest_version) > 0) {
 					$newest_version = $1;


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