tis-filezilla 3.27.1-13

  • package : tis-filezilla
  • version : 3.27.1-13
  • description : Client FTP Filezilla (limited to V3.8 for XP)
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2018-02-27 18:59:24

setup.py

#!/usr/bin/python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------
#    This file is part of WAPT
#    Copyright (C) 2013  Tranquil IT Systems http://www.tranquil.it
#    WAPT aims to help Windows systems administrators to deploy
#    setup and update applications on users PC.
#
#    WAPT is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    WAPT is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with WAPT.  If not, see <http://www.gnu.org/licenses/>.
#
# -----------------------------------------------------------------------

from setuphelpers import *
import platform
uninstallkey=['FileZilla Client']

def install():
    versionsoft = control['version'].split('-',1)[0]
    exe = 'FileZilla_%s_win32-setup.exe' % versionsoft

    if platform.win32_ver()[0]=='XP' or platform.win32_ver()[0]=='2003Server':
        #3.8.0 is the last supported version on winXP
        install_exe_if_needed('WinXP_FileZilla_3.8.0_win32-setup.exe','/S',key='FileZilla Client',min_version='3.8.0',killbefore='filezilla.exe')
    else:
        # for win Vista and above
        install_exe_if_needed(exe,'/S',key='FileZilla Client',min_version=versionsoft,killbefore='filezilla.exe')
    # disable auto update
    filecopyto('fzdefaults.xml',os.path.join(programfiles32,'FileZilla FTP Client'))


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://filezilla-project.org/download.php?type=client').headers['Location']
##    filename = urlparse.unquote(url.rsplit('/',1)[1])

    import re,requests,BeautifulSoup
    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())

    page = requests.get('https://filezilla-project.org/download.php?show_all=1',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'}).text
    pattern=re.compile(r"win32-setup.exe")
    bs = BeautifulSoup.BeautifulSoup(page)

    current_version = pe['version'].split('-',1)[0]
    filezilla_exe = str(bs.find('a',text=pattern))
    filezilla_version = re.findall('FileZilla_(.*)\_win32-setup.exe',str(filezilla_exe))[0]

    print "Current Filezilla WAPT package version is : %s" % current_version
    print "Latest Filezilla version is  is : %s" % filezilla_version

    wget_url = "http://10gbps-io.dl.sourceforge.net/project/filezilla/FileZilla_Client/%s/FileZilla_%s_win32-setup.exe" % (filezilla_version,filezilla_version)

    # updates control version from filename, increment package version.
    control = PackageEntry().load_control_from_wapt ('.')
    control.version = '%s-%s' % (filezilla_version,int(control.version.split('-',1)[1])+1)
    control.save_control_to_wapt('.')

    if not isfile(filezilla_exe):
        print('Downloading %s from %s'%(filezilla_exe,wget_url))
        wget(wget_url,filezilla_exe)
        # removes old exe
        if isfile(filezilla_exe):
            exes = glob.glob('Filezilla*.exe')
            for fn in exes:
                if fn != filezilla_exe:
                    remove_file(fn)
    else:
        print("Latest version already downloaded, skip download")

if __name__ == '__main__':
    update_package()

    

Changelog

No changelog
    

manifest.sha256

[["WAPT/icon.png", "b56bdb8c62724dabed19ca1fd5422fcb3bfc09d91243d909601c99fb8525fc52"], ["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WinXP_FileZilla_3.8.0_win32-setup.exe", "a55781763b9eda6fe11b3443754c9b2505bbf08016a3c265745957db0d247c58"], ["WAPT/wapt.psproj", "795d36d10109ca85357285f79090fac2be856e5830ea31fa913cc55cb825807b"], ["fzdefaults.xml", "134402d52744232d93b7a5ac0a9d1450c1b4465101dff4c90d8ab8a52c6bad03"], ["FileZilla_3.27.1_win32-setup.exe", "a33e1f324ed53e6ce8c804d302b91e99cb444fd03c6926982c5c779e866c5c86"], ["setup.py", "73c43b18506cfd0e73c516fe36cf8c7d1054af53f1d7536d36ee41c47ab56f61"], ["WAPT/control", "f127a499f1e0041ddc538f9e02cce5b2f360c6e2423351e1c2ad3f1e244627c7"]]