Author: ks156
Date: 2009-03-12 15:29:20 +0100 (Thu, 12 Mar 2009)
New Revision: 4008

Modified:
   
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/misc/tuxPaths.py
   
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
Log:
* Improved the use of the prefix.
  Now, the prefix can be set by the -p option. This will be used for the
  installers creation


Modified: 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/misc/tuxPaths.py
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/misc/tuxPaths.py
    2009-03-12 14:16:11 UTC (rev 4007)
+++ 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/misc/tuxPaths.py
    2009-03-12 14:29:20 UTC (rev 4008)
@@ -77,5 +77,6 @@
                     TUXDROID_BASE_PATH = os.path.join(prefix, 'share/tuxdroid')
             f.close()
         except:
+            TUXDROID_PREFIX = "/usr"
             TUXDROID_BASE_PATH = "/usr/share/tuxdroid"
 USER_BASE_PATH = os.path.expanduser("~")       

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-12 14:16:11 UTC (rev 4007)
+++ 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
     2009-03-12 14:29:20 UTC (rev 4008)
@@ -11,7 +11,7 @@
 import os
 
 ARCH = None
-
+PREFIX = None
 DEBUG = 0
 
 def __usage():
@@ -110,7 +110,7 @@
         pb.incProgressBar()
         # Copy the new files
         if item['command'] == "COPY":
-            dest = item['destination'].replace("$PREFIX", TUXDROID_PREFIX)
+            dest = item['destination'].replace("$PREFIX", PREFIX)
             path, filename = os.path.split(dest)
             if not os.path.isdir(path):
                 os.system("mkdir -p %s"%path)
@@ -120,7 +120,7 @@
         # Install a meta-package
         elif item['command'] == "INST":
             os.system("mkdir -p /tmp/tuxdroid_upd")
-            dest = item['destination'].replace("$PREFIX", TUXDROID_PREFIX)
+            dest = item['destination'].replace("$PREFIX", PREFIX)
             path = os.path.split(dest)[0]
             filename = os.path.split(item['source'])[1]
             
@@ -129,13 +129,13 @@
             os.system("tar -xf /tmp/tuxdroid_upd/%s -C /tmp/tuxdroid_upd/ &&\
                     cd /tmp/tuxdroid_upd/%s && /bin/bash install.sh %s %s &&\
                     rm -rf /tmp/tuxdroid_upd/" \
-                    %(filename, filename.split("-")[0], dest, TUXDROID_PREFIX))
+                    %(filename, filename.split("-")[0], dest, PREFIX))
     print ''
     writeDb(data)
 
     # Uninstall the ununsed stuff
     for item in toRemove:
-        dest = item['destination'].replace("$PREFIX", TUXDROID_PREFIX)
+        dest = item['destination'].replace("$PREFIX", PREFIX)
         if item['command'] == "COPY":
             if os.path.isfile(dest):
                 os.system("rm %s"%dest)
@@ -179,6 +179,8 @@
 
 def main():
     global DEBUG
+    global PREFIX 
+    PREFIX = TUXDROID_PREFIX
     
     # Set the default version type
     VERSION="Online"
@@ -186,8 +188,8 @@
     
     # Set the options parameters
     try:
-        opts, args = getopt.getopt(sys.argv[1:], "dhv:",\
-                ["debug", "help", "version="])
+        opts, args = getopt.getopt(sys.argv[1:], "dhv:p:",\
+                ["debug", "help", "version=", "prefix="])
     except getopt.error, msg:
         print msg
         print "For help use --help"
@@ -206,6 +208,9 @@
                 print "Unrecognized version type : %s"%a
                 print "Please see the help for the version type"
                 sys.exit(2)
+        if o in ("-p", "--prefix"):
+            PREFIX=a
+            print PREFIX
 
     # Retrieve informations from the server
     print ""


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