From 02843215d871c501ec5515d5b2589297d8d4a923 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 14 Feb 2018 02:06:21 -0500 Subject: gnu: shepherd: 'herd status' now sorts the result. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a patch by Ludovic Courtès from the upstream shepherd repository to partially fix . * gnu/packages/patches/shepherd-herd-status-sorted.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/admin.scm (shepherd)[source]: Add patch. --- .../patches/shepherd-herd-status-sorted.patch | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 gnu/packages/patches/shepherd-herd-status-sorted.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/shepherd-herd-status-sorted.patch b/gnu/packages/patches/shepherd-herd-status-sorted.patch new file mode 100644 index 0000000000..c6b9d870eb --- /dev/null +++ b/gnu/packages/patches/shepherd-herd-status-sorted.patch @@ -0,0 +1,79 @@ +From cc9564586729a5bb90dd5d2722b543fdde9ab821 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= +Date: Sun, 4 Feb 2018 21:56:36 +0100 +Subject: [PATCH] herd: 'herd status' now sorts the result. + +Partly fixes . +Reported by Mark H Weaver . + +Previously 'tests/basic.sh' could occasionally fail on: + + test "`$herd status`" == "$pristine_status" + +because the order of stopped services were not always the same. Indeed, +those services come from 'service-list' on the shepherd side, which uses +'hash-fold' to traverse the service hash table, and the traversal order +of 'hash-fold' is undefined. + +* modules/shepherd/scripts/herd.scm (display-status-summary)[service ++;; Copyright (C) 2013, 2014, 2016, 2018 Ludovic Courtès + ;; Copyright (C) 2002, 2003 Wolfgang Jährling + ;; + ;; This file is part of the GNU Shepherd. +@@ -46,13 +46,17 @@ of pairs." + + (define (display-status-summary services) + "Display a summary of the status of all of SERVICES." ++ (define (servicestring (service-canonical-name service1)) ++ (symbol->string (service-canonical-name service2)))) ++ + (define (display-services header bullet services) + (unless (null? services) + (display header) + (for-each (lambda (service) + (format #t " ~a ~a~%" bullet + (service-canonical-name service))) +- services))) ++ (sort services service ++;; Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès + ;; Copyright (C) 2002, 2003 Wolfgang Järling + ;; Copyright (C) 2014 Alex Sassmannshausen + ;; Copyright (C) 2016 Alex Kost +@@ -949,7 +949,8 @@ Return #f if service is not found." + %services)) + + (define (service-list) +- "Return the list of services currently defined." ++ "Return the list of services currently defined. Note: The order of the list ++returned in unspecified." + (hash-fold (lambda (name services result) + (let ((service (lookup-canonical-service name services))) + (if service +-- +2.16.1 + -- cgit v1.2.3