Attention : support for WAPT 1.8.2 ended on June the 30th 2022.

There are known vulnerabilities in WAPT dependencies in WAPT 1.8.2 branch. Please upgrade to the latest supported version. CVE listing (non exhaustive) :
  • * python engine : python 2.7 (CVE-2020-10735, CVE-2015-20107, CVE-2022-0391, CVE-2021-23336, CVE-2021-3177, CVE-2020-27619, CVE-2020-26116, CVE-2019-20907, CVE-2020-8492, etc.)
  • * cryptography : openssl : CVE-2022-2068, CVE-2022-1292, CVE-2022-0778, CVE-2021-4160, CVE-2021-3712, CVE-2021-23841, CVE-2021-23840, CVE-2021-23839, CVE-2020-1971, CVE-2020-1968, CVE-2019-1551
  • * python dependencies : cryptography (CVE-2020-36242, CVE-2020-25659), eventlet (CVE-2021-21419), jinja2 (CVE-2020-28493), psutil (CVE-2019-18874), waitress (CVE-2022-31015), lxml (CVE-2021-4381, CVE-2021-28957, CVE-2020-27783, CVE-2018-19787), ujson (CVE-2022-31117, CVE-2022-31116, CVE-2021-45958), python-ldap (CVE-2021-46823)

Updating automatically a software package

Note

This part of the documentation is for advanced users of WAPT.

Why is it useful to do that?

update_package functions are very practical, they allow to gain a lot of time when it is time to update a WAPT package with the most recent version of a piece of software.

Working principle

The update_package function will:

  • fetch online the latest version of the software;

  • download the latest version of the software binaries;

  • remove old versions of the software binaries;

  • update the version number of the software in the control file;

If you base your install function on the version number inside the control file, then you do not even need to modify your setup.py.

You just have to do your usual Quality Assurance tests before you build-upload your new package.

Example

Here is the update_package script for firefox-esr as an example:

def update_package():
      """ You can do a CTRL F9 in pyscripter to update the package """
      import re,requests,urlparse,glob

      url = requests.head('https://download.mozilla.org/?product=firefox-esr-latest&os=win&lang=fr',proxies={}).headers['Location']
      filename = urlparse.unquote(url.rsplit('/',1)[1])

      if not isfile(filename):
          print('Downloading %s from %s'%(filename,url))
          wget(url,filename)

      exes = glob.glob('*.exe')
      for fn in exes:
          if fn != filename:
              remove_file(fn)

      # updates control version from filename, increment package version.
      control = PackageEntry().load_control_from_wapt ('.')
      control.version = '%s-0'%(re.findall('Firefox Setup (.*)esr\.exe',filename)[0])
      control.save_control_to_wapt('.')

  if __name__ == '__main__':
      update_package()

You may launch the update_package script by pressing F9 in PyScripter.

You will find many inspiring examples of update_package scripts in packages hosted in the Tranquil IT store.