diff --git a/build.py b/build.py index b69020b5..0fcdcd67 100755 --- a/build.py +++ b/build.py @@ -74,15 +74,14 @@ if not os.path.isdir(build_dir): for app in apps: - if app['Disabled']: + if options.package and options.package != app['id']: + # Silent skip... + pass + elif app['Disabled']: print "Skipping %s: disabled" % app['id'] - elif not app['builds']: + elif (not app['builds']) or app['Repo Type'] =='' or len(app['builds']) == 0: print "Skipping %s: no builds specified" % app['id'] - - if (app['Disabled'] is None and app['Repo'] != '' - and app['Repo Type'] != '' and (options.package is None or - options.package == app['id']) and len(app['builds']) > 0): - + else: print "Processing " + app['id'] build_dir = 'build/' + app['id'] diff --git a/common.py b/common.py index d4552375..d70ea6f9 100644 --- a/common.py +++ b/common.py @@ -20,6 +20,7 @@ import glob, os, sys, re import shutil import subprocess import time +import operator def getvcs(vcstype, remote, local): if vcstype == 'git': @@ -54,39 +55,26 @@ class vcs: self.remote = remote self.local = local + self.refreshed = False - # Refresh the local repository - i.e. get the latest code. This - # works either by updating if a local copy already exists, or by - # cloning from scratch if it doesn't. - def refreshlocal(self): - if not os.path.exists(self.local): - self.clone() - else: - self.reset() - self.pull() - - # Clone the remote repository. It must not already exist locally. - def clone(self): - assert False # Must be defined in child - - # Reset the local repository. Remove changes, untracked files, etc. - # Put the working tree to either the given revision, or to the HEAD - # if not specified. - def reset(self, rev=None): - assert False # Must be defined in child - - # Get new commits from the remote repository. Local must be clean. - # Fetch would really be a better name, as this doesn't necessarily - # (depending on the vcs) affect the local source tree or HEAD! - def pull(self): - assert False # Must be defined in child + # Take the local repository to a clean version of the given revision, which + # is specificed in the VCS's native format. Beforehand, the repository can + # be dirty, or even non-existent. If the repository does already exist + # locally, it will be updated from the origin, but only once in the + # lifetime of the vcs object. + def gotorevision(self, rev): + raise VCSException("This VCS type doesn't define gotorevision") # Initialise and update submodules def initsubmodules(self): - assert False # Not supported unless overridden + raise VCSException('Submodules not supported for this vcs type') class vcs_git(vcs): + # If the local directory exists, but is somehow not a git repository, git + # will traverse up the directory tree until it finds one that is (i.e. + # fdroidserver) and then we'll proceed to destory it! This is called as + # a safety check. def checkrepo(self): p = subprocess.Popen(['git', 'rev-parse', '--show-toplevel'], stdout=subprocess.PIPE, cwd=self.local) @@ -94,28 +82,34 @@ class vcs_git(vcs): if not result.endswith(self.local): raise VCSException('Repository mismatch') - def clone(self): - if subprocess.call(['git', 'clone', self.remote, self.local]) != 0: - raise VCSException("Git clone failed") - - def reset(self, rev=None): - self.checkrepo() - if rev is None: - rev = 'origin' - if subprocess.call(['git', 'reset', '--hard', rev], - cwd=self.local) != 0: - raise VCSException("Git reset failed") - if subprocess.call(['git', 'clean', '-dfx'], - cwd=self.local) != 0: + def gotorevision(self, rev): + if not os.path.exists(self.local): + # Brand new checkout... + if subprocess.call(['git', 'clone', self.remote, self.local]) != 0: + raise VCSException("Git clone failed") + self.checkrepo() + else: + self.checkrepo() + # Discard any working tree changes... + if subprocess.call(['git', 'reset', '--hard'], cwd=self.local) != 0: + raise VCSException("Git reset failed") + # Remove untracked files now, in case they're tracked in the target + # revision (it happens!)... + if subprocess.call(['git', 'clean', '-dfx'], cwd=self.local) != 0: + raise VCSException("Git clean failed") + if not self.refreshed: + # Get latest commits and tags from remote... + if subprocess.call(['git', 'fetch', '--tags', 'origin'], + cwd=self.local) != 0: + raise VCSException("Git fetch failed") + self.refreshed = True + # Check out the appropriate revision... + if subprocess.call(['git', 'checkout', rev], cwd=self.local) != 0: + raise VCSException("Git checkout failed") + # Get rid of any uncontrolled files left behind... + if subprocess.call(['git', 'clean', '-dfx'], cwd=self.local) != 0: raise VCSException("Git clean failed") - def pull(self): - self.checkrepo() - # Might need tags that aren't on a branch. - if subprocess.call(['git', 'fetch', '--tags', 'origin'], - cwd=self.local) != 0: - raise VCSException("Git fetch failed") - def initsubmodules(self): self.checkrepo() if subprocess.call(['git', 'submodule', 'init'], @@ -128,6 +122,10 @@ class vcs_git(vcs): class vcs_gitsvn(vcs): + # If the local directory exists, but is somehow not a git repository, git + # will traverse up the directory tree until it finds one that is (i.e. + # fdroidserver) and then we'll proceed to destory it! This is called as + # a safety check. def checkrepo(self): p = subprocess.Popen(['git', 'rev-parse', '--show-toplevel'], stdout=subprocess.PIPE, cwd=self.local) @@ -135,34 +133,40 @@ class vcs_gitsvn(vcs): if not result.endswith(self.local): raise VCSException('Repository mismatch') - def clone(self): - if subprocess.call(['git', 'svn', 'clone', self.remote, self.local]) != 0: - raise VCSException("Git clone failed") - - def reset(self, rev=None): - self.checkrepo() - if rev is None: - rev = 'HEAD' + def gotorevision(self, rev): + if not os.path.exists(self.local): + # Brand new checkout... + if subprocess.call(['git', 'svn', 'clone', self.remote, self.local]) != 0: + raise VCSException("Git clone failed") + self.checkrepo() else: - p = subprocess.Popen(['git', 'svn', 'find-rev', 'r' + rev], - cwd=self.local, stdout=subprocess.PIPE) - rev = p.communicate()[0].rstrip() - if p.returncode != 0: - raise VCSException("Failed to get git treeish from svn rev") - if subprocess.call(['git', 'reset', '--hard', rev], - cwd=self.local) != 0: - raise VCSException("Git reset failed") - if subprocess.call(['git', 'clean', '-dfx'], - cwd=self.local) != 0: + self.checkrepo() + # Discard any working tree changes... + if subprocess.call(['git', 'reset', '--hard'], cwd=self.local) != 0: + raise VCSException("Git reset failed") + # Remove untracked files now, in case they're tracked in the target + # revision (it happens!)... + if subprocess.call(['git', 'clean', '-dfx'], cwd=self.local) != 0: + raise VCSException("Git clean failed") + if not self.refreshed: + # Get new commits and tags from repo... + if subprocess.call(['git', 'svn', 'rebase'], + cwd=self.local) != 0: + raise VCSException("Git svn rebase failed") + self.refreshed = True + # Figure out the git commit id corresponding to the svn revision... + p = subprocess.Popen(['git', 'svn', 'find-rev', 'r' + rev], + cwd=self.local, stdout=subprocess.PIPE) + rev = p.communicate()[0].rstrip() + if p.returncode != 0: + raise VCSException("Failed to get git treeish from svn rev") + # Check out the appropriate revision... + if subprocess.call(['git', 'checkout', rev], cwd=self.local) != 0: + raise VCSException("Git checkout failed") + # Get rid of any uncontrolled files left behind... + if subprocess.call(['git', 'clean', '-dfx'], cwd=self.local) != 0: raise VCSException("Git clean failed") - def pull(self): - self.checkrepo() - if subprocess.call(['git', 'svn', 'rebase'], - cwd=self.local) != 0: - raise VCSException("Git svn rebase failed") - - class vcs_svn(vcs): def userargs(self): @@ -172,77 +176,70 @@ class vcs_svn(vcs): '--password', self.password, '--non-interactive'] - def clone(self): - if subprocess.call(['svn', 'checkout', self.remote, self.local] + - self.userargs()) != 0: - raise VCSException("Svn checkout failed") - - def reset(self, rev=None): - if rev is None: - revargs = [] + def gotorevision(self, rev): + if not os.path.exists(self.local): + if subprocess.call(['svn', 'checkout', self.remote, self.local] + + self.userargs()) != 0: + raise VCSException("Svn checkout failed") else: - revargs = ['-r', rev] - for svncommand in ( - 'svn revert -R .', - r"svn status | awk '/\?/ {print $2}' | xargs rm -rf"): - if subprocess.call(svncommand, cwd=self.local, - shell=True) != 0: - raise VCSException("Svn reset failed") + for svncommand in ( + 'svn revert -R .', + r"svn status | awk '/\?/ {print $2}' | xargs rm -rf"): + if subprocess.call(svncommand, cwd=self.local, + shell=True) != 0: + raise VCSException("Svn reset failed") + if not self.refreshed: + if subprocess.call(['svn', 'update'] + + self.userargs(), cwd=self.local) != 0: + raise VCSException("Svn update failed") + self.refreshed = True + revargs = ['-r', rev] if subprocess.call(['svn', 'update', '--force'] + revargs + self.userargs(), cwd=self.local) != 0: raise VCSException("Svn update failed") - def pull(self): - if subprocess.call(['svn', 'update'] + - self.userargs(), cwd=self.local) != 0: - raise VCSException("Svn update failed") class vcs_hg(vcs): - def clone(self): - if subprocess.call(['hg', 'clone', self.remote, self.local]) !=0: - raise VCSException("Hg clone failed") - - def reset(self, rev=None): - if rev is None: - revargs = [] + def gotorevision(self, rev): + if not os.path.exists(self.local): + if subprocess.call(['hg', 'clone', self.remote, self.local]) !=0: + raise VCSException("Hg clone failed") else: - revargs = [rev] - if subprocess.call('hg status -u | xargs rm -rf', - cwd=self.local, shell=True) != 0: - raise VCSException("Hg clean failed") + if subprocess.call('hg status -u | xargs rm -rf', + cwd=self.local, shell=True) != 0: + raise VCSException("Hg clean failed") + if not self.refreshed: + if subprocess.call(['hg', 'pull'], + cwd=self.local) != 0: + raise VCSException("Hg pull failed") + self.refreshed = True + revargs = [rev] if subprocess.call(['hg', 'checkout', '-C'] + revargs, cwd=self.local) != 0: raise VCSException("Hg checkout failed") - def pull(self): - if subprocess.call(['hg', 'pull'], - cwd=self.local) != 0: - raise VCSException("Hg pull failed") class vcs_bzr(vcs): - def clone(self): - if subprocess.call(['bzr', 'branch', self.remote, self.local]) != 0: - raise VCSException("Bzr branch failed") - - def reset(self, rev=None): - if rev is None: - revargs = [] + def gotorevision(self, rev): + if not os.path.exists(self.local): + if subprocess.call(['bzr', 'branch', self.remote, self.local]) != 0: + raise VCSException("Bzr branch failed") else: - revargs = ['-r', rev] - if subprocess.call(['bzr', 'clean-tree', '--force', - '--unknown', '--ignored'], cwd=self.local) != 0: - raise VCSException("Bzr revert failed") + if subprocess.call(['bzr', 'clean-tree', '--force', + '--unknown', '--ignored'], cwd=self.local) != 0: + raise VCSException("Bzr revert failed") + if not self.refreshed: + if subprocess.call(['bzr', 'pull'], + cwd=self.local) != 0: + raise VCSException("Bzr update failed") + self.refreshed = True + revargs = ['-r', rev] if subprocess.call(['bzr', 'revert'] + revargs, cwd=self.local) != 0: raise VCSException("Bzr revert failed") - def pull(self): - if subprocess.call(['bzr', 'pull'], - cwd=self.local) != 0: - raise VCSException("Bzr update failed") - # Get the type expected for a given metadata field. def metafieldtype(name): @@ -548,9 +545,6 @@ class MetaDataException(Exception): # be a subdirectory of it. def prepare_source(vcs, app, build, build_dir, sdk_path, ndk_path, javacc_path, refresh): - if refresh: - vcs.refreshlocal() - # Optionally, the actual app source can be in a subdirectory... if build.has_key('subdir'): root_dir = os.path.join(build_dir, build['subdir']) @@ -558,8 +552,8 @@ def prepare_source(vcs, app, build, build_dir, sdk_path, ndk_path, javacc_path, root_dir = build_dir # Get a working copy of the right revision... - print "Resetting repository to " + build['commit'] - vcs.reset(build['commit']) + print "Getting source for revision " + build['commit'] + vcs.gotorevision(build['commit']) # Check that a subdir (if we're using one) exists. This has to happen # after the checkout, since it might not exist elsewhere... @@ -632,7 +626,9 @@ def prepare_source(vcs, app, build, build_dir, sdk_path, ndk_path, javacc_path, # Delete unwanted file... if build.has_key('rm'): - os.remove(os.path.join(build_dir, build['rm'])) + dest = os.path.join(build_dir, build['rm']) + if os.path.exists(dest): + os.remove(dest) # Fix apostrophes translation files if necessary... if build.get('fixapos', 'no') == 'yes': @@ -821,3 +817,20 @@ class KnownApks: if apkname in self.apks: return self.apks[apkname] return None + + def getlatest(self, num): + apps = {} + for apk, app in self.apks.iteritems(): + appid, added = app + if added: + if appid in apps: + if apps[appid] > added: + apps[appid] = added + else: + apps[appid] = added + sortedapps = sorted(apps.iteritems(), key=operator.itemgetter(1))[-num:] + lst = [] + for app, added in sortedapps: + lst.append(app) + return lst + diff --git a/metadata/apps.droidnotify.txt b/metadata/apps.droidnotify.txt new file mode 100644 index 00000000..89c50077 --- /dev/null +++ b/metadata/apps.droidnotify.txt @@ -0,0 +1,26 @@ +Category:System +License:GPLv3 +Web Site:https://code.google.com/p/droid-notify/ +Source Code:https://code.google.com/p/droid-notify/source/browse/ +Issue Tracker:https://code.google.com/p/droid-notify/issues/list +Donate:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=43V2NJQH5BQAA + +Summary:Notification management tool +Description: +This application will display a popup window for Missed Calls, Text Messages, Calendar Events and Emails (K-9 email). +It is extremely customizable with many options to suit your needs and style. +. + +Repo Type:svn +Repo:http://droid-notify.googlecode.com/svn/trunk + +Build Version:2.20,27,707,patch=facebook.patch,prebuild=mv lib/ libs/ \ + && git clone git://github.com/facebook/facebook-android-sdk.git \ + && cp facebook-android-sdk/facebook/default.properties facebook-android-sdk/facebook/project.properties \ + && cp build.xml facebook-android-sdk/facebook/ \ + && cp local.properties facebook-android-sdk/facebook/ + +Update Check Mode:Market +Market Version:2.21 +Market Version Code:28 + diff --git a/metadata/apps.droidnotify/facebook.patch b/metadata/apps.droidnotify/facebook.patch new file mode 100644 index 00000000..6382c131 --- /dev/null +++ b/metadata/apps.droidnotify/facebook.patch @@ -0,0 +1,10 @@ +Index: project.properties +=================================================================== +--- a/project.properties (revision 707) ++++ b/project.properties (working copy) +@@ -9,4 +9,4 @@ + + # Project target. + target=android-8 +-android.library.reference.1=../com_facebook_android ++android.library.reference.1=facebook-android-sdk/facebook diff --git a/metadata/com.axelby.podax.txt b/metadata/com.axelby.podax.txt new file mode 100644 index 00000000..187f324a --- /dev/null +++ b/metadata/com.axelby.podax.txt @@ -0,0 +1,30 @@ +Category:Multimedia +License:BSD +Web Site:https://market.android.com/details?id=com.axelby.podax +Source Code:https://github.com/thasmin/Podax +Issue Tracker:https://github.com/thasmin/Podax/issues + +Summary:podcast downloader and player +Description: +It automatically downloads new podcasts on an RSS feed, has a widget for easy control, and can import subscriptions from Google Reader. +Features include: +- keeping a list of subscriptions +- downloading new podcasts when they are available +- importing subscriptions from OPML +- two widgets for easy pausing and resuming +- discover popular podcasts from other Podax listeners +. + +Repo Type:git +Repo:git://github.com/thasmin/Podax.git + +# this force closes on my device +#Build Version:1.3,9,e44055a50fe5f4457f17c70666e3683bd7818fc1,target=android-7 +#Build Version:2.0,10,7141fee3933a580556121a01c60da04e9f37f7ac,target=android-7 +#Build Version:2.1,11,ab60ff786c0e050c94979f4801330c4f226e26d7,target=android-7 +Build Version:2.11,12,13d0e30198d96b4cd7b1a87065a1b8cf3ed578f4,target=android-7 + +Update Check Mode:Market +Market Version:2.11 +Market Version Code:12 + diff --git a/metadata/com.digitallizard.nicecompass.txt b/metadata/com.digitallizard.nicecompass.txt new file mode 100644 index 00000000..871b9765 --- /dev/null +++ b/metadata/com.digitallizard.nicecompass.txt @@ -0,0 +1,20 @@ +Category:Navigation +License:BSD +Web Site:https://market.android.com/details?id=com.digitallizard.nicecompass +Source Code:https://github.com/okey666/NiceCompass +Issue Tracker:https://github.com/okey666/NiceCompass/issues + +Summary:A nice compass app +Description: +It provides a graphical compass card along with text bearing information. +. + +Repo Type:git +Repo:git://github.com/okey666/NiceCompass.git + +Update Check Mode:Market +Market Version:1.3 +Market Version Code:6 + +# uses ActionBarSherlock library which is not included +#Build Version:1.3,6,b6f322cf10ec4320ca5b4111f75dccfdd4b6f7f0 diff --git a/metadata/com.funambol.androidsync.txt b/metadata/com.funambol.androidsync.txt index ae8ff80a..43a009f5 100644 --- a/metadata/com.funambol.androidsync.txt +++ b/metadata/com.funambol.androidsync.txt @@ -19,11 +19,12 @@ Build Version:10.0.4,14,2162,subdir=tags/10.0.4,update=no,initfun=yes Build Version:10.0.5,15,2211,subdir=tags/10.0.5,update=no,initfun=yes Build Version:10.0.6,16,2337,subdir=tags/10.0.6,update=no,initfun=yes +Update Check Mode:Market #Source inaccessible for the last few days: # svn: Can't open file 'branches/us6260v87/src/com/funambol/android/source/pim/.svn/lock': No space left on device #Source is now accessible, but the build is failing without an obvious error. #Need to look at this again. #Build Version:10.0.7,17,2671,subdir=tags/10.0.7,update=no,initfun=yes -Market Version:10.0.7 -Market Version Code:17 +Market Version:10.0.8 +Market Version Code:18 diff --git a/metadata/com.google.android.stardroid.txt b/metadata/com.google.android.stardroid.txt new file mode 100644 index 00000000..71c912c0 --- /dev/null +++ b/metadata/com.google.android.stardroid.txt @@ -0,0 +1,22 @@ +# libs/libGoogleAnalytics.jar +AntiFeatures:Tracking +Category:None +License:Apache2 +Web Site:https://code.google.com/p/stardroid/ +Source Code:https://code.google.com/p/stardroid/source/browse/ +Issue Tracker:https://code.google.com/p/stardroid/issues/list + +Summary:Sky Map to explore the skies +Description: +Point your phone at the sky, and Sky Map will show the stars, planets, constellations, and more to help you identify the celestial objects in view. You can also browse the skies in manual mode. +. + +Repo Type:svn +Repo:http://stardroid.googlecode.com/svn/trunk/app + +Build Version:1.6.4,1112,3 + +Update Check Mode:Market +Market Version:1.6.4 +Market Version Code:1112 + diff --git a/metadata/eu.vranckaert.worktime.txt b/metadata/eu.vranckaert.worktime.txt new file mode 100644 index 00000000..d9786b4b --- /dev/null +++ b/metadata/eu.vranckaert.worktime.txt @@ -0,0 +1,22 @@ +Disabled:Build problems +Category:Office +License:Apache2 +Web Site:https://code.google.com/p/worktime/ +Source Code:https://code.google.com/p/worktime/source/browse/ +Issue Tracker:https://code.google.com/p/worktime/wiki/Issues?tm=3 +Donate: + +Summary:tracks your work time +Description: +Worktime targets on business people that want to keep track of their time. Weather you are working on different projects for different clients or just one project for one company, WorkTime is the application that will track your time. +It also includes a widget which makes registering time even faster as you can do it right from you Android Home-Screen. +You can generate reports based by filtering your time registrations by date (pre-defined date ranges or a custom date range) and by project and task. +. + +Repo Type:svn +Repo:http://worktime.googlecode.com/svn/branches/1.1.2-f/android-app + +# Doesn't build, yet +#Build Version:1.1.2.f,104,268,target=android-11,patch=style.patch +Build Version:1.1.3.a - UNSTABLE,107,273,target=android-11,patch=style.patch + diff --git a/metadata/eu.vranckaert.worktime/style.patch b/metadata/eu.vranckaert.worktime/style.patch new file mode 100644 index 00000000..743b3399 --- /dev/null +++ b/metadata/eu.vranckaert.worktime/style.patch @@ -0,0 +1,16 @@ +Index: res/values-v13/styles.xml +=================================================================== +--- a/res/values-v13/styles.xml (revision 273) ++++ b/res/values-v13/styles.xml (working copy) +@@ -16,8 +16,9 @@ + --> + + +-