aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch
blob: bbb6b7c08ecfd2182182bcb7ccf6d090b4f11fd3 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 5059daf8bd59a83f520c14731173ea76ce8b8661 Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Sun, 8 Sep 2019 13:09:15 +0200
Subject: [PATCH] [debops-defaults] If `view` is not available, try less, etc.

---
 bin/debops-defaults | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/bin/debops-defaults b/bin/debops-defaults
index 9dd87fe0a..3e3db4c41 100755
--- a/bin/debops-defaults
+++ b/bin/debops-defaults
@@ -96,13 +96,22 @@ def main(role_list):
     config = read_config(project_root)
     playbooks_path = find_playbookpath(config, project_root, required=True)
 
-    # Make sure required commands are present
-    require_commands('view')
-
-    if sys.stdout.isatty():
+    # Check if one of the output commands is present
+    sys.stdout = io.BytesIO()  # suppress error message, if any
+    for cmd_args in (('view', '+set ft=yaml', '-'),
+                     ('less', '-'),
+                     ('more', '-')):
+        try:
+            require_commands(cmd_args[0])
+            break
+        except SystemExit:
+            # this command was not found
+            cmd_args = None
+    sys.stdout = sys.__stdout__
+
+    if cmd_args and sys.stdout.isatty():
         # if script is run as standalone, redirect to view
-        view = subprocess.Popen(['view', '+set ft=yaml', '-'],
-                                stdin=subprocess.PIPE)
+        view = subprocess.Popen(cmd_args, stdin=subprocess.PIPE)
         try:
             aggregate_defaults(playbooks_path, role_list, view.stdin)
         except IOError as e:
-- 
2.21.0

