From 2457ff04eca99062ce08ad85afcd76ec619d34c3 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Wed, 17 Jan 2024 08:38:05 -0600 Subject: [PATCH] trivial: only run migration process one time --- debian/fwupd-snap.postinst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/fwupd-snap.postinst b/debian/fwupd-snap.postinst index 6372d9c..1c371c8 100644 --- a/debian/fwupd-snap.postinst +++ b/debian/fwupd-snap.postinst @@ -1,9 +1,14 @@ #!/bin/sh -e +if [ ! -d /root/snap/fwupd ]; then + MIGRATE=1 +fi + # this will build the initial /root/snap/fwupd/current symlink systemctl start snap.fwupd.fwupd.service -if [ "$1" = "configure" ]; then +# only migrate the first install of snap +if [ "$1" = "configure" ] && [ -n $MIGRATE ]; then mkdir -p /root/snap/fwupd/current/etc/fwupd/remotes.d if [ -f /etc/fwupd/fwupd.conf ]; then cp /etc/fwupd/fwupd.conf /root/snap/fwupd/current/etc/fwupd/