From 5059daf8bd59a83f520c14731173ea76ce8b8661 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel 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 8e4256b1283d589d7d9'/>
path: root/gnu/packages/gdb.scm
AgeCommit message (Expand)Author
2023-08-28gnu: Add gdb-multiarch....* gnu/packages/gdb.scm (gdb-multiarch): New variable. 宋文武
2023-06-17gnu: Use target-hurd?, system-hurd? instead of hurd-target?, hurd-system?....* gnu/packages/hurd.scm (hurd-target?): Remove. (hurd-system?): Move to... * guix/utils.scm (system-hurd?): ...here. * gnu/packages/*: Update all users, removing (gnu packages hurd) include where now unused. Janneke Nieuwenhuizen
2023-05-07gnu: gdb/pinned: Move to gdb-12.1....* gnu/packages/gdb.scm (gdb/pinned): Refer to gdb-12.1. [properties]: Hide the package. (gdb-12): Inherit from gdb/pinned. Efraim Flashner
2023-04-18gnu: gdb: Change default to 12.x....* gnu/packages/gdb.scm (gdb): Change to GDB-12. Ludovic Courtès
2023-04-18gnu: gdb: Distinguish between the "pinned" and the "default" version....* gnu/packages/gdb.scm (gdb/pinned): New variable. * gnu/packages/rust.scm (rust)[native-inputs]: Use it instead of GDB. Ludovic Courtès
2023-04-18gnu: gdb: Remove Hurd patch....The patch was useful for GDB 11 on the previous Hurd version that was used; it's unnecessary on GDB 12 and GDB 11 has other build issues on the current GNU/Hurd. This change fixes "guix build gdb-minimal --target=i586-pc-gnu". * gnu/packages/patches/gdb-fix-gnu-nat-build.patch: Remove. * gnu/local.mk (dist_patch_DATA): Remove it. * gnu/packages/gdb.scm (gdb-11)[arguments]: Remove 'patch-gdb/hurd' phase. [inputs]: Remove "hurd-build.patch" input. [supported-systems]: New field. (gdb-12)[supported-systems]: New field. Ludovic Courtès
2023-04-18gnu: gdb-minimal: Update to 12.x....* gnu/packages/gdb.scm (gdb-minimal): Rebase on GDB-12. Ludovic Courtès
2023-04-18gnu: gdb: Use 'cross-mig' when targeting GNU/Hurd....This is a followup to 2756d662aa27cf55f3224e4a0a9e08c1be2cc551. * gnu/packages/gdb.scm (gdb-11)[native-inputs]: Use 'cross-mig' instead of 'mig/32-bit'. Ludovic Courtès
2022-11-07gnu: Add avr-gdb....* gnu/packages/gdb.scm (avr-gdb): New variable. Signed-off-by: Christopher Baines <mail@cbaines.net> Kristian Lein-Mathisen