Skip to content

Commit 46f9403

Browse files
Merge pull request #40 from fehlix/master
Read only Packages for current arch but also flat-repo Packages without binary in filename
2 parents fd941ab + 955d470 commit 46f9403

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

aptcache.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@ void AptCache::loadCacheFiles()
1818
const QString arch = getArch();
1919

2020
// Define include and exclude regex patterns
21-
const QRegularExpression includeRegex(QString(R"(^.*binary-%1_Packages$)").arg(arch));
22-
const QRegularExpression secondaryRegex(R"(^.*_Packages$)");
21+
const QRegularExpression allBinaryArchRegex(QString(R"(^.*binary-%1_Packages$)").arg(arch));
22+
const QRegularExpression allBinaryAnyRegex(R"(^.*binary-[a-z0-9]+_Packages$)");
23+
const QRegularExpression allRegex(R"(^.*_Packages$)");
24+
2325
const QRegularExpression excludeRegex(
2426
R"((debian_.*-backports_.*_Packages)|(mx_testrepo.*_test_.*_Packages)|(mx_repo.*_temp_.*_Packages))");
2527

2628
QDirIterator it(dir.path(), QDir::Files);
2729
while (it.hasNext()) {
2830
const QString fileName = it.next();
29-
if ((includeRegex.match(fileName).hasMatch() || secondaryRegex.match(fileName).hasMatch())
31+
if ((allBinaryArchRegex.match(fileName).hasMatch() ||
32+
(!allBinaryAnyRegex.match(fileName).hasMatch() && allRegex.match(fileName).hasMatch()))
3033
&& !excludeRegex.match(fileName).hasMatch()) {
3134
if (!readFile(fileName)) {
3235
qWarning() << "Error reading cache file:" << fileName;

debian/changelog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
mx-packageinstaller (24.12.04) mx; urgency=medium
2+
3+
* Adjust regex to read binary-packages for current arch only and
4+
add all flat-repo Packages without binary-arch in filename
5+
6+
-- fehlix <[email protected]> Tue, 31 Dec 2024 11:12:36 -0500
7+
18
mx-packageinstaller (24.12.03) mx; urgency=medium
29

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

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

0 commit comments

Comments
 (0)