diff --git a/.gitignore b/.gitignore index eeabf9ea..e35a4b72 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ repo/ built/ build_*/ *~ +*.pyc diff --git a/build.py b/build.py old mode 100644 new mode 100755 index 248bb7f9..3f816d1a --- a/build.py +++ b/build.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # build.py - part of the FDroid server tools @@ -19,7 +20,6 @@ import sys import os import shutil -import glob import subprocess import re import zipfile @@ -29,10 +29,11 @@ import shlex from xml.dom.minidom import Document from optparse import OptionParser +import common + #Read configuration... execfile('config.py') -execfile('metadata.py') # Parse command line... parser = OptionParser() @@ -45,7 +46,7 @@ parser.add_option("-c", "--clean", action="store_true", default=False, (options, args) = parser.parse_args() # Get all apps... -apps = read_metadata() +apps = common.read_metadata() #Clear and/or create the 'built' directory, depending on mode: built_dir = 'built' diff --git a/metadata.py b/common.py similarity index 98% rename from metadata.py rename to common.py index d6b6d22a..835d5c0d 100644 --- a/metadata.py +++ b/common.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# metadata.py - part of the FDroid server tools +# common.py - part of the FDroid server tools # Copyright (C) 2010, Ciaran Gultnieks, ciaran@ciarang.com # # This program is free software: you can redistribute it and/or modify @@ -16,6 +16,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import glob, os, sys + def read_metadata(verbose=False): apps = [] diff --git a/update.py b/update.py old mode 100644 new mode 100755 index b12f147a..fa8c1d15 --- a/update.py +++ b/update.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # update.py - part of the FDroid server tools @@ -34,7 +35,7 @@ repo_icon = None repo_url = None execfile('config.py') -execfile('metadata.py') +import common # Parse command line... parser = OptionParser() @@ -66,7 +67,7 @@ if (repo_url is None or repo_name is None or sys.exit(1) # Get all apps... -apps = read_metadata(verbose=options.verbose) +apps = common.read_metadata(verbose=options.verbose) # Copy apks and source tarballs for stuff we've built from source that # is flagged to be included in the repo...