summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-12-11 14:03:53 +0100
committerMichael Vogt <mvo@debian.org>2013-12-11 14:03:53 +0100
commitc9829e0744ca678e105aa0af26b87588023d7536 (patch)
treec8a04e64ed4ffb30cde3fabbf12292ea78592a45
parent37f45a579d4344c3ef6a044b12b992353e238301 (diff)
improve error message
-rw-r--r--cmdline/apt-get.cc9
-rwxr-xr-xtest/integration/test-apt-get-source-arch4
2 files changed, 8 insertions, 5 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index c2b59a83c..0b980cdf4 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -322,9 +322,12 @@ 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());
+ if (VerTag != "")
+ _error->Error(_("Can not find a package '%s' with version '%s'"),
+ Pkg.FullName().c_str(), VerTag.c_str());
+ if (RelTag != "")
+ _error->Error(_("Can not find a package '%s' with release '%s'"),
+ Pkg.FullName().c_str(), RelTag.c_str());
Src = Name;
return 0;
}
diff --git a/test/integration/test-apt-get-source-arch b/test/integration/test-apt-get-source-arch
index 97d0e096a..d7ed56dc9 100755
--- a/test/integration/test-apt-get-source-arch
+++ b/test/integration/test-apt-get-source-arch
@@ -61,10 +61,10 @@ E: Unable to find a source package for foo:not-a-available-arch" aptget source -
# error on unavailable version for arch
testequal "$HEADER
-E: Can not find a package 'foo:amd64' with version '2.0' and release ''
+E: Can not find a package 'foo:amd64' with version '2.0'
E: Unable to find a source package for foo:amd64=2.0" aptget source -q --print-uris foo:amd64=2.0
# error on unavailable release for arch
testequal "$HEADER
-E: Can not find a package 'foo:amd64' with version '' and release 'oldstable'
+E: Can not find a package 'foo:amd64' with release 'oldstable'
E: Unable to find a source package for foo:amd64/oldstable" aptget source -q --print-uris foo:amd64/oldstable