Author: ks156
Date: 2009-03-13 09:11:37 +0100 (Fri, 13 Mar 2009)
New Revision: 4041

Modified:
   
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
Log:
* Rewritten the INST routine.
* Renamed INSTALL to MIRROR


Modified: 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
     2009-03-13 07:13:42 UTC (rev 4040)
+++ 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
     2009-03-13 08:11:37 UTC (rev 4041)
@@ -12,7 +12,7 @@
 
 ARCH = None
 PREFIX = None
-INSTALL = ""
+MIRROR = ""
 CREATE_DB = False
 DEBUG = 0
 
@@ -113,7 +113,7 @@
         # Copy the new files
         if item['command'] == "COPY":
             dest = item['destination'].replace("$PREFIX", PREFIX)
-            dest = INSTALL + dest
+            dest = MIRROR + dest
             path, filename = os.path.split(dest)
             if not os.path.isdir(path):
                 os.system("mkdir -p %s"%path)
@@ -122,17 +122,22 @@
         # Install a meta-package
         elif item['command'] == "INST":
             os.system("mkdir -p /tmp/tuxdroid_upd")
+
             dest = item['destination'].replace("$PREFIX", PREFIX)
             path = os.path.split(dest)[0]
             filename = os.path.split(item['source'])[1]
             
             URLDownloadToFile(item['source'], "/tmp/tuxdroid_upd/%s"%filename)
-            
-            os.system("tar -xf /tmp/tuxdroid_upd/%s -C /tmp/tuxdroid_upd/ &&\
-                    cd /tmp/tuxdroid_upd/%s && /bin/bash install.sh %s %s %s 
&&\
-                    rm -rf /tmp/tuxdroid_upd/" \
-                    %(filename, filename.split("-")[0], INSTALL + dest, \
-                    INSTALL + PREFIX, dest))
+            # Prepare the command to install
+            cmd = "tar -xf /tmp/tuxdroid_upd/%s -C /tmp/tuxdroid_upd/ && " \
+                    % filename
+            cmd = cmd + "cd /tmp/tuxdroid_upd/%s && "%filename.split("-")[0]
+            cmd = cmd + "/bin/bash install.sh %s %s %s && " \
+                    % (MIRROR + dest, MIRROR + PREFIX, dest)
+                    # Mirror destination, Mirror prefix, Target destination
+            cmd = cmd + "rm -rf /tmp/tuxdroid_upd/"
+            print cmd
+            os.system(cmd)
     print ''
     writeDb(data)
 
@@ -183,7 +188,7 @@
 def main():
     global DEBUG
     global PREFIX 
-    global INSTALL
+    global MIRROR
     PREFIX = TUXDROID_PREFIX
     
     # Set the default version type
@@ -217,9 +222,9 @@
         if o in ("-i", "--install"):
             global ARCH
             global CREATE_DB
-            INSTALL=a
+            MIRROR=a
             print "Package creation mode"
-            print "Creating mirror to : %s"%INSTALL
+            print "Creating mirror to : %s"%MIRROR
             ARCH = raw_input("Enter arch (x86 or x86_64) : ")
             CREATE_DB = True
 


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to