Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / var / lib / dpkg / info / | server ip : 104.21.89.46 your ip : 108.162.216.97 H O M E |
Filename | /var/lib/dpkg/info/python.postinst |
Size | 4.71 kb |
Permission | rwxr-xr-x |
Owner | root : root |
Create time | 27-Apr-2025 09:53 |
Last modified | 21-Dec-2013 22:14 |
Last accessed | 07-Jul-2025 00:18 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#! /bin/sh
set -e
new_config_file()
{
cat > /etc/python/debian_config <<-EOF
[DEFAULT]
# how to byte-compile (comma separated: standard, optimize)
byte-compile = standard
EOF
}
case "$1" in
configure)
[ -d /etc/python ] || mkdir /etc/python
[ -f /etc/python/debian_config ] || new_config_file
# run the rtinstall script, when 2.5 became a supported version
if [ -x /usr/bin/python2.5 ] && [ -n "$2" ] && dpkg --compare-versions $2 lt 2.4.4-3; then
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime python2.5..."
fi
version=$(dpkg -s python2.5-minimal | awk '/^Version:/ {print $2}')
for hook in /usr/share/python/runtime.d/*.rtinstall; do
[ -x $hook ] || continue
$hook rtinstall python2.5 "$2" "$version"
done
fi
# run the rtinstall script, when 2.6 became a supported version
if [ -x /usr/bin/python2.6 ] && [ -n "$2" ] && dpkg --compare-versions $2 lt 2.5.4-6; then
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
fi
# run the rtinstall script, when 2.7 became a supported version
if [ -x /usr/bin/python2.7 ] && [ -n "$2" ] && dpkg --compare-versions $2 lt 2.6.6-13; then
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime python2.7..."
fi
version=$(dpkg -s python2.7-minimal | awk '/^Version:/ {print $2}')
for hook in /usr/share/python/runtime.d/*.rtinstall; do
[ -x $hook ] || continue
$hook rtinstall python2.7 "$2" "$version"
done
fi
if [ -n "$2" ] && dpkg --compare-versions $2 lt 2.7.2-7~; then
oldv=$(echo $2 | sed 's/^\(...\).*/\1/')
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "running python rtupdate hooks for python2.7..."
fi
for hook in /usr/share/python/runtime.d/*.rtupdate; do
[ -x $hook ] || continue
if ! $hook rtupdate python$oldv python2.7; then
hb=$(basename $hook .rtupdate)
echo >&2 "error running python rtupdate hook $hb"
errors=yes
fi
done
[ -z "$errors" ] || exit 4
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "running python post-rtupdate hooks for python2.7..."
fi
for hook in /usr/share/python/runtime.d/*.rtupdate; do
[ -x $hook ] || continue
if ! $hook post-rtupdate python$oldv python2.7; then
hb=$(basename $hook .rtupdate)
echo >&2 "error running python post-rtupdate hook $hb"
errors=yes
fi
done
[ -z "$errors" ] || exit 5
fi
if [ -f /var/lib/python/python2.5_already_installed ] \
&& [ ! -f /var/lib/python/python2.5_installed ]
then
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime python2.5..."
fi
oldversion=$(cat /var/lib/python/python2.5_already_installed)
newversion=$(dpkg -s python2.5-minimal | awk '/^Version:/ {print $2}')
for hook in /usr/share/python/runtime.d/*.rtinstall; do
[ -x $hook ] || continue
$hook rtinstall python2.5 "$oldversion" "$newversion"
done
fi
rm -f /var/lib/python/python2.5_already_installed
if [ -f /var/lib/python/python2.6_already_installed ] \
&& [ ! -f /var/lib/python/python2.6_installed ]
then
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime python2.6..."
fi
oldversion=$(cat /var/lib/python/python2.6_already_installed)
newversion=$(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 "$oldversion" "$newversion"
done
fi
rm -f /var/lib/python/python2.6_already_installed
if [ -f /var/lib/python/python2.7_already_installed ] \
&& [ ! -f /var/lib/python/python2.7_installed ]
then
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime python2.7..."
fi
oldversion=$(cat /var/lib/python/python2.7_already_installed)
newversion=$(dpkg -s python2.7-minimal | awk '/^Version:/ {print $2}')
for hook in /usr/share/python/runtime.d/*.rtinstall; do
[ -x $hook ] || continue
$hook rtinstall python2.7 "$oldversion" "$newversion"
done
fi
rm -f /var/lib/python/python2.7_already_installed
rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null || true
esac
set -e
new_config_file()
{
cat > /etc/python/debian_config <<-EOF
[DEFAULT]
# how to byte-compile (comma separated: standard, optimize)
byte-compile = standard
EOF
}
case "$1" in
configure)
[ -d /etc/python ] || mkdir /etc/python
[ -f /etc/python/debian_config ] || new_config_file
# run the rtinstall script, when 2.5 became a supported version
if [ -x /usr/bin/python2.5 ] && [ -n "$2" ] && dpkg --compare-versions $2 lt 2.4.4-3; then
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime python2.5..."
fi
version=$(dpkg -s python2.5-minimal | awk '/^Version:/ {print $2}')
for hook in /usr/share/python/runtime.d/*.rtinstall; do
[ -x $hook ] || continue
$hook rtinstall python2.5 "$2" "$version"
done
fi
# run the rtinstall script, when 2.6 became a supported version
if [ -x /usr/bin/python2.6 ] && [ -n "$2" ] && dpkg --compare-versions $2 lt 2.5.4-6; then
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
fi
# run the rtinstall script, when 2.7 became a supported version
if [ -x /usr/bin/python2.7 ] && [ -n "$2" ] && dpkg --compare-versions $2 lt 2.6.6-13; then
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime python2.7..."
fi
version=$(dpkg -s python2.7-minimal | awk '/^Version:/ {print $2}')
for hook in /usr/share/python/runtime.d/*.rtinstall; do
[ -x $hook ] || continue
$hook rtinstall python2.7 "$2" "$version"
done
fi
if [ -n "$2" ] && dpkg --compare-versions $2 lt 2.7.2-7~; then
oldv=$(echo $2 | sed 's/^\(...\).*/\1/')
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "running python rtupdate hooks for python2.7..."
fi
for hook in /usr/share/python/runtime.d/*.rtupdate; do
[ -x $hook ] || continue
if ! $hook rtupdate python$oldv python2.7; then
hb=$(basename $hook .rtupdate)
echo >&2 "error running python rtupdate hook $hb"
errors=yes
fi
done
[ -z "$errors" ] || exit 4
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "running python post-rtupdate hooks for python2.7..."
fi
for hook in /usr/share/python/runtime.d/*.rtupdate; do
[ -x $hook ] || continue
if ! $hook post-rtupdate python$oldv python2.7; then
hb=$(basename $hook .rtupdate)
echo >&2 "error running python post-rtupdate hook $hb"
errors=yes
fi
done
[ -z "$errors" ] || exit 5
fi
if [ -f /var/lib/python/python2.5_already_installed ] \
&& [ ! -f /var/lib/python/python2.5_installed ]
then
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime python2.5..."
fi
oldversion=$(cat /var/lib/python/python2.5_already_installed)
newversion=$(dpkg -s python2.5-minimal | awk '/^Version:/ {print $2}')
for hook in /usr/share/python/runtime.d/*.rtinstall; do
[ -x $hook ] || continue
$hook rtinstall python2.5 "$oldversion" "$newversion"
done
fi
rm -f /var/lib/python/python2.5_already_installed
if [ -f /var/lib/python/python2.6_already_installed ] \
&& [ ! -f /var/lib/python/python2.6_installed ]
then
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime python2.6..."
fi
oldversion=$(cat /var/lib/python/python2.6_already_installed)
newversion=$(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 "$oldversion" "$newversion"
done
fi
rm -f /var/lib/python/python2.6_already_installed
if [ -f /var/lib/python/python2.7_already_installed ] \
&& [ ! -f /var/lib/python/python2.7_installed ]
then
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime python2.7..."
fi
oldversion=$(cat /var/lib/python/python2.7_already_installed)
newversion=$(dpkg -s python2.7-minimal | awk '/^Version:/ {print $2}')
for hook in /usr/share/python/runtime.d/*.rtinstall; do
[ -x $hook ] || continue
$hook rtinstall python2.7 "$oldversion" "$newversion"
done
fi
rm -f /var/lib/python/python2.7_already_installed
rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null || true
esac