tis-swi-prolog icon

SWI-Prolog

Paquet d’installation silencieuse pour SWI-Prolog

9.2.9-1

  • package: tis-swi-prolog
  • name: SWI-Prolog
  • version: 9.2.9-1
  • maintainer: WAPT Team,Tranquil IT,Amel FRADJ
  • licence: https://www.swi-prolog.org/license.htmlz
  • target_os: windows
  • architecture: x64
  • signature_date:
  • size: 13.94 Mo
  • homepage : https://www.swi-prolog.org/

package           : tis-swi-prolog
version           : 9.2.9-1
architecture      : x64
section           : base
priority          : optional
name              : SWI-Prolog
categories        : 
maintainer        : WAPT Team,Tranquil IT,Amel FRADJ
description       : SWI-Prolog is a versatile implementation of the Prolog language
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : SWI-Prolog est une implémentation polyvalente du langage Prolog
description_pl    : SWI-Prolog to wszechstronna implementacja języka Prolog
description_de    : SWI-Prolog ist eine vielseitige Implementierung der Programmiersprache Prolog
description_es    : SWI-Prolog es una implementación versátil del lenguaje Prolog
description_pt    : SWI-Prolog é uma implementação versátil da linguagem Prolog
description_it    : SWI-Prolog è un'implementazione versatile del linguaggio Prolog
description_nl    : SWI-Prolog is een veelzijdige implementatie van de taal Prolog
description_ru    : SWI-Prolog - это универсальная реализация языка Prolog
audit_schedule    : 
editor            : 
keywords          : 
licence           : https://www.swi-prolog.org/license.htmlz
homepage          : https://www.swi-prolog.org/
package_uuid      : a54d5e04-fccb-4053-a7b9-8fa0793bbcfe
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : d34ff49d67a2c5c49a1d5865e03d242b8f9cb250cfdfe125d61d90855d42e2d3
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2024-12-25T12:37:31.000000
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
signature         : aRrnDbJaAk7UkOU+fjTQzbomPbL8K1fsTY+ZRd+SvftqvfoNqQT2NoIdH3XZQahZ26DWxqspTc9LMI8IOjgLtvq5oT2R0wmc4ZZ7X5vAmL1j1Gv0A3NxknzSed7RDf4ynCiCbjZBLrzvSUq7mio9n1X+MGigWvNvufTWpwqzKaX39kKC0OY4wG553k1CBdXQYFO3eSKRQqoQjITmxYAWyzWVxVOyDh4O+wcI/j2ojrGWHMeTruBwT7PalMomMWAQf9uSvy5cKizHhQXJS75NYDbmAK+WOyPICb646wM9KqPo64++uK4dXzL64pw1qLmoSqxjEZksu+0qWjelXHfgfQ==

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

r"""
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


def install():
    # Declaring local variables
    bin_name = glob.glob('swipl-*.exe')[0]
    # Installing the software
    install_exe_if_needed(bin_name,
        silentflags='/S /allusers',
        key='swipl',
        min_version=control.get_software_version(),
    )



from setuphelpers import *
import json
import re
import requests
import datetime


def update_package():
    # Déclarer les variables locales
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name

    # Obtenir la dernière version depuis les sources officielles
    url = "https://www.swi-prolog.org/download/stable/bin/"
    index = wgets(url, proxies=proxies)
    if not index:
        print("Error: Unable to fetch the index page.")
        return package_updated

    # Pattern pour trouver les fichiers .exe
    re_versions = re.compile(r'swipl-(\d+\.\d+\.\d+-\d+)\.x64\.exe')
    files = []

    # Extraire les liens et les versions
    for a in bs_find_all(index, 'a', href=True):
        href = a['href']
        match = re_versions.match(href)
        if match:
            version = match.group(1).split('-')[0]
            files.append((href, version))
            print(f"Found file: {href} with version: {version}")

    # Trouver le fichier le plus récent
    if files:
        # Trier par version en utilisant une fonction personnalisée
        def version_key(version_str):
            return list(map(int, version_str.split('-')[0].split('.')))

        latest_bin, latest_version = max(files, key=lambda x: version_key(x[1]))
        #Enlever l'extension .envelope pour obtenir le nom de fichier correct
        latest_bin = latest_bin.replace('.envelope', '')
        download_url = f"{url}{latest_bin}"

        if not requests.head(download_url, proxies=proxies).status_code == 404:
            print(f"Latest version: {latest_version}")
            print(f"Download URL: {download_url}")
        # remove files
        for f in glob.glob("*.exe"):
            if f != latest_bin:
                remove_file(f)

        # Downloading latest binaries
        wget(download_url, latest_bin, proxies=proxies)

        control.set_software_version(version)
        control.save_control_to_wapt()

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
aab0e69557afb0865a01693a3d10d71824f1b4606309bbf6eafceb9ce07597e0 : WAPT/control
d34ff49d67a2c5c49a1d5865e03d242b8f9cb250cfdfe125d61d90855d42e2d3 : WAPT/icon.png
c777e8fa69e9ff91f448a6a0af5f5bbe9209d21d17f27ce59e5acda8bbc74885 : luti.json
51a937d145267561776a5a2dba7338a321652d6e50a2a6e965be6393126f5481 : setup.py
0e6dbf5f4bb245344a257f2715f5d793d17870dee9eea1735ccb67b35f1e037c : swipl-9.2.9-1.x64.exe
a6560d5205d1aecec300e4f93011d9f95f8ad98bfa5ad63defa74b488048c97c : update_package.py