Remove old versions when updating package

master
Daniel Berteaud 6 years ago
parent 81c0ee3488
commit 0af914dd09
  1. 2
      WAPT/control
  2. 3
      setup.py

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

@ -27,6 +27,9 @@ def update_package():
url = asset['browser_download_url'] url = asset['browser_download_url']
print('Downloading Git %s for win%s from %s' % (version,arch,url)) print('Downloading Git %s for win%s from %s' % (version,arch,url))
wget(url,asset['name']) 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]): if Version(version) > Version(control['version'].split('-',1)[0]):
print('Updating control file with new version %s' % version) print('Updating control file with new version %s' % version)
pe.version = version + '-0' pe.version = version + '-0'

Loading…
Cancel
Save