chiark / gitweb /
Don't check for dirs and files in the main script
authorDaniel Martí <mvdan@mvdan.cc>
Mon, 4 Nov 2013 17:37:57 +0000 (18:37 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Mon, 4 Nov 2013 17:41:20 +0000 (18:41 +0100)
fdroid
fdroidserver/common.py

diff --git a/fdroid b/fdroid
index 94e3aafc699de03676270f3b43494a0a2fa3b23d..a1f124c51eb9a70ebcf8ecb19027ece32609f229 100755 (executable)
--- a/fdroid
+++ b/fdroid
@@ -52,14 +52,6 @@ def main():
         print_help()
         sys.exit(1)
 
-    if command != 'init' and not os.path.isfile('config.py'):
-        print "Missing config file - is this a repo directory?"
-        sys.exit(2)
-
-    for basedir in ('metadata', 'tmp'):
-        if not os.path.exists(basedir):
-             os.makedirs(basedir)
-
     # Trick optparse into displaying the right usage when --help is used.
     sys.argv[0] += ' ' + command
 
index 9ba3dd3e48bdbd2f796414f1329f8a657b1a5430..77ed1995e2b9f80de83c7f7d2919da92d20b2e55 100644 (file)
@@ -867,6 +867,9 @@ def write_metadata(dest, app):
 # returned by the parse_metadata function.
 def read_metadata(xref=True, package=None):
     apps = []
+    for basedir in ('metadata', 'tmp'):
+        if not os.path.exists(basedir):
+            os.makedirs(basedir)
     for metafile in sorted(glob.glob(os.path.join('metadata', '*.txt'))):
         if package is None or metafile == os.path.join('metadata', package + '.txt'):
             try: