mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-08 00:10:12 +01:00
Merge branch 'master' of git://gitorious.org/f-droid/fdroidserver
This commit is contained in:
commit
0b1c9ee570
@ -598,7 +598,8 @@ browser or the wiki. The link text will be the apps name.
|
|||||||
Links to web addresses can be done using @code{[http://example.com Text]}.
|
Links to web addresses can be done using @code{[http://example.com Text]}.
|
||||||
|
|
||||||
Bulletted lists are done by simply starting each item with a @code{*} on
|
Bulletted lists are done by simply starting each item with a @code{*} on
|
||||||
a new line, and numbered lists are the same but using @code{#}.
|
a new line, and numbered lists are the same but using @code{#}. There is
|
||||||
|
currently no support for nesting lists - you can have one level only.
|
||||||
|
|
||||||
@node Repo Type
|
@node Repo Type
|
||||||
@section Repo Type
|
@section Repo Type
|
||||||
|
@ -114,7 +114,7 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path):
|
|||||||
sshs = ssh.SSHClient()
|
sshs = ssh.SSHClient()
|
||||||
sshs.set_missing_host_key_policy(ssh.AutoAddPolicy())
|
sshs.set_missing_host_key_policy(ssh.AutoAddPolicy())
|
||||||
sshs.connect(sshconfig['hostname'], username=sshconfig['user'],
|
sshs.connect(sshconfig['hostname'], username=sshconfig['user'],
|
||||||
port=int(sshconfig['port']), timeout=10, look_for_keys=False,
|
port=int(sshconfig['port']), timeout=60, look_for_keys=False,
|
||||||
key_filename=sshconfig['identityfile'])
|
key_filename=sshconfig['identityfile'])
|
||||||
|
|
||||||
# Get an SFTP connection...
|
# Get an SFTP connection...
|
||||||
@ -179,14 +179,16 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path):
|
|||||||
if thisbuild.has_key('srclibs'):
|
if thisbuild.has_key('srclibs'):
|
||||||
for lib in thisbuild['srclibs'].split(';'):
|
for lib in thisbuild['srclibs'].split(';'):
|
||||||
name, _ = lib.split('@')
|
name, _ = lib.split('@')
|
||||||
srclibpaths.append((name, common.getsrclib(lib, 'build/extlib', sdk_path)))
|
srclibpaths.append((name, common.getsrclib(lib, 'build/extlib', sdk_path, basepath=True)))
|
||||||
# If one was used for the main source, add that too.
|
# If one was used for the main source, add that too.
|
||||||
basesrclib = vcs.getsrclib()
|
basesrclib = vcs.getsrclib()
|
||||||
if basesrclib:
|
if basesrclib:
|
||||||
srclibpaths.append(basesrclib)
|
srclibpaths.append(basesrclib)
|
||||||
print "Sending srclibs:"
|
|
||||||
for _, lib in srclibpaths:
|
for _, lib in srclibpaths:
|
||||||
|
print "Sending srclib '" + lib + "'"
|
||||||
ftp.chdir('/home/vagrant/build/extlib')
|
ftp.chdir('/home/vagrant/build/extlib')
|
||||||
|
if not os.path.exists(lib):
|
||||||
|
raise BuildException("Missing srclib directory '" + lib + "'")
|
||||||
send_dir(lib)
|
send_dir(lib)
|
||||||
|
|
||||||
# Execute the build script...
|
# Execute the build script...
|
||||||
|
@ -181,7 +181,9 @@ def main():
|
|||||||
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
||||||
help="Spew out even more information than normal")
|
help="Spew out even more information than normal")
|
||||||
parser.add_option("-p", "--package", default=None,
|
parser.add_option("-p", "--package", default=None,
|
||||||
help="Build only the specified package")
|
help="Check only the specified package")
|
||||||
|
parser.add_option("--auto", action="store_true", default=False,
|
||||||
|
help="Process auto-updates")
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
# Get all apps...
|
# Get all apps...
|
||||||
@ -197,6 +199,8 @@ def main():
|
|||||||
for app in apps:
|
for app in apps:
|
||||||
print "Processing " + app['id'] + '...'
|
print "Processing " + app['id'] + '...'
|
||||||
|
|
||||||
|
writeit = False
|
||||||
|
|
||||||
mode = app['Update Check Mode']
|
mode = app['Update Check Mode']
|
||||||
if mode == 'Market':
|
if mode == 'Market':
|
||||||
(version, vercode) = check_market(app)
|
(version, vercode) = check_market(app)
|
||||||
@ -219,6 +223,36 @@ def main():
|
|||||||
print '...updating to version:' + version + ' vercode:' + vercode
|
print '...updating to version:' + version + ' vercode:' + vercode
|
||||||
app['Current Version'] = version
|
app['Current Version'] = version
|
||||||
app['Current Version Code'] = str(int(vercode))
|
app['Current Version Code'] = str(int(vercode))
|
||||||
|
writeit = True
|
||||||
|
|
||||||
|
if options.auto:
|
||||||
|
mode = app['Auto Update Mode']
|
||||||
|
if mode == 'None':
|
||||||
|
pass
|
||||||
|
elif mode.startswith('Version '):
|
||||||
|
pattern = mode[8:]
|
||||||
|
gotcur = False
|
||||||
|
latest = None
|
||||||
|
for build in app['builds']:
|
||||||
|
if build['vercode'] == app['Current Version Code']:
|
||||||
|
gotcur = True
|
||||||
|
if not latest or build['vercode'] > latest['vercode']:
|
||||||
|
latest = build
|
||||||
|
if not gotcur:
|
||||||
|
newbuild = latest.copy()
|
||||||
|
del newbuild['origlines']
|
||||||
|
newbuild['vercode'] = app['Current Version Code']
|
||||||
|
newbuild['version'] = app['Current Version']
|
||||||
|
print "...auto-generating build for " + newbuild['version']
|
||||||
|
commit = pattern.replace('%v', newbuild['version'])
|
||||||
|
commit = commit.replace('%c', newbuild['vercode'])
|
||||||
|
newbuild['commit'] = commit
|
||||||
|
app['builds'].append(newbuild)
|
||||||
|
writeit = True
|
||||||
|
else:
|
||||||
|
print 'Invalid auto update mode'
|
||||||
|
|
||||||
|
if writeit:
|
||||||
metafile = os.path.join('metadata', app['id'] + '.txt')
|
metafile = os.path.join('metadata', app['id'] + '.txt')
|
||||||
common.write_metadata(metafile, app)
|
common.write_metadata(metafile, app)
|
||||||
|
|
||||||
|
@ -426,6 +426,7 @@ def parse_metadata(metafile, **kw):
|
|||||||
thisinfo['Disabled'] = None
|
thisinfo['Disabled'] = None
|
||||||
thisinfo['AntiFeatures'] = None
|
thisinfo['AntiFeatures'] = None
|
||||||
thisinfo['Update Check Mode'] = 'Market'
|
thisinfo['Update Check Mode'] = 'Market'
|
||||||
|
thisinfo['Auto Update Mode'] = 'None'
|
||||||
thisinfo['Current Version'] = ''
|
thisinfo['Current Version'] = ''
|
||||||
thisinfo['Current Version Code'] = '0'
|
thisinfo['Current Version Code'] = '0'
|
||||||
thisinfo['Repo Type'] = ''
|
thisinfo['Repo Type'] = ''
|
||||||
@ -594,6 +595,7 @@ def write_metadata(dest, app):
|
|||||||
mf.write('\n')
|
mf.write('\n')
|
||||||
if len(app['builds']) > 0:
|
if len(app['builds']) > 0:
|
||||||
mf.write('\n')
|
mf.write('\n')
|
||||||
|
writefield('Auto Update Mode')
|
||||||
writefield('Update Check Mode')
|
writefield('Update Check Mode')
|
||||||
if len(app['Current Version']) > 0:
|
if len(app['Current Version']) > 0:
|
||||||
writefield('Current Version')
|
writefield('Current Version')
|
||||||
@ -843,10 +845,12 @@ class MetaDataException(Exception):
|
|||||||
|
|
||||||
|
|
||||||
# Get the specified source library.
|
# Get the specified source library.
|
||||||
# Returns the path to it.
|
# Returns the path to it. Normally this is the path to be used when referencing
|
||||||
|
# it, which may be a subdirectory of the actual project. If you want the base
|
||||||
|
# directory of the project, pass 'basepath=True'.
|
||||||
# TODO: These are currently just hard-coded in this method. It will be a
|
# TODO: These are currently just hard-coded in this method. It will be a
|
||||||
# metadata-driven system eventually, but not yet.
|
# metadata-driven system eventually, but not yet.
|
||||||
def getsrclib(spec, extlib_dir, sdk_path):
|
def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
|
||||||
name, ref = spec.split('@')
|
name, ref = spec.split('@')
|
||||||
|
|
||||||
if name == 'GreenDroid':
|
if name == 'GreenDroid':
|
||||||
@ -866,6 +870,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
|
|||||||
'update', 'project', '-p',
|
'update', 'project', '-p',
|
||||||
libdir]) != 0:
|
libdir]) != 0:
|
||||||
raise BuildException('Error updating ActionBarSherlock project')
|
raise BuildException('Error updating ActionBarSherlock project')
|
||||||
|
if basepath:
|
||||||
|
return sdir
|
||||||
return libdir
|
return libdir
|
||||||
|
|
||||||
if name == 'Amazing-ListView':
|
if name == 'Amazing-ListView':
|
||||||
@ -878,6 +884,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
|
|||||||
'update', 'project', '-p',
|
'update', 'project', '-p',
|
||||||
libdir]) != 0:
|
libdir]) != 0:
|
||||||
raise BuildException('Error updating Amazing-ListView project')
|
raise BuildException('Error updating Amazing-ListView project')
|
||||||
|
if basepath:
|
||||||
|
return sdir
|
||||||
return libdir
|
return libdir
|
||||||
|
|
||||||
if name == 'ViewPagerIndicator':
|
if name == 'ViewPagerIndicator':
|
||||||
@ -890,6 +898,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
|
|||||||
'update', 'project', '-p',
|
'update', 'project', '-p',
|
||||||
libdir]) != 0:
|
libdir]) != 0:
|
||||||
raise BuildException('Error updating Android-ViewPagerIndicator project')
|
raise BuildException('Error updating Android-ViewPagerIndicator project')
|
||||||
|
if basepath:
|
||||||
|
return sdir
|
||||||
return libdir
|
return libdir
|
||||||
|
|
||||||
if name == 'UITableView':
|
if name == 'UITableView':
|
||||||
@ -902,6 +912,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
|
|||||||
'update', 'project', '-p',
|
'update', 'project', '-p',
|
||||||
libdir]) != 0:
|
libdir]) != 0:
|
||||||
raise BuildException('Error updating UITableView project')
|
raise BuildException('Error updating UITableView project')
|
||||||
|
if basepath:
|
||||||
|
return sdir
|
||||||
return libdir
|
return libdir
|
||||||
|
|
||||||
if name == 'ViewPagerTabs':
|
if name == 'ViewPagerTabs':
|
||||||
@ -929,6 +941,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
|
|||||||
'update', 'project', '-p',
|
'update', 'project', '-p',
|
||||||
libdir]) != 0:
|
libdir]) != 0:
|
||||||
raise BuildException('Error updating ActionBar project')
|
raise BuildException('Error updating ActionBar project')
|
||||||
|
if basepath:
|
||||||
|
return sdir
|
||||||
return libdir
|
return libdir
|
||||||
|
|
||||||
if name == 'ActionBarNW':
|
if name == 'ActionBarNW':
|
||||||
@ -941,6 +955,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
|
|||||||
'update', 'project', '-p',
|
'update', 'project', '-p',
|
||||||
libdir]) != 0:
|
libdir]) != 0:
|
||||||
raise BuildException('Error updating ActionBarNW project')
|
raise BuildException('Error updating ActionBarNW project')
|
||||||
|
if basepath:
|
||||||
|
return sdir
|
||||||
return libdir
|
return libdir
|
||||||
|
|
||||||
if name == 'FacebookSDK':
|
if name == 'FacebookSDK':
|
||||||
@ -953,6 +969,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
|
|||||||
'update', 'project', '-p',
|
'update', 'project', '-p',
|
||||||
libdir]) != 0:
|
libdir]) != 0:
|
||||||
raise BuildException('Error updating FacebookSDK project')
|
raise BuildException('Error updating FacebookSDK project')
|
||||||
|
if basepath:
|
||||||
|
return sdir
|
||||||
return libdir
|
return libdir
|
||||||
|
|
||||||
if name == 'OI':
|
if name == 'OI':
|
||||||
|
@ -235,6 +235,21 @@ def main():
|
|||||||
else:
|
else:
|
||||||
apkcache = {}
|
apkcache = {}
|
||||||
cachechanged = False
|
cachechanged = False
|
||||||
|
|
||||||
|
# Check repo directory for disabled builds and remove them...
|
||||||
|
for app in apps:
|
||||||
|
for build in app['builds']:
|
||||||
|
if build['commit'].startswith('!'):
|
||||||
|
apkfilename = app['id'] + '_' + str(build['vercode']) + '.apk'
|
||||||
|
apkpath = os.path.join('repo', apkfilename)
|
||||||
|
srcpath = apkfilename[:-4] + "_src.tar.gz"
|
||||||
|
for name in [apkpath, srcpath]:
|
||||||
|
if os.path.exists(name):
|
||||||
|
print "Deleting disabled build output " + apkfilename
|
||||||
|
os.remove(name)
|
||||||
|
if apkcache.has_key(apkfilename):
|
||||||
|
del apkcache[apkfilename]
|
||||||
|
|
||||||
apks = []
|
apks = []
|
||||||
for apkfile in glob.glob(os.path.join('repo','*.apk')):
|
for apkfile in glob.glob(os.path.join('repo','*.apk')):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user