summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-12-11 09:21:26 +0100
committerMichael Vogt <mvo@debian.org>2013-12-11 09:21:26 +0100
commit37f45a579d4344c3ef6a044b12b992353e238301 (patch)
tree9172e1bc4cf8e23f258bfba1bf8447fb96c917b0 /cmdline/apt-get.cc
parentadf379e7ad1900db6d3942ac7dca5cec4737d9a1 (diff)
improve error message for apt-get source pkg:arch{=ver,/release}
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 9cc5b4031..c2b59a83c 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -269,15 +269,15 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
break;
}
+ // ignore arches that are not for us
+ if (ArchTag != "" && Ver.Arch() != ArchTag)
+ continue;
+
// pick highest version for the arch unless the user wants
// something else
if (ArchTag != "" && VerTag == "" && RelTag == "")
- {
- if(Ver.Arch() != ArchTag)
- continue;
if(Cache->VS().CmpVersion(VerTag, Ver.VerStr()) < 0)
VerTag = Ver.VerStr();
- }
// We match against a concrete version (or a part of this version)
if (VerTag.empty() == false &&
@@ -320,6 +320,16 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
}
}
+ if (Src == "" && ArchTag != "")
+ {
+ _error->Error(_("Can not find a package '%s' with version '%s' and "
+ "release '%s'"), Pkg.FullName().c_str(),
+ VerTag.c_str(), RelTag.c_str());
+ Src = Name;
+ return 0;
+ }
+
+
if (Src.empty() == true)
{
// if we don't have found a fitting package yet so we will