Skip to content

Commit a7b5a8f

Browse files
committed
Fix CI build
1 parent 3affdc5 commit a7b5a8f

5 files changed

Lines changed: 21 additions & 16 deletions

File tree

src/config.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ void Config::setupUserConfig() {
246246

247247
QString localEtcPath = QString(SYSCONFDIR "/skyscraper/");
248248
if (!QFileInfo::exists(localEtcPath) || isRpInstall) {
249+
if (!isRpInstall) {
250+
qDebug() << "local install path does not exist" << localEtcPath;
251+
}
249252
// RetroPie or Windows installation type: handled externally
250253
return;
251254
}
@@ -269,21 +272,20 @@ void Config::setupUserConfig() {
269272
dest = dest.replace("resources/", "");
270273
} else if ((src == "peas.json" || src == "platforms_idmap.csv")) {
271274
isPristine = isPlatformCfgPristine(tgtDir % "/" % dest);
272-
// isPristine == 1: keep new file in *.dist
275+
// isPristine == 1: keep updated files from release in *.dist
273276
if (isPristine == 0) {
274277
configFiles[src].second = FileOp::OVERWRITE;
275278
} else if (isPristine < 0) {
276-
ncprintf(
277-
"\033[1;31mFile '%s' does not exist or cannot be read. "
278-
"Please fix. Quitting.\033[0m\n",
279-
(tgtDir % "/" % dest).toUtf8().constData());
279+
ncprintf("\033[1;31mFile '%s' cannot be read. "
280+
"Please fix. Quitting.\033[0m\n",
281+
(tgtDir % "/" % dest).toUtf8().constData());
280282
emit die(1,
281283
QString("cannot access '%1'").arg(tgtDir % "/" % dest),
282-
"File does not exist or permission denied");
284+
"Permission denied");
283285
}
284286
}
285287
QString tgt = tgtDir % "/" % dest;
286-
copyFile(localEtcPath % src, tgt, isPristine,
288+
copyFile(localEtcPath % src, tgt, isPristine == 0,
287289
configFiles.value(src).second);
288290
}
289291
}

src/platform.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,9 @@ bool Platform::loadPlatformsIdMap() {
278278
Whereas user edits in such files should go into _local files (introduced with
279279
3.13).
280280
*/
281-
// 0: pristine, 1: local changes, -1 not readable, -2 non existing
281+
// 0: pristine or not existing (-> overwrite),
282+
// 1: local changes,
283+
// -1 not readable (permission error)
282284
int Platform::isPlatformCfgfilePristine(const QString &cfgFilePath) {
283285
QMap<QString, QStringList> sha256sums = {
284286
// clang-format off
@@ -309,7 +311,7 @@ int Platform::isPlatformCfgfilePristine(const QString &cfgFilePath) {
309311
};
310312
QFileInfo cfgFileInfo = QFileInfo(cfgFilePath);
311313
if (!cfgFileInfo.exists()) {
312-
return -2;
314+
return 0;
313315
}
314316

315317
QCryptographicHash sha256 = QCryptographicHash(QCryptographicHash::Sha256);

supplementary/workflows/install

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ build() {
3232
cd "$SKYSCRAPER_HOME"
3333
# Qt5
3434
make --ignore-errors distclean || true
35+
sed -ie "0,/CONFIG += /{s/CONFIG.*/CONFIG += debug/}" skyscraper.pro
3536
qmake
3637
jobs=$(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu)
3738
make "-j$jobs"
3839
sudo make install
3940
# Qt6, without make install
4041
make --ignore-errors distclean || true
42+
sed -ie "0,/CONFIG += /{s/CONFIG.*/CONFIG += release/}" skyscraper.pro
4143
qmake6
4244
make "-j$jobs"
4345
}

supplementary/workflows/test

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ _test_android() {
1515

1616
_smoke_test() {
1717
# Qt5
18-
/usr/local/bin/Skyscraper --buildinfo
18+
/usr/local/bin/Skyscraper --buildinfo | grep -q -oPz "(?s)Skyscraper:\s+\d+\..+Qt:\s+5\."
1919
# Qt6
20-
"${SKYSCRAPER_HOME}/Skyscraper" --buildinfo
20+
"${SKYSCRAPER_HOME}/Skyscraper" --buildinfo | grep -q -oPz "(?s)Skyscraper:\s+\d+\..+Qt:\s+6\."
2121
}
2222

2323
_unit_tests() {
@@ -59,8 +59,7 @@ main() {
5959
case "${1:-}" in
6060
"android-aarch64") _test_android "aarch64" ;;
6161
"android-arm") _test_android "ARM" ;;
62-
*) _unit_tests && _exit_test;;
63-
#*) _smoke_test;;
62+
*) _smoke_test && _unit_tests && _exit_test;;
6463
esac
6564
}
6665

test/abstractscraper/test_abstractscraper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private slots:
3131

3232
void testDetectRegionsFromFilename2() {
3333
scraper = new AbstractScraper(&settings, NULL);
34-
QFileInfo info("Gametitle (j) world.zip");
34+
QFileInfo info("Gametitle (j) (world).zip");
3535
QList<QString> regionPriosExp;
3636
regionPriosExp.append("jp");
3737
regionPriosExp.append("wor");
@@ -40,11 +40,11 @@ private slots:
4040

4141
void testDetectRegionsFromFilename3() {
4242
scraper = new AbstractScraper(&settings, NULL);
43-
QFileInfo info("Gametitle (france) wOrLD (j).zip");
43+
QFileInfo info("Gametitle (france) (wOrLD) (j).zip");
4444
QList<QString> regionPriosExp;
4545
regionPriosExp.append("fr");
46-
regionPriosExp.append("jp");
4746
regionPriosExp.append("wor");
47+
regionPriosExp.append("jp");
4848
match(info, regionPriosExp);
4949
qDebug() << info.completeBaseName();
5050
qDebug() << regionPriosExp;

0 commit comments

Comments
 (0)