Remove old versions when updating package

This commit is contained in:
Daniel Berteaud 2018-12-13 09:14:32 +01:00
parent 81c0ee3488
commit 0af914dd09
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,5 @@
package : fws-git
version : 2.20.0-1
version : 2.20.0-2
architecture : all
section : base
priority : optional

View File

@ -27,6 +27,9 @@ def update_package():
url = asset['browser_download_url']
print('Downloading Git %s for win%s from %s' % (version,arch,url))
wget(url,asset['name'])
for old in glob.glob(r'Git-*-%s-bit.exe' % arch):
if not old == 'Git-%s-%s-bit.exe' %(version,arch):
remove_file(old)
if Version(version) > Version(control['version'].split('-',1)[0]):
print('Updating control file with new version %s' % version)
pe.version = version + '-0'