Remove old versions when updating package

master
Daniel Berteaud 6 years ago
parent efe79a3fa8
commit c5746bcbe2
  1. 2
      WAPT/control
  2. 6
      setup.py

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

@ -22,11 +22,15 @@ def update_package():
pe = PackageEntry();
control = pe.load_control_from_wapt('.')
for arch in ['32','64']:
if not isfile('TortoiseGit-%s.0-%sbit.msi' % (version, arch)):
filename = 'TortoiseGit-%s.0-%sbit.msi' % (version, arch)
url = 'https://download.tortoisegit.org/tgit/%s.0/%s' % (version, filename)
if not isfile('TortoiseGit-%s.0-%sbit.msi' % (version, arch)):
print('Downloading Tortoise Git %s for win%s from %s' % (version, arch, url))
wget(url, filename)
if isfile(filename):
for old in glob.glob(r'TortoiseGit-*%sbit.msi' % arch):
if old != filename:
remove_file(old)
if Version(version) > Version(control['version'].split('-',1)[0]):
print('Updating control file with new version %s' % version)

Loading…
Cancel
Save