mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 23:40:29 +03:00
Clean up working directory properly when building multiple versions
This commit is contained in:
parent
de6732684a
commit
79326c50e9
1 changed files with 18 additions and 4 deletions
22
build.py
22
build.py
|
|
@ -161,11 +161,17 @@ for app in apps:
|
||||||
cwd=build_dir) != 0:
|
cwd=build_dir) != 0:
|
||||||
print "Git reset failed"
|
print "Git reset failed"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
if subprocess.call(['git', 'clean', '-dfx'],
|
||||||
|
cwd=build_dir) != 0:
|
||||||
|
print "Git clean failed"
|
||||||
|
sys.exit(1)
|
||||||
elif app['repotype'] == 'svn':
|
elif app['repotype'] == 'svn':
|
||||||
for svncommand in (['svn', 'update', '--force',
|
for svncommand in (
|
||||||
'-r', thisbuild['commit']],
|
'svn revert -R .',
|
||||||
['svn', 'revert', '-R', '.']):
|
r"svn status | awk '/\?/ {print $2}' | xargs rm -rf",
|
||||||
if subprocess.call(svncommand, cwd=build_dir) != 0:
|
'svn update --force -r '+thisbuild['commit'],):
|
||||||
|
if subprocess.call(svncommand, cwd=build_dir,
|
||||||
|
shell=True) != 0:
|
||||||
print "Svn update failed"
|
print "Svn update failed"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif app['repotype'] == 'hg':
|
elif app['repotype'] == 'hg':
|
||||||
|
|
@ -173,11 +179,19 @@ for app in apps:
|
||||||
cwd=build_dir) != 0:
|
cwd=build_dir) != 0:
|
||||||
print "Hg checkout failed"
|
print "Hg checkout failed"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
if subprocess.call('hg status -u -0 | xargs rm -rf',
|
||||||
|
cwd=build_dir, shell=True) != 0:
|
||||||
|
print "Hg clean failed"
|
||||||
|
sys.exit(1)
|
||||||
elif app['repotype'] == 'bzr':
|
elif app['repotype'] == 'bzr':
|
||||||
if subprocess.call(['bzr', 'revert', '-r', thisbuild['commit']],
|
if subprocess.call(['bzr', 'revert', '-r', thisbuild['commit']],
|
||||||
cwd=build_dir) != 0:
|
cwd=build_dir) != 0:
|
||||||
print "Bzr revert failed"
|
print "Bzr revert failed"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
if subprocess.call(['bzr', 'clean-tree', '--unknown', '--ignored'],
|
||||||
|
cwd=build_dir) != 0:
|
||||||
|
print "Bzr revert failed"
|
||||||
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
print "Invalid repo type " + app['repotype']
|
print "Invalid repo type " + app['repotype']
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue