MX Package Installer not showing all enabled Repo packages  [Solved]

For issues with MX that has been modified from the initial install. Example: adding packages that then cause issues.
Message
Author
User avatar
AVLinux
Posts: 3073
Joined: Wed Jul 15, 2020 1:15 am

MX Package Installer not showing all enabled Repo packages

#1 Post by AVLinux »

Hi,

This came up a while back and I'm making a note of it here in case it is of interest for future improvements to MXPI..

I had just weaned myself off off Synaptic since MXPI had some recent improvements to display all installed packages on the system and Synaptic was no longer required for my purposes... Later I ended up needing to add and retain the nVidia CUDA Development Repository and packages from this Repo will not appear in MXPI at all so I had to reinstall Synaptic just to see the actual most up-to-date versions. While you could argue that I've added a non-standard Repo shouldn't MXPI show all packages in all enabled Repos?

If you look at refreshed MXPI and Synaptic side by side you can see they are reporting different versions of the same searched package name:


Image

User avatar
fehlix
Developer
Posts: 12767
Joined: Wed Apr 11, 2018 5:09 pm

Re: MX Package Installer not showing all enabled Repo packages

#2 Post by fehlix »

AVLinux wrote: Mon Dec 30, 2024 7:13 pm Hi,

This came up a while back and I'm making a note of it here in case it is of interest for future improvements to MXPI..

I had just weaned myself off off Synaptic since MXPI had some recent improvements to display all installed packages on the system and Synaptic was no longer required for my purposes... Later I ended up needing to add and retain the nVidia CUDA Development Repository and packages from this Repo will not appear in MXPI at all so I had to reinstall Synaptic just to see the actual most up-to-date versions. While you could argue that I've added a non-standard Repo shouldn't MXPI show all packages in all enabled Repos?

If you look at refreshed MXPI and Synaptic side by side you can see they are reporting different versions of the same searched package name:


Image
Perhaps give details on the added repo, so we can compare.

User avatar
AVLinux
Posts: 3073
Joined: Wed Jul 15, 2020 1:15 am

Re: MX Package Installer not showing all enabled Repo packages

#3 Post by AVLinux »

@fehlix

Hello, the Repo in question is the Repo that gets enabled when you select the ddm-mx option to install nVidia drivers from the development branch (for newer Video cards than the regular nVidia driver supports). ddm-mx usually uninstalls the keying and disables the Repo once the driver is installed but I needed some additional packages to match my nVidia driver version so I have kept it enabled.

Here's the sources.list.d entry:

Code: Select all

deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/ /
The keyring Deb is here:

Code: Select all

wget https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb

User avatar
dolphin_oracle
Developer
Posts: 22445
Joined: Sun Dec 16, 2007 12:17 pm

Re: MX Package Installer not showing all enabled Repo packages

#4 Post by dolphin_oracle »

I think we need to tweak the regex. the nvidia developer repo does not pass the regex test set up to scan package lists.

Code: Select all

void AptCache::loadCacheFiles()
{
    // Exclude Debian backports and MX testrepo and temp repos
    const QString arch = getArch();

    // Define include and exclude regex patterns
    const QRegularExpression includeRegex(QString(R"(^.*binary-%1_Packages$)").arg(arch));
    const QRegularExpression secondaryRegex(R"(^.*_Packages$)");
    const QRegularExpression excludeRegex(
        R"((debian_.*-backports_.*_Packages)|(mx_testrepo.*_test_.*_Packages)|(mx_repo.*_temp_.*_Packages))");

    QDirIterator it(dir.path(), QDir::Files);
    while (it.hasNext()) {
        const QString fileName = it.next();
        if ((includeRegex.match(fileName).hasMatch() || secondaryRegex.match(fileName).hasMatch())
            && !excludeRegex.match(fileName).hasMatch()) {
            if (!readFile(fileName)) {
                qWarning() << "Error reading cache file:" << fileName;
            }
        }
    }
}
maybe the secondary regex from

Code: Select all

const QRegularExpression secondaryRegex(R"(^.*binary-.*_Packages$)");
to

Code: Select all

 const QRegularExpression secondaryRegex(R"(^.*_Packages$)");



Image
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

User avatar
fehlix
Developer
Posts: 12767
Joined: Wed Apr 11, 2018 5:09 pm

Re: MX Package Installer not showing all enabled Repo packages

#5 Post by fehlix »

dolphin_oracle wrote: Mon Dec 30, 2024 11:49 pm I think we need to tweak the regex. the nvidia developer repo does not pass the regex test set up to scan package lists.

