f31522130f
Build system (5 gaps hardened): - COOKBOOK_OFFLINE defaults to true (fork-mode) - normalize_patch handles diff -ruN format - New 'repo validate-patches' command (25/25 relibc patches) - 14 patched Qt/Wayland/display recipes added to protected list - relibc archive regenerated with current patch chain Boot fixes (fixable): - Full ISO EFI partition: 16 MiB → 1 MiB (matches mini, BIOS hardcoded 2 MiB offset) - D-Bus system bus: absolute /usr/bin/dbus-daemon path (was skipped) - redbear-sessiond: absolute /usr/bin/redbear-sessiond path (was skipped) - daemon framework: silenced spurious INIT_NOTIFY warnings for oneshot_async services (P0-daemon-silence-init-notify.patch) - udev-shim: demoted INIT_NOTIFY warning to INFO (expected for oneshot_async) - relibc: comprehensive named semaphores (sem_open/close/unlink) replacing upstream todo!() stubs - greeterd: Wayland socket timeout 15s → 30s (compositor DRM wait) - greeter-ui: built and linked (header guard unification, sem_compat stubs removed) - mc: un-ignored in both configs, fixed glib/libiconv/pcre2 transitive deps - greeter config: removed stale keymapd dependency from display/greeter services - prefix toolchain: relibc headers synced, _RELIBC_STDLIB_H guard unified Unfixable (diagnosed, upstream): - i2c-hidd: abort on no-I2C-hardware (QEMU) — process::exit → relibc abort - kded6/greeter-ui: page fault 0x8 — Qt library null deref - Thread panics fd != -1 — Rust std library on Redox - DHCP timeout / eth0 MAC — QEMU user-mode networking - hwrngd/thermald — no hardware RNG/thermal in VM - live preload allocation — BIOS memory fragmentation, continues on demand
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
// Copyright (C) 2016 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
#include "configfile.h"
|
|
|
|
#include <QFile>
|
|
|
|
ConfigFile::SectionMap ConfigFile::parse(const QString &fileName)
|
|
{
|
|
QFile f(fileName);
|
|
if (!f.open(QIODevice::ReadOnly))
|
|
return ConfigFile::SectionMap();
|
|
return parse(&f);
|
|
}
|
|
|
|
ConfigFile::SectionMap ConfigFile::parse(QIODevice *dev)
|
|
{
|
|
SectionMap sections;
|
|
SectionMap::Iterator currentSection = sections.end();
|
|
|
|
ConfigFile::SectionMap result;
|
|
int currentLineNumber = 0;
|
|
while (!dev->atEnd()) {
|
|
QString line = QString::fromUtf8(dev->readLine()).trimmed();
|
|
++currentLineNumber;
|
|
|
|
if (line.isEmpty() || line.startsWith(QLatin1Char('#')))
|
|
continue;
|
|
|
|
if (line.startsWith(QLatin1Char('['))) {
|
|
if (!line.endsWith(']')) {
|
|
qWarning("Syntax error at line %d: Missing ']' at start of new section.", currentLineNumber);
|
|
return SectionMap();
|
|
}
|
|
line.remove(0, 1);
|
|
line.chop(1);
|
|
const QString sectionName = line;
|
|
currentSection = sections.insert(sectionName, Section());
|
|
continue;
|
|
}
|
|
|
|
if (currentSection == sections.end()) {
|
|
qWarning("Syntax error at line %d: Entry found outside of any section.", currentLineNumber);
|
|
return SectionMap();
|
|
}
|
|
|
|
Entry e;
|
|
e.lineNumber = currentLineNumber;
|
|
|
|
int equalPos = line.indexOf(QLatin1Char('='));
|
|
if (equalPos == -1) {
|
|
e.key = line;
|
|
} else {
|
|
e.key = line;
|
|
e.key.truncate(equalPos);
|
|
e.key = e.key.trimmed();
|
|
e.value = line.mid(equalPos + 1).trimmed();
|
|
}
|
|
currentSection->append(e);
|
|
}
|
|
return sections;
|
|
}
|