On Sat, Apr 14, 2012 at 9:45 PM, <jet-gu...@users.alioth.debian.org> wrote: > +compare() { > + [ $# != 2 ] && exit 1 > + A=$(md5sum $1 | cut -d' ' -f1) > + B=$(md5sum $2 | cut -d' ' -f1) > + [ "$A" = "$B" ] && return 0 || return 1 > +} > + > +do_remove() { > + for app in $APPLICATIONS; do > + if [ -f "/etc/crtmpserver/applications/$app.lua" ]; then > + compare "/etc/crtmpserver/applications/$app.lua" \ > + > "/usr/share/doc/crtmpserver-apps/examples/$app.lua" \ > + && rm "/etc/crtmpserver/applications/$app.lua" > + fi > + done
I notice now you compare the md5s of the files before removing them, but dpkg can handle all cases clean way, it would be enough to install them under /etc/. Plus, the following may also cause the script to exit with 1 as return code in the case /etc/crtmpserver/ is not empty: > + rmdir /etc/crtmpserver What the following line does is unconditionally removing the /etc/crtmpserver/ directory which is not good at all! Otherwise it returns 1, which means error! dpkg does not prune that directory if user's put custom files in it. > +do_purge() { > + rm -r /etc/crtmpserver || exit 1 > +} -- Alessio Treglia | www.alessiotreglia.com Debian Developer | ales...@debian.org Ubuntu Core Developer | quadris...@ubuntu.com 0416 0004 A827 6E40 BB98 90FB E8A4 8AE5 311D 765A _______________________________________________ pkg-multimedia-maintainers mailing list pkg-multimedia-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers