[gnome-build-meta/alatiera/ducktape-2] fixup! iso/eos-installer: add another patch for duktape compat



commit 6c3f4fc0de49c9aecec711f32932a4965f2ae060
Author: Jordan Petridis <jordan centricular com>
Date:   Tue Jul 19 18:08:05 2022 +0300

    fixup! iso/eos-installer: add another patch for duktape compat

 elements/iso/eos-installer.bst                     |  2 +-
 .../0001-polkit-rules-replace-const-with-var.patch | 26 --------------
 ...olkit-rules-tweak-to-be-ecma-5-compatible.patch | 40 ++++++++++++++++++++++
 3 files changed, 41 insertions(+), 27 deletions(-)
---
diff --git a/elements/iso/eos-installer.bst b/elements/iso/eos-installer.bst
index ea5e67f23..056daeefc 100644
--- a/elements/iso/eos-installer.bst
+++ b/elements/iso/eos-installer.bst
@@ -24,7 +24,7 @@ sources:
 - kind: patch
   path: files/eos-installer/0001-polkit-rules-use-non-sugary-closure-syntax.patch
 - kind: patch
-  path: files/eos-installer/0001-polkit-rules-replace-const-with-var.patch
+  path: files/eos-installer/0001-polkit-rules-tweak-to-be-ecma-5-compatible.patch
 
 depends:
 - freedesktop-sdk.bst:bootstrap-import.bst
diff --git a/files/eos-installer/0001-polkit-rules-tweak-to-be-ecma-5-compatible.patch 
b/files/eos-installer/0001-polkit-rules-tweak-to-be-ecma-5-compatible.patch
new file mode 100644
index 000000000..c8fc99d61
--- /dev/null
+++ b/files/eos-installer/0001-polkit-rules-tweak-to-be-ecma-5-compatible.patch
@@ -0,0 +1,40 @@
+From 2a457b167c34281c45e47c3a081b4837f8b78f2e Mon Sep 17 00:00:00 2001
+From: Jordan Petridis <jordan centricular com>
+Date: Tue, 19 Jul 2022 14:10:39 +0300
+Subject: [PATCH] polkit rules: tweak to be ecma 5 compatible
+
+Or how I lost a weekend debugging..
+
+Polkit rules must be ecma 5 compatible [1]
+
+* Use var instead of const for the array
+* Use indexOf instead of includes
+
+[1] https://gitlab.freedesktop.org/polkit/polkit/-/blob/master/docs/man/polkit.xml#L504
+---
+ eos-installer-data/90-eos-installer.rules | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/eos-installer-data/90-eos-installer.rules b/eos-installer-data/90-eos-installer.rules
+index f06b23e4..e5731ff4 100644
+--- a/eos-installer-data/90-eos-installer.rules
++++ b/eos-installer-data/90-eos-installer.rules
+@@ -43,13 +43,13 @@ polkit.addRule(function(action, subject) {
+         !(subject.user === 'live' && isLiveSystem))
+         return undefined;
+ 
+-    const allowedUdisksActions = [
++    var allowedUdisksActions = [
+         'org.freedesktop.udisks2.filesystem-mount',
+         'org.freedesktop.udisks2.open-device',
+         'org.freedesktop.udisks2.open-device-system',
+     ];
+ 
+-    if (allowedUdisksActions.includes(action.id) ||
++    if (allowedUdisksActions.indexOf(action.id) >= 0 ||
+         (action.id === 'org.freedesktop.policykit.exec' &&
+             action.lookup('program') === '/usr/sbin/eos-repartition-mbr')) {
+         if (subject.local)
+-- 
+2.36.1
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]