tis-ultradefrag 7.0.2-1

  • package : tis-ultradefrag
  • version : 7.0.2-1
  • description : Ultradefrag: Utilitaire de defragmentation
  • maintainer : Tranquil IT Systems
  • date : 2018-02-27 19:08:40

setup.py

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

uninstallkey = []

software_name = "UltraDefrag"

def install():
    print('installing %s' % software_name)
    versionsoft = control['version'].split('-',1)[0]
    if iswin64():
        install_exe_if_needed("ultradefrag-%s.bin.amd64.exe" % versionsoft,"/S",key="UltraDefrag",min_version=versionsoft,killbefore='ultradefrag.exe')
    else:
        install_exe_if_needed("ultradefrag-%s.bin.i386.exe" % versionsoft,"/S",key="UltraDefrag",min_version=versionsoft,killbefore='ultradefrag.exe')


def update_package():
    import BeautifulSoup,requests,re
    from waptpackage import PackageEntry
    verify=True
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    current_version = pe['version'].split('-',1)[0]

    base_url = "http://ultradefrag.sourceforge.net/en/index.html?download"

    page = requests.get(base_url,headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'},verify=verify).text
    bs = BeautifulSoup.BeautifulSoup(page)
    bs_raw_string = str(bs.find('div',{'class':'mpart'}).find('h2').find('strong').text)
    software_version = re.findall('STABLE RELEASE (.*)',str(bs_raw_string))[0]

    print "Current %s WAPT package version is : %s" % (software_name,current_version)
    print "Latest %s version available is : %s" % (software_name,software_version)

    if Version(current_version) < Version(software_version):
        print("%s package is not up-to-date, updating" % software_name)
        print("Cleanup current files")

        filename = "ultradefrag-%s.bin.i386.exe" % software_version
        filename64 = "ultradefrag-%s.bin.amd64.exe" % software_version

        for exe in glob.glob('*.exe'):
            if exe not in {filename,filename64}:
                remove_file(exe)

        print("Downloading latest version")
        download_url = 'https://freefr.dl.sourceforge.net/project/ultradefrag/stable-release/%s/ultradefrag-%s.bin.i386.exe' % (software_version,software_version)
        download_url64 = 'https://freefr.dl.sourceforge.net/project/ultradefrag/stable-release/%s/ultradefrag-%s.bin.amd64.exe' % (software_version,software_version)
        wget(download_url,filename)
        wget(download_url64,filename64)

        pe.version = software_version + '-0'
        pe.save_control_to_wapt(os.getcwd())
    else:
        print("No update needed, package already up to date")

if __name__ == "__main__":
    update_package()
    

Changelog

No changelog
    

manifest.sha256

[["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WAPT/wapt.psproj", "795d36d10109ca85357285f79090fac2be856e5830ea31fa913cc55cb825807b"], ["ultradefrag-7.0.2.bin.amd64.exe", "34cfc8b7a2b43891e0a7527fc27549b2b3372330f82cf95d32c1744429d2820f"], ["ultradefrag-7.0.2.bin.i386.exe", "69ea62c2987b869bcd21e7a7a7ae65d01ee9a853ace33b5bc973bbcbaa8a4123"], ["setup.py", "e4c8568c703c78ffbacce13e4dedabf7873919bcdfeecea4baa506e5041e4a83"], ["WAPT/control", "8f2b5d023f33d8f9983779b0fa4804fecebf5fcb4967c232cb82b1335d70907e"]]