From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id +P37NcI5FGdH7gAA62LTzQ:P1 (envelope-from ) for ; Sat, 19 Oct 2024 22:59:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id +P37NcI5FGdH7gAA62LTzQ (envelope-from ) for ; Sun, 20 Oct 2024 00:59:15 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=MBBdmm1c; dkim=fail ("headers rsa verify failed") header.d=ngraves.fr header.s=ovhmo4487190-selector1 header.b=JK5w8wOQ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1729378754; a=rsa-sha256; cv=none; b=nITV+WVavOkfq3OfGWapmeYQAi5YexQtuH5oFf/9hsouq1pFunaut3RD3RaHit1HJtOv/k 5sdVxiOHxYAZDEMQORN6GG15GXs9lFbcaL545Mw3+rpDv2CH64eSaN3Xu3STDelC2l4fI1 aaabghu38DTiZU5BCaPER0PR9hzjNbARvBEs1EL/tr9qud+SdgVdhayMxcR6cF6tiAVhV8 2hQa2eEcoOx3NpzB1JnDzZVZjtXmWtn+6fJqu6L1Uoc2Q0+b6Ol/H6ah3osFTQU+0rFOc1 Izm9nSitEa2SoGVYKhD51935rHEz3kViLTgpa5SeUMQWXGbMAX0WjSFpGnKydA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=MBBdmm1c; dkim=fail ("headers rsa verify failed") header.d=ngraves.fr header.s=ovhmo4487190-selector1 header.b=JK5w8wOQ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1729378754; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=4LDCXMdsaCu9BNry6O0r9xymf+ou9EphHskt+6vFxkc=; b=B0NGPaQAFLlL6e9s48g8yIZQOeWVykVt9gpJsx1BFs6eFquViD6cEZHVcTmQu7f/xljYEl I5M/ShFqY1v7Tb40yDd7XciK9+rs2fBLAQZeSDioREMZA9ovoqFHHcK+UHNb8/t6mClno+ mUTN+nN9VRRFUwKj+8rgqAfFR0rf7HSaz3Uz/xRMfd2qlqVR8OLKCF/6rHbQzik6bt6MuN 3ibV9BX2N3bpcyrHjefj+pRrNFSNjLUij51HMubEW5D8xBolXQ4muHNnD2WYtfxdbVlapP jk0ZAsXkkr40Y5sb65PhBOVS4H6244fStwXpO5TUMbLyTG8JGXV7svZ5j98BkQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AA86F37EB0 for ; Sun, 20 Oct 2024 00:59:13 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2IPB-0003d0-MQ; Sat, 19 Oct 2024 18:58:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2IP9-0003ce-B0 for guix-patches@gnu.org; Sat, 19 Oct 2024 18:58:39 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t2IP9-0000S7-1S for guix-patches@gnu.org; Sat, 19 Oct 2024 18:58:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=4LDCXMdsaCu9BNry6O0r9xymf+ou9EphHskt+6vFxkc=; b=MBBdmm1cbbGGEt+J6aYxuSuxZ4S1FbGbhtcbDGRhxcHK/smfTQmsYbKLW0rMgQWKaeTdhTjqzK3YmDDGmyqbLkwwRXqOuIZlo7fzRLdny2/r/OUd4GRammMOC/ESdC0I8RzIFanr/DShBUWCT5EkYuKFfNXSN2JGrQCVUPEF6/EQQH6EMMnihrC8MXNXF23JXEMm97VPxMCgtctm8PQHxEYQnq4y8v9zBu1nuumekSQ14290AEzVMiuI75vmo+JaNPEorTtnJryMH3/Bo6bmHiBJrtej2j1dOPVk8jOiawWZ/jgZ/UV3uO6NJf2PMCupwpwAEw2mfQbPnp4I18KH+g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t2IPW-000147-Af for guix-patches@gnu.org; Sat, 19 Oct 2024 18:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73892] [PATCH] gnu: debops: Update to 3.2.2. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 19 Oct 2024 22:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73892 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73892@debbugs.gnu.org Cc: Nicolas Graves X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17293787144041 (code B ref -1); Sat, 19 Oct 2024 22:59:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Oct 2024 22:58:34 +0000 Received: from localhost ([127.0.0.1]:45062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2IP2-000134-Sb for submit@debbugs.gnu.org; Sat, 19 Oct 2024 18:58:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:35774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2IOz-00012v-DF for submit@debbugs.gnu.org; Sat, 19 Oct 2024 18:58:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2IOa-0003aC-N7 for guix-patches@gnu.org; Sat, 19 Oct 2024 18:58:04 -0400 Received: from 6.mo560.mail-out.ovh.net ([87.98.165.38]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2IOW-0000QU-0p for guix-patches@gnu.org; Sat, 19 Oct 2024 18:58:04 -0400 Received: from director11.ghost.mail-out.ovh.net (unknown [10.109.148.34]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 4XWH633PL2z1Zdh for ; Sat, 19 Oct 2024 22:57:47 +0000 (UTC) Received: from ghost-submission-5b5ff79f4f-gfxm6 (unknown [10.110.168.217]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id A91531FD9C; Sat, 19 Oct 2024 22:57:46 +0000 (UTC) Received: from ngraves.fr ([37.59.142.97]) by ghost-submission-5b5ff79f4f-gfxm6 with ESMTPSA id F7oQDWo5FGfbCwQAozXF8w (envelope-from ); Sat, 19 Oct 2024 22:57:46 +0000 X-OVh-ClientIp: 90.110.172.34 Date: Sun, 20 Oct 2024 00:57:33 +0200 Message-ID: <20241019225744.26601-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 4137400683268399842 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddrvdehiedgudeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpedvgefhteduhfeulefgleefveehtdeftdffueetvefhieehffefgeeuveduiedtkeenucffohhmrghinhepuggvsghophhsrdhorhhgnecukfhppeduvdejrddtrddtrddupdeltddruddutddrudejvddrfeegpdefjedrheelrddugedvrdeljeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepghhuihigqdhprghttghhvghssehgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedtpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=4LDCXMdsaCu9BNry6O0r9xymf+ou9EphHskt+6vFxkc=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1729378667; v=1; b=JK5w8wOQSM8Nzbtw3/iHWMvMQR7xTjuiLNR5s/LY+yUt/veO//ugIdl9zP3Txmjp5FKictK7 ZMudxwVLHru4aDBgPNKBMZbidIVmyePP1ssF9sZl9t/5lcQ6ad3cCT2YVD08zO72xOyX1MyR01v EXmp+k5BGTl2CZ+tluQL/jXwc1omV4kiRfgbMZtAlp4q0XqCKUXg9UXZNST5htca2PM7b1N66v1 l4yxQ/1Wnxe+2VUbjUk3uULcGuQlmvh/TCkse/itpl219cgrdLmUBxGEUgnxVsJoI2vPbsJ4CU7 HavPPxT37TywLqdJlvKfV/xX1WXQhX73QNUPbAfaK0ffg== Received-SPF: pass client-ip=87.98.165.38; envelope-from=ngraves@ngraves.fr; helo=6.mo560.mail-out.ovh.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches From: Nicolas Graves via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.57 X-Spam-Score: -3.57 X-Migadu-Queue-Id: AA86F37EB0 X-Migadu-Scanner: mx10.migadu.com X-TUID: p3qGs0ptWzdz * gnu/packages/patches/debops-constants-for-external-program-names.patch and gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch: Remove patches. * gnu/packages/patches/debops-setup-py-avoid-git.patch: Add patch. * gnu/local.mk: Adjust patches. * gnu/packages/admin.scm (debops): Update to 3.2.2. [source]: Adjust patches. [build-system]: Switch to pyproject-build-system. [native-inputs]: Remove git. [inputs]: Add git, git-crypt. [propagated-inputs]: Reorder. Add python-dotenv, python-future, python-gitpython, python-jinja2, python-pyyaml, python-pyxdg, python-toml. [arguments]<#:tests?>: Unset (although no tests in source). <#:phases>: Remove all existing modifications. Add 'wrap-script phase. <#:modules>: Add for <#phases>. --- gnu/local.mk | 3 +- gnu/packages/admin.scm | 83 ++---- ...constants-for-external-program-names.patch | 276 ------------------ ...ps-debops-defaults-fall-back-to-less.patch | 45 --- .../patches/debops-setup-py-avoid-git.patch | 38 +++ 5 files changed, 69 insertions(+), 376 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 create mode 100644 gnu/packages/patches/debops-setup-py-avoid-git.patch diff --git a/gnu/local.mk b/gnu/local.mk index 89a795bfbd..911af88627 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1135,8 +1135,7 @@ dist_patch_DATA = \ %D%/packages/patches/dbus-c++-threading-mutex.patch \ %D%/packages/patches/dbxfs-remove-sentry-sdk.patch \ %D%/packages/patches/ddd-build.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/debops-setup-py-avoid-git.patch \ %D%/packages/patches/dee-vapi.patch \ %D%/packages/patches/dfu-programmer-fix-libusb.patch \ %D%/packages/patches/directfb-davinci-glibc-228-compat.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 2cb50ed4a8..ac2703556a 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -3048,7 +3048,7 @@ (define-public ansible (define-public debops (package (name "debops") - (version "1.1.0") + (version "3.2.2") (source (origin (method git-fetch) @@ -3057,69 +3057,46 @@ (define-public debops (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "052b2dykdn35pdpn9s4prawl6nl6yzih8nyf54hpvhpisvjrm1v5")) + (base32 "03d94bzljnw65f1ra7bxsl8q2l6g8gxcy8kqhm69ib08j50qa0h6")) (patches - (search-patches "debops-constants-for-external-program-names.patch" - "debops-debops-defaults-fall-back-to-less.patch")))) - (build-system python-build-system) - (native-inputs - (list git)) + (search-patches "debops-setup-py-avoid-git.patch")))) + (build-system pyproject-build-system) (inputs (list ansible encfs fuse-2 util-linux ;; for umount findutils + git + git-crypt gnupg which)) (propagated-inputs - (list python-future python-distro)) + (list python-distro + python-dotenv + python-future + python-gitpython + python-jinja2 + python-pyyaml + python-pyxdg + python-toml)) (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))))) + (list + #:modules '((guix build pyproject-build-system) + (guix build utils) + (srfi srfi-26)) + #:phases #~(modify-phases %standard-phases + (add-after 'sanity-check 'wrap-script + (lambda* (#:key inputs #:allow-other-keys) + (wrap-program (string-append #$output "/bin/debops") + `("PATH" ":" prefix + ,(map dirname + (map (cut search-input-file inputs <>) + (list "bin/ansible" + "bin/gpg" + "bin/git" + "bin/git-crypt" + "bin/umount")))))))))) (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 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 - diff --git a/gnu/packages/patches/debops-setup-py-avoid-git.patch b/gnu/packages/patches/debops-setup-py-avoid-git.patch new file mode 100644 index 0000000000..7586e661db --- /dev/null +++ b/gnu/packages/patches/debops-setup-py-avoid-git.patch @@ -0,0 +1,38 @@ +From a6219db1c473f862a2dddbdef9593d8a57dfc9ae Mon Sep 17 00:00:00 2001 +From: Nicolas Graves +Date: Sat, 19 Oct 2024 19:49:30 +0200 +Subject: [PATCH] setup: Don't rely on git to set the version. + +--- + setup.py | 15 +-------------- + 1 file changed, 1 insertion(+), 14 deletions(-) + +diff --git a/setup.py b/setup.py +index 0fc4555a4..98e4bffac 100755 +--- a/setup.py ++++ b/setup.py +@@ -48,20 +48,7 @@ except NameError: + return s + return s and s.decode('utf-8') or None + +-# Retrieve the project version from 'git describe' command and store it in the +-# __version__.py and VERSION files, needed for correct installation of the +-# Python package +-try: +- with open(os.devnull, 'w') as devnull: +- GIT_RELEASE = subprocess.check_output( +- ['git', 'describe'], stderr=devnull +- ).strip().lstrip(b'v').decode('utf-8').split('-') +- if len(GIT_RELEASE) > 1: +- RELEASE = (GIT_RELEASE[0] + '.dev' + GIT_RELEASE[1] +- + '+' + GIT_RELEASE[2]) +- else: +- RELEASE = GIT_RELEASE[0] +-except subprocess.CalledProcessError: ++if True: + try: + RELEASE = open('VERSION').read().strip() + except Exception: +-- +2.46.0 + -- 2.46.0