~ubuntu-branches/ubuntu/karmic/calibre/karmic

« back to all changes in this revision

Viewing changes to debian/calibre.preinst

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-30 12:49:41 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730124941-qjdsmri25zt8zocn
Tags: 0.6.3+dfsg-0ubuntu1
* New upstream release. Please see http://calibre.kovidgoyal.net/new_in_6/
  for the list of new features and changes.
* remove_postinstall.patch: Update for new version.
* build_debug.patch: Does not apply any more, disable for now. Might not be
  necessary any more.
* debian/copyright: Fix reference to versionless GPL.
* debian/rules: Drop obsolete dh_desktop call.
* debian/rules: Add workaround for weird Python 2.6 setuptools behaviour of
  putting compiled .so files into src/calibre/plugins/calibre/plugins
  instead of src/calibre/plugins.
* debian/rules: Drop hal fdi moving, new upstream version does not use hal
  any more. Drop hal dependency, too.
* debian/rules: Install udev rules into /lib/udev/rules.d.
* Add debian/calibre.preinst: Remove unmodified
  /etc/udev/rules.d/95-calibre.rules on upgrade.
* debian/control: Bump Python dependencies to 2.6, since upstream needs
  it now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
set -e
 
4
 
 
5
rm_conffile() {
 
6
  PKGNAME="calibre"
 
7
  CONFFILE="$1"
 
8
 
 
9
  if [ -e "$CONFFILE" ]; then
 
10
   md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
 
11
   old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
 
12
   if [ "$md5sum" != "$old_md5sum" ]; then
 
13
     echo "Obsolete conffile $CONFFILE has been modified by you."
 
14
     echo "Saving as $CONFFILE.dpkg-bak ..."
 
15
     mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
 
16
   else
 
17
     echo "Removing obsolete conffile $CONFFILE ..."
 
18
     rm -f "$CONFFILE"
 
19
   fi
 
20
 fi
 
21
}
 
22
 
 
23
case "$1" in
 
24
  install|upgrade)
 
25
    if dpkg --compare-versions "$2" lt-nl "0.6.3"; then
 
26
      rm_conffile "/etc/udev/rules.d/95-calibre.rules"
 
27
    fi
 
28
esac
 
29
 
 
30
exit 0