|
|
@ -72,14 +72,12 @@ def update_package(): |
|
|
|
|
|
|
|
|
|
|
|
filename = '' |
|
|
|
filename = '' |
|
|
|
url = requests.head('https://download.mozilla.org/?product=thunderbird-latest').headers['Location'] |
|
|
|
url = requests.head('https://download.mozilla.org/?product=thunderbird-latest').headers['Location'] |
|
|
|
filename = urlparse.unquote(url.rsplit('/',1)[1]) |
|
|
|
exe = urlparse.unquote(url.rsplit('/',1)[1]) |
|
|
|
version = re.findall(r'Thunderbird Setup (.*)\.exe',filename)[0] |
|
|
|
version = re.findall(r'Thunderbird Setup (.*)\.exe',exe)[0] |
|
|
|
control = PackageEntry().load_control_from_wapt ('.') |
|
|
|
control = PackageEntry().load_control_from_wapt ('.') |
|
|
|
|
|
|
|
|
|
|
|
if Version(version) > Version(control['version'].split('-',1)[0]): |
|
|
|
|
|
|
|
print('Updating package to %s' % version) |
|
|
|
|
|
|
|
for arch in ['32','64']: |
|
|
|
for arch in ['32','64']: |
|
|
|
filename = makepath('win%s' % arch, filename) |
|
|
|
filename = makepath('win%s' % arch, exe) |
|
|
|
url = 'https://download-installer.cdn.mozilla.net/pub/thunderbird/releases/%s/win%s/fr/Thunderbird%sSetup%s%s.exe' % (version,arch,'%20','%20',version) |
|
|
|
url = 'https://download-installer.cdn.mozilla.net/pub/thunderbird/releases/%s/win%s/fr/Thunderbird%sSetup%s%s.exe' % (version,arch,'%20','%20',version) |
|
|
|
if not isfile(filename): |
|
|
|
if not isfile(filename): |
|
|
|
print('Downloading %s from %s'%(filename,url)) |
|
|
|
print('Downloading %s from %s'%(filename,url)) |
|
|
@ -87,11 +85,14 @@ def update_package(): |
|
|
|
|
|
|
|
|
|
|
|
# removes old exe |
|
|
|
# removes old exe |
|
|
|
if isfile(filename): |
|
|
|
if isfile(filename): |
|
|
|
exes = glob.glob(r'x%s\Thunderbird*.exe' % arch) |
|
|
|
exes = glob.glob(r'win%s\Thunderbird*.exe' % arch) |
|
|
|
for fn in exes: |
|
|
|
for fn in exes: |
|
|
|
if fn != filename: |
|
|
|
if fn != filename: |
|
|
|
remove_file(fn) |
|
|
|
remove_file(fn) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Version(version) > Version(control['version'].split('-',1)[0]): |
|
|
|
|
|
|
|
print('Updating package to %s' % version) |
|
|
|
|
|
|
|
|
|
|
|
# updates control version from filename, increment package version. |
|
|
|
# updates control version from filename, increment package version. |
|
|
|
control.version = '%s-%s'%(re.findall(r'Thunderbird Setup (.*)\.exe',filename)[0],int(control.version.split('-',1)[1])+1) |
|
|
|
control.version = '%s-%s'%(re.findall(r'Thunderbird Setup (.*)\.exe',filename)[0],int(control.version.split('-',1)[1])+1) |
|
|
|
control.save_control_to_wapt('.') |
|
|
|
control.save_control_to_wapt('.') |
|
|
|