Skip to content

Commit c85764a

Browse files
Merge pull request #12 from fledge-iot/FOGL-3424
FOGL-3424 Debian postrm script improvised as per different cases to follow with
2 parents 56c930c + aad1ede commit c85764a

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

packages/Debian/common/DEBIAN/postrm

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,24 @@ remove_fledge_sudoer_file() {
3535
rm -rf /etc/sudoers.d/fledge
3636
}
3737

38-
echo "Remove fledge sudoers file"
39-
remove_fledge_sudoer_file
38+
case "$1" in
39+
remove|purge)
40+
echo "Cleanup of files"
41+
remove_unused_files
42+
echo "Remove fledge sudoers file"
43+
remove_fledge_sudoer_file
44+
;;
45+
disappear)
46+
;;
47+
upgrade)
48+
;;
49+
failed-upgrade)
50+
;;
51+
abort-install)
52+
;;
53+
abort-upgrade)
54+
;;
55+
*) echo "$0: didn't understand being called with \`$1'" 1>&2
56+
exit 0;;
57+
esac
58+
exit 0

packages/Debian/common/DEBIAN/preinst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ then
8484
exit 1
8585
fi
8686

87-
# Avoid the execution of the function during an upgrade
87+
# Below workaround needed only when we upgrade from 1.8.0 ONLY
88+
# As Debian flow be like 1.8.0.prerm => .next.preinst => 1.8.0.postrm => .next.postinst
8889
sed -i -e 's/^remove_unused_files$/#remove_unused_files/' /var/lib/dpkg/info/fledge.postrm
8990

9091
# Persist current version in case of upgrade/downgrade

0 commit comments

Comments
 (0)