apt-get source package=version fails if binary name != source name

Bug #202219 reported by Steve Magoun
4
Affects Status Importance Assigned to Milestone
APT
Fix Released
Unknown
apt (Debian)
Fix Released
Unknown
apt (Ubuntu)
Fix Released
Low
Michael Vogt

Bug Description

Binary package hint: apt

'apt-get source package=version' doesn't work (source not found) for packages in which the binary package name doesn't match the source package name. The problem isn't that the source doesn't exist in the repository (it does, and 'apt-get source package' does the right thing). The problem seems to be that supplying a specific version prevents apt-get source from performing a binary->source mapping.

An example follows. Notice that 'apt-get source package' pulls the exact version I want, and 'apt-get source package=version' works if <package> is the source package name rather than the binary package name:

(T: menlow)root@steve-hardy:~# apt-get source finger=0.17-11
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to find a source package for finger

(T: menlow)root@steve-hardy:~# apt-get source finger
Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 32.6kB of source archives.
Get:1 http://mobilepartners.canonical.com hardy/main bsd-finger 0.17-11 (dsc) [638B]
Get:2 http://mobilepartners.canonical.com hardy/main bsd-finger 0.17-11 (tar) [25.5kB]
Get:3 http://mobilepartners.canonical.com hardy/main bsd-finger 0.17-11 (diff) [6473B]
Fetched 32.6kB in 0s (1289kB/s)
sh: gcc: not found
dpkg-source: warning: Couldn't determine gcc system type, falling back to default (native compilation)
gpg: Signature made Fri Feb 9 00:00:42 2007 UTC using DSA key ID 1880283C
gpg: Can't check signature: public key not found
dpkg-source: extracting bsd-finger in bsd-finger-0.17
dpkg-source: unpacking bsd-finger_0.17.orig.tar.gz
dpkg-source: applying ./bsd-finger_0.17-11.diff.gz

(T: menlow)root@steve-hardy:~# rm -rf bsd-finger*
(T: menlow)root@steve-hardy:~# apt-get source bsd-finger=0.17-11
Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 32.6kB of source archives.
Get:1 http://mobilepartners.canonical.com hardy/main bsd-finger 0.17-11 (dsc) [638B]
Get:2 http://mobilepartners.canonical.com hardy/main bsd-finger 0.17-11 (tar) [25.5kB]
Get:3 http://mobilepartners.canonical.com hardy/main bsd-finger 0.17-11 (diff) [6473B]
Fetched 32.6kB in 0s (733kB/s)
sh: gcc: not found
dpkg-source: warning: Couldn't determine gcc system type, falling back to default (native compilation)
gpg: Signature made Fri Feb 9 00:00:42 2007 UTC using DSA key ID 1880283C
gpg: Can't check signature: public key not found
dpkg-source: extracting bsd-finger in bsd-finger-0.17
dpkg-source: unpacking bsd-finger_0.17.orig.tar.gz
dpkg-source: applying ./bsd-finger_0.17-11.diff.gz

Tags: oem-services
Changed in apt:
status: Unknown → New
Revision history for this message
Steve Magoun (smagoun) wrote :

The attached patch to apt-get fixes the problem for me. I'm a bit worried the patch subtly breaks something but I haven't found any problems while testing.

The code in question was added to apt in rev. 1.59 of apt-get:
http://cvs.debian.org/apt/cmdline/apt-get.cc?rev=1.156&root=deity&view=log

Changed in apt:
status: Unknown → New
Revision history for this message
Brian Murray (brian-murray) wrote :

Michael - I'm assigning this to you since it has a patch which I thought you might find interesting.

Changed in apt:
assignee: nobody → mvo
Daniel T Chen (crimsun)
Changed in apt:
importance: Undecided → Low
status: New → Confirmed
Changed in apt:
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 0.7.20.2ubuntu1

---------------
apt (0.7.20.2ubuntu1) jaunty; urgency=low

  [ Christian Perrier ]
  * Translations:
    - bg.po. Closes: #513211
    - zh_TW.po. Closes: #513311
    - nb.po. Closes: #513843

  [ Michael Vogt ]
  * merged from the debian-sid branch
  * [ABI break] merge support for http redirects, thanks to
    Jeff Licquia and Anthony Towns
  * [ABI break] use int for the package IDs (thanks to Steve Cotton)
  * apt-pkg/contrib/strutl.cc:
    - fix TimeToStr i18n (LP: #289807)
  * debian/apt.conf.autoremove:
    - readd "linux-image" (and friends) to the auto-remove
     blacklist
  * fix some i18n issues (thanks to Gabor Kelemen)
    LP: #263089
  * apt-pkg/deb/dpkgpm.cc:
    - filter "ENOMEM" errors when creating apport reports
  * cmdline/apt-get.cc:
    - fix "apt-get source pkg=ver" if binary name != source name
      (LP: #202219)
  * apt-pkg/indexrecords.cc:
    - fix some i18n issues
  * apt-pkg/contrib/strutl.h:
    - add new strprintf() function to make i18n strings easier
  * apt-pkg/dev/debsystem.cc:
    - add missing apti18n.h header
  * cmdline/apt-get.cc:
    - default to "false" for the "APT::Get::Build-Dep-Automatic"
      option (follow debian here)
  * apt-pkg/pkgcache.cc:
    - do not run "dpkg --configure pkg" if pkg is in trigger-awaited
      state (LP: #322955)
  * methods/https.cc:
    - add Acquire::https::AllowRedirect support
    - do not unlink files in partial/ (thanks to robbiew)

  [ Dereck Wonnacott ]
  * Clarify the --help for 'purge' (LP: #243948)

  [ Ian Weisser ]
  * /apt-pkg/deb/debsystem.cc:
    - add 'sudo' to the error message to "run 'dpkg --configure -a'"
      (LP: #52697)

 -- Michael Vogt <email address hidden> Mon, 09 Feb 2009 14:21:05 +0100

Changed in apt:
status: Confirmed → Fix Released
Changed in apt:
status: New → Fix Released
Changed in apt (Debian):
status: Confirmed → Fix Released
Michael Terry (mterry)
tags: added: oem-services
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.