aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd-systemctl
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>2013-04-24 13:37:21 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-04-29 14:45:06 +0100
commit999302e9d87aee2fe5f171995ee33118e8b30f8c (patch)
tree065bb4d02190157ab2d8f4a5b17a906020691e4d /meta/recipes-core/systemd/systemd-systemctl
parent499bb2c6b369a021ace3059426470d3371c07fb1 (diff)
downloadopenembedded-core-contrib-999302e9d87aee2fe5f171995ee33118e8b30f8c.tar.gz
systemd-systemctl: parse unit files more correctly
Old script failed to parse unit files containing comments like | #Alias=some-alias or whitespaces like | WantedBy = foo correctly. Patch changes script to interpret keywords only when they are at the beginning of a line and ignores whitespaces before the '='. (From OE-Core rev: 443e75ee2c0e9a62df997aef24855bce54d39177) Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd-systemctl')
-rwxr-xr-xmeta/recipes-core/systemd/systemd-systemctl/systemctl9
1 files changed, 3 insertions, 6 deletions
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
index d71c7eda8b..8abbdf6938 100755
--- a/meta/recipes-core/systemd/systemd-systemctl/systemctl
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -78,8 +78,7 @@ for service in $services; do
echo "Found $service in $service_file"
# create the required symbolic links
- wanted_by=$(grep WantedBy $ROOT/$service_file \
- | sed 's,WantedBy=,,g' \
+ wanted_by=$(sed '/^WantedBy[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
| tr ',' '\n' \
| grep '\(\.target$\)\|\(\.service$\)')
@@ -97,8 +96,7 @@ for service in $services; do
done
# create the required symbolic 'Alias' links
- alias=$(grep Alias $ROOT/$service_file \
- | sed 's,Alias=,,g' \
+ alias=$(sed '/^Alias[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
| tr ',' '\n' \
| grep '\.service$')
@@ -114,8 +112,7 @@ for service in $services; do
done
# call us for the other required scripts
- also=$(grep Also $ROOT/$service_file \
- | sed 's,Also=,,g' \
+ also=$(sed '/^Also[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
| tr ',' '\n')
for a in $also; do
echo "Also=$a found in $service"