|
|
|
@ -72,25 +72,26 @@ def update_package(): |
|
|
|
|
|
|
|
|
|
filename = '' |
|
|
|
|
url = requests.head('https://download.mozilla.org/?product=thunderbird-latest').headers['Location'] |
|
|
|
|
filename = urlparse.unquote(url.rsplit('/',1)[1]) |
|
|
|
|
version = re.findall(r'Thunderbird Setup (.*)\.exe',filename)[0] |
|
|
|
|
exe = urlparse.unquote(url.rsplit('/',1)[1]) |
|
|
|
|
version = re.findall(r'Thunderbird Setup (.*)\.exe',exe)[0] |
|
|
|
|
control = PackageEntry().load_control_from_wapt ('.') |
|
|
|
|
|
|
|
|
|
for arch in ['32','64']: |
|
|
|
|
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) |
|
|
|
|
if not isfile(filename): |
|
|
|
|
print('Downloading %s from %s'%(filename,url)) |
|
|
|
|
wget(url,filename) |
|
|
|
|
|
|
|
|
|
# removes old exe |
|
|
|
|
if isfile(filename): |
|
|
|
|
exes = glob.glob(r'win%s\Thunderbird*.exe' % arch) |
|
|
|
|
for fn in exes: |
|
|
|
|
if fn != filename: |
|
|
|
|
remove_file(fn) |
|
|
|
|
|
|
|
|
|
if Version(version) > Version(control['version'].split('-',1)[0]): |
|
|
|
|
print('Updating package to %s' % version) |
|
|
|
|
for arch in ['32','64']: |
|
|
|
|
filename = makepath('win%s' % arch, filename) |
|
|
|
|
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): |
|
|
|
|
print('Downloading %s from %s'%(filename,url)) |
|
|
|
|
wget(url,filename) |
|
|
|
|
|
|
|
|
|
# removes old exe |
|
|
|
|
if isfile(filename): |
|
|
|
|
exes = glob.glob(r'x%s\Thunderbird*.exe' % arch) |
|
|
|
|
for fn in exes: |
|
|
|
|
if fn != filename: |
|
|
|
|
remove_file(fn) |
|
|
|
|
|
|
|
|
|
# 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) |
|
|
|
|