~ubuntu-branches/ubuntu/vivid/tidy/vivid

« back to all changes in this revision

Viewing changes to debian/tidy.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Jason Thomas
  • Date: 2008-01-20 21:46:03 UTC
  • mfrom: (0.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080120214603-oqicq5jwr1exrm55
Tags: 20080116cvs-2
* debian/control: build depends on xsltproc
  (closes: #461608)
* debian/tidy.preinst,postinst: add code to move old config file
  (closes: #461623)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Move a conffile without triggering a dpkg question
 
4
mv_conffile() {
 
5
    OLDCONFFILE="$1"
 
6
    NEWCONFFILE="$2"
 
7
 
 
8
    if [ -e "$OLDCONFFILE" ]; then
 
9
        echo "Preserving user changes to $NEWCONFFILE ..."
 
10
        mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
 
11
        mv -f "$OLDCONFFILE" "$NEWCONFFILE"
 
12
    fi
 
13
}
 
14
 
 
15
case "$1" in
 
16
configure)
 
17
    if dpkg --compare-versions "$2" le "$LASTVERSION"; then
 
18
        mv_conffile "/etc/tidy/tidy.conf" "/etc/tidy.conf"
 
19
    fi
 
20
esac
 
21
 
 
22
#DEBHELPER#
 
23
 
 
24
exit 0