File: common.functions.postrm

package info (click to toggle)
texlive-lang 2009-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 197,212 kB
  • ctags: 1,803
  • sloc: perl: 10,832; ansic: 3,233; makefile: 657; sh: 652; lisp: 485; awk: 331; python: 283; ruby: 177; sed: 138; xml: 57; cs: 2
file content (54 lines) | stat: -rw-r--r-- 1,281 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# common.functions.postrm start
# $Id: common.functions.postrm 3943 2009-05-22 12:11:09Z preining $
check_move_back () 
{
  orig="$1"
  new="$2"
  if [ -r "$new" ] ; then
    mkdir -p $(dirname "$orig")
    mv "$new" "$orig" 
  fi
}

handle_config_file_postrm() 
{
    cfgfile="$1"
    action="$2"
    version="$3"
    case "$action" in
      abort-upgrade)
	if dpkg --compare-versions "$version" ge 2007; then
	  return 0
	fi
	;;
      *)
	return 0
	;;
    esac
    conf_relpath=${cfgfile#/etc/texmf/}
    conf_oldpath="/etc/texmf/texlive/$conf_relpath"
    case "$cfgfile" in 
        /etc/texmf/dvips/config/*)
	    # special case for dvips config
	    conf_oldpath="/etc/texmf/texlive/dvips/${conf_oldpath#/etc/texmf/dvips/config}"
            ;;
        # files which were only present in tetex
        /etc/texmf/texdoctk/texdoctk.dat)
	    conf_oldpath="/etc/texdoctk/texdoctk.dat"
            ;;
        /etc/texmf/xdvi/xdvi.cfg)
	    # old tetex version
	    if [ -r "$cfgfile" ]; then
	      cp $cfgfile /etc/texmf/xdvi.cfg
	    fi
            # old texlive version 
	    conf_oldpath="/etc/texmf/texlive/xdvi.cfg"
    esac
    check_move_back $conf_oldpath $cfgfile 
}

# common.functions.postrm end
# Local Variables:
# mode: shell-script
# End:
# vim:set expandtab: #