"scanner": "Scan the source code of a package",
"stats": "Update the stats of the repo",
"server": "Interact with the repo HTTP server",
- }
+}
def print_help():
if os.path.isdir(vd):
# Vagrant 1.2 (and maybe 1.1?) it's a directory tree...
with open(os.path.join(vd, 'machines', 'default',
- 'virtualbox', 'id')) as vf:
+ 'virtualbox', 'id')) as vf:
id = vf.read()
return id
else:
return True
# Vagrant 1.2 - the directory can exist, but the id can be missing...
if not os.path.exists(os.path.join(vd, 'machines', 'default',
- 'virtualbox', 'id')):
+ 'virtualbox', 'id')):
return False
return True
ftp.put(os.path.join(serverpath, 'common.py'), 'common.py')
ftp.put(os.path.join(serverpath, 'metadata.py'), 'metadata.py')
ftp.put(os.path.join(serverpath, '..', 'buildserver',
- 'config.buildserver.py'), 'config.py')
+ 'config.buildserver.py'), 'config.py')
ftp.chmod('config.py', 0o600)
# Copy over the ID (head commit hash) of the fdroidserver in use...
shutil.copyfile(os.path.join(homedir, fn),
os.path.join(metadir, fn))
subprocess.call(['jar', 'uf', os.path.abspath(src),
- 'META-INF/' + fn], cwd=tmp_dir)
+ 'META-INF/' + fn], cwd=tmp_dir)
# Copy the unsigned apk to our destination directory for further
# processing (by publish.py)...
class vcs:
+
def __init__(self, remote, local):
# svn, git-svn and bzr may require auth
writeback = False
else:
deleterepo = True
- logging.info(
- "Repository details for %s changed - deleting" % (
- self.local))
+ logging.info("Repository details for %s changed - deleting" % (
+ self.local))
else:
deleterepo = True
logging.info("Repository details for %s missing - deleting" % (
def latesttags(self, alltags, number):
self.checkrepo()
p = FDroidPopen(['echo "' + '\n'.join(alltags) + '" | '
- + 'xargs -I@ git log --format=format:"%at @%n" -1 @ | '
- + 'sort -n | awk \'{print $2}\''],
+ +
+ 'xargs -I@ git log --format=format:"%at @%n" -1 @ | '
+ + 'sort -n | awk \'{print $2}\''],
cwd=self.local, shell=True, output=False)
return p.output.splitlines()[-number:]
class FDroidException(Exception):
+
def __init__(self, value, detail=None):
self.value = value
self.detail = detail
re.compile(r'crashlytics', re.IGNORECASE),
re.compile(r'ouya.*sdk', re.IGNORECASE),
re.compile(r'libspen23', re.IGNORECASE),
- ]
+ ]
scanignore = getpaths(build_dir, thisbuild, 'scanignore')
scandelete = getpaths(build_dir, thisbuild, 'scandelete')
'application/java-archive',
'application/octet-stream',
'binary',
- ):
+ ):
if has_extension(fp, 'apk'):
removeproblem('APK file', fd, fp)
class AsynchronousFileReader(threading.Thread):
+
'''
Helper class to implement asynchronous reading of a file
in a separate thread. Pushes read lines on a queue to
re.compile(r'.*variant\.outputFile = .*'),
re.compile(r'.*output\.outputFile = .*'),
re.compile(r'.*\.readLine\(.*'),
- ]
+ ]
for root, dirs, files in os.walk(build_dir):
if 'build.gradle' in files:
path = os.path.join(root, 'build.gradle')
'build.properties',
'default.properties',
'ant.properties',
- ]:
+ ]:
if propfile in files:
path = os.path.join(root, propfile)
"github URLs should always use https:// not http://"),
(re.compile(r'.*[^sS]://code\.google\.com/.*'),
"code.google.com URLs should always use https:// not http://"),
- ],
+ ],
'Source Code': [
(re.compile(r'.*[^sS]://github\.com/.*'),
"github URLs should always use https:// (not http://, git://, or git@)"),
"dl.google.com URLs should always use https:// not http://"),
(re.compile(r'.*[^sS]://gitorious\.org/.*'),
"gitorious URLs should always use https:// (not http://, git://, or git@)"),
- ],
+ ],
'Repo': [
(re.compile(r'.*[^sS]://code\.google\.com/.*'),
"code.google.com URLs should always use https:// not http://"),
"Apache SVN URLs should always use https:// (not http:// or svn://)"),
(re.compile(r'.*[^sS]://svn\.code\.sf\.net/.*'),
"Sourceforge SVN URLs should always use https:// (not http:// or svn://)"),
- ],
+ ],
'Issue Tracker': [
(re.compile(r'.*code\.google\.com/p/[^/]+[/]*$'),
"/issues is missing"),
"github URLs should always use https:// not http://"),
(re.compile(r'.*[^sS]://gitorious\.org/.*'),
"gitorious URLs should always use https:// not http://"),
- ],
+ ],
'License': [
(re.compile(r'^(|None|Unknown)$'),
"No license specified"),
- ],
+ ],
'Summary': [
(re.compile(r'^$'),
"Summary yet to be filled"),
- ],
+ ],
'Description': [
(re.compile(r'^No description available$'),
"Description yet to be filled"),
"Unnecessary leading space"),
(re.compile(r'.*\s$'),
"Unnecessary trailing space"),
- ],
+ ],
}
regex_pedantic = {
"Appending .git is not necessary"),
(re.compile(r'.*code\.google\.com/p/[^/]+/[^w]'),
"Possible incorrect path appended to google code project site"),
- ],
+ ],
'Source Code': [
(re.compile(r'.*github\.com/[^/]+/[^/]+\.git'),
"Appending .git is not necessary"),
(re.compile(r'.*code\.google\.com/p/[^/]+/source/.*'),
"/source is often enough on its own"),
- ],
+ ],
'Repo': [
(re.compile(r'^http://.*'),
"use https:// if available"),
(re.compile(r'^svn://.*'),
"use https:// if available"),
- ],
+ ],
'Issue Tracker': [
(re.compile(r'.*code\.google\.com/p/[^/]+/issues/.*'),
"/issues is often enough on its own"),
(re.compile(r'.*github\.com/[^/]+/[^/]+/issues/.*'),
"/issues is often enough on its own"),
- ],
+ ],
'Summary': [
(re.compile(r'.*\b(free software|open source)\b.*', re.IGNORECASE),
"No need to specify that the app is Free Software"),
(re.compile(r'.*[a-z0-9][.,!?][ $]'),
"Punctuation should be avoided"),
- ],
- }
+ ],
+}
def main():
class MetaDataException(Exception):
+
def __init__(self, value):
self.value = value
('Current Version', ''),
('Current Version Code', '0'),
('No Source Since', ''),
- ])
+])
# In the order in which they are laid out on files
('preassemble', []),
('antcommands', None),
('novcheck', False),
- ])
+])
# Designates a metadata field type and checks that it matches
r"^(Tags|Tags .+|RepoManifest|RepoManifest/.+|RepoTrunk|HTTP|Static|None)$", None,
["Update Check Mode"],
[])
- }
+}
# Check an app's metadata information for integrity errors
'apps': Counter(),
'appsver': Counter(),
'unknown': []
- }
+ }
p = subprocess.Popen(["zcat", logfile], stdout=subprocess.PIPE)
matches = (logsearch(line) for line in p.stdout)
('Kivy-1.7.2.tar.gz',
'https://pypi.python.org/packages/source/K/Kivy/Kivy-1.7.2.tar.gz',
'0485e2ef97b5086df886eb01f8303cb542183d2d71a159466f99ad6c8a1d03f1'),
- ]
+]
if config['arch64']:
cachefiles.extend([
'examples/makebs.config.py',
'examples/opensc-fdroid.cfg',
'examples/fdroid-icon.png']),
- ],
+ ],
install_requires=[
'mwclient',
'paramiko',
'apache-libcloud >= 0.14.1',
'pyasn1',
'pyasn1-modules',
- ],
+ ],
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Operating System :: POSIX',
'Topic :: Utilities',
- ],
+ ],
)