1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-14 02:50:12 +01:00

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

This commit is contained in:
Ciaran Gultnieks 2013-05-31 07:59:50 +01:00
commit 94afbd8878
5 changed files with 40 additions and 41 deletions

View File

@ -638,9 +638,14 @@ The git-svn option connects to an SVN repository, and you specify the URL in
exactly the same way, but git is used as a back-end. This is preferable for exactly the same way, but git is used as a back-end. This is preferable for
performance reasons, and also because a local copy of the entire history is performance reasons, and also because a local copy of the entire history is
available in case the upstream repository disappears. (It happens!). In available in case the upstream repository disappears. (It happens!). In
order to use RepoManifest or Tags as update check modes for this VCS type order to use Tags as update check mode for this VCS type, the URL must have
the URL must encode the path to the trunk and tags, like so: the tags= special argument set. Likewise, if you intend to use the
http://svn.code.sf.net/p/project/code;trunk=trunk;tags=tags. RepoManifest/branch scheme, you would want to specify branches= as well.
Finally, trunk= can also be added. All these special arguments will be passed
to "git svn" in order, and their values must be relative paths to the svn repo
root dir.
Here's an example of a complex git-svn Repo URL:
http://svn.code.sf.net/p/project/code/svn;trunk=trunk;tags=tags;branches=branches
For a Subversion repo that requires authentication, you can precede the repo For a Subversion repo that requires authentication, you can precede the repo
URL with username:password@ and those parameters will be passed as @option{--username} URL with username:password@ and those parameters will be passed as @option{--username}

4
fdroid
View File