2022-05-22 21:56:39 +0200'>2022-05-22gnu: guile-fibers: Add 'upstream-name' property....* gnu/packages/guile-xyz.scm (guile-fibers-1.1)[properties]: New field. Ludovic Courtès 2022-05-22gnu: guile-fibers@1.1: Update to c25dcb9....* gnu/packages/guile-xyz.scm (guile-fibers-1.1): Update to c25dcb9. [arguments]: Remove 'regenerate-autotools' phase. Ludovic Courtès 2022-05-18gnu: guile-redis: Update to 2.2.0....* gnu/packages/guile-xyz.scm (guile-redis): Update to 2.2.0. Ricardo Wurmus 2022-05-17gnu: guile-sjson: Update to 0.2.2....* gnu/packages/guile-xyz.scm (guile-sjson): Update to 0.2.2. Christine Lemmer-Webber 2022-05-13gnu: artanis: Remove input labels....* gnu/packages/guile-xyz.scm (artanis)[native-inputs]: Remove input labels. Use BASH-MINIMAL instead of BASH. Ludovic Courtès 2022-05-13gnu: artanis: Update to 0.5.1....* gnu/packages/guile-xyz.scm (artanis): Update to 0.5.1. [source]: Substitute "artanis/tpl/parser.scm". Signed-off-by: Ludovic Courtès <ludo@gnu.org> Wamm K. D 2022-05-13gnu: guile-ics: Update to 0.2.1...* gnu/packages/guile-xyz.scm (guile-ics): Update to 0.2.1. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Artyom V. Poptsov 2022-05-12gnu: emacsy: Use webkitgtk-with-libsoup2....* gnu/packages/guile-xyz.scm (emacsy)[inputs]: Use webkitgtk-with-libsoup2. [phases]: Delete trailing #t. Maxim Cournoyer 2022-04-26gnu: guile-srfi-189: Build from upstream sources....* gnu/packages/guile-xyz.scm (guile-srfi-189): Retarget git-reference to the official repo, and increase revision by one. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Attila Lendvai 2022-04-14gnu: guile-fibers@1.1: Support cross-compilation....Fixes <https://issues.guix.gnu.org/54793>. Reported by Mathieu Othacehe <othacehe@gnu.org>. * gnu/packages/guile-xyz.scm (guile-fibers-1.1)[arguments]: Add 'support-cross-compilation' phase. Ludovic Courtès 2022-03-24gnu: guile-fibers: Remove GNU/Hurd from 'supported-systems'....* gnu/packages/guile-xyz.scm (guile-fibers-1.1)[supported-systems]: New field. Ludovic Courtès 2022-03-24gnu: guile-fibers: Support cross-compilation....* gnu/packages/guile-xyz.scm (guile-fibers-1.1)[native-inputs]: Add GUILE-3.0. (guile2.2-fibers)[inputs, native-inputs]: Adjust accordingly. Ludovic Courtès 2022-03-01gnu: guile-wisp: Update to 1.0.7....* gnu/packages/guile-xyz.scm (guile-wisp): Update to 1.0.7. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Arne Babenhauserheide 2022-02-11gnu: lokke: Build with Guile 3.0.8....* gnu/packages/guile.scm (guile-3.0-for-lokke): Remove. * gnu/packages/patches/guile-3.0.7-psyntax-nil.patch: Remove. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/guile-xyz.scm (lokke)[native-inputs]: Replace GUILE-3.0-FOR-LOKKE by GUILE-3.0-LATEST. Ludovic Courtès 2022-02-08gnu: nomad: Depends on proper version of g-golf....* gnu/packages/guile-xyz.scm (nomad)[inputs]: Replace 'g-golf' with 'guile2.2-g-golf'. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Zhu Zihao 2022-02-08gnu: Add guile2.2-g-golf....* gnu/packages/guile-xyz.scm (guile2.2-g-golf): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Zhu Zihao 2022-02-08gnu: Deprecate the 'g-golf' variable....g-golf now supports both Guile 3.0 and 2.2. Assign a new name to identify the g-golf for different Guile version. * gnu/packages/guile-xyz.scm (g-golf): Rename to guile-g-golf. (g-golf): Define as deprecated by guile-g-golf. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Zhu Zihao 2022-02-08gnu: g-golf: Update to 0.0.1-1010-1824633....* gnu/packages/guile-xyz.scm (g-golf)[arguments]: Use G-Expression. <phases>: Add phase 'fix-guile-site-directory'. Patch 'configure.ac' before bootstrapping, avoid breaking configure script in accident. In phase 'substitute-libs', use `search-input-file` for searching libraries. In phase 'start-xorg-server', simplify the X server startup script. [inputs]: Remove gtk+ and clutter. Use label-less style. [native-inputs]: Add gtk+ and clutter, they're now only needed in test. Use label-less style. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Zhu Zihao 2022-02-08gnu: guile-dsv: Update to 0.5.1...* gnu/packages/guile-xyz.scm (guile-dsv): Update to 0.5.1. Signed-off-by: Julien Lepiller <julien@lepiller.eu> Artyom V. Poptsov 2022-02-07gnu: haunt: Update to 0.2.6....* gnu/packages/guile-xyz.scm (haunt): Update to 0.2.6. Ludovic Courtès 2022-02-05gnu: guile-fibers: Add (fibers io-wakeup)....This patch is required by gnunet-scheme. It has been submitted upstream at <https://github.com/wingo/fibers/pull/50>, but there has not been any response so far. * gnu/packages/patches/guile-fibers-wait-for-io-readiness.patch: New file. * gnu/packages/guile-xyz.scm (guile-fibers-1.1)[source]{patches}: Add it. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Maxime Devos 2022-02-02gnu: guile-fibers: Add version 1.1.0....This release looks to break a few packages, so keep using fibers 1.0 to build things, and provide the new version to allow switching to when packages are compatible. * gnu/packages/guile-xyz.scm (guile-fibers-1.1): New variable. (guile-fibers): Inherit from guile-fibers-1.1. (guile2.0-fibers): Rename to guile2.2-fibers, and inherit from guile-fibers-1.1. Christopher Baines 2022-02-01gnu: Add Lokke....* gnu/packages/guile.scm (guile-3.0-for-lokke): New variable. * gnu/packages/guile-xyz.scm (lokke): New variable. * gnu/packages/patches/guile-3.0.7-psyntax-nil.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Ludovic Courtès 2022-01-27gnu: guile-drmaa: Update to 0.1.1....* gnu/packages/guile-xyz.scm (guile-drmaa): Update to 0.1.1. Ricardo Wurmus 2022-01-24gnu: nomad: Fix missing webkit2gtk-4.0 compilation error....* gnu/package/guile-xyz.scm (nomad)[arguments]<phases>: Add phase 'fix-webkitgtk' to update webkit2gtk-4.0 reference in file 'configure.ac' and 'typelib/Makefile.am'. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Zhu Zihao 2022-01-18gnu: Add guile-srfi-189....* gnu/packages/guile-xyz.scm (guile-srfi-189): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Attila Lendvai 2022-01-09gnu: guile-squee: Update to 0-3.a151fd0....* gnu/packages/guile-xyz.scm (guile-squee): Update to 0-3.a151fd0. [arguments]: Use search-input-file and remove a trailing #t. Mathieu Othacehe