Skip to content

Commit

Permalink
remove the snapd dirs last (should fix error on ppc64el)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvo5 committed Jan 10, 2017
1 parent 22f4c6e commit 4aacdf8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion debian/snapd.postrm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if [ "$1" = "purge" ]; then
rm -rf "/var/snap/$snap/common"
rm -f "/var/snap/$snap/current"
# opportunistic remove (may fail if there are still revisions left
for d in "/snap/bin" "/snap/$snap" "/var/snap/$snap" "/snap" "/var/snap"; do
for d in "/snap/$snap" "/var/snap/$snap"; do
if [ -d "$d" ]; then
rmdir --ignore-fail-on-non-empty $d
fi
Expand All @@ -53,6 +53,13 @@ if [ "$1" = "purge" ]; then
rm -f "/etc/systemd/system/multi-user.target.wants/$unit"
done

echo "Final directory cleanup"
for d in "/snap/bin" "/snap" "/var/snap"; do
if [ -d "$d" ]; then
rmdir --ignore-fail-on-non-empty $d
fi
done

echo "Discarding preserved snap namespaces"
# opportunistic as those might not be actually mounted
for mnt in /run/snapd/ns/*.mnt; do
Expand Down

0 comments on commit 4aacdf8

Please sign in to comment.