diff --git a/WAPT/control b/WAPT/control index 63744b8..04ac198 100644 --- a/WAPT/control +++ b/WAPT/control @@ -5,28 +5,28 @@ section : base priority : optional maintainer : Daniel Berteaud description : Clean and optimize Windows -depends : -conflicts : +depends : +conflicts : maturity : PROD locale : all target_os : windows min_os_version : 5.1 -max_os_version : +max_os_version : min_wapt_version : 1.5 -sources : -installed_size : +sources : +installed_size : impacted_process : ccleaner.exe,ccleaner64.exe description_fr : Outils de nettoyage et d'optimisation de Windows -description_pl : -description_de : -description_es : -audit_schedule : +description_pl : +description_de : +description_es : +audit_schedule : editor : Piriform -keywords : -licence : +keywords : +licence : homepage : http://www.piriform.com/ccleaner/ -package_uuid : +package_uuid : signer : Daniel Berteaud -signer_fingerprint: -signature_date : -signed_attributes : \ No newline at end of file +signer_fingerprint: +signature_date : +signed_attributes : \ No newline at end of file diff --git a/setup.py b/setup.py index b9d838c..68f2493 100644 --- a/setup.py +++ b/setup.py @@ -52,12 +52,13 @@ def session_setup(): def update_package(): + control = PackageEntry().load_control_from_wapt ('.') page = requests.get('https://www.ccleaner.com/fr-fr/ccleaner/download/slim',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'}).text bs = BeautifulSoup.BeautifulSoup(page) download = bs.find('p', attrs={"class": u"fs-13"}).a["href"] filename = download.rsplit('/',1)[1] - # on ne telecharge que si on ne l'a pas deja + # Only download if needed if not isfile(filename): wget(download, filename) else: @@ -69,12 +70,10 @@ def update_package(): remove_file(fn) vers = get_file_properties(filename)['ProductVersion'] - os.chdir(os.path.dirname(__file__)) - from waptpackage import PackageEntry - pe = PackageEntry() - pe.load_control_from_wapt(os.getcwd()) - pe.version = vers + '-0' - pe.save_control_to_wapt(os.getcwd()) + + if Version(vers) > Version(control['version'].split('-',1)[0]): + control.version = vers + '-0' + control.save_control_to_wapt(os.getcwd()) if __name__ == '__main__':