I am creating a icon package named smoothX* and its in development stage, and the same is been maintained in Ubuntu PPA, every time I update or delete some of them I want the same to be reflected in the PPA .deb, for that I added a preinst script to the debian folder with the following.
#!/bin/sh
set -e
#remove old installation files
if which smoothX* >/dev/null 2>&1 ; then
rm -Rf /usr/share/icons/smoothX*
fi
but nothing happens except it installs over that (the old altered or deleted files are still there.)
How to delete the old installed files completely with preinst script and make it to install the contents of the fresh deb file and configure it. Your help will be highly appreciated thank you.
well I managed to do, what I exactly needed since I have already uploaded to PPA and maintaining the package. with this "preinst" script,
#!/bin/sh
set -e
# remove old and obsolete files
rm -R -f /usr/share/icons/smoothX*
exit 0
also I know thats not the right way to do it, for I am a noob in bash scripting I would like to know how to do the right way, when I googled,I got:
if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
dpkg-maintscript-helper rm_conffile /etc/foo/conf.d/bar 1.2-1 -- "$@"
fi
which I was unable to understand, howto with dpkg-maintscript
.
Thankyou and hope someone could guide me.