tis-firefox-de 56.0.1-5

  • package : tis-firefox-de
  • version : 56.0.1-5
  • description : Firefox butineur Allemand
  • maintainer : Hubert TOUVET
  • date : 2017-10-10 13:38:13

setup.py

# -*- coding: utf-8 -*-
from setuphelpers import *

def install():

    if windows_version() < Version('6.1'):
        error("Firefox >= 53 is not available anymore for Windows XP")
    version = control.version.split('-',1)[0]
    ukey = 'Mozilla Firefox %s (x86 de)'%version
    exe = 'Firefox Setup %s.exe'%version
    install_exe_if_needed(exe,'-ms',key=ukey,min_version=version,killbefore='firefox.exe')


def update_package():
    """updates the package / control version with the latest stable firefox version"""
    import re,requests,urlparse,glob

    # get index of all dowloads
    """
    #url_base = 'https://download-installer.cdn.mozilla.net/pub/firefox/releases/latest/win32/de/'
    url_base = 'https://download-installer.cdn.mozilla.net/pub/firefox/releases/43.0/win32/de/'
    index = wgets(url_base)

    # get list of lastest german versions
    re_setup = re.compile(r'<a href=".*/(Firefox%20Setup%20[0-9.]*.exe)">Firefox Setup .*</a>')
    filename = urlparse.unquote(re_setup.findall(index)[0])
    url = url_base+filename
    """
    url = requests.head('https://download.mozilla.org/?product=firefox-latest&os=win&lang=de').headers['Location']
    filename = urlparse.unquote(url.rsplit('/',1)[1])

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

    # removes old exe
    if isfile(filename):
        exes = glob.glob('Firefox*.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-%s'%(re.findall('Firefox Setup (.*)\.exe',filename)[0],int(control.version.split('-',1)[1])+1)
        control.save_control_to_wapt('.')


if __name__ == '__main__':
    update_package()
    

manifest.sha1

[["WAPT/control", "2ee538d1d28d3eb2a683ef4d533bf64cd1039679"], ["setup.py", "fea5aeed0368b3ab7ed2278074c6e0f1ca6faf44"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "557e60050809687d56525e6ac46df9c0e02ccae6"], ["Firefox Setup 56.0.1.exe", "9349888b5357fe87cb3c2ca14032de12c81a930f"]]