Prevent deletion of language files at acpupsd uninstall.
authorArne Fitzenreiter <arne_f@ipfire.org>
Sat, 7 Nov 2009 08:31:20 +0000 (09:31 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sat, 7 Nov 2009 08:31:20 +0000 (09:31 +0100)
Remove the language files from the pak.

config/rootfiles/packages/apcupsd
lfs/apcupsd
src/paks/apcupsd/install.sh [new file with mode: 0644]
src/paks/apcupsd/uninstall.sh [new file with mode: 0644]
src/paks/apcupsd/update.sh [new file with mode: 0644]

index 3b3273d..7a5df79 100644 (file)
@@ -28,5 +28,3 @@ srv/web/ipfire/cgi-bin/upsstats.cgi
 #usr/share/man/man8/apcupsd.8
 etc/rc.d/init.d/apcupsd
 var/ipfire/menu.d/EX-apcupsd.menu
-var/ipfire/langs/de.pl
-var/ipfire/langs/en.pl
index 4e664fe..5638cab 100644 (file)
@@ -32,7 +32,7 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = apcupsd
-PAK_VER    = 3
+PAK_VER    = 4
 
 DEPS       = ""
 
diff --git a/src/paks/apcupsd/install.sh b/src/paks/apcupsd/install.sh
new file mode 100644 (file)
index 0000000..682363b
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+extract_files
+restore_backup ${NAME}
diff --git a/src/paks/apcupsd/uninstall.sh b/src/paks/apcupsd/uninstall.sh
new file mode 100644 (file)
index 0000000..4e26837
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+stop_service ${NAME}
+make_backup ${NAME}
+#
+#Remove language files from rootfile to prevent deletion at uninstall
+#
+cat /opt/pakfire/db/rootfiles/apcupsd | \
+    grep -v "var/ipfire/langs" > /opt/pakfire/db/rootfiles/apcupsd.tmp
+mv /opt/pakfire/db/rootfiles/apcupsd.tmp /opt/pakfire/db/rootfiles/apcupsd
+#
+remove_files
diff --git a/src/paks/apcupsd/update.sh b/src/paks/apcupsd/update.sh
new file mode 100644 (file)
index 0000000..89c40d0
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+./uninstall.sh
+./install.sh