Your IP : 216.73.216.170


Current Path : /var/lib/dpkg/info/
Upload File :
Current File : /var/lib/dpkg/info/python2.6-minimal.postinst

#! /bin/sh

set -e

if [ ! -f /etc/python2.6/sitecustomize.py ]; then
    cat <<-EOF
	# Empty sitecustomize.py to avoid a dangling symlink
EOF
fi

syssite=/usr/lib/python2.6/site-packages
localsite=/usr/local/lib/python2.6/dist-packages
syslink=../../${localsite#/usr/*}

case "$1" in
    configure)
        # Create empty directories in /usr/local
        if [ ! -e /usr/local/lib/python2.6 ]; then
            mkdir -p /usr/local/lib/python2.6 2> /dev/null || true
            chmod 2775 /usr/local/lib/python2.6 2> /dev/null || true
            chown root:staff /usr/local/lib/python2.6 2> /dev/null || true
        fi
        if [ ! -e $localsite ]; then
            mkdir -p $localsite 2> /dev/null || true
            chmod 2775 $localsite 2> /dev/null || true
            chown root:staff $localsite 2> /dev/null || true
        fi
	#if [ ! -h $syssite ]; then
	#    ln -s $syslink $syssite
	#fi

	if which update-binfmts >/dev/null; then
	    update-binfmts --import python2.6
	fi

    ;;
esac

if [ "$1" = configure ]; then
    (
    files=$(dpkg -L python2.6-minimal | sed -n '/^\/usr\/lib\/python2.6\/.*\.py$/p')
	python2.6 /usr/lib/python2.6/py_compile.py $files
	if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
	    python2.6 -O /usr/lib/python2.6/py_compile.py $files
	fi
    )
    bc=no
    if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.6.4-2 \
        || [ -f /var/lib/python/python2.6_installed ]; then
    	bc=yes
    fi
    if grep -sq '^unsupported-versions[^#]*python2.6' /usr/share/python/debian_defaults
    then
	# FIXME: byte compile anyway?
	bc=no
    fi
    if [ "$bc" = yes ]; then
	# new installation or installation of first version with hook support
	if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
	    echo "Linking and byte-compiling packages for runtime python2.6..."
	fi
	version=$(dpkg -s python2.6-minimal | awk '/^Version:/ {print $2}')
	for hook in /usr/share/python/runtime.d/*.rtinstall; do
	    [ -x $hook ] || continue
	    $hook rtinstall python2.6 "$2" "$version"
	done
	if [ -f /var/lib/python/python2.6_installed ]; then
	    rm -f /var/lib/python/python2.6_installed
	    rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null
	fi
    fi
fi



exit 0