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 e='id' value='c11195cac3e9ef1625d54bcdbbbcd7a11dc78040'/>
path: root/gnu/packages/language.scm
AgeCommit message (Expand)Author
2024-11-12gnu: liblouisutdml: Update to 2.12.0-0.00ca783....* gnu/packages/language.scm (liblouisutdml): Update to 2.12.0-0.00ca783. [arguments]: Use G-expressions. [native-inputs]: Remove labels. [propagated-inputs]: Remove labels. Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail> Change-Id: Iedbcb5b3073f26a42805ae02550a28f6f1abee86 Zheng Junjie
2024-11-04gnu: liblouis: Update to 3.31.0. [security fixes]...This fixes CVE-2022-26981. * gnu/packages/language.scm (liblouis): Update to 3.31.0. [arguments]: Improve style using gexps. [native-inputs]: Remove labels. Replace python-wrapper by python-minimal. Change-Id: Ibfa143ec97816539ba9c2904cd390c9d6d54c9d5 Nicolas Graves
2024-10-20gnu: libchewing: Update to 0.9.0....* gnu/packages/language.scm (libchewing): Update to 0.9.0. [build-system]: Switch to cargo-build-system. [arguments]: Adjust for switch to cargo-build-system. Enable parallel-tests. Add a phase to allow older versions of rust-clap-mangen. Add the cmake version of 'configure after 'configure. Use the cmake versions of 'build, 'check and 'install. [native-inputs]: Add corrosion, cmake-minimal. Remove autoconf, automake, libtool, perl, pkg-config, python-wrapper, texinfo. Co-authored-by: Charles <charles@charje.net> Change-Id: Ic11e38646fc47cfc2c575320f43b9355a1c83b39 Signed-off-by: jgart <jgart@dismail.de> Efraim Flashner
2024-08-31build-systems: gnu: Export %default-gnu-imported-modules and %default-gnu-mod......Until now users would have to cargo cult or inspect the private %default-modules variable of (guix build-systems gnu) to discover which modules to include when extending the used modules via the #:modules argument. The renaming was automated via the command: $ git grep -l %gnu-build-system-modules | xargs sed 's/%gnu-build-system-modules/%default-gnu-imported-modules/' -i * guix/build-system/gnu.scm (%gnu-build-system-modules): Rename to... (%default-gnu-imported-modules): ... this. (%default-modules): Rename to... (%default-gnu-modules): ... this. Export. (dist-package, gnu-build, gnu-cross-build): Adjust accordingly. Change-Id: Idef307fff13cb76f3182d782b26e1cd3a5c757ee Maxim Cournoyer
2024-08-18gnu: mecab-ipadic: Reduce irony....* gnu/packages/language.scm (mecab-ipadic)[description]: Fix typo. Change-Id: I8bf2dc7deb7479f4b8cdb3298cd82089ab67de8a Tobias Geerinckx-Rice
2024-01-21Merge branch 'master' into emacs-teamLiliana Marie Prikler
2023-11-01gnu: skktools: Build autoloads before installing them....* gnu/packages/language.scm (skktools)[#:phases]: Move ‘make-autoloads’ after ‘unpack’. Liliana Marie Prikler