tis-fix-wapt-packages

0.1.0-1
Globally fix package version errors
213 downloads
Download
tis-fix-wapt-packages icon

  Description 

  • package : tis-fix-wapt-packages
  • version : 0.1.0-1
  • architecture : all
  • categories : System and network
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
  • description : Globally fix package version errors
  • locale : all
  • target_os : all
  • min_wapt_version : 1.8
  • sources :
  • installed_size :
  • impacted_process :
  • description_fr : Corriger globalement les erreurs de version de paquets
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor : Tranquil IT
  • licence :
  • signature_date : 2021-06-09T11:11:41.975972

  Setup.py 

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

# Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
packages_to_remove_dict_list = [
{
    "name"       : "adobereader",
    "version"       : "2021.1.200150",
    "remove_newer"  : False
},
]
""" {
    "name"       : "pdfcreator",
    "version"       : "3.2.0",
    "remove_newer"  : True
}, """


def install():
    # Declaring local variables
    package_prefix = control.package.split('-', 1)[0]
    for package_remove in packages_to_remove_dict_list:
        read_package = WAPT.is_installed('%s-%s' % (package_prefix, package_remove['name']))
        to_remove = False
        if read_package:
            if package_remove['remove_newer']:
                if Version(read_package.get_software_version()) > Version(package_remove['version']):
                    to_remove = True
            else:
                if Version(read_package.get_software_version()) == Version(package_remove['version']):
                    to_remove = True
            if to_remove:
                WAPT.forget_packages(package_remove['name'])
                WAPT.install(package_remove['name'])


""" 
                    try:
                        WAPT.uninstall(package_remove['name'])
                    except:
                        WAPT.forget_packages(package_remove['name'])
                        WAPT.install(package_remove['name'])

"""


def update_package():
    pass




										

  Changelog 



No changelog.txt.
									
  manifest.sha256