~ubuntu-branches/ubuntu/trusty/tgif/trusty

« back to all changes in this revision

Viewing changes to debian/preinst

  • Committer: Package Import Robot
  • Author(s): Willi Mann
  • Date: 2012-06-16 13:05:52 UTC
  • mfrom: (4.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120616130552-fgyrsobp2j23ixwh
Tags: 1:4.2.5-1.2
* Non-maintainer upload.
* debian/preinst: Also support clean installation when package was previously
  removed but not purged. closes: #666227

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#DEBHELPER#
4
4
 
5
5
case $1 in
6
 
   install|abort-upgrade ) 
 
6
   abort-upgrade ) 
7
7
   exit 0
8
8
   ;;
9
 
   upgrade )
10
 
   # Remove old config file if upgrading from tgif <= 3.0p13-1
11
 
   rm -rf /etc/X11/tgif
12
 
   # Clean up app-defaults files from previous versions of the postinst
13
 
   # script tgif (< 4.2.2-4).  This should restore the files to their
14
 
   # pristine state unless the user has made additional alterations.
15
 
   for bit in "" "/ja_JP.eucJP" "/ru"; do
16
 
       file=/etc/X11$bit/app-defaults/Tgif
17
 
       # Remove all instances of the 
18
 
       #   Tgif*InitialPaperSize:
19
 
       #   Tgif*GridSystem:
20
 
       # line pairs appended by old versions of postinst.
21
 
       sed '/Tgif\*InitialPaperSize/,+1 d' $file > $file.clean
22
 
       mv $file.clean $file
23
 
   done
 
9
   install|upgrade )
 
10
   if [ ! -z "$2" ]; then
 
11
      # Remove old config file if upgrading from tgif <= 3.0p13-1
 
12
      rm -rf /etc/X11/tgif
 
13
      # Clean up app-defaults files from previous versions of the postinst
 
14
      # script tgif (< 4.2.2-4).  This should restore the files to their
 
15
      # pristine state unless the user has made additional alterations.
 
16
      for bit in "" "/ja_JP.eucJP" "/ru"; do
 
17
          file=/etc/X11$bit/app-defaults/Tgif
 
18
          # Remove all instances of the 
 
19
          #   Tgif*InitialPaperSize:
 
20
          #   Tgif*GridSystem:
 
21
          # line pairs appended by old versions of postinst.
 
22
          sed '/Tgif\*InitialPaperSize/,+1 d' $file > $file.clean
 
23
          mv $file.clean $file
 
24
      done
 
25
   fi
24
26
   ;;
25
27
   * )
26
28
   echo "preinst called with unknown argument \`$1'" >&2