[-]
[+]
|
Changed |
_service:tar_git:patchmanager.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:patchmanager.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/sailfishos-patches/patchmanager.git</param>
<param name="branch"/>
- <param name="revision">3.2.8</param>
+ <param name="revision">3.2.9</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:patchmanager-3.2.9.tar.gz/src/bin/patchmanager-daemon/journal.cpp
^
|
@@ -1,4 +1,4 @@
-#include "journal.h"
+#include "journal.h"
#include <QVariantMap>
#include <QDebug>
|
[-]
[+]
|
Changed |
_service:tar_git:patchmanager-3.2.9.tar.gz/src/bin/patchmanager-daemon/patchmanagerobject.cpp
^
|
@@ -86,62 +86,67 @@
return x;\
}
-static const QString PATCHES_DIR = QStringLiteral("/usr/share/patchmanager/patches");
-static const QString PATCHES_WORK_DIR_PREFIX = QStringLiteral("/tmp/patchmanager3");
-static const QString PATCHES_WORK_DIR = QStringLiteral("%1/%2").arg(PATCHES_WORK_DIR_PREFIX, "work");
+// locations
+static const QString PATCHES_DIR = QStringLiteral("/usr/share/patchmanager/patches");
+static const QString PATCHES_WORK_DIR_PREFIX= QStringLiteral("/tmp/patchmanager3");
+static const QString PATCHES_WORK_DIR = QStringLiteral("%1/%2").arg(PATCHES_WORK_DIR_PREFIX, "work");
static const QString PATCHES_ADDITIONAL_DIR = QStringLiteral("%1/%2").arg(PATCHES_WORK_DIR_PREFIX, "patches");
-static const QString PATCH_FILE = QStringLiteral("patch.json");
-static const QString MANGLE_CONFIG_FILE = QStringLiteral("/etc/patchmanager/manglelist.conf");
-static const QString NAME_KEY = QStringLiteral("name");
-static const QString DESCRIPTION_KEY = QStringLiteral("description");
-static const QString CATEGORY_KEY = QStringLiteral("category");
-static const QString INFOS_KEY = QStringLiteral("infos");
-static const QString PATCH_KEY = QStringLiteral("patch");
-static const QString RPM_KEY = QStringLiteral("rpm");
-static const QString AVAILABLE_KEY = QStringLiteral("available");
-static const QString SECTION_KEY = QStringLiteral("section");
-static const QString PATCHED_KEY = QStringLiteral("patched");
-static const QString VERSION_KEY = QStringLiteral("version");
-static const QString COMPATIBLE_KEY = QStringLiteral("compatible");
-static const QString ISCOMPATIBLE_KEY = QStringLiteral("isCompatible");
-static const QString CONFLICTS_KEY = QStringLiteral("conflicts");
+static const QString PATCH_METADATA_FILE = QStringLiteral("patch.json");
+static const QString MANGLE_CONFIG_FILE = QStringLiteral("/etc/patchmanager/manglelist.conf");
-static const QString AUSMT_BACKUP_DIR = QStringLiteral("/var/lib/patchmanager/ausmt/patches");
+static const QString AUSMT_BACKUP_DIR = QStringLiteral("/var/lib/patchmanager/ausmt/patches");
static const QString AUSMT_INSTALLED_LIST_FILE = QStringLiteral("/var/lib/patchmanager/ausmt/packages");
-static const QString PM_APPLY = QStringLiteral("/usr/libexec/pm_apply");
-static const QString PM_UNAPPLY = QStringLiteral("/usr/libexec/pm_unapply");
-
-// external binaries
-static const QString BIN_UNZIP = QStringLiteral("/usr/bin/unzip");
-static const QString BIN_TAR = QStringLiteral("/bin/tar");
-static const QString BIN_PKCON = QStringLiteral("/usr/bin/pkcon");
-static const QString BIN_SYSTEMCTL_U = QStringLiteral("/usr/bin/systemctl-user");
-static const QString BIN_RPM = QStringLiteral("/bin/rpm");
-
-static const QString BROWSER_CODE = QStringLiteral("browser");
-static const QString CAMERA_CODE = QStringLiteral("camera");
-static const QString CALENDAR_CODE = QStringLiteral("calendar");
-static const QString CLOCK_CODE = QStringLiteral("clock");
-static const QString CONTACTS_CODE = QStringLiteral("contacts");
-static const QString EMAIL_CODE = QStringLiteral("email");
-static const QString GALLERY_CODE = QStringLiteral("gallery");
-static const QString HOMESCREEN_CODE = QStringLiteral("homescreen");
-static const QString MEDIA_CODE = QStringLiteral("media");
-static const QString MESSAGES_CODE = QStringLiteral("messages");
-static const QString PHONE_CODE = QStringLiteral("phone");
-static const QString SILICA_CODE = QStringLiteral("silica");
-static const QString SETTINGS_CODE = QStringLiteral("settings");
-static const QString KEYBOARD_CODE = QStringLiteral("keyboard");
-
static const QString s_newConfigLocation = QStringLiteral("/etc/patchmanager2.conf");
static const QString s_oldConfigLocation = QStringLiteral("/home/nemo/.config/patchmanager2.conf");
-static const QString s_patchmanagerSocket = QStringLiteral("/tmp/patchmanager-socket");
+static const QString s_patchmanagerSocket = QStringLiteral("/tmp/patchmanager-socket");
static const QString s_patchmanagerCacheRoot = QStringLiteral("/tmp/patchmanager");
static const QString s_sessionBusConnection = QStringLiteral("pm3connection");
+// helpers
+static const QString PM_APPLY = QStringLiteral("/usr/libexec/pm_apply");
+static const QString PM_UNAPPLY = QStringLiteral("/usr/libexec/pm_unapply");
+
+// external binaries
+static const QString BIN_UNZIP = QStringLiteral("/usr/bin/unzip");
+static const QString BIN_TAR = QStringLiteral("/bin/tar");
+static const QString BIN_PKCON = QStringLiteral("/usr/bin/pkcon");
+static const QString BIN_SYSTEMCTL_U = QStringLiteral("/usr/bin/systemctl-user");
+static const QString BIN_RPM = QStringLiteral("/bin/rpm");
+
+// map key constants: states
+static const QString NAME_KEY = QStringLiteral("name");
+static const QString DESCRIPTION_KEY = QStringLiteral("description");
+static const QString CATEGORY_KEY = QStringLiteral("category");
+static const QString INFOS_KEY = QStringLiteral("infos");
+static const QString PATCH_KEY = QStringLiteral("patch");
+static const QString RPM_KEY = QStringLiteral("rpm");
+static const QString AVAILABLE_KEY = QStringLiteral("available");
+static const QString SECTION_KEY = QStringLiteral("section");
+static const QString PATCHED_KEY = QStringLiteral("patched");
+static const QString VERSION_KEY = QStringLiteral("version");
+static const QString COMPATIBLE_KEY = QStringLiteral("compatible");
+static const QString ISCOMPATIBLE_KEY = QStringLiteral("isCompatible");
+static const QString CONFLICTS_KEY = QStringLiteral("conflicts");
+
+// map key constants: patch categories
+static const QString BROWSER_CODE = QStringLiteral("browser");
+static const QString CAMERA_CODE = QStringLiteral("camera");
+static const QString CALENDAR_CODE = QStringLiteral("calendar");
+static const QString CLOCK_CODE = QStringLiteral("clock");
+static const QString CONTACTS_CODE = QStringLiteral("contacts");
+static const QString EMAIL_CODE = QStringLiteral("email");
+static const QString GALLERY_CODE = QStringLiteral("gallery");
+static const QString HOMESCREEN_CODE = QStringLiteral("homescreen");
+static const QString MEDIA_CODE = QStringLiteral("media");
+static const QString MESSAGES_CODE = QStringLiteral("messages");
+static const QString PHONE_CODE = QStringLiteral("phone");
+static const QString SILICA_CODE = QStringLiteral("silica");
+static const QString SETTINGS_CODE = QStringLiteral("settings");
+static const QString KEYBOARD_CODE = QStringLiteral("keyboard");
+
QString getLang()
{
QString lang = QStringLiteral("en_US.utf8");
@@ -178,7 +183,7 @@
return false;
}
- QFile file(patchDir.absoluteFilePath(PATCH_FILE));
+ QFile file(patchDir.absoluteFilePath(PATCH_METADATA_FILE));
if (!file.open(QIODevice::ReadOnly)) {
return false;
}
@@ -550,8 +555,9 @@
return;
}
+ qDebug() << Q_FUNC_INFO << "Patch changes the following files:\n\t" << m_patchFiles.value(patchName).join("\n\t");
for (const QString &fileName : m_patchFiles.value(patchName)) {
- qDebug() << Q_FUNC_INFO << "Processing patch file" << fileName;
+ qDebug() << Q_FUNC_INFO << "Processing file" << fileName;
QFileInfo fi(fileName);
QDir fakeDir(QStringLiteral("%1%2").arg(s_patchmanagerCacheRoot, fi.absoluteDir().absolutePath()));
@@ -867,7 +873,7 @@
QStringList packages;
for (const QString &file : patchedFiles) {
- qDebug() << Q_FUNC_INFO << "Processing patched file" << file;
+ qDebug() << Q_FUNC_INFO << "Processing file" << file;
QProcess rpmProc;
rpmProc.start(BIN_RPM, { QStringLiteral("-qf"), QStringLiteral("--qf"), QStringLiteral("%{NAME}"), file });
@@ -1640,8 +1646,10 @@
for (const QString &patchFolder : patchesDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) {
QFile patchFile(QStringLiteral("%1/%2/unified_diff.patch").arg(PATCHES_DIR, patchFolder));
if (!patchFile.exists() || !patchFile.open(QFile::ReadOnly)) {
+ qWarning() << Q_FUNC_INFO << "Could not read diff file for: " << patchFolder;
continue;
}
+ qDebug() << Q_FUNC_INFO << "Collecting info for: " << patchFolder;
while (!patchFile.atEnd()) {
const QByteArray line = patchFile.readLine();
if (line.startsWith(QByteArrayLiteral("+++ "))) {
@@ -1649,9 +1657,12 @@
QString path = toPatch;
for (int i = 0; i < toManglePaths.size(); i++) {
- if (path.startsWith(toManglePaths[i])) {
- qDebug() << Q_FUNC_INFO << "Editing path: " << path;
+ // we need to deal with either absolute, or "git-style" beginnings, see #426:
+ QString checkpath = path.mid(path.indexOf('/', 0));
+ if (checkpath.startsWith(toManglePaths[i])) {
+ qDebug() << Q_FUNC_INFO << "Mangle: Editing path: " << path;
path.replace(toManglePaths[i], mangledPaths[i]);
+ qDebug() << Q_FUNC_INFO << "Mangle: Edited path: " << path;
}
}
@@ -1666,6 +1677,7 @@
}
}
if (!filesConflicts[path].contains(patchFolder)) {
+ qDebug() << Q_FUNC_INFO << "Possible conflict in: " << path;
filesConflicts[path].append(patchFolder);
}
@@ -2011,7 +2023,7 @@
}
const QString patchPath = QStringLiteral("%1/%2").arg(PATCHES_DIR, patch);
- const QString jsonPath = QStringLiteral("%1/%2").arg(patchPath, PATCH_FILE);
+ const QString jsonPath = QStringLiteral("%1/%2").arg(patchPath, PATCH_METADATA_FILE);
QDir patchDir(patchPath);
if (patchDir.exists()) {
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-a-bit-newer/patch-a-bit-newer.pro
^
|
@@ -0,0 +1,6 @@
+TEMPLATE = aux
+
+patch.path = /usr/share/patchmanager/patches/pm-test-case-patch-a-bit-newer
+patch.files = patch/unified_diff.patch patch/patch.json
+
+INSTALLS += patch
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-a-bit-newer/patch-source/b/usr/share/patchmanager-test/testfile-added-by-patch-a-bit-newer
^
|
@@ -0,0 +1 @@
+this was added by patch-a-bit-newer patch
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-a-bit-newer/patch/patch.json
^
|
@@ -0,0 +1,14 @@
+{
+ "description": "Patchmanager Test Case: The version specified in the meta data is likely newer than this SFOS version (X.Y.0.99).\n PM should not allow to activate or install it.",
+ "name": "pm-test-patch-a-bit-newer",
+ "display_name": "PM Test Case 4-3: a bit newer",
+ "category": "other",
+ "author": "patchmanager",
+ "version": "1.0.0",
+ "compatible": [
+ "4.5.0.99",
+ "4.6.0.99",
+ "5.0.0.99",
+ "5.9.0.99"
+ ]
+}
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-a-bit-newer/patch/unified_diff.patch
^
|
@@ -0,0 +1,5 @@
+diff -Naur a/usr/share/patchmanager-test/testfile-added-by-patch-a-bit-newer b/usr/share/patchmanager-test/testfile-added-by-patch-a-bit-newer
+--- a/usr/share/patchmanager-test/testfile-added-by-patch-a-bit-newer 1970-01-01 01:00:00.000000000 +0100
++++ b/usr/share/patchmanager-test/testfile-added-by-patch-a-bit-newer 2023-04-15 19:09:07.568614812 +0200
+@@ -0,0 +1 @@
++this was added by patch-a-bit-newer patch
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-too-new/patch-source/b/usr/share/patchmanager-test/testfile-added-by-patch-too-new
^
|
@@ -0,0 +1 @@
+this was added by patch-too-new patch
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-too-new/patch-too-new.pro
^
|
@@ -0,0 +1,6 @@
+TEMPLATE = aux
+
+patch.path = /usr/share/patchmanager/patches/pm-test-case-patch-too-new
+patch.files = patch/unified_diff.patch patch/patch.json
+
+INSTALLS += patch
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-too-new/patch/patch.json
^
|
@@ -0,0 +1,11 @@
+{
+ "description": "Patchmanager Test Case: The version specified in the meta data is very science fiction.\n PM should not allow to activate or install it.",
+ "name": "pm-test-patch-too-new",
+ "display_name": "PM Test Case 4-2: Too New",
+ "category": "other",
+ "author": "patchmanager",
+ "version": "1.0.0",
+ "compatible": [
+ "9.9.9.0"
+ ]
+}
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-too-new/patch/unified_diff.patch
^
|
@@ -0,0 +1,5 @@
+diff -Naur a/usr/share/patchmanager-test/testfile-added-by-patch-too-new b/usr/share/patchmanager-test/testfile-added-by-patch-too-new
+--- a/usr/share/patchmanager-test/testfile-added-by-patch-too-new 1970-01-01 01:00:00.000000000 +0100
++++ b/usr/share/patchmanager-test/testfile-added-by-patch-too-new 2023-04-15 18:55:53.475630091 +0200
+@@ -0,0 +1 @@
++this was added by patch-too-new patch
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-too-old/patch-source/b/usr/share/patchmanager-test/testfile-added-by-patch-too-old
^
|
@@ -0,0 +1 @@
+this was added by patch-too-old patch
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-too-old/patch-too-old.pro
^
|
@@ -0,0 +1,6 @@
+TEMPLATE = aux
+
+patch.path = /usr/share/patchmanager/patches/pm-test-case-patch-too-old
+patch.files = patch/unified_diff.patch patch/patch.json
+
+INSTALLS += patch
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-too-old/patch/patch.json
^
|
@@ -0,0 +1,11 @@
+{
+ "description": "Patchmanager Test Case: The version specified in the meta data is too old.\n PM should not allow to activate or install it.",
+ "name": "pm-test-patch-too-old",
+ "display_name": "PM Test Case 4-1: Too Old",
+ "category": "other",
+ "author": "patchmanager",
+ "version": "1.0.0",
+ "compatible": [
+ "0.0.1.10"
+ ]
+}
|
[-]
[+]
|
Added |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patch-too-old/patch/unified_diff.patch
^
|
@@ -0,0 +1,5 @@
+diff -Naur a/usr/share/patchmanager-test/testfile-added-by-patch-too-old b/usr/share/patchmanager-test/testfile-added-by-patch-too-old
+--- a/usr/share/patchmanager-test/testfile-added-by-patch-too-old 1970-01-01 01:00:00.000000000 +0100
++++ b/usr/share/patchmanager-test/testfile-added-by-patch-too-old 2023-04-15 18:46:39.415912679 +0200
+@@ -0,0 +1 @@
++this was added by patch-too-old patch
|
[-]
[+]
|
Changed |
_service:tar_git:patchmanager-3.2.9.tar.gz/tests/patching/patching.pro
^
|
@@ -1,6 +1,9 @@
TEMPLATE = subdirs
SUBDIRS = app \
add-a-file \
+ patch-too-new \
+ patch-too-old \
+ patch-a-bit-newer \
32-to-64 \
64-to-32 \
32-to-64-alt \
|