Author: pebender
Date: Thu Sep  4 16:58:23 2008
New Revision: 3701

Modified:
    trunk/gar-minimyth/script/perl/perl-MiniMyth/checksums
    trunk/gar-minimyth/script/perl/perl-MiniMyth/files/MiniMyth.pm

Log:
- Changed MiniMtyh.pm so that it checks wither or not http and tftp file
   transfers resulted in a transfered file even when the return value
   indicates that there was no problem.



Modified: trunk/gar-minimyth/script/perl/perl-MiniMyth/checksums
==============================================================================
--- trunk/gar-minimyth/script/perl/perl-MiniMyth/checksums      (original)
+++ trunk/gar-minimyth/script/perl/perl-MiniMyth/checksums      Thu Sep  4  
16:58:23 2008
@@ -1 +1 @@
-5ef32d37875cea6a9a67cd1f6b492211  download/MiniMyth.pm
+0ed399374d018db1344e024bf3e076ff  download/MiniMyth.pm

Modified: trunk/gar-minimyth/script/perl/perl-MiniMyth/files/MiniMyth.pm
==============================================================================
--- trunk/gar-minimyth/script/perl/perl-MiniMyth/files/MiniMyth.pm       
(original)
+++ trunk/gar-minimyth/script/perl/perl-MiniMyth/files/MiniMyth.pm      Thu Sep 
  
4 16:58:23 2008
@@ -1214,14 +1214,23 @@
      $curl->setopt(CURLOPT_WRITEDATA, $OUT_FILE);
      my $retcode = $curl->perform;
      close($OUT_FILE);
-    if (($retcode == 0) && ($curl->getinfo(CURLINFO_HTTP_CODE) == 200))
+    if    (! -e $local_file)
      {
-        $result = $url;
+        $result = '';
      }
-    else
+    elsif ($retcode != 0)
+    {
+        unlink $local_file;
+        $result = '';
+    }
+    elsif ($curl->getinfo(CURLINFO_HTTP_CODE) != 200)
      {
          unlink $local_file;
-        $result = ''
+        $result = '';
+    }
+    else
+    {
+        $result = $url;
      }
      return $result;
  }
@@ -1279,15 +1288,19 @@
  #    my $retcode = $curl->perform;
  #    close($OUT_FILE);
      my $retcode = system(qq(/usr/bin/tftp -g -r $remote_file -l  
$local_file $remote_server));
-    chmod(0600, $local_file);
-    if ($retcode == 0)
+    if    (! -e $local_file)
      {
-        $result = $url;
+        $result = '';
      }
-    else
+    elsif ($retcode != 0)
      {
          unlink $local_file;
-        $result = ''
+        $result = '';
+    }
+    else
+    {
+        chmod(0600, $local_file);
+        $result = $url;
      }
      return $result;
  }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"minimyth-commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/minimyth-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to