Commit 67417fc1 authored by Didier Roche's avatar Didier Roche Committed by Martin Pitt
Browse files

Reset display-manager symlink to match /e/X/d-d-m

Do it even if display-manager.service was removed and adapt
the autopkgtests for this.
parent f7242964
systemd (215-9) UNRELEASED; urgency=medium
* Add display managers autopkgtests.
* Reset display-manager symlink to match /e/X/d-d-m even if
display-manager.service was removed. Adapt the autopkgtests for it.
-- Didier Roche <didrocks@ubuntu.com> Wed, 10 Dec 2014 13:57:17 +0100
......
......@@ -7,8 +7,8 @@ which display-manager is started.
---
Makefile.am | 11 ++-
src/default-display-manager-generator/Makefile | 28 ++++++
.../default-display-manager-generator.c | 105 +++++++++++++++++++++
3 files changed, 143 insertions(+), 1 deletion(-)
.../default-display-manager-generator.c | 103 +++++++++++++++++++++
3 files changed, 141 insertions(+), 1 deletion(-)
create mode 100644 src/default-display-manager-generator/Makefile
create mode 100644 src/default-display-manager-generator/default-display-manager-generator.c
......@@ -77,10 +77,10 @@ index 0000000..b29b937
+.PHONY: all clean
diff --git a/src/default-display-manager-generator/default-display-manager-generator.c b/src/default-display-manager-generator/default-display-manager-generator.c
new file mode 100644
index 0000000..2fe9521
index 0000000..817b30b
--- /dev/null
+++ b/src/default-display-manager-generator/default-display-manager-generator.c
@@ -0,0 +1,105 @@
@@ -0,0 +1,103 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
......@@ -136,10 +136,8 @@ index 0000000..2fe9521
+ default_dm = strstrip(basename(default_dm_path));
+
+ r = readlink_value(dm_service_unit, &enabled_dm_unit);
+ if (r < 0) {
+ log_warning("No default display manager unit service enabled, setup is manual or a sysvinit file");
+ return 0;
+ }
+ if (r < 0)
+ enabled_dm_unit = strdup("");
+
+ /* all is fine if the info matches */
+ if (streq(strappenda(default_dm, ".service"), enabled_dm_unit))
......
......@@ -65,8 +65,6 @@ class DisplayManagersTest(unittest.TestCase):
self.assertFalse(self.is_active_unit('lightdm'))
self.assertTrue(self.is_active_unit('systemddm'))
# FIXME: generator doesn't retarget in that case where it should
@unittest.expectedFailure
def test_multiple_systemd_ddmconfig_match_no_symlink(self):
'''create a display-manager symlink to matching systemd unit ddm config'''
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment