--help output references wrong executable name

Bug #1225140 reported by Jamin W. Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-coverage (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ python-coverage --help
Coverage.py, version 3.6
Measure, collect, and report on code coverage in Python programs.

usage: coverage <command> [options] [args]

Commands:
    annotate Annotate source files with execution information.
    combine Combine a number of data files.
    erase Erase previously collected coverage data.
    help Get help on using coverage.py.
    html Create an HTML report.
    report Report coverage stats on modules.
    run Run a Python program and measure code execution.
    xml Create an XML report of coverage results.

Use "coverage help <command>" for detailed help on any command.
Use "coverage help classic" for help on older command syntax.
For more information, see http://nedbatchelder.com/code/coverage

Based on the above, I should be able to call "coverage help":

$ coverage help
coverage: command not found

The help output should reference the correct script name (in this case python-coverage) or even better yet, the name under which the script was called, since the package provides three different names for the same executable:

$ dpkg -L python-coverage | grep bin/ | xargs ls -l
-rwxr-xr-x 1 root root 303 Mar 22 03:34 /usr/bin/coverage2
-rwxr-xr-x 1 root root 309 Mar 22 03:34 /usr/bin/coverage-2.7
-rwxr-xr-x 1 root root 301 Mar 22 03:34 /usr/bin/python-coverage

$ diff -u /usr/bin/coverage2 /usr/bin/python-coverage
--- /usr/bin/coverage2 2013-03-22 03:34:02.000000000 -0700
+++ /usr/bin/python-coverage 2013-03-22 03:34:02.000000000 -0700
@@ -1,10 +1,10 @@
 #! /usr/bin/python
-# EASY-INSTALL-ENTRY-SCRIPT: 'coverage==3.6','console_scripts','coverage2'
+# EASY-INSTALL-ENTRY-SCRIPT: 'coverage==3.6','console_scripts','coverage'
 __requires__ = 'coverage==3.6'
 import sys
 from pkg_resources import load_entry_point

 if __name__ == '__main__':
     sys.exit(
- load_entry_point('coverage==3.6', 'console_scripts', 'coverage2')()
+ load_entry_point('coverage==3.6', 'console_scripts', 'coverage')()
     )

$ diff -u /usr/bin/coverage2 /usr/bin/coverage-2.7
--- /usr/bin/coverage2 2013-03-22 03:34:02.000000000 -0700
+++ /usr/bin/coverage-2.7 2013-03-22 03:34:02.000000000 -0700
@@ -1,10 +1,10 @@
 #! /usr/bin/python
-# EASY-INSTALL-ENTRY-SCRIPT: 'coverage==3.6','console_scripts','coverage2'
+# EASY-INSTALL-ENTRY-SCRIPT: 'coverage==3.6','console_scripts','coverage-2.7'
 __requires__ = 'coverage==3.6'
 import sys
 from pkg_resources import load_entry_point

 if __name__ == '__main__':
     sys.exit(
- load_entry_point('coverage==3.6', 'console_scripts', 'coverage2')()
+ load_entry_point('coverage==3.6', 'console_scripts', 'coverage-2.7')()
     )

$ diff -u /usr/bin/python-coverage /usr/bin/coverage-2.7
--- /usr/bin/python-coverage 2013-03-22 03:34:02.000000000 -0700
+++ /usr/bin/coverage-2.7 2013-03-22 03:34:02.000000000 -0700
@@ -1,10 +1,10 @@
 #! /usr/bin/python
-# EASY-INSTALL-ENTRY-SCRIPT: 'coverage==3.6','console_scripts','coverage'
+# EASY-INSTALL-ENTRY-SCRIPT: 'coverage==3.6','console_scripts','coverage-2.7'
 __requires__ = 'coverage==3.6'
 import sys
 from pkg_resources import load_entry_point

 if __name__ == '__main__':
     sys.exit(
- load_entry_point('coverage==3.6', 'console_scripts', 'coverage')()
+ load_entry_point('coverage==3.6', 'console_scripts', 'coverage-2.7')()
     )

$ for E in $(dpkg -L python-coverage | grep bin/); do echo ${E}; ${E} --help | grep usage; done
/usr/bin/coverage2
usage: coverage <command> [options] [args]
/usr/bin/python-coverage
usage: coverage <command> [options] [args]
/usr/bin/coverage-2.7
usage: coverage <command> [options] [args]

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: python-coverage 3.6-0ubuntu2
ProcVersionSignature: Ubuntu 3.8.0-30.44-generic 3.8.13.6
Uname: Linux 3.8.0-30-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.9.2-0ubuntu8.4
Architecture: amd64
Date: Fri Sep 13 11:27:32 2013
InstallationDate: Installed on 2009-12-21 (1361 days ago)
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
MarkForUpload: True
SourcePackage: python-coverage
UpgradeStatus: Upgraded to raring on 2013-04-26 (140 days ago)

Revision history for this message
Jamin W. Collins (jcollins) wrote :
Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote :

Here I see two issues:

1. /usr/bin/coverage is not installed;
2. "--help output references wrong executable name".

The first should be fixed in the Debian/Ubuntu packaging. The latter should be fixed upstream.

Revision history for this message
Jamin W. Collins (jcollins) wrote :

Looks like there's a bit of a misunderstanding here. There may be multiple issues, but a missing "/usr/bin/coverage" file isn't really one of them. That is the upstream's name for the executable. The packager has chosen to rename the executable for some reason (see snippet below). Since the packager has renamed the executable the packager should also be making sure to update references to the old executable.

From the package's debian/rules:

override_dh_auto_install:
    dh_auto_install
    mv ${package_install_bin_dir}/coverage \
        ${package_install_bin_dir}/python-coverage

Based on changelog entries, this was done in 2.80-1 by Ben Finney <email address hidden>:

* debian/rules
    + Upstream packaging installs program to '/usr/bin/coverage', move to
      '/usr/bin/python-coverage' to conform with existing versions.

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.