Package: debian-goodies
Version: 0.53
Severity: normal
File: /usr/bin/debmany
Tags: patch

On a Debian squeeze system with backports enabled, the package ntop
(for example) only exists in squeeze-backports, not in squeeze. So,
the command

    apt-get -q2 --print-uris --reinstall install ntop

lists the URLs from squeeze-backports first (I'm not sure why, but it
does), and then the dependencies of ntop, which are in squeeze
repositories. This is a problem for debmany because it downloads the
package listed last in the apt-get output. So, you will get the
documentation of python-mako, or python-markupsafe, or possibly
something else, depending on what you have installed.

Attached is a patch which fixes this. I grep for the package name
instead of just taking the last line of apt-get output. This should
always work as long as the package filename follows Debian
conventions.

The patch also fixes the following minor issues:

1. Version number is supposed to be output with the usage information.
2. Remove obsolete date in usage information.
3. Remove misleading comment in debug output.

-- System Information:
Debian Release: 6.0.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'proposed-updates'), (500, 
'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.39-bpo.2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages debian-goodies depends on:
ii  curl                   7.21.0-2          Get a file from an HTTP, HTTPS or 
ii  dctrl-tools [grep-dctr 2.14.5            Command-line tools to process Debi
ii  dialog                 1.1-20100428-1    Displays user-friendly dialog boxe
ii  less                   436-1             pager program similar to more
ii  lsof                   4.81.dfsg.1-1     List open files
ii  perl                   5.10.1-17squeeze2 Larry Wall's Practical Extraction 
ii  python                 2.6.6-3+squeeze6  interactive high-level object-orie
ii  whiptail               0.52.11-1         Displays user-friendly dialog boxe

debian-goodies recommends no packages.

Versions of packages debian-goodies suggests:
ii  popularity-contest   1.49                Vote for your favourite packages a
ii  xdg-utils            1.0.2+cvs20100307-2 desktop integration utilities from
ii  zenity               2.30.0-1            Display graphical dialog boxes fro

-- no debconf information
--- debian-goodies-0.59/debmany/debmany 2010-05-26 03:34:24.000000000 -0700
+++ /usr/bin/debmany    2011-10-30 20:28:42.182991029 -0700
@@ -29,6 +29,9 @@
 
 curdir=`pwd`
 
+# Version of debmany
+version=1.4
+
 error()
 {
   # show errorcode and quit
@@ -48,7 +51,7 @@
 
 usage()
 {
-  echo "debmany $version Thu May 15 16:56:19 CEST 2008
+  echo "debmany $version
 Description: Display a manpage or documentation files from a Debian package.
              The list of files is displayed in a dialog.
              Supported locations for debian packages are: Local .deb-file,
@@ -134,9 +137,6 @@
   usage "Viewer for other data '$othercmd' is not available or executable"
 fi
 
-# Version of debmany
-version=1.3
-
 # choose whiptail or dialog
 whiptail=/usr/bin/whiptail
 dialog=/usr/bin/dialog
@@ -243,8 +243,8 @@
 
   if [ -z "$file" ]
   then
-    debug "Mode3: Determining the path of '$package' (you use file:// in 
sources.list)" # comment
-    aptdata=`apt-get -q2 --print-uris --reinstall install "$package" 
2>/dev/null | tail -1`
+    debug "Mode3: Determining the path of '$package'" # comment
+    aptdata=`apt-get -q2 --print-uris --reinstall install "$package" 
2>/dev/null | grep "$package"_`
     if [ -z "$aptdata" ]
     then
       error "There is no package called '$package'."

Reply via email to