Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read only Packages for current arch but also flat-repo Packages without binary in filename #40

Merged
merged 2 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions aptcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ void AptCache::loadCacheFiles()
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 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 ((includeRegex.match(fileName).hasMatch() || secondaryRegex.match(fileName).hasMatch())
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;
Expand Down
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
mx-packageinstaller (24.12.04) mx; urgency=medium

* Adjust regex to read binary-packages for current arch only and
add all flat-repo Packages without binary-arch in filename

-- fehlix <[email protected]> Tue, 31 Dec 2024 11:12:36 -0500

mx-packageinstaller (24.12.03) mx; urgency=medium

* adjust secondary regex to pick up more package lists
Expand All @@ -9,6 +16,7 @@ mx-packageinstaller (24.12.02) mx; urgency=medium
* Set the application name to fix the Qt translation domain and
window icon name based on the application name instead of the
executable file or symlink name
* Adjust regex for Packages filenames without binary-arch from flat-repo

-- fehlix <[email protected]> Tue, 31 Dec 2024 10:19:35 -0500

Expand Down
Loading