bagder: curl-www/dl remcheck.pl,1.12,1.13

[email protected]
Newsgroups gmane.comp.web.curl.www.cvs
Message-ID <[email protected]>
Update of /cvsroot/curl/curl-www/dl
In directory labb:/tmp/cvs-serv5336

Modified Files:
	remcheck.pl 
Log Message:
make it possible to check only specific packages by providing a command line
arg

make the remcheck timestamp only if the remote URL was possible to fetch, as
then we can use the 'remcheck' timestamp to detect broken URLs like if the
remcheck timestamp is more than 2-3 weeks...


Index: remcheck.pl
===================================================================
RCS file: /cvsroot/curl/curl-www/dl/remcheck.pl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- remcheck.pl	12 May 2005 08:19:05 -0000	1.12
+++ remcheck.pl	18 May 2005 07:27:17 -0000	1.13
@@ -3,6 +3,8 @@
 require "../latest.pm";
 require "stuff.pm";
 
+my $show = $ARGV[0];
+
 # get database
 $db=new pbase;
 $db->open($databasefilename);
@@ -45,6 +47,10 @@
 logmsg `curl --version`;
 my $version = $latest::headver;
 
+if($show) {
+    logmsg "told to only deal with packages matching \"$show\"\n";
+}
+
 sub show {
     my ($t)=@_;
     if($t eq "-") {
@@ -169,14 +175,20 @@
     if($s eq "-") {
         $s = "Generic";
     }
-    logmsg sprintf("===> Package: %s %s %s %s %s by %s (%s)\n",
-                   $s,
-                   show($$ref{'osver'}),
-                   show($$ref{'cpu'}),
-                   show($$ref{'flav'}),
-                   show($$ref{'pack'}),
-                   $$ref{'name'},
-                   $$ref{'curl'});
+    my $desc = sprintf("%s %s %s %s %s by %s (%s)",
+                       $s,
+                       show($$ref{'osver'}),
+                       show($$ref{'cpu'}),
+                       show($$ref{'flav'}),
+                       show($$ref{'pack'}),
+                       $$ref{'name'},
+                       $$ref{'curl'});
+
+    if($show && ($desc !~ /$show/i)) {
+        next;
+    }
+                       
+    logmsg "===> Package: $desc\n";
     logmsg sprintf " Modify: http://curl.haxx.se/dl/mod_entry.cgi?__id=%s\n",
     $$ref{'__id'};
 
@@ -212,8 +224,6 @@
 
         logmsg " Check URL: \"$churl\"\n";
 
-        $$ref{'remcheck'} = timestamp();
-
         # expand $version!
         if($churl =~ s/\$version/$version/g) {
             # 'fixedver' means that we have the version number in the URL
@@ -233,6 +243,8 @@
                 next;
             }
 
+            $$ref{'remcheck'} = timestamp();
+
             # there's a regex to check for in the downloaded page
             $chregex = CGI::unescapeHTML($chregex);
 
@@ -326,6 +338,8 @@
                 next;
             }
 
+            $$ref{'remcheck'} = timestamp();
+
             logmsg " Remote version found: $ver\n";
             logmsg sprintf " Present database version: %s\n", $$ref{'curl'};
             if($$ref{'curl'} ne $ver) {

_______________________________________________
http://cool.haxx.se/mailman/listinfo/curl-www-commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.