#695546 apt: can't download source package when same-name binary pkg from different-name src pkg exists

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Thorsten Glaser
Date:
2012-12-10 03:03:03 UTC
Severity:
normal
#695546#5
Date:
2012-12-09 23:53:13 UTC
From:
To:
I’ve tried, and failed, to use apt to download a source package,
and had to resort using dget with an URI from packages.d.o:

root@ara3:~ # apt-get -d source konsole
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'kdebase' as source package instead of 'konsole'
E: Unable to find a source package for kdebase
100|root@ara3:~ # apt-cache showsrc konsole
Package: konsole
Binary: konsole, konsole-dbg
Version: 4:4.8.4-1
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Uploaders: José Manuel Santamaría Lema <panfaust@gmail.com>, Eshat Cakar <info@eshat.de>, Modestas Vainius <modax@debian.org>
Build-Depends: kde-sc-dev-latest (>= 4:4.8.4), cmake, debhelper (>= 7.3.16), pkg-kde-tools (>= 0.12), kdelibs5-dev (>= 4:4.8), libkonq5-dev (>= 4:4.8), libphonon-dev (>= 4:4.3.0), libxkbfile-dev
Architecture: any
Standards-Version: 3.9.3
Format: 3.0 (quilt)
Files:
 91d938650ad3e31eeaf6f213e27eb6e9 1521 konsole_4.8.4-1.dsc
 4a6e9477d3a2104853b2faceb7c2e352 441968 konsole_4.8.4.orig.tar.xz
 496b66e5aac1130aa818a8b5ddfd5fca 5035 konsole_4.8.4-1.debian.tar.gz
Vcs-Browser: http://git.debian.org/?p=pkg-kde/kde-sc/konsole.git
Vcs-Git: git://git.debian.org/pkg-kde/kde-sc/konsole.git
Checksums-Sha1:
 f7f9e88fe71f72c4fea52ce1f39682cf0134079c 1521 konsole_4.8.4-1.dsc
 a5900aa089a28fcaa69b45cfc7b46f556a38bd11 441968 konsole_4.8.4.orig.tar.xz
 853fe0106e620c29d78c2df7af72e93ca6ed0cab 5035 konsole_4.8.4-1.debian.tar.gz
Checksums-Sha256:
 efdb130d7e40906c0ba3fd834bcc14fde4cb2b7ed10dc7988e9e578f7fd89f02 1521 konsole_4.8.4-1.dsc
 85001aefb81c6455562847e15b99fba28aa40ffa6df8fead8ba6c826b096cf81 441968 konsole_4.8.4.orig.tar.xz
 0eb029fb16d0fdf5026054f9c348d9f435a8cd0ab759a73a7deec327e71c24a6 5035 konsole_4.8.4-1.debian.tar.gz
Homepage: http://www.kde.org/
Package-List:
 konsole deb kde optional
 konsole-dbg deb debug extra
Directory: pool/main/k/konsole
Priority: source
Section: kde

Package: konsole
Binary: konsole, konsole-dbg
Version: 4:4.8.4-2
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Uploaders: José Manuel Santamaría Lema <panfaust@gmail.com>, Eshat Cakar <info@eshat.de>, Modestas Vainius <modax@debian.org>
Build-Depends: kde-sc-dev-latest (>= 4:4.8.4), cmake, debhelper (>= 7.3.16), pkg-kde-tools (>= 0.12), kdelibs5-dev (>= 4:4.8), libkonq5-dev (>= 4:4.8), libphonon-dev (>= 4:4.3.0), libxkbfile-dev
Architecture: any
Standards-Version: 3.9.3
Format: 3.0 (quilt)
Files:
 369a4da81a9fb74e535ec42edfdafc5d 1513 konsole_4.8.4-2.dsc
 4a6e9477d3a2104853b2faceb7c2e352 441968 konsole_4.8.4.orig.tar.xz
 b578901ecc70e5db9efc84fb1bb0f826 5759 konsole_4.8.4-2.debian.tar.gz
Vcs-Browser: http://git.debian.org/?p=pkg-kde/kde-sc/konsole.git
Vcs-Git: git://git.debian.org/pkg-kde/kde-sc/konsole.git
Checksums-Sha1:
 33c9719a9fbae6f863262076ae17a1aa6985478f 1513 konsole_4.8.4-2.dsc
 a5900aa089a28fcaa69b45cfc7b46f556a38bd11 441968 konsole_4.8.4.orig.tar.xz
 e68601560718d6a6416d61f9fee05f01b9d93978 5759 konsole_4.8.4-2.debian.tar.gz
