Author: pebender
Date: Tue Jan 20 19:32:22 2009
New Revision: 4297

Modified:
    trunk/gar-minimyth/html/minimyth/document-changelog.txt
     
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.sh/functions
    trunk/gar-minimyth/script/perl/perl-MiniMyth/checksums
    trunk/gar-minimyth/script/perl/perl-MiniMyth/files/MiniMyth.pm

Log:
- Changed tftp URLs from using tftp to using curl as the latest curl claims
   to fix the TFTP timeout bugs.



Modified: trunk/gar-minimyth/html/minimyth/document-changelog.txt
==============================================================================
--- trunk/gar-minimyth/html/minimyth/document-changelog.txt     (original)
+++ trunk/gar-minimyth/html/minimyth/document-changelog.txt     Tue Jan 20  
19:32:22 2009
@@ -75,6 +75,8 @@
        is not needed (group and other have the same access) and it causes  
the
        files to be copied from read-only branch to read-write branch of the
        unionfs union.
+    - Changed tftp URLs from using tftp to using curl as the latest curl  
claims
+      to fix the TFTP timeout bugs.

  Modified udev
      - Renamed 06-minimyth-mythtv.rules to 07-minimyth-mythtv.rules.

Modified:  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.sh/functions
==============================================================================
---  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.sh/functions
        
(original)
+++  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.sh/functions
        
Tue Jan 20 19:32:22 2009
@@ -276,7 +276,7 @@
      /usr/bin/test -n "${LOCAL_DIR}" && /bin/mkdir -p "${LOCAL_DIR}"
      /usr/bin/test -n "${LOCAL_DIR}" && /usr/bin/test ! -d "${LOCAL_DIR}"  
&& return

-    /usr/bin/tftp -g -r "${REMOTE_FILE}"  
-l "${LOCAL_FILE}" "${REMOTE_SERVER}" || return
+    /usr/bin/curl -s -f "tftp://${REMOTE_SERVER}${REMOTE_FILE}";  
-o "${LOCAL_FILE}" || return

      /usr/bin/logger -s -t minimyth  
-p "local0.info" "'tftp://${REMOTE_SERVER}${REMOTE_FILE}' downloaded."

@@ -454,7 +454,7 @@
          return
      fi

-    if /usr/bin/tftp -p -l "${LOCAL_FILE}"  
-r "${REMOTE_FILE}" "${REMOTE_SERVER}" ; then
+    if /usr/bin/curl -s  
-T "${LOCAL_FILE}" "tftp://${REMOTE_SERVER}${REMOTE_FILE}"; ; then
          /usr/bin/logger -s -t minimyth -p "local0.info"  \
              "'tftp://${REMOTE_SERVER}${REMOTE_FILE}' posted."
          /bin/true

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      Tue Jan 20  
19:32:22 2009
@@ -1 +1 @@
-94127aaf8d0b4caa99632f6aba6b1d53  download/MiniMyth.pm
+9c7e3e8dd3b9b2bb35cc33d7faed10fe  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      Tue Jan 
 
20 19:32:22 2009
@@ -12,7 +12,7 @@
  use File::Path ();
  use File::Spec ();
  use Net::Telnet ();
-use WWW::Curl::Easy qw(CURLINFO_HTTP_CODE CURLOPT_INFILE  
CURLOPT_INFILESIZE CURLOPT_PUT CURLOPT_URL CURLOPT_VERBOSE  
CURLOPT_WRITEDATA);
+use WWW::Curl::Easy qw(CURLINFO_HTTP_CODE CURLOPT_INFILE  
CURLOPT_INFILESIZE CURLOPT_PUT CURLOPT_UPLOAD CURLOPT_URL CURLOPT_VERBOSE  
CURLOPT_WRITEDATA);

  sub new
  {
@@ -1255,26 +1255,20 @@
              }
              when (/^tftp$/)
              {
-#               if (open(my $OUT_FILE, '>', $local_file))
-#               {
-#                   chmod(0600, $local_file);
-#                   my $curl = new WWW::Curl::Easy;
-#                   $curl->setopt(CURLOPT_URL, $url_item);
-#                   $curl->setopt(CURLOPT_WRITEDATA, $OUT_FILE);
-#                   my $retcode = $curl->perform;
-#                   close($OUT_FILE);
-#                   if ( (-e $local_file) &&
-#                        ($retcode == 0)  )
-#                   {
-#                       $result = $url_item;
-#                   }
-#               }
-                my $retcode = system(qq(/usr/bin/tftp -g -r $remote_file  
-l $local_file $remote_server > /dev/null 2>&1));
-                if ( (-e $local_file) &&
-                     ($retcode == 0)  )
+                if (open(my $OUT_FILE, '>', $local_file))
                  {
                      chmod(0600, $local_file);
-                    $result = $url;
+                    my $curl = new WWW::Curl::Easy;
+                    $curl->setopt(CURLOPT_VERBOSE, 0);
+                    $curl->setopt(CURLOPT_URL, $url_item);
+                    $curl->setopt(CURLOPT_WRITEDATA, $OUT_FILE);
+                    my $retcode = $curl->perform;
+                    close($OUT_FILE);
+                    if ( (-e $local_file) &&
+                         ($retcode == 0)  )
+                    {
+                        $result = $url_item;
+                    }
                  }
              }
              default
@@ -1385,30 +1379,26 @@
              }
              when (/^tftp$/  )
              {
-#               if (open(my $IN_FILE, '<', $local_file))
-#               {
-#                   if (open(my $OUT_FILE, '>', File::Spec->devnull))
-#                   {
-#                       my $local_file_size = -s $local_file;
-#                       my $curl = new WWW::Curl::Easy;
-#                       $curl->setopt(CURLOPT_VERBOSE, 0);
-#                       $curl->setopt(CURLOPT_URL, $url_item);
-#                       $curl->setopt(CURLOPT_INFILE, $IN_FILE);
-#                       $curl->setopt(CURLOPT_INFILESIZE,  
$local_file_size);
-#                       $curl->setopt(CURLOPT_WRITEDATA, $OUT_FILE);
-#                       my $retcode = $curl->perform;
-#                       close($OUT_FILE);
-#                       if ($retcode == 0)
-#                       {
-#                           $result = $url_item;
-#                       }
-#                   }
-#                   close($IN_FILE);
-#               }
-                my $retcode = system(qq(/usr/bin/tftp -p -l $local_file -r  
$remote_file $remote_server > /dev/null 2>&1));
-                if ($retcode == 0)
+                if (open(my $IN_FILE, '<', $local_file))
                  {
-                    $result = $url_item;
+                    if (open(my $OUT_FILE, '>', File::Spec->devnull))
+                    {
+                        my $local_file_size = -s $local_file;
+                        my $curl = new WWW::Curl::Easy;
+                        $curl->setopt(CURLOPT_VERBOSE, 0);
+                        $curl->setopt(CURLOPT_URL, $url_item);
+                        $curl->setopt(CURLOPT_INFILE, $IN_FILE);
+                        $curl->setopt(CURLOPT_INFILESIZE,  
$local_file_size);
+                        $curl->setopt(CURLOPT_WRITEDATA, $OUT_FILE);
+                        $curl->setopt(CURLOPT_UPLOAD, 1);
+                        my $retcode = $curl->perform;
+                        close($OUT_FILE);
+                        if ($retcode == 0)
+                        {
+                            $result = $url_item;
+                        }
+                    }
+                    close($IN_FILE);
                  }
              }
              default

--~--~---------~--~----~------------~-------~--~----~
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