Browse Source

Print useful error on "apt changelog" without arguments

Fixes Debian/apt#77
tags/debian/1.8.0_alpha3
Julian Andres Klode 2 years ago
parent
commit
0e688a2525
2 changed files with 6 additions and 1 deletions
  1. +1
    -1
      apt-private/private-download.cc
  2. +5
    -0
      test/integration/test-apt-get-changelog

+ 1
- 1
apt-private/private-download.cc View File

@@ -248,7 +248,7 @@ bool DoChangelog(CommandLine &CmdL)
APT::VersionList verset = APT::VersionList::FromCommandLine(Cache,
CmdL.FileList + 1, APT::CacheSetHelper::CANDIDATE, helper);
if (verset.empty() == true)
return false;
return _error->Error(_("No packages found"));

bool const downOnly = _config->FindB("APT::Get::Download-Only", false);
bool const printOnly = _config->FindB("APT::Get::Print-URIs", false);


+ 5
- 0
test/integration/test-apt-get-changelog View File

@@ -132,3 +132,8 @@ testfilestats 'dpkg.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAU
head -n 3 dpkg.changelog > dpkg.change
testfileequal 'dpkg.change' "$(apthelper cat-file 'rootdir/usr/share/doc/dpkg/changelog' | head -n 3)"
rm -f dpkg.change dpkg.changelog

# no package specified
testfailureequal 'E: No packages found' aptget changelog
testfailureequal 'E: Unable to locate package clclclclc
E: No packages found' aptget changelog clclclclc

Loading…
Cancel
Save