[xiph-cvs] r6472 - trunk/positron/scripts

volsung at xiph.org volsung at xiph.org
Tue Mar 30 08:23:37 PST 2004



Author: volsung
Date: 2004-03-30 11:23:37 -0500 (Tue, 30 Mar 2004)
New Revision: 6472

Modified:
   trunk/positron/scripts/positron
Log:
Special case to handle the now common occurance of the Neuros not
having a database directory at all.

<p>Modified: trunk/positron/scripts/positron
===================================================================
--- trunk/positron/scripts/positron	2004-03-30 16:22:44 UTC (rev 6471)
+++ trunk/positron/scripts/positron	2004-03-30 16:23:37 UTC (rev 6472)
@@ -16,6 +16,7 @@
 # or FITNESS FOR A PARTICULAR PURPOSE.  See the license for more details.
 
 import sys
+import os
 from os import path
 import getopt
 from positron.config import Config
@@ -149,6 +150,19 @@
         sys.exit(1)
 
     try:
+        
+	# Another special case since "rebuild" can be called when there
+	# is no db dir present.  Creating the dir before creating the
+        # Neuros object will ensure that no exceptions are thrown.
+        if remaining[0] == "rebuild":
+            dbdir = path.join(config.mountpoint, Neuros.DB_DIR)
+            if not path.exists(dbdir):
+                os.mkdir(dbdir)
+            elif not path.isdir(dbdir):
+                print "Error: There is file called %s where the database directory" % (dbdir,)
+                print "must go.  Please remove it and rerun 'positron rebuild'."
+                sys.exit(1)
+
         myNeuros = Neuros(config.mountpoint)
 
         if commands.has_key(remaining[0]):

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list