Author: ks156
Date: 2009-03-18 11:15:23 +0100 (Wed, 18 Mar 2009)
New Revision: 4120

Modified:
   
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/misc/installedFileDB.py
   
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
Log:
* Fixed a bug with the database path
* Fixed a bug with the architecture detection


Modified: 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/misc/installedFileDB.py
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/misc/installedFileDB.py
     2009-03-18 10:04:51 UTC (rev 4119)
+++ 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/misc/installedFileDB.py
     2009-03-18 10:15:23 UTC (rev 4120)
@@ -79,15 +79,17 @@
     
     return toInstall, toRemove                       
 
-def writeDb(data):
-    f = open("/etc/tuxdroid/software.db1", "w")
+def writeDb(data, path):
+    if not os.path.isdir(path):
+        os.system("mkdir -p %s"%path)
+    f = open("%s/software.db1"%path, "w")
     for entry in data:
         s="%s|%s|%s|%s|%s|%s\n"%(entry['md5Tag'], entry['name'],\
                 entry['destination'], entry['source'], \
                 entry['command'], entry['fileSize'])
         f.write(s)
     f.close()
-    os.system("mv /etc/tuxdroid/software.db1 /etc/tuxdroid/software.db")
+    os.system("mv %s/software.db1 %s/software.db"%(path, path))
 
 
 def __isRightArchitecture(item, ARCH):

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-18 10:04:51 UTC (rev 4119)
+++ 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
     2009-03-18 10:15:23 UTC (rev 4120)
@@ -110,35 +110,36 @@
     # Install or update the new software
     for item in toInstall:
         pb.incProgressBar()
-        # Copy the new files
-        if item['command'] == "COPY":
-            dest = item['destination'].replace("$PREFIX", PREFIX)
-            dest = MIRROR + dest
-            path, filename = os.path.split(dest)
-            if not os.path.isdir(path):
-                os.system("mkdir -p %s"%path)
-            URLDownloadToFile(item['source'], dest)
-            os.system("chmod 755 %s"%dest)
-        # Install a meta-package
-        elif item['command'] == "INST":
-            os.system("mkdir -p /tmp/tuxdroid_upd")
+        if __isRightArchitecture(item):
+            # Copy the new files
+            if item['command'] == "COPY":
+                dest = item['destination'].replace("$PREFIX", PREFIX)
+                dest = MIRROR + dest
+                path, filename = os.path.split(dest)
+                if not os.path.isdir(path):
+                    os.system("mkdir -p %s"%path)
+                URLDownloadToFile(item['source'], dest)
+                os.system("chmod 755 %s"%dest)
+            # 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)
-            # 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/"
-            os.system(cmd)
+                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)
+                # 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/"
+                os.system(cmd)
     print ''
-    writeDb(data)
+    writeDb(data, MIRROR + "/etc/tuxdroid/")
 
     # Uninstall the ununsed stuff
     for item in toRemove:
@@ -197,7 +198,7 @@
     # Set the options parameters
     try:
         opts, args = getopt.getopt(sys.argv[1:], "dhv:p:i:",\
-                ["debug", "help", "version=", "prefix=", "install"])
+                ["debug", "help", "version=", "prefix=", "install="])
     except getopt.error, msg:
         print msg
         print "For help use --help"


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