Don't check for dirs and files in the main script

This commit is contained in:
Daniel Martí 2013-11-04 18:37:57 +01:00
parent 85d32576eb
commit 429221f282
2 changed files with 3 additions and 8 deletions

8
fdroid
View file

@ -52,14 +52,6 @@ def main():
print_help() print_help()
sys.exit(1) 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. # Trick optparse into displaying the right usage when --help is used.
sys.argv[0] += ' ' + command sys.argv[0] += ' ' + command

View file

@ -867,6 +867,9 @@ def write_metadata(dest, app):
# returned by the parse_metadata function. # returned by the parse_metadata function.
def read_metadata(xref=True, package=None): def read_metadata(xref=True, package=None):
apps = [] 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'))): for metafile in sorted(glob.glob(os.path.join('metadata', '*.txt'))):
if package is None or metafile == os.path.join('metadata', package + '.txt'): if package is None or metafile == os.path.join('metadata', package + '.txt'):
try: try: