summaryrefslogtreecommitdiff
path: root/pcr/systemd-knock/0001-shared-install-avoid-prematurely-rejecting-missing-u.patch
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2014-11-24 03:23:31 -0200
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2014-11-24 03:23:31 -0200
commit86f6b5b4aa49d8dd6d605296b735ab7bd9075459 (patch)
treec778cad0787fe5e540aa581350a2dfc3c1e9d8bb /pcr/systemd-knock/0001-shared-install-avoid-prematurely-rejecting-missing-u.patch
parent940326a85675d7ad682db7cc2ef9539e876b4dfb (diff)
parentb19aa2f64b1d83caef5baef1c21c3303b5cbd6f9 (diff)
downloadabslibre-86f6b5b4aa49d8dd6d605296b735ab7bd9075459.tar.gz
abslibre-86f6b5b4aa49d8dd6d605296b735ab7bd9075459.tar.bz2
abslibre-86f6b5b4aa49d8dd6d605296b735ab7bd9075459.zip
Merge branch 'master' of ssh://projects.parabola.nu/~git/abslibre
Diffstat (limited to 'pcr/systemd-knock/0001-shared-install-avoid-prematurely-rejecting-missing-u.patch')
-rw-r--r--pcr/systemd-knock/0001-shared-install-avoid-prematurely-rejecting-missing-u.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/pcr/systemd-knock/0001-shared-install-avoid-prematurely-rejecting-missing-u.patch b/pcr/systemd-knock/0001-shared-install-avoid-prematurely-rejecting-missing-u.patch
new file mode 100644
index 000000000..6ea9c7cca
--- /dev/null
+++ b/pcr/systemd-knock/0001-shared-install-avoid-prematurely-rejecting-missing-u.patch
@@ -0,0 +1,39 @@
+From 0ffce503cd6e5a5ff5ba5cd1cc23684cfb8bb9e3 Mon Sep 17 00:00:00 2001
+From: Dave Reisner <dreisner@archlinux.org>
+Date: Thu, 30 Oct 2014 20:12:05 -0400
+Subject: [PATCH] shared/install: avoid prematurely rejecting "missing" units
+
+f7101b7368df copied some logic to prevent enabling masked units, but
+also added a check which causes attempts to enable templated units to
+fail. Since we know the logic beyond this check will properly handle
+units which truly do not exist, we can rely on the unit file state
+comparison to suffice for expressing the intent of f7101b7368df.
+
+ref: https://bugs.archlinux.org/task/42616
+---
+ src/shared/install.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/src/shared/install.c b/src/shared/install.c
+index 035b44c..cab93e8 100644
+--- a/src/shared/install.c
++++ b/src/shared/install.c
+@@ -1620,12 +1620,10 @@ int unit_file_enable(
+ STRV_FOREACH(i, files) {
+ UnitFileState state;
+
++ /* We only want to know if this unit is masked, so we ignore
++ * errors from unit_file_get_state, deferring other checks.
++ * This allows templated units to be enabled on the fly. */
+ state = unit_file_get_state(scope, root_dir, *i);
+- if (state < 0) {
+- log_error("Failed to get unit file state for %s: %s", *i, strerror(-state));
+- return state;
+- }
+-
+ if (state == UNIT_FILE_MASKED || state == UNIT_FILE_MASKED_RUNTIME) {
+ log_error("Failed to enable unit: Unit %s is masked", *i);
+ return -ENOTSUP;
+--
+2.1.3
+