Checksums-Sha256:
 c50934b3def4856f3b16adf9ce46e14c2220d6fbf0f187e04e33cee73b4c4058 1513 konsole_4.8.4-2.dsc
 85001aefb81c6455562847e15b99fba28aa40ffa6df8fead8ba6c826b096cf81 441968 konsole_4.8.4.orig.tar.xz
 7cc699b1a540d0d92ae44e0b7e150aed1e19699e845fee15c7757320bf48be85 5759 konsole_4.8.4-2.debian.tar.gz
Homepage: http://www.kde.org/
Package-List:
 konsole deb kde optional
 konsole-dbg deb debug extra
Directory: pool/main/k/konsole
Priority: source
Section: kde

root@ara3:~ # apt-get -d source konsole=4:4.8.4-2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'kdebase' as source package instead of 'konsole'
E: Ignore unavailable version '4:4.8.4-2' of package 'konsole'
E: Unable to find a source package for kdebase
100|root@ara3:~ # apt-get -d source src:konsole=4:4.8.4-2
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Ignore unavailable version '4:4.8.4-2' of package 'src:konsole'
E: Unable to find a source package for src:konsole

I don’t know why apt insists on overriding me telling it that
I want a *source* package. The root cause here is probably
that the archive knows of a binary package named konsole,
which is made from a source package named kdebase:

root@ara3:~ # apt-cache policy konsole
konsole:
  Installed: (none)
  Candidate: 4:3.5.9.dfsg.1-6
  Version table:
     4:3.5.9.dfsg.1-6 0
        500 http://ftp.debian-ports.org/debian/ unstable/main m68k Packages
root@ara3:~ # apt-cache show konsole=4:3.5.9.dfsg.1-6 | fgrep Source
Source: kdebase

But I don’t want the source for that! I want the current
source so I can build it.

I think the selection mechanism is mapping the binary→source name
too early. I should be able to get what I want from explicitly
specifying a version. I should also be able to get what I want
from prefixing “src:” (even without telling it a version number,
but, as you can see, even with one *and* src: it doesn’t work).

#695546#10
Date:
2012-12-10 01:42:13 UTC
From:
To:
Control: severity -1 normal

This command is the correct form to use when there is no corresponding
binary package yet available.  From apt-get(8):
package matching that name and version available, as demonstrated by
your apt-cache showsrc output.

However, can you try this command:
$ apt-get -d source --only-source konsole=4:4.8.4-2

Note that unless you use the “--only-source” option (although implicit
with “source pkg=ver”) you have not told apt to look for a specific
source package name.  The commands “source” and “build-dep” are
documented to search for binary package names first.

I don't know where you got the idea to use the “src:” prefix, but that
is not a documented syntax.

Anyway, this should only be a temporary problem and happens in
either of two rare situations:
- a binary package moves from one source to another; and
- a source package is newer than the correspondingly available
  binary or source package.

Both of which have happened to you at the same time, though you do
have quite a mixture of repositories in your sources.list.

It has exposed what may be a real bug in apt-get's selection of source
packages when given --only-source and a version.

That is documented and ok for the vast majority of cases where there
is no overlap between source package names and the binary package
names supplied by another source.

To avoid the mapping you should use “--only-source”, which is implicit
when a version is specified, so indeed something is afoul here.

Yes.

See “--only-source”.

Regards

#695546#17
Date:
2012-12-10 02:00:26 UTC
From:
To:
Daniel Hartwig dixit:

Okay, that one works, although it’s pretty long to type
and not too easy to remember…

… oh. Well, almost all other Debian tools I use support it, and I
probably just mistook apt for doing the same.

The second situation is actually my default case… it’s what I use
apt-get source for all day.

I can reduce it to just debian-ports unstable+unreleased binary plus
debian source, that’d not be an issue.

When not given --only-source but a version.

Hrm, okay.

Ah okay. Thanks for the quick response and the possible workaround.

Goodnight,
//mirabilos

#695546#22
Date:
2012-12-10 02:59:41 UTC
From:
To:
# echo 'APT::Get::Only-Source "1";' >> /etc/apt/apt.conf

Anyway, without the “--only-source” should be equivalent according to
my reading of apt-get(8).  So I believe this constitutes a bug.

[Maybe wishlist item.]

Sure.

Regards