dh_python2 prerm snippet should be simplified

Bug #712741 reported by Steve Langasek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-defaults (Ubuntu)
New
Low
Barry Warsaw

Bug Description

dh_python2 sets a versioned dependency on python (>= 2.7.1-0ubuntu2 with the explanation:

  # minimum version required for pycompile/pyclean

But dh_python2 also installs this prerm snippet:

if which pyclean >/dev/null 2>&1; then
        pyclean -p #PACKAGE# #ARGS#
else
        dpkg -L #PACKAGE# | grep \.py$ | while read file
        do
                rm -f "${file}"[co] >/dev/null
        done
fi

This should be simplified to just 'pyclean -p #PACKAGE# #ARGS#' - since we have a dependency that ensures pyclean is present, we don't need to check for it in the prerm because our prerm will be called already before python can possibly be removed from the system.

The same applies to the postinst snippet, which checks for pycompile where it doesn't need to.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: python 2.6.6-2ubuntu2
ProcVersionSignature: Ubuntu 2.6.35-25.44-generic 2.6.35.10
Uname: Linux 2.6.35-25-generic x86_64
Architecture: amd64
Date: Thu Feb 3 11:50:42 2011
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: python-defaults

Revision history for this message
Steve Langasek (vorlon) wrote :
Changed in python-defaults (Ubuntu):
assignee: nobody → Barry Warsaw (barry)
importance: Undecided → Low
tags: added: pycentral-deprecation
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.