[arch-commits] Commit in systemd/trunk (2 files)

Evangelos Foutras foutrelis at nymeria.archlinux.org
Tue May 7 16:04:37 UTC 2013


    Date: Tuesday, May 7, 2013 @ 18:04:36
  Author: foutrelis
Revision: 184612

upgpkg: systemd 203-2

Fix systemd-sleep to work without sleep.conf.

Added:
  systemd/trunk/0002-systemd-sleep-it-is-not-an-error-if-the-config-file-.patch
Modified:
  systemd/trunk/PKGBUILD

-----------------------------------------------------------------+
 0002-systemd-sleep-it-is-not-an-error-if-the-config-file-.patch |   45 ++++++++++
 PKGBUILD                                                        |    5 -
 2 files changed, 49 insertions(+), 1 deletion(-)

Added: 0002-systemd-sleep-it-is-not-an-error-if-the-config-file-.patch
===================================================================
--- 0002-systemd-sleep-it-is-not-an-error-if-the-config-file-.patch	                        (rev 0)
+++ 0002-systemd-sleep-it-is-not-an-error-if-the-config-file-.patch	2013-05-07 16:04:36 UTC (rev 184612)
@@ -0,0 +1,45 @@
+From 0ee8d63649ab475fe2a16b2d62b5a5e2a8a69829 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Tue, 7 May 2013 11:35:23 -0400
+Subject: [PATCH] systemd-sleep: it is not an error if the config file is
+ missing
+
+---
+ src/shared/sleep-config.c | 19 ++++++++-----------
+ 1 file changed, 8 insertions(+), 11 deletions(-)
+
+diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c
+index 73a3acb..cd3238b 100644
+--- a/src/shared/sleep-config.c
++++ b/src/shared/sleep-config.c
+@@ -47,19 +47,16 @@ int parse_sleep_config(const char *verb, char ***modes, char ***states) {
+         FILE _cleanup_fclose_ *f;
+ 
+         f = fopen(PKGSYSCONFDIR "/sleep.conf", "re");
+-        if (!f) {
+-                if (errno == ENOENT)
+-                        return 0;
+-
+-                log_warning("Failed to open configuration file " PKGSYSCONFDIR "/sleep.conf: %m");
+-                return 0;
++        if (!f)
++                log_full(errno == ENOENT ? LOG_DEBUG: LOG_WARNING,
++                         "Failed to open configuration file " PKGSYSCONFDIR "/sleep.conf: %m");
++        else {
++                r = config_parse(NULL, PKGSYSCONFDIR "/sleep.conf", f, "Sleep\0",
++                                 config_item_table_lookup, (void*) items, false, false, NULL);
++                if (r < 0)
++                        log_warning("Failed to parse configuration file: %s", strerror(-r));
+         }
+ 
+-        r = config_parse(NULL, PKGSYSCONFDIR "/sleep.conf", f, "Sleep\0",
+-                         config_item_table_lookup, (void*) items, false, false, NULL);
+-        if (r < 0)
+-                log_warning("Failed to parse configuration file: %s", strerror(-r));
+-
+         if (streq(verb, "suspend")) {
+                 /* empty by default */
+                 *modes = suspend_mode;
+-- 
+1.8.2.2
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2013-05-07 14:20:11 UTC (rev 184611)
+++ PKGBUILD	2013-05-07 16:04:36 UTC (rev 184612)
@@ -4,7 +4,7 @@
 pkgbase=systemd
 pkgname=('systemd' 'systemd-sysvcompat')
 pkgver=203
-pkgrel=1
+pkgrel=2
 arch=('i686' 'x86_64')
 url="http://www.freedesktop.org/wiki/Software/systemd"
 license=('GPL2' 'LGPL2.1' 'MIT')
@@ -17,12 +17,14 @@
         'initcpio-install-udev'
         'initcpio-install-timestamp'
         '0001-login-add-missing-_public_-to-sd_get_machine_names.patch'
+        '0002-systemd-sleep-it-is-not-an-error-if-the-config-file-.patch'
         'use-split-usr-path.patch')
 md5sums=('b5a124ae8aee2b9fa357f912e87e9048'
          'e99e9189aa2f6084ac28b8ddf605aeb8'
          'fb37e34ea006c79be1c54cbb0f803414'
          'df69615503ad293c9ddf9d8b7755282d'
          '8504a59afaa5d52fa6b5b26fc89873cf'
+         '988cf83af952990ff48d3b97bcf06845'
          '76bf83fe34c5b40533abc5dc940576a6')
 
 prepare() {
@@ -32,6 +34,7 @@
   patch -Np1 <"$srcdir/use-split-usr-path.patch"
 
   patch -Np1 <"$srcdir/0001-login-add-missing-_public_-to-sd_get_machine_names.patch"
+  patch -Np1 <"$srcdir/0002-systemd-sleep-it-is-not-an-error-if-the-config-file-.patch"
 }
 
 build() {




More information about the arch-commits mailing list