Skip to content

Commit ee0a00e

Browse files
Merge pull request #80 from fledge-iot/FOGL-7866
FOGL-7866 postrm script added for plugin debian script
2 parents d36a268 + abfea8e commit ee0a00e

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

plugins/make_deb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ do
194194
if [ ! -z "${service_notification_version}" ] ; then
195195
sed -i "s/fledge-service-notification/fledge-service-notification (${service_notification_version})/" ${deb_path}/control
196196
fi
197+
if [ -d ${GIT_ROOT}/python ]; then
198+
sed -i "s|__INSTALL_DIR__|${installs}|g" ${deb_path}/postrm
199+
else
200+
sed -i '/^remove_install_dir () {/,/}/d' ${deb_path}/postrm
201+
sed -i 's/remove_install_dir$//g' ${deb_path}/postrm
202+
fi
197203
if [ -f "${GIT_ROOT}/additional_lib.version" ]; then
198204
while read line ; do
199205
if [ ! -z "$line" ]; then

plugins/packages/DEBIAN/postrm

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
3+
##--------------------------------------------------------------------
4+
## Copyright (c) 2023 Dianomic Systems Inc.
5+
##
6+
## Licensed under the Apache License, Version 2.0 (the "License");
7+
## you may not use this file except in compliance with the License.
8+
## You may obtain a copy of the License at
9+
##
10+
## http://www.apache.org/licenses/LICENSE-2.0
11+
##
12+
## Unless required by applicable law or agreed to in writing, software
13+
## distributed under the License is distributed on an "AS IS" BASIS,
14+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
## See the License for the specific language governing permissions and
16+
## limitations under the License.
17+
##--------------------------------------------------------------------
18+
19+
##--------------------------------------------------------------------
20+
##
21+
## @postinst DEBIAN/postrm
22+
## This script is used to modifies links or other files associated with fledge, and/or removes files created by the package.
23+
##
24+
## Author: Ashish Jabble
25+
##
26+
##--------------------------------------------------------------------
27+
28+
set -e
29+
30+
remove_install_dir () {
31+
if [ -d /usr/local/fledge/__INSTALL_DIR__ ]; then
32+
rm -rf /usr/local/fledge/__INSTALL_DIR__
33+
fi
34+
}
35+
36+
case "$1" in
37+
remove|purge)
38+
remove_install_dir
39+
;;
40+
disappear)
41+
;;
42+
upgrade)
43+
;;
44+
failed-upgrade)
45+
;;
46+
abort-install)
47+
;;
48+
abort-upgrade)
49+
;;
50+
*) echo "$0: didn't understand being called with \`$1'" 1>&2
51+
exit 0;;
52+
esac
53+
exit 0

0 commit comments

Comments
 (0)