tis-ripgrep-portable icon

RipGre

Paquet d’installation silencieuse pour RipGre

14.1.1-1

  • package: tis-ripgrep-portable
  • name: RipGre
  • version: 14.1.1-1
  • maintainer: Administrator
  • target_os: windows
  • architecture: x86
  • signature_date:
  • size: 1.93 Mo

package           : tis-ripgrep-portable
version           : 14.1.1-1
architecture      : x86
section           : base
priority          : optional
name              : RipGre
categories        : 
maintainer        : Administrator
description       : rga is an online search tool that allows you to search for a regular expression in a multitude of file types
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : rga est un outil de recherche orienté ligne qui vous permet de rechercher une expression régulière dans une multitude de types de fichiers
description_pl    : rga to narzędzie do wyszukiwania online, które umożliwia wyszukiwanie wyrażeń regularnych w szerokiej gamie typów plików
description_de    : rga ist ein online-orientiertes Suchwerkzeug, mit dem Sie in einer Vielzahl von Dateitypen nach einem regulären Ausdruck suchen können
description_es    : rga es una herramienta de búsqueda en línea que le permite buscar una expresión regular en una amplia gama de tipos de archivo
description_pt    : O rga é uma ferramenta de pesquisa online que lhe permite procurar uma expressão regular numa vasta gama de tipos de ficheiros
description_it    : rga è uno strumento di ricerca online che consente di cercare un'espressione regolare in un'ampia gamma di tipi di file
description_nl    : rga is een online zoekprogramma waarmee je kunt zoeken naar een reguliere uitdrukking in een groot aantal bestandstypen
description_ru    : rga - это инструмент онлайн-поиска, позволяющий искать регулярные выражения в файлах самых разных типов
audit_schedule    : 
editor            : 
keywords          : 
licence           : 
homepage          : 
package_uuid      : e09ddbba-2909-470f-b8a9-9fbefd1e4d75
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 5005ab036c49d4d00c52cfdb72c778f1f1324c3f767f98f94ed5eda9afd5a159
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2024-09-14T08:00:32.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         : tvLxvdI5lyw20/6jun4CKGRziziNskCFjfOg7sWeEn90GyhQcLibYrLVvbyr5XeUwVmVYmT7bMZOAXBmr8+tpRNX6555IXJx+16P3D2kfVdQ/z9enLCQWujJaQNoD2VCe28/xfMuyI6NzeDtaYI6UiYUpBBuFiBhTEphfNhJqMqG0ovk6+DIBsfh5Jim9ZmdLEHu4yhbqpZVNpjhiOE4ORMAX1GA2NED64etR1nsJ+zu2IIShP+eCZIrPs6O0yP4/W+uFg3rq6ZohjhXreJw9XTW2flM41VQZVSYvMoRwR0+XXfO/rUuf/4TnNLDVU1rVoehQ8nCpdIlY0QkS39Oiw==

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

app_name = "ripgrep"
app_dir = makepath(programfiles, app_name)
app_path = makepath(app_dir,  "rg.exe")
audit_version = False

def get_installed_version(app_path):
    return get_file_properties(app_path).get("FileVersion", "")

def install():
    # Find the zip file
    zip_name = glob.glob(f"{app_name}*.zip")[0]
    unzip_dest = makepath(".", "temp_dezip")
    
    # Remove the temporary directory if it already exists
    if isdir(unzip_dest):
        remove_tree(unzip_dest)
    
    # Extract the zip file
    print(f"Extracting: {zip_name} to: {unzip_dest}")
    unzip(zip_name, unzip_dest)
    
    # Find the name of the extracted directory
    unzipped_dir = makepath(unzip_dest, os.listdir(unzip_dest)[0])
    
    # Remove the old application directory if it exists
    if isdir(app_dir):
        remove_tree(app_dir)
    
    # Move the new extracted directory to the final installation directory
    copytree2(unzipped_dir, app_dir, onreplace=default_overwrite)
    
    # Remove the temporary directory
    remove_tree(unzip_dest)
    
    # Create custom shortcuts
    create_desktop_shortcut(app_name, target=app_path)
    create_programs_menu_shortcut(app_name, target=app_path)

def audit():
    # Auditing software
    audit_status = "OK"
    installed_version = get_installed_version(app_path)
    if Version(installed_version) < Version(control.get_software_version()) and audit_version:
        print("%s is installed in version (%s) instead of (%s)" % (app_name, installed_version, control.get_software_version()))
        audit_status = "WARNING"
    elif isdir(app_dir) and not dir_is_empty(app_dir):
        print("%s (%s) is installed" % (app_name, installed_version))
        audit_status = "OK"
    else:
        print("%s is not installed" % app_name)
        audit_status = "ERROR"
    return audit_status

def uninstall():
    # Uninstalling software
    killalltasks(ensure_list(control.impacted_process))
    if isdir(app_dir):
        remove_tree(app_dir)

    # Removing shortcuts
    remove_desktop_shortcut(app_name)
    remove_programs_menu_shortcut(app_name)

from setuphelpers import *
import requests
import re
import json

def update_package():
    # Déclarer les variables locales
    result = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    git_repo = "BurntSushi/ripgrep"
    dict_arch ={
        "x64":"x86_64-pc-windows-msvc",
        "x86": "-i686-pc-windows-msvc",
    }
    url_api = f"https://api.github.com/repos/{git_repo}/releases/latest"
    
    # Getting latest version information from official sources
    print("API used is: %s" % url_api)
    json_load = json.loads(wgets(url_api, proxies=proxies))

    for download in json_load["assets"]:
        if download["browser_download_url"].endswith('.zip') and dict_arch[control.architecture] in download["browser_download_url"]:
            url_dl = download["browser_download_url"]
            version = json_load["tag_name"].replace("v","")
            filename = download["name"]
            break

    if not isfile(filename):
        package_updated = True
        wget(url_dl,filename,proxies=proxies)

    #nettoyer les fichiers temporaires
    for f in glob.glob('*.zip'):
        if f != filename:
            remove_file(f)
    
    control.set_software_version(version)
    control.save_control_to_wapt()

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
396d9738a0a6f7368f5c323e0245fdbd9f703441d2925ca5d66003a3059dccdf : WAPT/control
5005ab036c49d4d00c52cfdb72c778f1f1324c3f767f98f94ed5eda9afd5a159 : WAPT/icon.png
92eac10302b0ab9ceada51c910215447bdd4a8450e48dccc80711da315c90b5b : luti.json
1e5c99e4851c964152db07c79151982c7fa7a549b645b6b47daae07a9c185f8e : ripgrep-14.1.1-i686-pc-windows-msvc.zip
b2cb6c87cf65f91fb23fcef43b50218eb03bca199437f13654354e586111684f : setup.py
eb23304f093568cc958b9dce3ab502f31bdc4d861464a5ae9d0b2a0db2c43469 : update_package.py