dh_python2 prerm snippet should be simplified

Bug #712741 reported by Steve Langasek on 2011-02-03
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-defaults (Ubuntu)
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#
        dpkg -L #PACKAGE# | grep \.py$ | while read file
                rm -f "${file}"[co] >/dev/null

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
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
 PATH=(custom, user)
SourcePackage: python-defaults

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  Edit
Everyone can see this information.

Other bug subscribers