Merge branch 'master' of gitorious.org:f-droid/fdroidserver

This commit is contained in:
Ciaran Gultnieks 2013-09-09 08:49:52 +01:00
commit f19531e742
5 changed files with 40 additions and 13 deletions

View file

@ -50,8 +50,8 @@ def check_tags(app, sdk_path):
build_dir = os.path.join('build/', app['id'])
repotype = app['Repo Type']
if repotype not in ('git', 'git-svn'):
return (None, 'Tags update mode only works for git and git-svn repositories currently')
if repotype not in ('git', 'git-svn', 'hg'):
return (None, 'Tags update mode only works for git, hg and git-svn repositories currently')
# Set up vcs interface and make sure we have the latest code...
vcs = common.getvcs(app['Repo Type'], app['Repo'], build_dir, sdk_path)

View file

@ -342,6 +342,11 @@ class vcs_hg(vcs):
cwd=self.local) != 0:
raise VCSException("Hg checkout failed")
def gettags(self):
p = subprocess.Popen(['hg', 'tags', '-q'],
stdout=subprocess.PIPE, cwd=self.local)
return p.communicate()[0].splitlines()[1:]
class vcs_bzr(vcs):
@ -459,8 +464,6 @@ def parse_metadata(metafile, **kw):
if not isinstance(metafile, file):
metafile = open(metafile, "r")
thisinfo['id'] = metafile.name[9:-4]
if kw.get("verbose", False):
print "Reading metadata for " + thisinfo['id']
else:
thisinfo['id'] = None
@ -669,7 +672,11 @@ def write_metadata(dest, app):
def read_metadata(verbose=False, xref=True):
apps = []
for metafile in sorted(glob.glob(os.path.join('metadata', '*.txt'))):
apps.append(parse_metadata(metafile, verbose=verbose))
try:
appinfo = parse_metadata(metafile, verbose=verbose)
except Exception, e:
raise MetaDataException("Problem reading metadata file %s: - %s" % (metafile, str(e)))
apps.append(appinfo)
if xref:
# Parse all descriptions at load time, just to ensure cross-referencing