@ -18,7 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys import sys
import fdroidserver
commands = [ commands = [
"build", "build",
@ -45,8 +44,7 @@ def main():
command = sys.argv[1] command = sys.argv[1]
if not command in commands: if not command in commands:
print "Command '" + command + "' not recognised." print "Command '" + command + "' not recognised.\n"
print ""
print_help() print_help()
sys.exit(1) sys.exit(1)

View File

@ -60,11 +60,9 @@ def check_tags(app, sdk_path):
vcs.gotorevision(None) vcs.gotorevision(None)
if len(app['builds']) == 0: if len(app['builds']) > 0:
return (None, "Can't use Tags with no builds defined") if 'subdir' in app['builds'][-1]:
build_dir = os.path.join(build_dir, app['builds'][-1]['subdir'])
if 'subdir' in app['builds'][-1]:
build_dir = os.path.join(build_dir, app['builds'][-1]['subdir'])
hver = None hver = None
hcode = "0" hcode = "0"
@ -126,7 +124,10 @@ def check_repomanifest(app, sdk_path, branch=None):
vcs.gotorevision('origin/master') vcs.gotorevision('origin/master')
pass pass
elif vcs.repotype() == 'git-svn': elif vcs.repotype() == 'git-svn':
vcs.gotorevision(None) if branch:
vcs.gotorevision(branch)
else:
vcs.gotorevision(None)
elif vcs.repotype() == 'svn': elif vcs.repotype() == 'svn':
vcs.gotorevision(None) vcs.gotorevision(None)
elif vcs.repotype() == 'hg': elif vcs.repotype() == 'hg':
@ -135,11 +136,9 @@ def check_repomanifest(app, sdk_path, branch=None):
else: else:
vcs.gotorevision('default') vcs.gotorevision('default')
if len(app['builds']) == 0: if len(app['builds']) > 0:
return (None, "Can't use RepoManifest with no builds defined") if 'subdir' in app['builds'][-1]:
build_dir = os.path.join(build_dir, app['builds'][-1]['subdir'])
if 'subdir' in app['builds'][-1]:
build_dir = os.path.join(build_dir, app['builds'][-1]['subdir'])
version, vercode, package = common.parse_androidmanifest(build_dir) version, vercode, package = common.parse_androidmanifest(build_dir)
if not package: if not package:
@ -177,9 +176,6 @@ def check_market(app):
except urllib2.HTTPError, e: except urllib2.HTTPError, e:
if e.code == 404: if e.code == 404:
return (None, 'Not in market') return (None, 'Not in market')
elif e.code == 503:
print "Whoops"
sys.exit(1)
else: else:
return (None, 'Failed with HTTP status' + str(req.getcode())) return (None, 'Failed with HTTP status' + str(req.getcode()))
except Exception, e: except Exception, e:

View File

@ -208,13 +208,11 @@ class vcs_gitsvn(vcs):
if len(remote_split) > 1: if len(remote_split) > 1:
for i in remote_split[1:]: for i in remote_split[1:]:
if i.startswith('trunk='): if i.startswith('trunk='):
trunk = i[6:] gitsvn_cmd += ['-T', i[6:]]
elif i.startswith('tags='): elif i.startswith('tags='):
tags = i[5:] gitsvn_cmd += ['-t', i[5:]]
if trunk: elif i.startswith('branches='):
gitsvn_cmd += ['-T', trunk] gitsvn_cmd += ['-b', i[9:]]
if tags:
gitsvn_cmd += ['-t', tags]
if subprocess.call(gitsvn_cmd + [remote_split[0], self.local]) != 0: if subprocess.call(gitsvn_cmd + [remote_split[0], self.local]) != 0:
raise VCSException("Git clone failed") raise VCSException("Git clone failed")
else: else:
@ -237,22 +235,24 @@ class vcs_gitsvn(vcs):
raise VCSException("Git svn rebase failed") raise VCSException("Git svn rebase failed")
self.refreshed = True self.refreshed = True
if rev: if rev:
if rev == 'trunk': # Try finding a svn tag
if subprocess.call(['git', 'checkout', 'trunk'], cwd=self.local) != 0: p = subprocess.Popen(['git', 'checkout', 'tags/' + rev],
raise VCSException("Git checkout failed") cwd=self.local, stderr=subprocess.PIPE)
if p.returncode == 0:
print p.communicate()[0]
else: else:
# Try finding a svn tag # No tag found, normal svn rev translation
if subprocess.call(['git', 'checkout', 'tags/' + rev], cwd=self.local) != 0: # Translate svn rev into git format
# No tag found, normal svn rev translation p = subprocess.Popen(['git', 'svn', 'find-rev', 'r' + rev],
# Translate svn rev into git format cwd=self.local, stdout=subprocess.PIPE)
p = subprocess.Popen(['git', 'svn', 'find-rev', 'r' + rev], rev = p.communicate()[0].rstrip()
cwd=self.local, stdout=subprocess.PIPE) if p.returncode != 0 or len(rev) == 0:
rev = p.communicate()[0].rstrip() # Try a plain git checkout as a last resort
if p.returncode != 0 or len(rev) == 0:
raise VCSException("Failed to get git treeish from svn rev")
# Check out the appropriate git revision...
if subprocess.call(['git', 'checkout', rev], cwd=self.local) != 0: if subprocess.call(['git', 'checkout', rev], cwd=self.local) != 0:
raise VCSException("Git checkout failed") raise VCSException("No git treeish found and direct git checkout failed")
# Check out the appropriate git revision...
if subprocess.call(['git', 'checkout', rev], cwd=self.local) != 0:
raise VCSException("Git checkout failed")
# Get rid of any uncontrolled files left behind... # Get rid of any uncontrolled files left behind...
if subprocess.call(['git', 'clean', '-dffx'], cwd=self.local) != 0: if subprocess.call(['git', 'clean', '-dffx'], cwd=self.local) != 0:
raise VCSException("Git clean failed") raise VCSException("Git clean failed")

View File

@ -103,7 +103,7 @@ def update_wiki(apps, apks, verbose=False):
wikidata += "We have the current version of this app." wikidata += "We have the current version of this app."
wikidata += " (Check mode: " + app['Update Check Mode'] + ")\n\n" wikidata += " (Check mode: " + app['Update Check Mode'] + ")\n\n"
if len(app['No Source Since']) > 0: if len(app['No Source Since']) > 0:
wikidata += "This application has been partially or entirely been missing source code since version " + app['No Source Since'] + "\n\n" wikidata += "This application has partially or entirely been missing source code since version " + app['No Source Since'] + ".\n\n"
if len(app['Current Version']) > 0: if len(app['Current Version']) > 0:
wikidata += "The current (recommended) version is " + app['Current Version'] wikidata += "The current (recommended) version is " + app['Current Version']
wikidata += " (version code " + app['Current Version Code'] + ").\n\n" wikidata += " (version code " + app['Current Version Code'] + ").\n\n"