1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-07 01:40:10 +02:00

Added ability to build from svn without checking out the entire repo

This commit is contained in:
Ciaran Gultnieks 2011-01-02 11:27:50 +00:00
parent a81e48dad0
commit cae8bd1546
2 changed files with 27 additions and 8 deletions

18
README
View File

@ -74,6 +74,13 @@ values are:
The repository location. Usually a git: or svn: URL.
Normally the repository is checked out once for the application, then moved
to a particular revision/commit/tag for each build version. For an SVN
repository though, this behaviour can be changed by appending a * to the
repository URL - in this case the repository is checked out once per build
version, with the subdir parameter in place of the *. This can be beneficial
when dealing with very large SVN repositories.
==Build Version==
Any number of these fields can be present, each specifying a version to
@ -90,10 +97,13 @@ In addition to the three, always required, parameters described above,
further parameters can be added (in name=value format) to apply further
configuration to the build. These are:
subdir=<path> - specifies to build from a subdirectory of the checked out
source code
oldsdkloc=yes - the sdk location in the repo is in an old format
target=<target> - specifies a particular SDK target, when the source doesn't
subdir=<path> - Specifies to build from a subdirectory of the checked out
source code. Normally this directory is changed to before
building, but there is a special case for SVN repositories
where the URL is specified with a * at the end. See the
documentation for the Repo field for more information.
oldsdkloc=yes - The sdk location in the repo is in an old format
target=<target> - Specifies a particular SDK target, when the source doesn't
Another example, using extra parameters:

View File

@ -68,9 +68,10 @@ for app in apps:
print "Git clone failed"
sys.exit(1)
elif app['repotype'] == 'svn':
if subprocess.call(['svn', 'checkout', app['repo'], build_dir]) != 0:
print "Svn checkout failed"
sys.exit(1)
if not app['repo'].endswith("*"):
if subprocess.call(['svn', 'checkout', app['repo'], build_dir]) != 0:
print "Svn checkout failed"
sys.exit(1)
else:
print "Invalid repo type " + app['repotype'] + " in " + app['id']
sys.exit(1)
@ -81,7 +82,15 @@ for app in apps:
# Optionally, the actual app source can be in a subdirectory...
if thisbuild.has_key('subdir'):
root_dir = os.path.join(build_dir, thisbuild['subdir'])
if app['repotype'] == 'svn' and app['repo'].endswith("*"):
root_dir = build_dir
if subprocess.call(['svn', 'checkout',
app['repo'][:-1] + thisbuild['subdir'],
build_dir]) != 0:
print "Svn checkout failed"
sys.exit(1)
else:
root_dir = os.path.join(build_dir, thisbuild['subdir'])
else:
root_dir = build_dir