Code: Select all

const QRegularExpression secondaryRegex(R"(^.*binary-.*_Packages$)");
to

Code: Select all

 const QRegularExpression secondaryRegex(R"(^.*_Packages$)");
I'd rather stay with the orignal intention and look only for binary-"$arch" Packages file,
and only add from those "flat-repos" which do not have binary-"$arch" but have all their list files under top-repo dir.
So, perhapbs hold off a bit with the above... so I can send my adjustments

User avatar
fehlix
Developer
Posts: 12767
Joined: Wed Apr 11, 2018 5:09 pm

Re: MX Package Installer not showing all enabled Repo packages

#6 Post by fehlix »

dolphin_oracle wrote: Mon Dec 30, 2024 11:49 pm

Code: Select all

 const QRegularExpression secondaryRegex(R"(^.*_Packages$)");
OK send a PR ( with resolved merge confilcts):
So we read all binary-{arch} but also any Packages from those flat repository
which do not have a binary-arch within the file name, which are normally located at top-dir of the flat repo.
So it looks now like this:

Code: Select all

void AptCache::loadCacheFiles()
{
    // Exclude Debian backports and MX testrepo and temp repos
    const QString arch = getArch();

    // Define include and exclude regex patterns
    const QRegularExpression allBinaryArchRegex(QString(R"(^.*binary-%1_Packages$)").arg(arch));
    const QRegularExpression allBinaryAnyRegex(R"(^.*binary-[a-z0-9]+_Packages$)");
    const QRegularExpression allRegex(R"(^.*_Packages$)");

    const QRegularExpression excludeRegex(
        R"((debian_.*-backports_.*_Packages)|(mx_testrepo.*_test_.*_Packages)|(mx_repo.*_temp_.*_Packages))");

    QDirIterator it(dir.path(), QDir::Files);
    while (it.hasNext()) {
        const QString fileName = it.next();
        if ((allBinaryArchRegex.match(fileName).hasMatch() ||
            (!allBinaryAnyRegex.match(fileName).hasMatch() && allRegex.match(fileName).hasMatch()))
            && !excludeRegex.match(fileName).hasMatch()) {
            if (!readFile(fileName)) {
                qWarning() << "Error reading cache file:" << fileName;
            }
        }
    }
}
with the adjusted

Code: Select all

const QRegularExpression secondaryRegex(R"(^.*_Packages$)");
we would potentially get to many packages into the list, with the risk if having displayed packages from other arch,
which may lead to other issues.

User avatar
dolphin_oracle
Developer
Posts: 22445
Joined: Sun Dec 16, 2007 12:17 pm

Re: MX Package Installer not showing all enabled Repo packages

#7 Post by dolphin_oracle »

Ok sounds good to me. I've never been particularly good with regex :happy:
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

User avatar
fehlix
Developer
Posts: 12767
Joined: Wed Apr 11, 2018 5:09 pm

Re: MX Package Installer not showing all enabled Repo packages

#8 Post by fehlix »

With these adjustments we would now have listed in "MXPI Enabled Repos" tab those nvidia stuff from nvidia developer "flat" repo:
adjust-flatrepo-regex-nvidia.jpg
But also such from other flat repos like megasync in case people have added manually the mega repo:
adjust-flatrepo-regex-mega.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
fehlix
Developer
Posts: 12767
Joined: Wed Apr 11, 2018 5:09 pm

Re: MX Package Installer not showing all enabled Repo packages

#9 Post by fehlix »

Maybe we should adjust the version number (version.h) with the rules files itself,
which would allow to build without any pre-build run, and would not conflict to any existing build procedure with a pre-build run.
Send a PR, with adjusted rules, but I kept the duplicated override_dh_auto_install at the end,
probably a OBS thing, so kept it.
Otherwsie, I guess a rebuild with a pre-buid run would be nice,
to avoid we have always the same version 24.1 as indicated within about :
mxpi-w-version-number-24.1.jpg
or shown on command line:

Code: Select all

mx-packageinstaller 
mx-packageinstaller version: 24.1
+++ void MainWindow::setProgressDialog() +++
...
You do not have the required permissions to view the files attached to this post.

User avatar
fehlix
Developer
Posts: 12767
Joined: Wed Apr 11, 2018 5:09 pm

Re: MX Package Installer not showing all enabled Repo packages

#10 Post by fehlix »

Cool, new build on the way to the repos, with autobuild version number:
mxpi-w-latest-version-number.jpg
Thanks,
HNY..
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “MX Modified”