File: libglobus-openssl-module-doc.preinst

package info (click to toggle)
globus-openssl-module 4.6-3~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 1,392 kB
  • sloc: sh: 11,131; ansic: 172; makefile: 132
file content (41 lines) | stat: -rw-r--r-- 933 bytes parent folder | download
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
#!/bin/sh

set -e

##
## Functions to replace a symlink with a directory
## Backported from jessie's version of dpkg-maintscript-helper
##
symlink_to_dir() {
	local SYMLINK="$1"
	local SYMLINK_TARGET="$2"
	local LASTVERSION="$3"
	local PACKAGE="$4"

	# Skip remaining parameters up to --
	while [ "$1" != "--" -a $# -gt 0 ]; do shift; done
	shift

	if [ "$1" = "install" -o "$1" = "upgrade" ] &&
	   [ -n "$2" ] && [ -h "$SYMLINK" ] &&
	   symlink_match "$SYMLINK" "$SYMLINK_TARGET" &&
	   dpkg --compare-versions "$2" le-nl "$LASTVERSION"; then
		mv -f "$SYMLINK" "${SYMLINK}.dpkg-backup"
	fi
}

symlink_match()
{
	local SYMLINK="$1"
	local SYMLINK_TARGET="$2"

	[ "$(readlink $SYMLINK)" = "$SYMLINK_TARGET" ] || \
	[ "$(readlink -f $SYMLINK)" = "$SYMLINK_TARGET" ]
}

#DEBHELPER#

symlink_to_dir \
    /usr/share/doc/libglobus-openssl-module-doc \
    libglobus-openssl-module-dev 4.6-2~ \
    libglobus-openssl-module-doc -- "$@"