[neon/neon-packaging/debconf-kde/Neon/stable] debian/patches: add merge request patch to see if it helps libqapt
Carlos De Maine
null at kde.org
Sat Dec 7 02:12:21 GMT 2024
Git commit df013c825aa8ff3ff03dc70678f7ccb99d24ddf2 by Carlos De Maine.
Committed on 07/12/2024 at 02:12.
Pushed by carlosdem into branch 'Neon/stable'.
add merge request patch to see if it helps libqapt
A +718 -0 debian/patches/kf6_more.diff
A +1 -0 debian/patches/series
https://invent.kde.org/neon/neon-packaging/debconf-kde/-/commit/df013c825aa8ff3ff03dc70678f7ccb99d24ddf2
diff --git a/debian/patches/kf6_more.diff b/debian/patches/kf6_more.diff
new file mode 100644
index 0000000..8580eda
--- /dev/null
+++ b/debian/patches/kf6_more.diff
@@ -0,0 +1,718 @@
+diff --git a/.clang-format b/.clang-format
+new file mode 100644
+index 0000000000000000000000000000000000000000..977a49ee993d1f5ed56d853b8f1b3af5391474eb
+--- /dev/null
++++ b/.clang-format
+@@ -0,0 +1,86 @@
++---
++---
++# SPDX-FileCopyrightText: 2019 Christoph Cullmann <cullmann at kde.org>
++# SPDX-FileCopyrightText: 2019 Gernot Gebhard <gebhard at absint.com>
++#
++# SPDX-License-Identifier: MIT
++
++---
++Language: JavaScript
++DisableFormat: true
++---
++
++# Style for C++
++Language: Cpp
++Standard: c++20
++
++# base is WebKit coding style: https://webkit.org/code-style-guidelines/
++# below are only things set that diverge from this style!
++BasedOnStyle: WebKit
++
++# 4 spaces indent
++TabWidth: 4
++
++# No line limit
++ColumnLimit: 0
++
++# sort includes inside line separated groups
++SortIncludes: true
++
++# Braces are usually attached, but not after functions or class declarations.
++BreakBeforeBraces: Custom
++BraceWrapping:
++ AfterClass: true
++ AfterControlStatement: false
++ AfterEnum: false
++ AfterFunction: true
++ AfterNamespace: true
++ AfterObjCDeclaration: false
++ AfterStruct: true
++ AfterUnion: false
++ BeforeCatch: false
++ BeforeElse: false
++ IndentBraces: false
++
++# CrlInstruction *a;
++PointerAlignment: Right
++
++# horizontally aligns arguments after an open bracket.
++AlignAfterOpenBracket: Align
++
++# don't move all parameters to new line
++AllowAllParametersOfDeclarationOnNextLine: false
++
++# no single line functions
++AllowShortFunctionsOnASingleLine: None
++
++# In case we have an if statement with multiple lines the operator should be at the beginning of the line
++# but we do not want to break assignments
++BreakBeforeBinaryOperators: NonAssignment
++
++# format C++11 braced lists like function calls
++Cpp11BracedListStyle: true
++
++# do not put a space before C++11 braced lists
++SpaceBeforeCpp11BracedList: false
++
++# no namespace indentation to keep indent level low
++NamespaceIndentation: None
++
++# we use template< without space.
++SpaceAfterTemplateKeyword: false
++
++# Always break after template declaration
++AlwaysBreakTemplateDeclarations: true
++
++# macros for which the opening brace stays attached.
++ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE , wl_resource_for_each, wl_resource_for_each_safe ]
++
++# keep lambda formatting multi-line if not empty
++AllowShortLambdasOnASingleLine: Empty
++
++# We do not want clang-format to put all arguments on a new line
++AllowAllArgumentsOnNextLine: false
++
++# Indent lambdas to the start of the line, not to the start of the lambda
++LambdaBodyIndentation: OuterScope
+diff --git a/.gitignore b/.gitignore
+new file mode 100644
+index 0000000000000000000000000000000000000000..ec37b93b4e26b127e845d53707df41c5e6615ac5
+--- /dev/null
++++ b/.gitignore
+@@ -0,0 +1,28 @@
++# Ignore the following files
++.vscode
++*~
++*.[oa]
++*.diff
++*.kate-swp
++*.kdev4
++.kdev_include_paths
++*.kdevelop.pcs
++*.moc
++*.moc.cpp
++*.orig
++*.user
++.*.swp
++.swp.*
++Doxyfile
++Makefile
++avail
++random_seed
++/build*/
++CMakeLists.txt.user*
++*.unc-backup*
++/compile_commands.json
++.clangd
++.idea
++/cmake-build*
++.cache
++.directory
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e865211e53b00123811ce7451172f119e82be778..665bb33756e4504e39dc13955e57e8a5e3dd742a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -12,13 +12,13 @@ project(libdebconf-kde VERSION 1.1.1)
+
+ set(QT_MIN_VERSION "5.8.0")
+ set(KF_MIN_VERSION "5.96.0")
++set(KDE_COMPILERSETTINGS_LEVEL "5.85.0")
+
+-find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
++find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
+ set(CMAKE_MODULE_PATH
+ ${ECM_MODULE_PATH}
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
+
+-include(ECMPackageConfigHelpers)
+ include(ECMSetupVersion)
+ include(FeatureSummary)
+ include(GenerateExportHeader)
+@@ -26,8 +26,6 @@ include(KDEInstallDirs)
+ include(KDECMakeSettings)
+ include(KDECompilerSettings)
+
+-set(REQUIRED_QT_VERSION 5.2.0) # Used in CMakeConfig to check deps
+-
+ if (QT_MAJOR_VERSION STREQUAL "6")
+ set(QT_REQUIRED_VERSION "6.4.0")
+ set(QT_MIN_VERSION "${QT_REQUIRED_VERSION}")
+@@ -37,6 +35,8 @@ else()
+ set(KF_MAJOR_VERSION "5")
+ endif()
+
++set(REQUIRED_QT_VERSION "${QT_MIN_VERSION}") # Used in CMakeConfig to check deps
++
+ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED
+ COMPONENTS
+ Widgets
+@@ -67,13 +67,6 @@ ecm_setup_version(${PROJECT_VERSION}
+
+ add_definitions(-DPROJECT_VERSION=\"${PROJECT_VERSION}\")
+ add_definitions(
+- -DQT_NO_KEYWORDS
+- -DQT_NO_CAST_TO_ASCII
+- -DQT_NO_CAST_FROM_ASCII
+- -DQT_STRICT_ITERATORS
+- -DQT_NO_URL_CAST_FROM_STRING
+- -DQT_NO_CAST_FROM_BYTEARRAY
+- -DQT_USE_QSTRINGBUILDER
+ -DQT_DISABLE_DEPRECATED_BEFORE=0x050900
+ )
+
+@@ -86,7 +79,7 @@ include_directories(
+ # create a Config.cmake and a ConfigVersion.cmake file and install them
+ set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/DebconfKDE")
+
+-ecm_configure_package_config_file(
++configure_package_config_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/DebconfKDEConfig.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/DebconfKDEConfig.cmake"
+ INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR})
+@@ -103,4 +96,6 @@ install(EXPORT DebconfKDETargets
+ add_subdirectory(src)
+ add_subdirectory(tools)
+
++ki18n_install(po)
++
+ feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
+diff --git a/TODO b/TODO
+index ae4aba26216426578321e567134d9470a265a714..7e2affc6469e7338918ed463d99ec4e0587c1216 100644
+--- a/TODO
++++ b/TODO
+@@ -1,17 +1,11 @@
+ Commands to review/fix:
+ * Dummy commands, right now they just reply with a "O ok", but probably they
+ should do something:
+- - INFO
+ - FSET (actually it stores the flags as specified by the client, so they
+ could be retrieved later by FGET, but we don't do things with them).
+- - BEGINBLOCK
+- - ENDBLOCK
+ * Not yet implemented commands:
+ - CLEAR
+ - RESET
+- - METAGET
+- - REGISTER
+- - UNREGISTER
+ - PURGE
+ - PREVIOUS_MODULE
+ (this one is not documented in the debconf protocol specs, as well as DATA
+diff --git a/src/DebconfGui.cpp b/src/DebconfGui.cpp
+index c63dcb23558795f4a4587a37bf97c850f1853717..4226f3530a11420c83ef8416e26d2b661c3e8a4e 100644
+--- a/src/DebconfGui.cpp
++++ b/src/DebconfGui.cpp
+@@ -68,6 +68,7 @@
+ #include <QtCore/QFile>
+ #include <QtWidgets/QLabel>
+ #include <QHostInfo>
++#include <QFrame>
+
+ #include <KGuiItem>
+ #include <KIconLoader>
+@@ -247,11 +248,15 @@ void DebconfGui::cmd_go(const QString &title, const QStringList &input)
+ bool needStretch = true;
+ if (input.size() == 1) {
+ const QString key = input.first();
+- if (d->frontend->type(key) == DebconfFrontend::Text &&
+- d->frontend->type(key) == DebconfFrontend::Note &&
+- d->frontend->type(key) == DebconfFrontend::Error &&
+- d->frontend->type(key) == DebconfFrontend::Multiselect) {
+- needStretch = false;
++ switch (d->frontend->type(key)) {
++ case DebconfFrontend::Text:
++ case DebconfFrontend::Note:
++ case DebconfFrontend::Error:
++ case DebconfFrontend::Multiselect:
++ needStretch = false;
++ break;
++ default:
++ break;
+ }
+ }
+
+@@ -259,7 +264,20 @@ void DebconfGui::cmd_go(const QString &title, const QStringList &input)
+ layout->addStretch();
+ }
+
++ const QString side_info = d->frontend->getSideInfo();
++ if (!side_info.isEmpty()) {
++ QLabel *label = new QLabel(side_info);
++ layout->addWidget(label);
++ }
++
+ for (const QString &elementName : input) {
++ if (elementName == QLatin1String("div")) {
++ QFrame *divider = new QFrame(d->parentWidget);
++ divider->setFrameShape(QFrame::HLine);
++ divider->setFrameShadow(QFrame::Sunken);
++ layout->addWidget(divider);
++ continue;
++ }
+ DebconfElement *element = d->createElement(elementName);
+ d->elements.append(element);
+ layout->addWidget(element);
+diff --git a/src/debconf.cpp b/src/debconf.cpp
+index 85db705a65ec52686b9a91b1dffcf3b91c014367..5b78b0cb1c36d5ff724f2df2526e6396f1fb572b 100644
+--- a/src/debconf.cpp
++++ b/src/debconf.cpp
+@@ -62,26 +62,29 @@
+ namespace DebconfKde {
+
+ const DebconfFrontend::Cmd DebconfFrontend::commands[] = {
+- { "SET", &DebconfFrontend::cmd_set },
+- { "GO", &DebconfFrontend::cmd_go },
+- { "TITLE", &DebconfFrontend::cmd_title },
+- { "SETTITLE", &DebconfFrontend::cmd_title },
+- { "DATA", &DebconfFrontend::cmd_data },
+- { "SUBST", &DebconfFrontend::cmd_subst },
+- { "INPUT", &DebconfFrontend::cmd_input },
+- { "GET", &DebconfFrontend::cmd_get },
+- { "CAPB", &DebconfFrontend::cmd_capb },
+- { "PROGRESS", &DebconfFrontend::cmd_progress },
+- { "X_PING", &DebconfFrontend::cmd_x_ping },
+- { "VERSION", &DebconfFrontend::cmd_version },
+- { "X_LOADTEMPLATEFILE", &DebconfFrontend::cmd_x_loadtemplatefile },
+- { "INFO", &DebconfFrontend::cmd_info },
+- { "FGET", &DebconfFrontend::cmd_fget },
+- { "FSET", &DebconfFrontend::cmd_fset },
+- { "BEGINBLOCK", &DebconfFrontend::cmd_beginblock },
+- { "ENDBLOCK", &DebconfFrontend::cmd_endblock },
+- { "STOP", &DebconfFrontend::cmd_stop },
+- { nullptr, nullptr } };
++ { "SET", &DebconfFrontend::cmd_set, 2 },
++ { "GO", &DebconfFrontend::cmd_go, 0 },
++ { "TITLE", &DebconfFrontend::cmd_title, 1 },
++ { "SETTITLE", &DebconfFrontend::cmd_title, 1 },
++ { "DATA", &DebconfFrontend::cmd_data, 3 },
++ { "SUBST", &DebconfFrontend::cmd_subst, 3 },
++ { "INPUT", &DebconfFrontend::cmd_input, 1 },
++ { "GET", &DebconfFrontend::cmd_get, 1 },
++ { "CAPB", &DebconfFrontend::cmd_capb, 1 },
++ { "PROGRESS", &DebconfFrontend::cmd_progress, 1 },
++ { "X_PING", &DebconfFrontend::cmd_x_ping, 0 },
++ { "VERSION", &DebconfFrontend::cmd_version, 0 },
++ { "X_LOADTEMPLATEFILE", &DebconfFrontend::cmd_x_loadtemplatefile, 1 },
++ { "INFO", &DebconfFrontend::cmd_info, 0 },
++ { "FGET", &DebconfFrontend::cmd_fget, 2 },
++ { "FSET", &DebconfFrontend::cmd_fset, 3 },
++ { "BEGINBLOCK", &DebconfFrontend::cmd_beginblock, 0 },
++ { "ENDBLOCK", &DebconfFrontend::cmd_endblock, 0 },
++ { "STOP", &DebconfFrontend::cmd_stop, 0 },
++ { "REGISTER", &DebconfFrontend::cmd_register, 2 },
++ { "UNREGISTER", &DebconfFrontend::cmd_unregister, 1 },
++ { "EXIST", &DebconfFrontend::cmd_exist, 1 },
++ { nullptr, nullptr, 0 } };
+
+ DebconfFrontend::DebconfFrontend(QObject *parent)
+ : QObject(parent)
+@@ -190,33 +193,34 @@ QString DebconfFrontend::property(const QString &key, PropertyKey p) const
+ return r;
+ }
+
+-void DebconfFrontend::cmd_capb(const QString &caps)
++void DebconfFrontend::cmd_capb(const QStringList &args)
+ {
++ const QString caps = args[0];
+ Q_EMIT backup(caps.split(QLatin1String(", ")).contains(QLatin1String("backup")));
+ say(QLatin1String("0 backup"));
+ }
+
+-void DebconfFrontend::cmd_set(const QString ¶m)
++void DebconfFrontend::cmd_set(const QStringList &args)
+ {
+- const QString item = param.section(QLatin1Char(' '), 0, 0);
+- const QString value = param.section(QLatin1Char(' '), 1);
++ const QString item = args[0];
++ const QString value = args[1];
+ m_values[item] = value;
+ qCDebug(DEBCONF) << "# SET: [" << item << "] " << value;
+ say(QLatin1String("0 ok"));
+ }
+
+-void DebconfFrontend::cmd_get(const QString ¶m)
++void DebconfFrontend::cmd_get(const QStringList &args)
+ {
+- say(QLatin1String("0 ") + m_values.value(param));
++ say(QLatin1String("0 ") + m_values.value(args[0]));
+ }
+
+-void DebconfFrontend::cmd_input(const QString ¶m)
++void DebconfFrontend::cmd_input(const QStringList &args)
+ {
+- m_input.append(param.section(QLatin1Char(' '), 1));
++ m_input.append(args[0]);
+ say(QLatin1String("0 will ask" ));
+ }
+
+-void DebconfFrontend::cmd_go(const QString &)
++void DebconfFrontend::cmd_go(const QStringList &)
+ {
+ qCDebug(DEBCONF) << "# GO";
+ m_input.removeDuplicates();
+@@ -224,12 +228,65 @@ void DebconfFrontend::cmd_go(const QString &)
+ m_input.clear();
+ }
+
+-void DebconfFrontend::cmd_progress(const QString ¶m)
++void DebconfFrontend::cmd_progress(const QStringList &args)
+ {
++ const QString param = args[0];
+ qCDebug(DEBCONF) << "DEBCONF: PROGRESS " << param;
+ Q_EMIT progress(param);
+ }
+
++void DebconfFrontend::cmd_register(const QStringList &args)
++{
++ const QString templateName = args[0];
++ const QString question = args[1];
++
++ if (!m_data.contains(templateName)) {
++ say(QLatin1String("20 No such template, \"%1\"").arg(templateName));
++ return;
++ }
++ m_data[question] = m_data[templateName];
++ say(QLatin1String("0 ok"));
++}
++
++void DebconfFrontend::cmd_unregister(const QStringList &args)
++{
++ const QString question = args[0];
++ if (!m_data.contains(question)) {
++ say(QLatin1String("20 %1 doesn't exist").arg(question));
++ return;
++ }
++ if (m_input.contains(question)) {
++ say(QLatin1String("20 %1 is busy, cannot unregister right now").arg(question));
++ return;
++ }
++ m_data.remove(question);
++ say(QLatin1String("0 ok"));
++}
++
++void DebconfFrontend::cmd_metaget(const QStringList &args)
++{
++ const QString question = args[0];
++ const QString fieldName = args[1];
++ if (!m_data.contains(question)) {
++ say(QLatin1String("20 %1 doesn't exist").arg(question));
++ return;
++ }
++ const auto properties = m_data[question];
++ const auto key = propertyKeyFromString(fieldName);
++ if (!properties.contains(key)) {
++ say(QLatin1String("20 %1 does not exist").arg(fieldName));
++ return;
++ }
++ const QString data = properties[key];
++ say(QLatin1String("0 ") + data);
++}
++
++void DebconfFrontend::cmd_exist(const QStringList &args)
++{
++ const QString question = args[0];
++ say(QLatin1String("0 ") + (m_data.contains(question) ? QLatin1String("true") : QLatin1String("false")));
++}
++
+ void DebconfFrontend::next()
+ {
+ m_input.clear();
+@@ -247,8 +304,9 @@ void DebconfFrontend::cancel()
+ reset();
+ }
+
+-void DebconfFrontend::cmd_title(const QString ¶m)
++void DebconfFrontend::cmd_title(const QStringList &args)
+ {
++ const QString param = args[0];
+ if (!property(param, Description).isEmpty()) {
+ m_title = property(param, Description);
+ } else {
+@@ -258,46 +316,47 @@ void DebconfFrontend::cmd_title(const QString ¶m)
+ say(QLatin1String("0 ok"));
+ }
+
+-void DebconfFrontend::cmd_data(const QString ¶m)
++void DebconfFrontend::cmd_data(const QStringList &args)
+ {
+ // We get strings like
+ // aiccu/brokername description Tunnel broker:
+ // item = "aiccu/brokername"
+ // type = "description"
+ // rest = "Tunnel broker:"
+- const QString item = param.section(QLatin1Char(' '), 0, 0);
+- const QString type = param.section(QLatin1Char(' '), 1, 1);
+- const QString value = param.section(QLatin1Char(' '), 2);
++ const QString item = args[0];
++ const QString type = args[1];
++ const QString value = args[2];
+
+ m_data[item][propertyKeyFromString(type)] = value;
+ qCDebug(DEBCONF) << "# NOTED: [" << item << "] [" << type << "] " << value;
+ say(QStringLiteral( "0 ok" ));
+ }
+
+-void DebconfFrontend::cmd_subst(const QString ¶m)
++void DebconfFrontend::cmd_subst(const QStringList &args)
+ {
+ // We get strings like
+ // aiccu/brokername brokers AARNet, Hexago / Freenet6, SixXS, Wanadoo France
+ // item = "aiccu/brokername"
+ // type = "brokers"
+ // value = "AARNet, Hexago / Freenet6, SixXS, Wanadoo France"
+- const QString item = param.section(QLatin1Char(' '), 0, 0);
+- const QString type = param.section(QLatin1Char(' '), 1, 1);
+- const QString value = param.section(QLatin1Char(' '), 2);
++ const QString item = args[0];
++ const QString type = args[1];
++ const QString value = args[2];
+
+ m_subst[item][type] = value;
+ qCDebug(DEBCONF) << "# SUBST: [" << item << "] [" << type << "] " << value;
+ say(QLatin1String("0 ok"));
+ }
+
+-void DebconfFrontend::cmd_x_ping(const QString ¶m)
++void DebconfFrontend::cmd_x_ping(const QStringList &args)
+ {
+- Q_UNUSED(param);
++ Q_UNUSED(args);
+ say(QLatin1String("0 pong"));
+ }
+
+-void DebconfFrontend::cmd_version(const QString ¶m)
++void DebconfFrontend::cmd_version(const QStringList &args)
+ {
++ const QString param = args[0];
+ if ( !param.isEmpty() ) {
+ const QString major_version_str = param.section(QLatin1Char('.'), 0, 0);
+ bool ok = false;
+@@ -311,9 +370,9 @@ void DebconfFrontend::cmd_version(const QString ¶m)
+ say(QLatin1String("0 2.1"));
+ }
+
+-void DebconfFrontend::cmd_x_loadtemplatefile(const QString ¶m)
++void DebconfFrontend::cmd_x_loadtemplatefile(const QStringList &args)
+ {
+- QFile template_file(param);
++ QFile template_file(args[0]);
+ if (template_file.open(QFile::ReadOnly)) {
+ QTextStream template_stream(&template_file);
+ QString line = QLatin1String("");
+@@ -366,22 +425,30 @@ void DebconfFrontend::cmd_x_loadtemplatefile(const QString ¶m)
+ say(QLatin1String("0 ok"));
+ }
+
+-void DebconfFrontend::cmd_info(const QString ¶m)
++void DebconfFrontend::cmd_info(const QStringList &args)
+ {
+- Q_UNUSED(param)
+- //FIXME: this is a dummy command, we should actually do something
+- //with param.
++ const QString &key = args[0];
++ if (key.isEmpty()) {
++ // this is the Perl debconf behaviour
++ say(QLatin1String("0 ok"));
++ return;
++ }
++ if (!m_data.contains(key)) {
++ say(QLatin1String("20 question doesn't exist"));
++ return;
++ }
++ m_side_info = m_data[key][PropertyKey::Description];
+ say(QLatin1String("0 ok"));
+ }
+
+-void DebconfFrontend::cmd_fget(const QString ¶m)
++void DebconfFrontend::cmd_fget(const QStringList &args)
+ {
+ // We get strings like
+ // foo/bar seen false
+ // question = "foo/bar"
+ // flag = "seen"
+- const QString question = param.section(QLatin1Char(' '), 0, 0);
+- const QString flag = param.section(QLatin1Char(' '), 1, 1);
++ const QString question = args[0];
++ const QString flag = args[1];
+
+ if (m_flags[question][flag]) {
+ say(QLatin1String("0 true"));
+@@ -390,16 +457,16 @@ void DebconfFrontend::cmd_fget(const QString ¶m)
+ }
+ }
+
+-void DebconfFrontend::cmd_fset(const QString ¶m)
++void DebconfFrontend::cmd_fset(const QStringList &args)
+ {
+ // We get strings like
+ // foo/bar seen false
+ // question = "foo/bar"
+ // flag = "seen"
+ // value = "false"
+- const QString question = param.section(QLatin1Char(' '), 0, 0);
+- const QString flag = param.section(QLatin1Char(' '), 1, 1);
+- const QString value = param.section(QLatin1Char(' '), 2, 2);
++ const QString question = args[0];
++ const QString flag = args[1];
++ const QString value = args[2];
+
+ if ( value == QLatin1String("false") ) {
+ m_flags[question][flag] = false;
+@@ -409,25 +476,25 @@ void DebconfFrontend::cmd_fset(const QString ¶m)
+ say(QLatin1String("0 ok"));
+ }
+
+-void DebconfFrontend::cmd_beginblock(const QString ¶m)
++void DebconfFrontend::cmd_beginblock(const QStringList &args)
+ {
+- Q_UNUSED(param)
+- //FIXME: this is a dummy command, we should actually do something
+- //with param.
++ Q_UNUSED(args)
++ m_making_block = true;
+ say(QLatin1String("0 ok"));
+ }
+
+-void DebconfFrontend::cmd_endblock(const QString ¶m)
++void DebconfFrontend::cmd_endblock(const QStringList &args)
+ {
+- Q_UNUSED(param)
+- //FIXME: this is a dummy command, we should actually do something
+- //with param.
++ Q_UNUSED(args)
++ if (m_making_block)
++ m_input.append(QStringLiteral("div"));
++ m_making_block = false;
+ say(QLatin1String("0 ok"));
+ }
+
+-void DebconfFrontend::cmd_stop(const QString ¶m)
++void DebconfFrontend::cmd_stop(const QStringList &args)
+ {
+- Q_UNUSED(param)
++ Q_UNUSED(args)
+ //Do nothing.
+ }
+
+@@ -447,11 +514,29 @@ bool DebconfFrontend::process()
+ const Cmd *c = commands;
+ while (c->cmd != nullptr) {
+ if (command == QLatin1String(c->cmd)) {
+- (this->*(c->run))(value);
++ QStringList args{};
++ if (c->num_args_min > 0) {
++ int args_scanned = 0;
++ for (int i = 0; i < c->num_args_min; i++) {
++ const int end_index = (i < (c->num_args_min - 1)) ? i : -1;
++ const QString arg = value.section(QLatin1Char(' '), i, end_index);
++ if (!arg.isEmpty()) args_scanned++;
++ args.append(arg);
++ }
++
++ if (args_scanned < c->num_args_min) {
++ say(QLatin1String("20 Incorrect number of arguments"));
++ return false;
++ }
++ } else {
++ args.append(value);
++ }
++ (this->*(c->run))(args);
+ return true;
+ }
+ ++ c;
+ }
++ say(QLatin1String("20 Unsupported command \"%1\" received").arg(command.toLower()));
+ return false;
+ }
+
+diff --git a/src/debconf.h b/src/debconf.h
+index 71431f68547309487f4d17fa19cf78610d75178e..87a8e5278a8e6daf7135db3a9cc6da2ddbf6d1ce 100644
+--- a/src/debconf.h
++++ b/src/debconf.h
+@@ -123,6 +123,8 @@ public:
+ */
+ virtual void cancel();
+
++ inline QString getSideInfo() const { return m_side_info; }
++
+ Q_SIGNALS:
+ void go(const QString &title, const QStringList &input);
+ void progress(const QString ¶m);
+@@ -161,27 +163,32 @@ protected:
+ virtual void reset();
+
+ private:
+- void cmd_capb(const QString &caps);
+- void cmd_set(const QString ¶m);
+- void cmd_get(const QString ¶m);
+- void cmd_input(const QString ¶m);
+- void cmd_go(const QString &);
+- void cmd_title(const QString ¶m);
+- void cmd_data(const QString ¶m);
+- void cmd_subst(const QString ¶m);
+- void cmd_progress(const QString ¶m);
+- void cmd_x_ping(const QString ¶m);
+- void cmd_version(const QString ¶m);
+- void cmd_x_loadtemplatefile(const QString ¶m);
+- void cmd_info(const QString ¶m);
+- void cmd_fget(const QString ¶m);
+- void cmd_fset(const QString ¶m);
+- void cmd_beginblock(const QString ¶m);
+- void cmd_endblock(const QString ¶m);
+- void cmd_stop(const QString ¶m);
++ void cmd_capb(const QStringList &args);
++ void cmd_set(const QStringList &args);
++ void cmd_get(const QStringList &args);
++ void cmd_input(const QStringList &args);
++ void cmd_go(const QStringList &);
++ void cmd_title(const QStringList &args);
++ void cmd_data(const QStringList &args);
++ void cmd_subst(const QStringList &args);
++ void cmd_progress(const QStringList &args);
++ void cmd_x_ping(const QStringList &args);
++ void cmd_version(const QStringList &args);
++ void cmd_x_loadtemplatefile(const QStringList &args);
++ void cmd_info(const QStringList &args);
++ void cmd_fget(const QStringList &args);
++ void cmd_fset(const QStringList &args);
++ void cmd_beginblock(const QStringList &args);
++ void cmd_endblock(const QStringList &args);
++ void cmd_stop(const QStringList &args);
++ void cmd_register(const QStringList &args);
++ void cmd_unregister(const QStringList &args);
++ void cmd_metaget(const QStringList &args);
++ void cmd_exist(const QStringList &args);
+ struct Cmd {
+ const char *cmd;
+- void (DebconfFrontend::*run)(const QString &);
++ void (DebconfFrontend::*run)(const QStringList &);
++ int num_args_min;
+ };
+ static const Cmd commands[];
+
+@@ -202,7 +209,9 @@ private:
+ QHash<QString, QString> m_values;
+ QHash<QString, Flags> m_flags;
+ QString m_title;
++ QString m_side_info;
+ QStringList m_input;
++ bool m_making_block;
+ };
+
+ /**
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..74f21a9
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+kf6_more.diff
More information about the Neon-commits
mailing list