Old packages in repos

Hi,

today I was doing a little bit of package cleaning and I noticed that I had the package kpmcore3 installed. This package seems to be no more on the official repos. Also I had partitionmanager3 installed that depends on that package and this one is on Manjaro’s repos. These seem to be some old packages, as kpmcore and partitionmanager packages exists also in the repos.

This lead me to create a small script to check what packages are in Manjaro’s repos that depend on packages that are not anymore available. The result was this:

lib32-sni-qt depends on non existent sni-qt
lib32-sni-qt depends on non existent lib32-qt4
lib32-qjson depends on non existent lib32-qt4
lib32-libdbusmenu-qt depends on non existent lib32-qt4
manjaro-bspwm-mate-settings depends on non existent manjaro-browser-settings-native
manjaro-kde-settings-19.0 depends on non existent breath2-icon-themes
manjaro-kde-settings-19.0 depends on non existent breath2-wallpaper
manjaro-kde-settings-19.0 depends on non existent plasma5-themes-breath2
partitionmanager3 depends on non existent kpmcore3
unified-manjaro-themes-openbox depends on non existent faenza-green-icon-theme
i3-theme-dark depends on non existent gtk-xfce-engine
manjaro-kde-tx-settings depends on non existent breath2-icon-themes
plasma-theme-infinitybook depends on non existent plasma5-themes-breath2
plasma-theme-infinitybook depends on non existent breath2-icon-themes
plasma-theme-infinitybook depends on non existent sddm-breath2-theme
qt-at-spi depends on non existent qt4
marked-man depends on non existent marked<1 (Version 3.0.7-1 available)
manjaro-kde-minimal-settings-18.0 depends on non existent adapta-breath-theme
i3-theme-dust depends on non existent gtk-xfce-engine
manjaro-kde-settings-18.0 depends on non existent adapta-breath-theme
manjaro-kde-settings-shells depends on non existent breath2-icon-themes
manjaro-kde-settings-shells depends on non existent breath2-wallpaper
manjaro-kde-settings-shells depends on non existent plasma5-themes-breath2
py-corners depends on non existent python2-xlib
darch-run depends on non existent linux53

What gives us that the following packages exist in the repos but it is not possible to install them as they depend on packages that do not exist anymore:

darch-run
i3-theme-dark
i3-theme-dust
lib32-libdbusmenu-qt
lib32-qjson
lib32-sni-qt
manjaro-bspwm-mate-settings
manjaro-kde-minimal-settings-18
manjaro-kde-settings-18
manjaro-kde-settings-19
manjaro-kde-settings-shells
manjaro-kde-tx-settings
marked-man
partitionmanager3
plasma-theme-infinitybook
py-corners
qt-at-spi
unified-manjaro-themes-openbox

Is there any reason for these packages to be in Manjaro’s repos?

PS: Probably @philm is the one that knows the answer.

2 Likes

I’ll look over those packages, thanks for bringing this to our attention.

EDIT: Most have been removed.

marked0.8 qualifies for the marked<1 requirement. See Manjaro - Branch Compare. Those are all Arch community packages.

Mind sharing it? :grinning:

exists pacman -Dkk included in manjaro-check-repo

5 Likes

So I just reinvented the wheel… :sweat_smile: :sweat_smile:

Yes, of course. Please, take in mind that it is nothing fancy and there is plenty room for improve…
I have a folder with two scripts. First expand the database files to the current directory with a shell script:

