I have confirmed your patch worked for me. Perhaps the documentation should 
also be updated to indicate that remotes need to be cloned/added using the 
https protocol?

I still can't send the resulting two files via git send-email (the final step), 
as I would have to do a significant amount of configuration in my _personal_ 
gmail account in order to use git send-email to send the final patch. I will 
attach the resulting two files here and perhaps that will be sufficient for 
someone to begin reviewing my actual PR.

Thanks,
Bob
From b637a46f58b5adc7dcc76bdef90a7be8c8462df8 Mon Sep 17 00:00:00 2001
Message-Id: <[email protected]>
From: Bob Henz <[email protected]>
Date: Mon, 26 Sep 2022 20:54:41 -0400
Subject: [PATCH 0/1] Fix WantedBy processing

An empty string assignment to WantedBy should clear all prior WantedBy
settings. This matches behavior of the current systemd implementation.
When using systemd drop-in files (instead of patching published
.service files) this change becomes especially important.

The following changes since commit 68b07bb7f0f01925f9da1cb966239ee49d5c84e3:

  lttng-tools: Disable on qemuriscv32 (2022-09-26 15:08:32 +0100)

are available in the Git repository at:

  https://github.com/BadgerTechnologies/openembedded-core fix-wantedby-clearing
  https://github.com/BadgerTechnologies/openembedded-core/tree/fix-wantedby-clearing

Bob Henz (1):
  Fix WantedBy processing

 meta/recipes-core/systemd/systemd-systemctl/systemctl | 11 +++++++++++
 1 file changed, 11 insertions(+)

-- 
2.25.1

From b637a46f58b5adc7dcc76bdef90a7be8c8462df8 Mon Sep 17 00:00:00 2001
Message-Id: <b637a46f58b5adc7dcc76bdef90a7be8c8462df8.1664240081.git.robert_h...@jabil.com>
In-Reply-To: <[email protected]>
References: <[email protected]>
From: Bob Henz <[email protected]>
Date: Mon, 19 Sep 2022 22:02:58 -0400
Subject: [PATCH 1/1] Fix WantedBy processing

An empty string assignment to WantedBy should clear all prior WantedBy
settings. This matches behavior of the current systemd implementation.

Signed-off-by: Bob Henz <[email protected]>
---
 meta/recipes-core/systemd/systemd-systemctl/systemctl | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
index 6d19666d82..cddae75a06 100755
--- a/meta/recipes-core/systemd/systemd-systemctl/systemctl
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -26,6 +26,9 @@ locations = list()
 
 class SystemdFile():
     """Class representing a single systemd configuration file"""
+
+    _clearable_keys = ['WantedBy']
+
     def __init__(self, root, path, instance_unit_name):
         self.sections = dict()
         self._parse(root, path)
@@ -80,6 +83,14 @@ class SystemdFile():
                 v = m.group('value')
                 if k not in section:
                     section[k] = list()
+
+                # If we come across a "key=" line for a "clearable key", then
+                # forget all preceding assignments. This works because we are
+                # processing files in correct parse order.
+                if k in self._clearable_keys and not v:
+                    del section[k]
+                    continue
+
                 section[k].extend(v.split())
 
     def get(self, section, prop):
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#171081): 
https://lists.openembedded.org/g/openembedded-core/message/171081
Mute This Topic: https://lists.openembedded.org/mt/93809846/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to