From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 24 12:12:13 2022 Received: (at submit) by debbugs.gnu.org; 24 Aug 2022 16:12:13 +0000 Received: from localhost ([127.0.0.1]:47907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQszE-0001a8-8P for submit@debbugs.gnu.org; Wed, 24 Aug 2022 12:12:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:49132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQszB-0001a0-KQ for submit@debbugs.gnu.org; Wed, 24 Aug 2022 12:12:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQszB-0005L6-B8 for guix-patches@gnu.org; Wed, 24 Aug 2022 12:12:09 -0400 Received: from outbound.soverin.net ([2a10:de80:1:4091:b9e9:2215:0:1]:52669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQsz4-0006Gs-Ph for guix-patches@gnu.org; Wed, 24 Aug 2022 12:12:09 -0400 Received: from smtp.freedom.nl (c04smtp-lb01.int.sover.in [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 4MCWM05DfczLt for ; Wed, 24 Aug 2022 16:11:56 +0000 (UTC) Received: from smtp.freedom.nl (smtp.freedom.nl [10.10.4.107]) by freedom.nl DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=adriaan.se; s=soverin; t=1661357516; bh=O1gKkVlgdeyJAl/99MSAByvKpkgsfLtpGbOpPGRCGG4=; h=From:To:Cc:Subject:Date:From; b=YU2uZ0Y1A2ApaieGVV8HNwq0cS/AO7C5ohTblFU59Sa66XjnQCz5ELWgxXdPJkiDL SE67aTlQKem/owJ6gLrRIOkYHybfH8WBPHSipTJBz7CqV0zeVLwuTakdajvo9Mw7iM 2UaaASX/Dsd0JlTxTV639wp42JFbXxP+gGJ5dEts1afRKErUI/ChDUV3cQh9k+Bo4d TB10d6i5oXXORK0mqOrW1iRwpBaejAjQ+agFJ7RkLuDAkEZkUCbTmprp46bc3w8lJn rx89L7VnJN+T/FDuHCzkA2wuGWuOuWrchMbo+j8R1YFvL3H+ZbMET5ft+Uwof5qA6z waQ1oQCEBG0zA== From: Arjan Adriaanse To: guix-patches@gnu.org Subject: [PATCH] gnu: debops: Update to 3.0.2. Date: Wed, 24 Aug 2022 18:11:49 +0200 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=2a10:de80:1:4091:b9e9:2215:0:1; envelope-from=arjan@adriaan.se; helo=outbound.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: Arjan Adriaanse X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/admin.scm (debops): Update to 3.0.2. --- gnu/local.mk | 2 - gnu/packages/admin.scm | 110 +++---- ...constants-for-external-program-names.patch | 276 ------------------ ...ps-debops-defaults-fall-back-to-less.patch | 45 --- 4 files changed, 36 insertions(+), 397 deletions(-) delete mode 100644 gnu/packages/patches/debops-constants-for-external-program-names.patch delete mode 100644 gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch diff --git a/gnu/local.mk b/gnu/local.mk index 26dfb6afe2..d98178e8b6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1000,8 +1000,6 @@ dist_patch_DATA = \ %D%/packages/patches/dbus-c++-gcc-compat.patch \ %D%/packages/patches/dbus-c++-threading-mutex.patch \ %D%/packages/patches/dbxfs-remove-sentry-sdk.patch \ - %D%/packages/patches/debops-constants-for-external-program-names.patch \ - %D%/packages/patches/debops-debops-defaults-fall-back-to-less.patch \ %D%/packages/patches/dee-vapi.patch \ %D%/packages/patches/desmume-gcc6-fixes.patch \ %D%/packages/patches/desmume-gcc7-fixes.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index a4c5189222..edce512673 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -51,6 +51,7 @@ ;;; Copyright © 2021 Artyom V. Poptsov ;;; Copyright © 2022 Wamm K. D. ;;; Copyright © 2022 Roman Riabenko +;;; Copyright © 2022 Arjan Adriaanse ;;; ;;; This file is part of GNU Guix. ;;; @@ -147,6 +148,7 @@ (define-module (gnu packages admin) #:use-module (gnu packages polkit) #:use-module (gnu packages popt) #:use-module (gnu packages python) + #:use-module (gnu packages python-build) #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) @@ -2841,84 +2843,44 @@ (define-public ansible (define-public debops (package (name "debops") - (version "1.1.0") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/debops/debops") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "052b2dykdn35pdpn9s4prawl6nl6yzih8nyf54hpvhpisvjrm1v5")) - (patches - (search-patches "debops-constants-for-external-program-names.patch" - "debops-debops-defaults-fall-back-to-less.patch")))) + (version "3.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/debops/debops") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "05m9i17hyiz4mm3d1h9zi7j4gid69j08p2yg7zqpaxmby2sbnncf")))) (build-system python-build-system) - (native-inputs - (list git)) - (inputs - (list ansible - encfs - fuse - util-linux ;; for umount - findutils - gnupg - which)) - (propagated-inputs - (list python-future python-distro)) + (native-inputs (list git)) + (propagated-inputs (list python-distro + python-future + python-jinja2 + python-pyyaml + python-pyxdg + python-toml + python-dotenv + ansible + python-netaddr + python-passlib + python-ldap + python-dnspython + python-pyopenssl)) (arguments - `(#:tests? #f - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'nuke-debops-update - (lambda _ - (chmod "bin/debops-update" #o755) ; FIXME work-around git-fetch issue - (with-output-to-file "bin/debops-update" - (lambda () - (format #t "#!/bin/sh -echo 'debops is installed via guix. guix-update is useless in this case. -Please use `guix package -u debops` instead.'"))) - #t)) - ;; patch shebangs only in actuall scripts, not in files included in - ;; roles (which are to be delivered to the targte systems) - (delete `patch-generated-file-shebangs) - (replace 'patch-source-shebangs - (lambda _ - (for-each patch-shebang - (find-files "bin" - (lambda (file stat) - ;; Filter out symlinks. - (eq? 'regular (stat:type stat))) - #:stat lstat)))) - (add-after 'unpack 'fix-paths - (lambda _ - (define (substitute-program-names file) - ;; e.g. ANSIBLE_PLAYBOOK = '/gnu/store/…/bin/ansible-playbook' - (for-each - (lambda (name) - (let ((varname (string-upcase - (string-map - (lambda (c) (if (char=? c #\-) #\_ c)) - name)))) - (substitute* file - (((string-append "^(" varname " = )'.*'") line prefix) - (string-append prefix "'" (which name) "'"))))) - '("ansible-playbook" "encfs" "find" "fusermount" - "umount" "gpg" "ansible" "which"))) - (for-each substitute-program-names - '("bin/debops" - "bin/debops-padlock" - "bin/debops-task" - "debops/__init__.py" - "debops/cmds/__init__.py")) - #t))))) + `(#:phases (modify-phases %standard-phases + ;; Patching shebangs breaks scripts that are meant to be + ;; deployed to other systems and there are no scripts that + ;; do need patching. + (delete 'patch-source-shebangs) + (delete 'patch-generated-file-shebangs)))) (home-page "https://www.debops.org/") (synopsis "Collection of general-purpose Ansible roles") - (description "The Ansible roles provided by that can be used to manage -Debian or Ubuntu hosts. In addition, a default set of Ansible playbooks can -be used to apply the provided roles in a controlled way, using Ansible -inventory groups. + (description + "The Ansible roles provided by that can be used to manage Debian or +Ubuntu hosts. In addition, a default set of Ansible playbooks can be used to +apply the provided roles in a controlled way, using Ansible inventory groups. The roles are written with a high customization in mind, which can be done using Ansible inventory. This way the role and playbook code can be shared diff --git a/gnu/packages/patches/debops-constants-for-external-program-names.patch b/gnu/packages/patches/debops-constants-for-external-program-names.patch deleted file mode 100644 index b3b34ed323..0000000000 --- a/gnu/packages/patches/debops-constants-for-external-program-names.patch +++ /dev/null @@ -1,276 +0,0 @@ -From 78d5cddafebb28e2e54efeb781495b5607ddb356 Mon Sep 17 00:00:00 2001 -From: Hartmut Goebel -Date: Thu, 8 Aug 2019 15:19:48 +0200 -Subject: [PATCH] Scripts: Use constants for external program names. - -This makes it much, much easier to replace the program -with one using an absolute path. This is necessary for -e.g. Guix to keep references to these external programs. ---- - bin/debops | 10 +++++++--- - bin/debops-padlock | 21 +++++++++++++++------ - bin/debops-task | 7 +++++-- - bin/debops-update | 18 +++++++++++------- - debops/__init__.py | 17 ++++++++++++----- - debops/cmds/__init__.py | 6 +++++- - 6 files changed, 55 insertions(+), 24 deletions(-) - -diff --git a/bin/debops b/bin/debops -index 2b7ad3f88..caaeb892f 100755 ---- a/bin/debops -+++ b/bin/debops -@@ -59,6 +59,10 @@ ConfigFileHeader = """\ - # You can manipulate the contents of this file via `.debops.cfg`. - """ - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+ANSIBLE_PLAYBOOK = 'ansible-playbook' -+ - - def write_config(filename, config): - cfgparser = configparser.ConfigParser() -@@ -131,7 +135,7 @@ def gen_ansible_cfg(filename, config, project_root, playbooks_path, - os.path.join(playbooks_path, "roles"), - "/etc/ansible/roles"))) - -- ansible_version_out = subprocess.check_output(["ansible-playbook", -+ ansible_version_out = subprocess.check_output([ANSIBLE_PLAYBOOK, - "--version"]).decode() - - # Get first line and split by spaces to get second 'word'. -@@ -197,7 +201,7 @@ def main(cmd_args): - playbooks_path = '/nonexistent' - - # Make sure required commands are present -- require_commands('ansible-playbook') -+ require_commands(ANSIBLE_PLAYBOOK) - - # Check if user specified a potential playbook name as the first - # argument. If yes, use it as the playbook name and remove it from -@@ -256,7 +260,7 @@ def main(cmd_args): - print("Running Ansible playbooks:") - for element in play_list: - print(element) -- return subprocess.call(['ansible-playbook'] + play_list + arg_list) -+ return subprocess.call([ANSIBLE_PLAYBOOK] + play_list + arg_list) - finally: - if revert_unlock: - padlock_lock(encfs_encrypted) -diff --git a/bin/debops-padlock b/bin/debops-padlock -index bfdfb8e06..2a97716cd 100755 ---- a/bin/debops-padlock -+++ b/bin/debops-padlock -@@ -67,6 +67,14 @@ devrandom = os.environ.get('DEVRANDOM', "/dev/urandom") - - SCRIPT_FILENAME = 'padlock-script' - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+ENCFS = 'encfs' -+FIND = 'find' -+FUSERMOUNT = 'fusermount' -+UMOUNT = 'umount' -+GPG = 'gpg' -+ - # ---- DebOps environment setup ---- - - -@@ -80,9 +88,9 @@ def main(subcommand_func, **kwargs): - # Make sure required commands are present - # OS X compatibility - if sys.platform == 'darwin': -- require_commands('encfs', 'find', 'umount', 'gpg') -+ require_commands(ENCFS, FIND, UMOUNT, GPG) - else: -- require_commands('encfs', 'find', 'fusermount', 'gpg') -+ require_commands(ENCFS, FIND, FUSERMOUNT, GPG) - - inventory_path = find_inventorypath(project_root, required=False) - # If inventory hasn't been found automatically, assume it's the default -@@ -121,7 +129,7 @@ def init(encfs_decrypted, encfs_encrypted, recipients): - # Generate a random password and encrypt it with GPG keys of recipients. - print("Generating a random", ENCFS_KEYFILE_LENGTH, "char password") - pwd = gen_pwd() -- gpg = subprocess.Popen(['gpg', '--encrypt', '--armor', -+ gpg = subprocess.Popen([GPG, '--encrypt', '--armor', - '--output', encfs_keyfile] + recipients, - stdin=subprocess.PIPE) - gpg.communicate(pwd.encode('utf-8')) -@@ -133,9 +141,10 @@ def init(encfs_decrypted, encfs_encrypted, recipients): - # NB2: We can not use padlock_unlock here, because the config file - # does not yet exist. - encfs = subprocess.Popen([ -- 'encfs', encfs_encrypted, encfs_decrypted, -+ ENCFS, encfs_encrypted, encfs_decrypted, - '--extpass', -- 'gpg --decrypt --no-mdc-warning --output - '+shquote(encfs_keyfile)], -+ GPG + ' --decrypt --no-mdc-warning --output - ' -+ + shquote(encfs_keyfile)], - stdin=subprocess.PIPE) - encfs.communicate(('p\n'+pwd).encode('utf-8')) - -@@ -154,7 +163,7 @@ def init(encfs_decrypted, encfs_encrypted, recipients): - - # Protect the EncFS configuration file by also encrypting it with - # the GPG keys of recipients. -- subprocess.call(['gpg', '--encrypt', '--armor', -+ subprocess.call([GPG, '--encrypt', '--armor', - '--output', encfs_configfile+'.asc'] - + recipients + [encfs_configfile]) - os.remove(encfs_configfile) -diff --git a/bin/debops-task b/bin/debops-task -index 223e5f834..dc31ad4e6 100755 ---- a/bin/debops-task -+++ b/bin/debops-task -@@ -49,11 +49,14 @@ project_root = find_debops_project(required=True) - # todo: need to decide on semantics! - # config = read_config(project_root) - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+ANSIBLE = 'ansible' - - # ---- Main script ---- - - # Make sure required commands are present --require_commands('ansible') -+require_commands(ANSIBLE) - - ansible_inventory = find_inventorypath(project_root) - -@@ -71,5 +74,5 @@ if INSECURE: - os.environ['ANSIBLE_HOST_KEY_CHECKING'] = 'False' - - # Run ansible with custom environment --cmd = ['ansible'] + module + sys.argv[1:] -+cmd = [ANSIBLE] + module + sys.argv[1:] - subprocess.call(cmd) -diff --git a/bin/debops-update b/bin/debops-update -index 88c5e2c82..cc7e57cb0 100755 ---- a/bin/debops-update -+++ b/bin/debops-update -@@ -90,6 +90,10 @@ GALAXY_REQUIREMENTS = "galaxy/requirements.txt" - # Default Ansible Galaxy user account name - GALAXY_ACCOUNT = "debops" - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+GIT = 'git' -+ - - # ---- Functions ---- - -@@ -137,7 +141,7 @@ def clone_git_repository(repo_uri, branch, destination, dry_run=False): - if dry_run: - print("Cloning '%s' to %s..." % (repo_uri, destination)) - else: -- subprocess.call(['git', 'clone', '--quiet', '--branch', branch, -+ subprocess.call([GIT, 'clone', '--quiet', '--branch', branch, - repo_uri, destination]) - - -@@ -152,22 +156,22 @@ def update_git_repository(path, dry_run=False, remote_uri=False): - os.chdir(path) - - if dry_run: -- subprocess.call(['git', 'fetch']) -- subprocess.call(['git', 'diff', 'HEAD', 'origin', '--stat']) -+ subprocess.call([GIT, 'fetch']) -+ subprocess.call([GIT, 'diff', 'HEAD', 'origin', '--stat']) - else: - # Get the current sha of the head branch - current_sha = subprocess.check_output( -- ['git', 'rev-parse', 'HEAD']).strip() -+ [GIT, 'rev-parse', 'HEAD']).strip() - - # Fetch it silently and store the new sha -- subprocess.call(['git', 'fetch', '--quiet']) -+ subprocess.call([GIT, 'fetch', '--quiet']) - fetch_sha = subprocess.check_output( -- ['git', 'rev-parse', 'FETCH_HEAD']).strip() -+ [GIT, 'rev-parse', 'FETCH_HEAD']).strip() - - if current_sha != fetch_sha: - print() - print('--') -- subprocess.call(['git', 'merge', fetch_sha]) -+ subprocess.call([GIT, 'merge', fetch_sha]) - - if remote_uri: - compare_uri = (remote_uri + '/compare/' + current_sha[:7] -diff --git a/debops/__init__.py b/debops/__init__.py -index 1c2cedcb0..da8430e41 100644 ---- a/debops/__init__.py -+++ b/debops/__init__.py -@@ -93,6 +93,13 @@ ENCFS_KEYFILE = ".encfs6.keyfile" - # Length of the random EncFS password stored in encrypted keyfile - ENCFS_KEYFILE_LENGTH = 256 - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+ENCFS = 'encfs' -+FUSERMOUNT = 'fusermount' -+UMOUNT = 'umount' -+GPG = 'gpg' -+ - - # ---- Functions ---- - -@@ -180,9 +187,9 @@ def padlock_lock(encrypted_path): - return False - # OS X compatibility - if sys.platform == 'darwin': -- subprocess.call(['umount', decrypted_path]) -+ subprocess.call([UMOUNT, decrypted_path]) - else: -- subprocess.call(['fusermount', '-u', decrypted_path]) -+ subprocess.call([FUSERMOUNT, '-u', decrypted_path]) - return True - - -@@ -237,14 +244,14 @@ def padlock_unlock(encrypted_path): - # Start encfs. It will wait for input on the `configfile` named - # pipe. - encfs = subprocess.Popen([ -- 'encfs', encrypted_path, decrypted_path, -+ ENCFS, encrypted_path, decrypted_path, - '--extpass', -- 'gpg --decrypt --no-mdc-warning --output - %s' % shquote(keyfile)]) -+ GPG + ' --decrypt --no-mdc-warning --output - %s' % shquote(keyfile)]) - # now decrypt the config and write it into the named pipe - with open(configfile, 'w') as fh: - # NB: gpg must write to stdout to avoid it is asking whether - # the file should be overwritten -- subprocess.Popen(['gpg', -+ subprocess.Popen([GPG, - '--decrypt', '--no-mdc-warning', '--output', '-', - crypted_configfile], stdout=fh).wait() - encfs.wait() -diff --git a/debops/cmds/__init__.py b/debops/cmds/__init__.py -index b221fa191..9fabf43a5 100644 ---- a/debops/cmds/__init__.py -+++ b/debops/cmds/__init__.py -@@ -55,6 +55,10 @@ SCRIPT_NAME = os.path.basename(sys.argv[0]) - # command line) - INSECURE = bool(os.environ.get('INSECURE', False)) - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+WHICH = 'which' -+ - - def error_msg(message, severity="Error"): - """ -@@ -70,7 +74,7 @@ def require_commands(*cmd_names): - Check if required commands exist. - """ - def command_exists(cmd_name): -- which = "where" if platform.system() == "Windows" else "which" -+ which = "where" if platform.system() == "Windows" else WHICH - return not subprocess.call([which, cmd_name], - stdout=DEVNULL, stderr=subprocess.STDOUT) - --- -2.21.0 - diff --git a/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch b/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch deleted file mode 100644 index bbb6b7c08e..0000000000 --- a/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch +++ /dev/null @@ -1,45 +0,0 @@ -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 - base-commit: d769cf81d83d75400e5ed0394b839d8ddb770384 -- 2.37.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 24 17:59:46 2022 Received: (at 57388) by debbugs.gnu.org; 24 Aug 2022 21:59:46 +0000 Received: from localhost ([127.0.0.1]:48368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQyPa-00027P-8r for submit@debbugs.gnu.org; Wed, 24 Aug 2022 17:59:46 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:38120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQyPY-00027H-Io for 57388@debbugs.gnu.org; Wed, 24 Aug 2022 17:59:45 -0400 Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16] ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by baptiste.telenet-ops.be with bizsmtp id BZzj2800520ykKC01ZzjL5; Wed, 24 Aug 2022 23:59:43 +0200 Message-ID: Date: Wed, 24 Aug 2022 23:59:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [bug#57388] [PATCH] gnu: debops: Update to 3.0.2. Content-Language: en-US To: Arjan Adriaanse , 57388@debbugs.gnu.org References: From: Maxime Devos In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------lT05LKC0WpubEt0TtA2F5Uqh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1661378383; bh=IqSU3BCRW4063OQv3UxTOAPfDPahoimcPmeBGu8P8HE=; h=Date:Subject:To:References:From:In-Reply-To; b=oPZCz2/AadsR/ljsZiqQ7BxuEFFeI/TpkO+ckAZ1dusdxKXX/ZbLYqZSgKp2vLXjw EBxDwtfhOTmERwxokTIhr937pX8FXu6encY+KXK1O9wuFFUp5B0+flCwFdWbeDwx4g h8hCVOv6ivbEn1QZDHIWT2vW6MgoZTqI2LyxLZNNhJQJMhACxR8g+TfKaY3UCurz0I 5XnVoAi0zgtr9IFYTahr/vZ77tJawqon77pCSPkgksifXNH6kGgjXcXGT76qEwvN/o 7kTo2Cgw3bElR7sygBabSdgMA7JOvHEI0zeJXy3CN74cbtAs7W4HQLTqRXbVCFG7Pl IlC1/mJld51hw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 57388 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------lT05LKC0WpubEt0TtA2F5Uqh Content-Type: multipart/mixed; boundary="------------qrbsKEwI8XZbSE41w2A4ngDj"; protected-headers="v1" From: Maxime Devos To: Arjan Adriaanse , 57388@debbugs.gnu.org Message-ID: Subject: Re: [bug#57388] [PATCH] gnu: debops: Update to 3.0.2. References: In-Reply-To: --------------qrbsKEwI8XZbSE41w2A4ngDj Content-Type: multipart/mixed; boundary="------------VoKiwqQO5igFNEyN7Kj987pX" --------------VoKiwqQO5igFNEyN7Kj987pX Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 T24gMjQtMDgtMjAyMiAxODoxMSwgQXJqYW4gQWRyaWFhbnNlIHdyb3RlOg0KDQo+IC0gICAg ICAgICA7OyBwYXRjaCBzaGViYW5ncyBvbmx5IGluIGFjdHVhbGwgc2NyaXB0cywgbm90IGlu IGZpbGVzIGluY2x1ZGVkIGluDQo+IC0gICAgICAgICA7OyByb2xlcyAod2hpY2ggYXJlIHRv IGJlIGRlbGl2ZXJlZCB0byB0aGUgdGFyZ3RlIHN5c3RlbXMpDQo+IC0gICAgICAgICAoZGVs ZXRlIGBwYXRjaC1nZW5lcmF0ZWQtZmlsZS1zaGViYW5ncykNCj4gLSAgICAgICAgIChyZXBs YWNlICdwYXRjaC1zb3VyY2Utc2hlYmFuZ3MNCj4gLSAgICAgICAgICAgKGxhbWJkYSBfDQo+ IC0gICAgICAgICAgICAgKGZvci1lYWNoIHBhdGNoLXNoZWJhbmcNCj4gLSAgICAgICAgICAg ICAgICAgICAgICAgKGZpbmQtZmlsZXMgImJpbiINCj4gLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKGxhbWJkYSAoZmlsZSBzdGF0KQ0KPiAtICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDs7IEZpbHRlciBvdXQgc3ltbGlua3MuDQo+IC0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGVxPyAncmVndWxhciAoc3RhdDp0 eXBlIHN0YXQpKSkNCj4gLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIzpz dGF0IGxzdGF0KSkpKQ0KPiBbLi4uXQ0KPiArICAgICBgKCM6cGhhc2VzIChtb2RpZnktcGhh c2VzICVzdGFuZGFyZC1waGFzZXMNCj4gKyAgICAgICAgICAgICAgICAgIDs7IFBhdGNoaW5n IHNoZWJhbmdzIGJyZWFrcyBzY3JpcHRzIHRoYXQgYXJlIG1lYW50IHRvIGJlDQo+ICsgICAg ICAgICAgICAgICAgICA7OyBkZXBsb3llZCB0byBvdGhlciBzeXN0ZW1zIGFuZCB0aGVyZSBh cmUgbm8gc2NyaXB0cyB0aGF0DQo+ICsgICAgICAgICAgICAgICAgICA7OyBkbyBuZWVkIHBh dGNoaW5nLg0KPiArICAgICAgICAgICAgICAgICAgKGRlbGV0ZSAncGF0Y2gtc291cmNlLXNo ZWJhbmdzKQ0KPiArICAgICAgICAgICAgICAgICAgKGRlbGV0ZSAncGF0Y2gtZ2VuZXJhdGVk LWZpbGUtc2hlYmFuZ3MpKSkpDQoNClRoaXMgc2VlbXMgYSBzZXJpb3VzIHN0ZWFsdGggY2hh bmdlLCBub3QganVzdCByZW1vdmluZyBhIGZldyB0cmFpbGluZyANCiN0LiBIZW5jZSwgdGhp cyBpcyBzb21ldGhpbmcgdG8gZ2l2ZSBhIHJhdGlvbmFsZSBmb3IgKGluIHRoZSBjb21taXQg DQptZXNzYWdlIG9yIGEgY29tbWVudCkgLS0gZS5nLiwgd291bGQgaXQgYmUgcG9zc2libGUg dG8gb25seSBwYXRjaCB0aGUgDQonc2FmZScgc2NyaXB0cyBhbmQgbGVhdmUgdGhlIHNjcmlw dHMgdGhhdCBhcmUgc2VuZCBvdmVyIHRoZSBuZXR3b3JrIA0KYWxvbmUsIHN1Y2NlZWRpbmcg aW4gYm90aCB5b3VyIGFwcGFyZW50IHJlYXNvbiBmb3IgdGhpcyBwYXRjaCBhbmQgdGhlIA0K cmVhc29uIGZvciBwYXRjaC1zb3VyY2Utc2hlYmFuZ3M/DQoNCkxpa2V3aXNlIGZvciAnZml4 LXBhdGhzJywgJ251a2UtZGVib3BzLXVwZGF0ZScgYW5kIHRoZSByZW1vdmVkIHBhdGNoLg0K DQpHcmVldGluZ3MsDQpNYXhpbWUuDQoNCg== --------------VoKiwqQO5igFNEyN7Kj987pX Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------VoKiwqQO5igFNEyN7Kj987pX-- --------------qrbsKEwI8XZbSE41w2A4ngDj-- --------------lT05LKC0WpubEt0TtA2F5Uqh Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYwafTwUDAAAAAAAKCRBJ4+4iGRcl7lu/ AP9gIHhgLufTdLLriO1Q/fIGljm8cDNbpjXt0ios6IyczAEA+QHHEDhyXRXdYAcSoHeuRylZX5HE XmY9c6Ts8ErVawM= =stLY -----END PGP SIGNATURE----- --------------lT05LKC0WpubEt0TtA2F5Uqh-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 25 05:33:01 2022 Received: (at 57388) by debbugs.gnu.org; 25 Aug 2022 09:33:01 +0000 Received: from localhost ([127.0.0.1]:48998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR9ES-0005l8-2q for submit@debbugs.gnu.org; Thu, 25 Aug 2022 05:33:01 -0400 Received: from outbound.soverin.net ([185.233.34.21]:53735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR9EN-0005kr-PI for 57388@debbugs.gnu.org; Thu, 25 Aug 2022 05:32:58 -0400 Received: from smtp.freedom.nl (c04smtp-lb01.int.sover.in [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 4MCyS05zwKzLh for <57388@debbugs.gnu.org>; Thu, 25 Aug 2022 09:32:48 +0000 (UTC) Received: from smtp.freedom.nl (smtp.freedom.nl [10.10.4.108]) by freedom.nl DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=adriaan.se; s=soverin; t=1661419968; bh=vyjwubjs2EEEynMsyTFtE1M8bgd2wP167FRiU7OR9SQ=; h=From:To:Cc:Subject:Date:From; b=QMLKilF96f+Vjhc/6gij0wHNBsRftAKmOgs/q2Ctd1tcDM57j1J6frtPf3MCBpr2x NIjFuCADhTDwVtl5zT676ADdYWBfiLSUmX0u/gvB6Bp2FseviKVEzD+YV9Wl0A/8s+ tFKHgXYmUUAO5EkR/voM7EqL3OQLuiHogHqExHBHZ3PKWc/Oqvphhl0wbzoKg1bOZR gjIuSzAH7TRITgazBJOyOOxDxRa2flTF2UhdE7eODvZPLnE8fzPIOMpoNOWiq0UAQz 1QVBCQggtXXIsw+NgOH4YAs1820FY1kdKa391sIwDQBAmuuOQIDfRdNeF6QsN3rCrs mvfO6K54g+Gog== From: Arjan Adriaanse To: 57388@debbugs.gnu.org Subject: [PATCH v2] gnu: debops: Update to 3.0.2. Date: Thu, 25 Aug 2022 11:32:24 +0200 Message-Id: <413b037ef4801cbba32994f5fb16a169b7e8a36b.1661419761.git.arjan@adriaan.se> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57388 Cc: Arjan Adriaanse X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is an update of two major versions which renders the old package definition mostly obsolete. The inputs are refactored to only include dependencies defined in setup.py, which are required to run the program and use the included Ansible roles. The other previously defined inputs are optional and only needed when choosing to use a specific method of encrypting secrets. The patch for fixing program paths of those optional dependencies are not needed any more, because they should be available in PATH or can be defined in a config file. There are no scripts that need shebang patching any more, because there is now only a pure Python entry point that is properly handled by the build system. * gnu/packages/patches/debops-constants-for-external-program-names.patch, gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/admin.scm (debops): Update to 3.0.2. [source](patches): Remove. [inputs]: Remove optional dependencies. [propagated-inputs]: Update Python dependencies. [arguments]: Remove custom build phases. --- gnu/local.mk | 2 - gnu/packages/admin.scm | 110 +++---- ...constants-for-external-program-names.patch | 276 ------------------ ...ps-debops-defaults-fall-back-to-less.patch | 45 --- 4 files changed, 36 insertions(+), 397 deletions(-) delete mode 100644 gnu/packages/patches/debops-constants-for-external-program-names.patch delete mode 100644 gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch diff --git a/gnu/local.mk b/gnu/local.mk index 26dfb6afe2..d98178e8b6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1000,8 +1000,6 @@ dist_patch_DATA = \ %D%/packages/patches/dbus-c++-gcc-compat.patch \ %D%/packages/patches/dbus-c++-threading-mutex.patch \ %D%/packages/patches/dbxfs-remove-sentry-sdk.patch \ - %D%/packages/patches/debops-constants-for-external-program-names.patch \ - %D%/packages/patches/debops-debops-defaults-fall-back-to-less.patch \ %D%/packages/patches/dee-vapi.patch \ %D%/packages/patches/desmume-gcc6-fixes.patch \ %D%/packages/patches/desmume-gcc7-fixes.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index a4c5189222..edce512673 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -51,6 +51,7 @@ ;;; Copyright © 2021 Artyom V. Poptsov ;;; Copyright © 2022 Wamm K. D. ;;; Copyright © 2022 Roman Riabenko +;;; Copyright © 2022 Arjan Adriaanse ;;; ;;; This file is part of GNU Guix. ;;; @@ -147,6 +148,7 @@ (define-module (gnu packages admin) #:use-module (gnu packages polkit) #:use-module (gnu packages popt) #:use-module (gnu packages python) + #:use-module (gnu packages python-build) #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) @@ -2841,84 +2843,44 @@ (define-public ansible (define-public debops (package (name "debops") - (version "1.1.0") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/debops/debops") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "052b2dykdn35pdpn9s4prawl6nl6yzih8nyf54hpvhpisvjrm1v5")) - (patches - (search-patches "debops-constants-for-external-program-names.patch" - "debops-debops-defaults-fall-back-to-less.patch")))) + (version "3.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/debops/debops") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "05m9i17hyiz4mm3d1h9zi7j4gid69j08p2yg7zqpaxmby2sbnncf")))) (build-system python-build-system) - (native-inputs - (list git)) - (inputs - (list ansible - encfs - fuse - util-linux ;; for umount - findutils - gnupg - which)) - (propagated-inputs - (list python-future python-distro)) + (native-inputs (list git)) + (propagated-inputs (list python-distro + python-future + python-jinja2 + python-pyyaml + python-pyxdg + python-toml + python-dotenv + ansible + python-netaddr + python-passlib + python-ldap + python-dnspython + python-pyopenssl)) (arguments - `(#:tests? #f - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'nuke-debops-update - (lambda _ - (chmod "bin/debops-update" #o755) ; FIXME work-around git-fetch issue - (with-output-to-file "bin/debops-update" - (lambda () - (format #t "#!/bin/sh -echo 'debops is installed via guix. guix-update is useless in this case. -Please use `guix package -u debops` instead.'"))) - #t)) - ;; patch shebangs only in actuall scripts, not in files included in - ;; roles (which are to be delivered to the targte systems) - (delete `patch-generated-file-shebangs) - (replace 'patch-source-shebangs - (lambda _ - (for-each patch-shebang - (find-files "bin" - (lambda (file stat) - ;; Filter out symlinks. - (eq? 'regular (stat:type stat))) - #:stat lstat)))) - (add-after 'unpack 'fix-paths - (lambda _ - (define (substitute-program-names file) - ;; e.g. ANSIBLE_PLAYBOOK = '/gnu/store/…/bin/ansible-playbook' - (for-each - (lambda (name) - (let ((varname (string-upcase - (string-map - (lambda (c) (if (char=? c #\-) #\_ c)) - name)))) - (substitute* file - (((string-append "^(" varname " = )'.*'") line prefix) - (string-append prefix "'" (which name) "'"))))) - '("ansible-playbook" "encfs" "find" "fusermount" - "umount" "gpg" "ansible" "which"))) - (for-each substitute-program-names - '("bin/debops" - "bin/debops-padlock" - "bin/debops-task" - "debops/__init__.py" - "debops/cmds/__init__.py")) - #t))))) + `(#:phases (modify-phases %standard-phases + ;; Patching shebangs breaks scripts that are meant to be + ;; deployed to other systems and there are no scripts that + ;; do need patching. + (delete 'patch-source-shebangs) + (delete 'patch-generated-file-shebangs)))) (home-page "https://www.debops.org/") (synopsis "Collection of general-purpose Ansible roles") - (description "The Ansible roles provided by that can be used to manage -Debian or Ubuntu hosts. In addition, a default set of Ansible playbooks can -be used to apply the provided roles in a controlled way, using Ansible -inventory groups. + (description + "The Ansible roles provided by that can be used to manage Debian or +Ubuntu hosts. In addition, a default set of Ansible playbooks can be used to +apply the provided roles in a controlled way, using Ansible inventory groups. The roles are written with a high customization in mind, which can be done using Ansible inventory. This way the role and playbook code can be shared diff --git a/gnu/packages/patches/debops-constants-for-external-program-names.patch b/gnu/packages/patches/debops-constants-for-external-program-names.patch deleted file mode 100644 index b3b34ed323..0000000000 --- a/gnu/packages/patches/debops-constants-for-external-program-names.patch +++ /dev/null @@ -1,276 +0,0 @@ -From 78d5cddafebb28e2e54efeb781495b5607ddb356 Mon Sep 17 00:00:00 2001 -From: Hartmut Goebel -Date: Thu, 8 Aug 2019 15:19:48 +0200 -Subject: [PATCH] Scripts: Use constants for external program names. - -This makes it much, much easier to replace the program -with one using an absolute path. This is necessary for -e.g. Guix to keep references to these external programs. ---- - bin/debops | 10 +++++++--- - bin/debops-padlock | 21 +++++++++++++++------ - bin/debops-task | 7 +++++-- - bin/debops-update | 18 +++++++++++------- - debops/__init__.py | 17 ++++++++++++----- - debops/cmds/__init__.py | 6 +++++- - 6 files changed, 55 insertions(+), 24 deletions(-) - -diff --git a/bin/debops b/bin/debops -index 2b7ad3f88..caaeb892f 100755 ---- a/bin/debops -+++ b/bin/debops -@@ -59,6 +59,10 @@ ConfigFileHeader = """\ - # You can manipulate the contents of this file via `.debops.cfg`. - """ - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+ANSIBLE_PLAYBOOK = 'ansible-playbook' -+ - - def write_config(filename, config): - cfgparser = configparser.ConfigParser() -@@ -131,7 +135,7 @@ def gen_ansible_cfg(filename, config, project_root, playbooks_path, - os.path.join(playbooks_path, "roles"), - "/etc/ansible/roles"))) - -- ansible_version_out = subprocess.check_output(["ansible-playbook", -+ ansible_version_out = subprocess.check_output([ANSIBLE_PLAYBOOK, - "--version"]).decode() - - # Get first line and split by spaces to get second 'word'. -@@ -197,7 +201,7 @@ def main(cmd_args): - playbooks_path = '/nonexistent' - - # Make sure required commands are present -- require_commands('ansible-playbook') -+ require_commands(ANSIBLE_PLAYBOOK) - - # Check if user specified a potential playbook name as the first - # argument. If yes, use it as the playbook name and remove it from -@@ -256,7 +260,7 @@ def main(cmd_args): - print("Running Ansible playbooks:") - for element in play_list: - print(element) -- return subprocess.call(['ansible-playbook'] + play_list + arg_list) -+ return subprocess.call([ANSIBLE_PLAYBOOK] + play_list + arg_list) - finally: - if revert_unlock: - padlock_lock(encfs_encrypted) -diff --git a/bin/debops-padlock b/bin/debops-padlock -index bfdfb8e06..2a97716cd 100755 ---- a/bin/debops-padlock -+++ b/bin/debops-padlock -@@ -67,6 +67,14 @@ devrandom = os.environ.get('DEVRANDOM', "/dev/urandom") - - SCRIPT_FILENAME = 'padlock-script' - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+ENCFS = 'encfs' -+FIND = 'find' -+FUSERMOUNT = 'fusermount' -+UMOUNT = 'umount' -+GPG = 'gpg' -+ - # ---- DebOps environment setup ---- - - -@@ -80,9 +88,9 @@ def main(subcommand_func, **kwargs): - # Make sure required commands are present - # OS X compatibility - if sys.platform == 'darwin': -- require_commands('encfs', 'find', 'umount', 'gpg') -+ require_commands(ENCFS, FIND, UMOUNT, GPG) - else: -- require_commands('encfs', 'find', 'fusermount', 'gpg') -+ require_commands(ENCFS, FIND, FUSERMOUNT, GPG) - - inventory_path = find_inventorypath(project_root, required=False) - # If inventory hasn't been found automatically, assume it's the default -@@ -121,7 +129,7 @@ def init(encfs_decrypted, encfs_encrypted, recipients): - # Generate a random password and encrypt it with GPG keys of recipients. - print("Generating a random", ENCFS_KEYFILE_LENGTH, "char password") - pwd = gen_pwd() -- gpg = subprocess.Popen(['gpg', '--encrypt', '--armor', -+ gpg = subprocess.Popen([GPG, '--encrypt', '--armor', - '--output', encfs_keyfile] + recipients, - stdin=subprocess.PIPE) - gpg.communicate(pwd.encode('utf-8')) -@@ -133,9 +141,10 @@ def init(encfs_decrypted, encfs_encrypted, recipients): - # NB2: We can not use padlock_unlock here, because the config file - # does not yet exist. - encfs = subprocess.Popen([ -- 'encfs', encfs_encrypted, encfs_decrypted, -+ ENCFS, encfs_encrypted, encfs_decrypted, - '--extpass', -- 'gpg --decrypt --no-mdc-warning --output - '+shquote(encfs_keyfile)], -+ GPG + ' --decrypt --no-mdc-warning --output - ' -+ + shquote(encfs_keyfile)], - stdin=subprocess.PIPE) - encfs.communicate(('p\n'+pwd).encode('utf-8')) - -@@ -154,7 +163,7 @@ def init(encfs_decrypted, encfs_encrypted, recipients): - - # Protect the EncFS configuration file by also encrypting it with - # the GPG keys of recipients. -- subprocess.call(['gpg', '--encrypt', '--armor', -+ subprocess.call([GPG, '--encrypt', '--armor', - '--output', encfs_configfile+'.asc'] - + recipients + [encfs_configfile]) - os.remove(encfs_configfile) -diff --git a/bin/debops-task b/bin/debops-task -index 223e5f834..dc31ad4e6 100755 ---- a/bin/debops-task -+++ b/bin/debops-task -@@ -49,11 +49,14 @@ project_root = find_debops_project(required=True) - # todo: need to decide on semantics! - # config = read_config(project_root) - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+ANSIBLE = 'ansible' - - # ---- Main script ---- - - # Make sure required commands are present --require_commands('ansible') -+require_commands(ANSIBLE) - - ansible_inventory = find_inventorypath(project_root) - -@@ -71,5 +74,5 @@ if INSECURE: - os.environ['ANSIBLE_HOST_KEY_CHECKING'] = 'False' - - # Run ansible with custom environment --cmd = ['ansible'] + module + sys.argv[1:] -+cmd = [ANSIBLE] + module + sys.argv[1:] - subprocess.call(cmd) -diff --git a/bin/debops-update b/bin/debops-update -index 88c5e2c82..cc7e57cb0 100755 ---- a/bin/debops-update -+++ b/bin/debops-update -@@ -90,6 +90,10 @@ GALAXY_REQUIREMENTS = "galaxy/requirements.txt" - # Default Ansible Galaxy user account name - GALAXY_ACCOUNT = "debops" - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+GIT = 'git' -+ - - # ---- Functions ---- - -@@ -137,7 +141,7 @@ def clone_git_repository(repo_uri, branch, destination, dry_run=False): - if dry_run: - print("Cloning '%s' to %s..." % (repo_uri, destination)) - else: -- subprocess.call(['git', 'clone', '--quiet', '--branch', branch, -+ subprocess.call([GIT, 'clone', '--quiet', '--branch', branch, - repo_uri, destination]) - - -@@ -152,22 +156,22 @@ def update_git_repository(path, dry_run=False, remote_uri=False): - os.chdir(path) - - if dry_run: -- subprocess.call(['git', 'fetch']) -- subprocess.call(['git', 'diff', 'HEAD', 'origin', '--stat']) -+ subprocess.call([GIT, 'fetch']) -+ subprocess.call([GIT, 'diff', 'HEAD', 'origin', '--stat']) - else: - # Get the current sha of the head branch - current_sha = subprocess.check_output( -- ['git', 'rev-parse', 'HEAD']).strip() -+ [GIT, 'rev-parse', 'HEAD']).strip() - - # Fetch it silently and store the new sha -- subprocess.call(['git', 'fetch', '--quiet']) -+ subprocess.call([GIT, 'fetch', '--quiet']) - fetch_sha = subprocess.check_output( -- ['git', 'rev-parse', 'FETCH_HEAD']).strip() -+ [GIT, 'rev-parse', 'FETCH_HEAD']).strip() - - if current_sha != fetch_sha: - print() - print('--') -- subprocess.call(['git', 'merge', fetch_sha]) -+ subprocess.call([GIT, 'merge', fetch_sha]) - - if remote_uri: - compare_uri = (remote_uri + '/compare/' + current_sha[:7] -diff --git a/debops/__init__.py b/debops/__init__.py -index 1c2cedcb0..da8430e41 100644 ---- a/debops/__init__.py -+++ b/debops/__init__.py -@@ -93,6 +93,13 @@ ENCFS_KEYFILE = ".encfs6.keyfile" - # Length of the random EncFS password stored in encrypted keyfile - ENCFS_KEYFILE_LENGTH = 256 - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+ENCFS = 'encfs' -+FUSERMOUNT = 'fusermount' -+UMOUNT = 'umount' -+GPG = 'gpg' -+ - - # ---- Functions ---- - -@@ -180,9 +187,9 @@ def padlock_lock(encrypted_path): - return False - # OS X compatibility - if sys.platform == 'darwin': -- subprocess.call(['umount', decrypted_path]) -+ subprocess.call([UMOUNT, decrypted_path]) - else: -- subprocess.call(['fusermount', '-u', decrypted_path]) -+ subprocess.call([FUSERMOUNT, '-u', decrypted_path]) - return True - - -@@ -237,14 +244,14 @@ def padlock_unlock(encrypted_path): - # Start encfs. It will wait for input on the `configfile` named - # pipe. - encfs = subprocess.Popen([ -- 'encfs', encrypted_path, decrypted_path, -+ ENCFS, encrypted_path, decrypted_path, - '--extpass', -- 'gpg --decrypt --no-mdc-warning --output - %s' % shquote(keyfile)]) -+ GPG + ' --decrypt --no-mdc-warning --output - %s' % shquote(keyfile)]) - # now decrypt the config and write it into the named pipe - with open(configfile, 'w') as fh: - # NB: gpg must write to stdout to avoid it is asking whether - # the file should be overwritten -- subprocess.Popen(['gpg', -+ subprocess.Popen([GPG, - '--decrypt', '--no-mdc-warning', '--output', '-', - crypted_configfile], stdout=fh).wait() - encfs.wait() -diff --git a/debops/cmds/__init__.py b/debops/cmds/__init__.py -index b221fa191..9fabf43a5 100644 ---- a/debops/cmds/__init__.py -+++ b/debops/cmds/__init__.py -@@ -55,6 +55,10 @@ SCRIPT_NAME = os.path.basename(sys.argv[0]) - # command line) - INSECURE = bool(os.environ.get('INSECURE', False)) - -+# External programms used. List here for easy substitution for -+# hard-coded paths. -+WHICH = 'which' -+ - - def error_msg(message, severity="Error"): - """ -@@ -70,7 +74,7 @@ def require_commands(*cmd_names): - Check if required commands exist. - """ - def command_exists(cmd_name): -- which = "where" if platform.system() == "Windows" else "which" -+ which = "where" if platform.system() == "Windows" else WHICH - return not subprocess.call([which, cmd_name], - stdout=DEVNULL, stderr=subprocess.STDOUT) - --- -2.21.0 - diff --git a/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch b/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch deleted file mode 100644 index bbb6b7c08e..0000000000 --- a/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch +++ /dev/null @@ -1,45 +0,0 @@ -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 - base-commit: d769cf81d83d75400e5ed0394b839d8ddb770384 -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 18 15:55:14 2025 Received: (at 57388-done) by debbugs.gnu.org; 18 Mar 2025 19:55:14 +0000 Received: from localhost ([127.0.0.1]:43383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tud1t-0003KM-W0 for submit@debbugs.gnu.org; Tue, 18 Mar 2025 15:55:14 -0400 Received: from msg-1.mailo.com ([213.182.54.11]:33990 helo=mailo.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tud1q-0003F8-6J for 57388-done@debbugs.gnu.org; Tue, 18 Mar 2025 15:55:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nicolasgoaziou.fr; s=mailo; t=1742327703; bh=ZjA7bqHvu98AT5h2zmkrzUk4A9c0p/YGA/pZzatEf58=; h=X-EA-Auth:From:To:Subject:In-Reply-To:Date:Message-ID: MIME-Version:Content-Type; b=Ifm52AYC1Q4+jd2BJdJrY46CnigVGX7RsTRmOeogticOyrOMl0Vbuny6NkzdzhBox sErwkYPu6AVwKY89p4j34uttXuY5f0kSXigVagDjSzt+D0ROgkJVZnjATlk2e+NxHp ZfrKyDw8dYuYa59uWGbO4c7x0eP6HjGvDc0/EZsk= Received: by b221-8.in.mailobj.net [192.168.90.28] with ESMTP via ip-20.mailobj.net [213.182.54.20] Tue, 18 Mar 2025 20:55:03 +0100 (CET) X-EA-Auth: GxGAW88pgZvhes/nJ/KMiDCcn35yteo2NIfwMMLH0Uwg55d+fQapKifDnBUckNliJC7gtR0fmgoYVL/rTAmazWM6SJKTJyRgh8tEipWQSjM= From: Nicolas Goaziou To: 57388-done@debbugs.gnu.org Subject: Re: [PATCH] gnu: debops: Update to 3.0.2. In-Reply-To: <413b037ef4801cbba32994f5fb16a169b7e8a36b.1661419761.git.arjan@adriaan.se> Date: Tue, 18 Mar 2025 20:54:46 +0100 Message-ID: <87msdiktbt.fsf@nicolasgoaziou.fr> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57388-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, > This is an update of two major versions which renders the old package > definition mostly obsolete. The inputs are refactored to only include > dependencies defined in setup.py, which are required to run the program and > use the included Ansible roles. The other previously defined inputs are > optional and only needed when choosing to use a specific method of encrypting > secrets. The patch for fixing program paths of those optional dependencies > are not needed any more, because they should be available in PATH or can be > defined in a config file. There are no scripts that need shebang patching any > more, because there is now only a pure Python entry point that is properly > handled by the build system. > > * gnu/packages/patches/debops-constants-for-external-program-names.patch, > gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch: Delete > files. > * gnu/local.mk (dist_patch_DATA): Adjust accordingly. > * gnu/packages/admin.scm (debops): Update to 3.0.2. Closing as the package is already at a higher version in Guix. From unknown Sun Aug 10 07:38:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 16 Apr 2025 11:24:22 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator