public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 proxmox-ve] apt hook: disable on remove
@ 2024-04-16 12:32 Fabian Grünbichler
  2024-04-16 15:03 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Grünbichler @ 2024-04-16 12:32 UTC (permalink / raw)
  To: pve-devel

and (re-)enable on install. adapted from apt-listbugs/apt-listchanges, which
solve the issue of removing (instead of purging) the conffile and hook binary
providing package in the same fashion.

Suggested-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
---
v2:
- add addition file existence check in remove case
- add missing trailer(s)

 debian/proxmox-ve.postrm  | 35 +++++++++++++++++++++++++++++++++++
 debian/proxmox-ve.preinst | 13 +++++++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 debian/proxmox-ve.postrm
 create mode 100644 debian/proxmox-ve.preinst

diff --git a/debian/proxmox-ve.postrm b/debian/proxmox-ve.postrm
new file mode 100644
index 0000000..cebd343
--- /dev/null
+++ b/debian/proxmox-ve.postrm
@@ -0,0 +1,35 @@
+#! /bin/sh
+set -e
+
+hook=/etc/apt/apt.conf.d/10pveapthook
+
+case "$1" in
+    purge)
+        rm -f $hook.disabled
+        ;;
+
+    remove)
+        if test -f $hook; then
+            mv $hook $hook.disabled
+        fi
+        ;;
+
+    abort-install)
+        if test "x$2" != "x" && test -f $hook
+        then
+            mv $hook $hook.disabled
+        fi
+        ;;
+
+    upgrade|failed-upgrade|abort-upgrade|disappear)
+        ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/proxmox-ve.preinst b/debian/proxmox-ve.preinst
new file mode 100644
index 0000000..e190c3d
--- /dev/null
+++ b/debian/proxmox-ve.preinst
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+hook=/etc/apt/apt.conf.d/10pveapthook
+if test -f $hook.disabled
+then
+    mv $hook.disabled $hook
+fi
+
+#DEBHELPER#
+
+exit 0
-- 
2.39.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH v2 proxmox-ve] apt hook: disable on remove
  2024-04-16 12:32 [pve-devel] [PATCH v2 proxmox-ve] apt hook: disable on remove Fabian Grünbichler
@ 2024-04-16 15:03 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2024-04-16 15:03 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Grünbichler

Am 16/04/2024 um 14:32 schrieb Fabian Grünbichler:
> and (re-)enable on install. adapted from apt-listbugs/apt-listchanges, which
> solve the issue of removing (instead of purging) the conffile and hook binary
> providing package in the same fashion.
> 
> Suggested-by: Fiona Ebner <f.ebner@proxmox.com>
> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> v2:
> - add addition file existence check in remove case
> - add missing trailer(s)
> 
>  debian/proxmox-ve.postrm  | 35 +++++++++++++++++++++++++++++++++++
>  debian/proxmox-ve.preinst | 13 +++++++++++++
>  2 files changed, 48 insertions(+)
>  create mode 100644 debian/proxmox-ve.postrm
>  create mode 100644 debian/proxmox-ve.preinst
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-16 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-16 12:32 [pve-devel] [PATCH v2 proxmox-ve] apt hook: disable on remove Fabian Grünbichler
2024-04-16 15:03 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal