[RESOLVED] digiKam package

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
vnatton
Messages: 6
Registration: January 9, 2024 - 1:53 PM

January 9, 2024 - 1:58 PM

Good morning,
Following a user request, I created the DigiKam package (Win 10 64bit). It's not super clean, but it's just waiting to be improved.
I haven't found an easy way to check for updates, so I parse the RSS feed looking for the latest version and then construct the download URL.

Good day

Code: Select all

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

exe_name =  "Digikam-x64.exe"

def install():
    install_exe_if_needed(exe_name,key="digiKam")
    pass

def update_package():
    import xml.etree.ElementTree as ET
    # On doit utiliser cette bibliotheque pour accéder a une URL
    import urllib.request

    opener = urllib.request.build_opener()
    url = "https://apps.kde.org/fr/digikam/index.xml"
    tree = ET.parse(opener.open(url))
    root = tree.getroot()

    #root[0][6][1].text correspond au lien la derniere version

    text_link_last_version = root[0][6][1].text
    version_online = text_link_last_version.split("#")[1]


    #Construction du lien de téléchargement
    download_url = "https://download.kde.org/stable/digikam/%s/digiKam-%s-Win64.exe" % (version_online,version_online)
    latest_bin = download_url.split("/")[-1]

    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()

    exe_name =  "Digikam-x64.exe"

    # Checking version from file
    version_actuelle = Version(control.get_software_version())
    if version_actuelle != Version(version_online) and version_actuelle != "":
        if os.path.isfile(exe_name):
            print("Changing version to the version number of the binary")
            os.rename(exe_name, "%s-ancien" % exe_name)

        # Téléchargement du dernier binaire
        print("Latest %s version is: %s" % (control.name, version_online))
        print("Download URL is: %s" % download_url)

        if not isfile(latest_bin):
            print("Downloading: %s" % latest_bin)
            wget(download_url, latest_bin, proxies=proxies)
            os.rename(latest_bin, exe_name)
        else:
            print("Binary is present: %s" % latest_bin)


        # Changement de la version du paquet
        if Version(version_online) > version_actuelle:
            print("Software version updated (from: %s to: %s)" % (version_actuelle, Version(version_online)))
            package_updated = True
        else:
            print("Software version up-to-date (%s)" % Version(version_online))

        control.set_software_version(version_online)
        control.save_control_to_wapt()

        # Suppression du binaire obsolete
        if isfile("%s-ancien" % exe_name):
            os.remove("%s-ancien" % exe_name)

        # Validating update-package-sources
        return package_updated
    else:
        print("Binary file version corresponds to online version")

    pass
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

January 10, 2024 - 10:46

Hi Vianney,

Happy New Year 2024! Thanks for your feedback, Jimmy will take a look and see about adding Digikam to the Luti loop and to the :-)

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
User avatar
jpele
Messages: 156
Registration: March 4, 2019 - 12:01
Location: Nantes

January 10, 2024 - 4:53 PM

Hello Vianney,
Happy New Year 2024 to you too!
Just so you know, the package has been built in testing and will be available exclusively in this repository for 5 days:
https://wapt.tranquil.it/wapt-testing/t ... EPROD.wapt
I had to redo the update_package() for the "luti loop," but the use of the RSS feed is interesting.
The code used can be found in the package : https://wapt.tranquil.it/store/fr/tis-w ... kage-tools.

Best regards,
Jimmy
Locked