|
|
|
@ -20,15 +20,33 @@ |
|
|
|
|
# along with WAPT. If not, see <http://www.gnu.org/licenses/>. |
|
|
|
|
# |
|
|
|
|
# ----------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
from setuphelpers import * |
|
|
|
|
import time |
|
|
|
|
import subprocess |
|
|
|
|
|
|
|
|
|
uninstallkey = [] |
|
|
|
|
|
|
|
|
|
def on_dist_backup(operation,src,dst): |
|
|
|
|
# When we backup the distribution dir, we have to exclude |
|
|
|
|
# lightning as a new version will be installed, bundled with TB itself. |
|
|
|
|
# Everything else should be backed up |
|
|
|
|
if src.endswith("{e2fda1a4-762b-4020-b5ad-a41df1933103}.xpi"): |
|
|
|
|
print("Skiping Lightning XPI") |
|
|
|
|
return False |
|
|
|
|
else: |
|
|
|
|
return True |
|
|
|
|
|
|
|
|
|
def install(): |
|
|
|
|
waptversion = Version(__version__) |
|
|
|
|
|
|
|
|
|
# Backup distribution/extensions as a TB upgrade wipe it |
|
|
|
|
backup_dist = False |
|
|
|
|
if isdir(makepath(programfiles, "Mozilla Thunderbird", "distribution")): |
|
|
|
|
print("Taking a backup of the distribution directory") |
|
|
|
|
backup_dist = True |
|
|
|
|
copytree2(src=makepath(programfiles, "Mozilla Thunderbird", "distribution"), dst="distribution", oncopy=on_dist_backup) |
|
|
|
|
|
|
|
|
|
if waptversion > Version('1.5') : |
|
|
|
|
|
|
|
|
|
softname = 'Mozilla Thunderbird' |
|
|
|
@ -49,6 +67,7 @@ def install(): |
|
|
|
|
time.sleep (5) |
|
|
|
|
|
|
|
|
|
version = control.version.split('-',1)[0] |
|
|
|
|
major_version = control.version.split('.',1)[0] |
|
|
|
|
arch = control.architecture |
|
|
|
|
#locale = control.locale |
|
|
|
|
locale = 'fr' |
|
|
|
@ -63,9 +82,15 @@ def install(): |
|
|
|
|
difffreespace = diskfreespacebefore - diskfreespaceafter |
|
|
|
|
print(ur"Needed disk space : " + str(difffreespace)) |
|
|
|
|
|
|
|
|
|
# Now restore distribution backup |
|
|
|
|
if backup_dist: |
|
|
|
|
print("Restoring distribution directory") |
|
|
|
|
copytree2(src=r'distribution', dst=makepath(programfiles, "Mozilla Thunderbird", "distribution")) |
|
|
|
|
|
|
|
|
|
else: |
|
|
|
|
error('This package is not compatible with your WAPT version. Please upgrade to WAPT 1.5 or more.') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def update_package(): |
|
|
|
|
"""updates the package / control version with the latest stable thunderbird version""" |
|
|
|
|
import re,requests,urlparse,glob |
|
|
|
|