diff --git a/docs/fdroid.texi b/docs/fdroid.texi index 3c866862..1e9b9182 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -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]}. 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 @section Repo Type diff --git a/fdroidserver/build.py b/fdroidserver/build.py index dfe65cad..f18b308c 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -114,7 +114,7 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path): sshs = ssh.SSHClient() sshs.set_missing_host_key_policy(ssh.AutoAddPolicy()) 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']) # 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'): for lib in thisbuild['srclibs'].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. basesrclib = vcs.getsrclib() if basesrclib: srclibpaths.append(basesrclib) - print "Sending srclibs:" for _, lib in srclibpaths: + print "Sending srclib '" + lib + "'" ftp.chdir('/home/vagrant/build/extlib') + if not os.path.exists(lib): + raise BuildException("Missing srclib directory '" + lib + "'") send_dir(lib) # Execute the build script... diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index 1b99b085..aa7c648e 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -181,7 +181,9 @@ def main(): parser.add_option("-v", "--verbose", action="store_true", default=False, help="Spew out even more information than normal") 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() # Get all apps... @@ -197,6 +199,8 @@ def main(): for app in apps: print "Processing " + app['id'] + '...' + writeit = False + mode = app['Update Check Mode'] if mode == 'Market': (version, vercode) = check_market(app) @@ -219,8 +223,38 @@ def main(): print '...updating to version:' + version + ' vercode:' + vercode app['Current Version'] = version app['Current Version Code'] = str(int(vercode)) - metafile = os.path.join('metadata', app['id'] + '.txt') - common.write_metadata(metafile, app) + 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') + common.write_metadata(metafile, app) print "Finished." diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 0dd2942b..34f0d306 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -426,6 +426,7 @@ def parse_metadata(metafile, **kw): thisinfo['Disabled'] = None thisinfo['AntiFeatures'] = None thisinfo['Update Check Mode'] = 'Market' + thisinfo['Auto Update Mode'] = 'None' thisinfo['Current Version'] = '' thisinfo['Current Version Code'] = '0' thisinfo['Repo Type'] = '' @@ -594,6 +595,7 @@ def write_metadata(dest, app): mf.write('\n') if len(app['builds']) > 0: mf.write('\n') + writefield('Auto Update Mode') writefield('Update Check Mode') if len(app['Current Version']) > 0: writefield('Current Version') @@ -843,10 +845,12 @@ class MetaDataException(Exception): # 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 # 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('@') if name == 'GreenDroid': @@ -866,6 +870,8 @@ def getsrclib(spec, extlib_dir, sdk_path): 'update', 'project', '-p', libdir]) != 0: raise BuildException('Error updating ActionBarSherlock project') + if basepath: + return sdir return libdir if name == 'Amazing-ListView': @@ -878,6 +884,8 @@ def getsrclib(spec, extlib_dir, sdk_path): 'update', 'project', '-p', libdir]) != 0: raise BuildException('Error updating Amazing-ListView project') + if basepath: + return sdir return libdir if name == 'ViewPagerIndicator': @@ -890,6 +898,8 @@ def getsrclib(spec, extlib_dir, sdk_path): 'update', 'project', '-p', libdir]) != 0: raise BuildException('Error updating Android-ViewPagerIndicator project') + if basepath: + return sdir return libdir if name == 'UITableView': @@ -902,6 +912,8 @@ def getsrclib(spec, extlib_dir, sdk_path): 'update', 'project', '-p', libdir]) != 0: raise BuildException('Error updating UITableView project') + if basepath: + return sdir return libdir if name == 'ViewPagerTabs': @@ -929,6 +941,8 @@ def getsrclib(spec, extlib_dir, sdk_path): 'update', 'project', '-p', libdir]) != 0: raise BuildException('Error updating ActionBar project') + if basepath: + return sdir return libdir if name == 'ActionBarNW': @@ -941,6 +955,8 @@ def getsrclib(spec, extlib_dir, sdk_path): 'update', 'project', '-p', libdir]) != 0: raise BuildException('Error updating ActionBarNW project') + if basepath: + return sdir return libdir if name == 'FacebookSDK': @@ -953,6 +969,8 @@ def getsrclib(spec, extlib_dir, sdk_path): 'update', 'project', '-p', libdir]) != 0: raise BuildException('Error updating FacebookSDK project') + if basepath: + return sdir return libdir if name == 'OI': diff --git a/fdroidserver/update.py b/fdroidserver/update.py index a7dceaaf..ac8fc2c8 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -235,6 +235,21 @@ def main(): else: apkcache = {} 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 = [] for apkfile in glob.glob(os.path.join('repo','*.apk')):