cups: for now cups make a backup on uninstall

Message ID 20220428142416.23557-1-daniel.weismueller@ipfire.org
State Accepted
Commit 2a14689ba86fa0acc222c6bffdb911d674ce34f8
Headers
Series cups: for now cups make a backup on uninstall |

Commit Message

Daniel Weismueller April 28, 2022, 2:24 p.m. UTC
  and a restore on install / update

The include file that was added in a previous commit allowed to manually
create a backup, but none was created when the addon was installed,
uninstalled or updated.

Signed-off-by: Daniel Weismueller <daniel.weismueller@ipfire.org>
---
 src/paks/cups/install.sh   | 1 +
 src/paks/cups/uninstall.sh | 1 +
 2 files changed, 2 insertions(+)
  

Comments

Adolf Belka May 1, 2022, 4:56 p.m. UTC | #1
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>

On 28/04/2022 16:24, Daniel Weismueller wrote:
> and a restore on install / update
>
> The include file that was added in a previous commit allowed to manually
> create a backup, but none was created when the addon was installed,
> uninstalled or updated.
>
> Signed-off-by: Daniel Weismueller <daniel.weismueller@ipfire.org>
> ---
>   src/paks/cups/install.sh   | 1 +
>   src/paks/cups/uninstall.sh | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/src/paks/cups/install.sh b/src/paks/cups/install.sh
> index b3f0f1368..cc5866971 100644
> --- a/src/paks/cups/install.sh
> +++ b/src/paks/cups/install.sh
> @@ -23,6 +23,7 @@
>   #
>   . /opt/pakfire/lib/functions.sh
>   extract_files
> +restore_backup "${NAME}"
>   /etc/init.d/messagebus reload
>   start_service --delay 300 --background ${NAME}
>   ln -svf ../init.d/cups /etc/rc.d/rc0.d/K00cups
> diff --git a/src/paks/cups/uninstall.sh b/src/paks/cups/uninstall.sh
> index 01b13de76..d4abdde63 100644
> --- a/src/paks/cups/uninstall.sh
> +++ b/src/paks/cups/uninstall.sh
> @@ -23,6 +23,7 @@
>   #
>   . /opt/pakfire/lib/functions.sh
>   stop_service ${NAME}
> +make_backup "${NAME}"
>   remove_files
>   rm -rf /etc/rc.d/rc*.d/*cups
>   /etc/init.d/messagebus reload
  

Patch

diff --git a/src/paks/cups/install.sh b/src/paks/cups/install.sh
index b3f0f1368..cc5866971 100644
--- a/src/paks/cups/install.sh
+++ b/src/paks/cups/install.sh
@@ -23,6 +23,7 @@ 
 #
 . /opt/pakfire/lib/functions.sh
 extract_files
+restore_backup "${NAME}"
 /etc/init.d/messagebus reload
 start_service --delay 300 --background ${NAME}
 ln -svf ../init.d/cups /etc/rc.d/rc0.d/K00cups
diff --git a/src/paks/cups/uninstall.sh b/src/paks/cups/uninstall.sh
index 01b13de76..d4abdde63 100644
--- a/src/paks/cups/uninstall.sh
+++ b/src/paks/cups/uninstall.sh
@@ -23,6 +23,7 @@ 
 #
 . /opt/pakfire/lib/functions.sh
 stop_service ${NAME}
+make_backup "${NAME}"
 remove_files
 rm -rf /etc/rc.d/rc*.d/*cups
 /etc/init.d/messagebus reload