Skip to content

Commit

Permalink
Merge pull request #40 from fehlix/master
Browse files Browse the repository at this point in the history
Read only Packages for current arch but also flat-repo Packages without binary in filename
  • Loading branch information
dolphinoracle authored Dec 31, 2024
2 parents fd941ab + 955d470 commit 46f9403
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
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

0 comments on commit 46f9403

Please sign in to comment.