#!/bin/bash
for i in /var/lib/pacman/sync/*.db
do
    name=$(basename $i)
    name="${name%.*}"
    if [ "$name" != 'pamac_aur' ]
    then
        mkdir "$name"
        tar -zxf "$i" -C "$name"
    fi
done

and then do the “magic” with a python script:

from pathlib import Path
import csv
import re


def compare_versions(pkgver, queryver):
    """ Compare versions and return 0 if they are equal, -1 if package version is greater or 1 if query version is greater """
    # Add epoch if version doesn't have it
    if queryver[1:2] != ':':
        queryver = '0:' + queryver
    if pkgver[1:2] != ':':
        pkgver = '0:' + pkgver

    # Poor's man version comparison
    pkgver = re.findall('[^:+.-]+', pkgver)
    queryver = re.findall('[^:+.-]+', queryver)
    for i in range(min(len(pkgver), len(queryver))):
        if pkgver[i] == queryver[i]:
            continue
        if int(pkgver[i]) < int(queryver[i]):
            return 1
        if int(pkgver[i]) > int(queryver[i]):
            return -1
    return 0


# Get database directories
p = Path('.')
dirs = []
for i in p.iterdir():
    if i.is_dir():
        dirs.append(i)

# Traverse database directories and get package information
properties = set()
properties.add('REPO')
packages = dict()
for repo in dirs:
    for item in repo.iterdir():
        package = dict()
        with open(item / 'desc','r') as file:
            data = file.read().strip().split('\n\n')
        for field in data:
            property, *value = field.split('\n')
            property = property.strip('%')
            properties.add(property)
            value = ','.join(value)
            package[property] = value
        package['REPO'] = str(repo)
        packages[package['NAME']] = package


# Write database information to a CSV file
# csv_columns = properties
# with open('packages_db.csv', 'w') as csvfile:
#     writer = csv.DictWriter(csvfile, fieldnames=csv_columns)
#     _ = writer.writeheader()
#     for data in packages.values():
#         _ = writer.writerow(data)

# Get available versions of packages and libraries
available = dict()
for pkg in packages.values():
    available[pkg['NAME']] = [pkg['VERSION']]   # List, because there can be different versions of the same entity

for pkg in packages.values():
    if 'PROVIDES' in pkg.keys():
        for name in pkg['PROVIDES'].split(','):
            if name.find('=') > 0:
                name, ver = name.split('=')
            else:
                ver = pkg['VERSION']
            if name in available.keys():
                available[name].append(ver)
            else:
                available[name] = [ver]

# Check dependencies
for pkg in packages.values():
    if 'DEPENDS' not in pkg.keys():
        continue
    for dep in pkg['DEPENDS'].split(','):
        comp = re.findall('[<=>]+', dep)
        if comp:
            comp = comp[0]
            wanted_pkg, wanted_ver = dep.split(comp)
            if wanted_pkg not in available.keys():
                print(f"{pkg['NAME']} depends on non existent {wanted_pkg}")
            else:
                message = ''
                flag = False
                for actual_ver in available[wanted_pkg]:
                    if comp == '<' and compare_versions(actual_ver, wanted_ver) != 1 or \
                        comp == '>' and compare_versions(actual_ver, wanted_ver) != -1 or \
                        comp == '=' and compare_versions(actual_ver, wanted_ver) != 0 or \
                        comp == '>=' and compare_versions(actual_ver, wanted_ver) == 1 or \
                        comp == '<=' and compare_versions(actual_ver, wanted_ver) == -1:
                        message = f"{pkg['NAME']} depends on non existent {wanted_pkg}{comp}{wanted_ver} (Version {actual_ver} available)"
                    else:
                        flag = True
                        break
                if not flag:
                    print(message)
        else:
            wanted_pkg = dep
            if wanted_pkg not in available.keys():
                print(f"{pkg['NAME']} depends on non existent {wanted_pkg}")

Scripts are a little bit pointless now, but maybe they can help with another thing. Once you have the database info, you can check whatever you want.

EDIT:

Yes, I had a bug in my code. Fixed. The only one I can’t get around is perl-text-diff that depends on perl-algorithm-diff>=1.1900 (Version 1.201-2 available). The version numbers doesn’t make sense to me: 201 > 1900 (!)

EDIT2:
Now code manages epoch properly

2 Likes

Ah, I guess I still have some pacman and mbn commands to learn. What mbn command would incorporate it?

That’s why perl-text-diff has an epoch: 1:1.201-2. :wink: Blame upstream for screwing up their versioning, I guess.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.