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

Clean up working directory properly when building multiple versions

This commit is contained in:
Ciaran Gultnieks 2011-06-17 08:32:17 +01:00
parent de6732684a
commit 79326c50e9

View File

@ -161,11 +161,17 @@ for app in apps:
cwd=build_dir) != 0:
print "Git reset failed"
sys.exit(1)
if subprocess.call(['git', 'clean', '-dfx'],
cwd=build_dir) != 0:
print "Git clean failed"
sys.exit(1)
elif app['repotype'] == 'svn':
for svncommand in (['svn', 'update', '--force',
'-r', thisbuild['commit']],
['svn', 'revert', '-R', '.']):
if subprocess.call(svncommand, cwd=build_dir) != 0:
for svncommand in (
'svn revert -R .',
r"svn status | awk '/\?/ {print $2}' | xargs rm -rf",
'svn update --force -r '+thisbuild['commit'],):
if subprocess.call(svncommand, cwd=build_dir,
shell=True) != 0:
print "Svn update failed"
sys.exit(1)
elif app['repotype'] == 'hg':
@ -173,11 +179,19 @@ for app in apps:
cwd=build_dir) != 0:
print "Hg checkout failed"
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':
if subprocess.call(['bzr', 'revert', '-r', thisbuild['commit']],
cwd=build_dir) != 0:
print "Bzr revert failed"
sys.exit(1)
if subprocess.call(['bzr', 'clean-tree', '--unknown', '--ignored'],
cwd=build_dir) != 0:
print "Bzr revert failed"
sys.exit(1)
else:
print "Invalid repo type " + app['repotype']
sys.exit(1)