Skip to content

Commit

Permalink
trivial: use SNAP_COMMON instead of SNAP_USER_DATA
Browse files Browse the repository at this point in the history
This mirrors changes in fwupd/fwupd#6701
  • Loading branch information
superm1 committed Jan 22, 2024
1 parent 57796d6 commit 4a56baa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions debian/fwupd-snap.postinst
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#!/bin/sh -e

if [ ! -d /root/snap/fwupd ]; then
if [ ! -d /var/snap/fwupd/common/var/etc/fwupd ]; then
MIGRATE=1
fi

# this will build the initial /root/snap/fwupd/current symlink
# this will build the initial /var/snap/fwupd/common directory structure
systemctl start snap.fwupd.fwupd.service

# 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/
mkdir -p /var/snap/fwupd/common/var/etc/fwupd
cp /etc/fwupd/fwupd.conf /var/snap/fwupd/common/var/etc/fwupd
fi
if [ -d /etc/fwupd/remotes.d ]; then
cp /etc/fwupd/remotes.d/* /root/snap/fwupd/current/etc/fwupd/remotes.d/
mkdir -p /var/snap/fwupd/common/var/lib/fwupd/remotes.d
cp /etc/fwupd/remotes.d/* /var/snap/fwupd/common/var/lib/fwupd/remotes.d
fi
fi

Expand Down

0 comments on commit 4a56baa

Please sign in to comment.