Browse Source

Try to fix Update function. (There is still an error).

master
Heuze Florent 1 month ago
parent
commit
bc989c42ff
  1. 12
      setup.py

12
setup.py

@ -39,7 +39,7 @@ def update_package():
from waptpackage import PackageEntry
print('Updating OpenVPN package')
page = wgets('https://openvpn.net/community-downloads/')
latest_version = re.search('OpenVPN (\d+(\.\d+)*) .* released on', page).group(1)
latest_version = re.search('OpenVPN (\d+(\.\d+)*) .* Released', page).group(1)
pe = PackageEntry()
control = pe.load_control_from_wapt(os.getcwd())
current_version = control['version'].split('-',1)[0]
@ -48,13 +48,13 @@ def update_package():
# Win7 Would be possible, but has a problem installing the tap driver, even when the cert is added to the trust store
# Just maintain the package for Win10 and later. Win7 is EOL in 2020 anyway
for os_version in ['Win10']:
build = re.search('openvpn\-install\-%s\-(I\d+)\-%s\.exe' % (latest_version, os_version), page).group(1)
if not isfile('openvpn\-install-%s-%s.exe' % (latest_version, build)):
url = 'https://swupdate.openvpn.org/community/releases/openvpn-install-%s-%s-%s.exe' % (latest_version, build, os_version)
build = re.search('OpenVPN\-%s\-(I\d+)\-%s\.msi' % (latest_version, os_version), page).group(1)
if not isfile('OpenVPN-%s-%s.msi' % (latest_version, build)):
url = 'https://swupdate.openvpn.org/community/releases/OpenVPN-%s-%s-%s.msi' % (latest_version, build, os_version)
print('downloading %s' % url)
wget(url, os.getcwd())
for file in glob.glob('*%s.exe' % os_version):
if file != 'openvpn-install-%s-%s-%s.exe' % (latest_version, build, os_version):
for file in glob.glob('*%s.msi' % os_version):
if file != 'OpenVPN-%s-%s-%s.msi' % (latest_version, build, os_version):
print('Removing %s' % file)
remove_file(file)

Loading…
Cancel
Save