diff options
Diffstat (limited to 'cmdline')
-rw-r--r-- | cmdline/apt-cache.cc | 17 | ||||
-rw-r--r-- | cmdline/apt-get.cc | 12 | ||||
-rwxr-xr-x | cmdline/apt-key | 1 | ||||
-rwxr-xr-x | cmdline/apt-mark | 3 |
4 files changed, 25 insertions, 8 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 355e9aefb..07b95e3ca 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1505,15 +1505,26 @@ bool ShowSrcPackage(CommandLine &CmdL) if (_error->PendingError() == true) return false; + unsigned found = 0; for (const char **I = CmdL.FileList + 1; *I != 0; I++) { SrcRecs.Restart(); pkgSrcRecords::Parser *Parse; - while ((Parse = SrcRecs.Find(*I,false)) != 0) - cout << Parse->AsStr() << endl;; + unsigned found_this = 0; + while ((Parse = SrcRecs.Find(*I,false)) != 0) { + cout << Parse->AsStr() << endl;; + found++; + found_this++; + } + if (found_this == 0) { + _error->Warning(_("Unable to locate package %s"),*I); + continue; + } } - return true; + if (found > 0) + return true; + return _error->Error(_("No packages found")); } /*}}}*/ // Policy - Show the results of the preferences file /*{{{*/ diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 5af2dca04..62f712c39 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1347,9 +1347,11 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, if (Src.empty() == true) { // Sources files have no codename information - if (VerTag.empty() == true && DefRel.empty() == false) - _error->Warning(_("Ignore unavailable target release '%s' of package '%s'"), DefRel.c_str(), TmpSrc.c_str()); - DefRel.clear(); + if (VerTag.empty() == true && DefRel.empty() == false) + { + _error->Error(_("Ignore unavailable target release '%s' of package '%s'"), DefRel.c_str(), TmpSrc.c_str()); + return 0; + } } } if (Src.empty() == true) @@ -1417,8 +1419,8 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, if (Last != 0 || VerTag.empty() == true) break; //if (VerTag.empty() == false && Last == 0) - _error->Warning(_("Ignore unavailable version '%s' of package '%s'"), VerTag.c_str(), TmpSrc.c_str()); - VerTag.clear(); + _error->Error(_("Ignore unavailable version '%s' of package '%s'"), VerTag.c_str(), TmpSrc.c_str()); + return 0; } if (Last == 0 || Last->Jump(Offset) == false) diff --git a/cmdline/apt-key b/cmdline/apt-key index e45468fd4..27731ef7d 100755 --- a/cmdline/apt-key +++ b/cmdline/apt-key @@ -146,6 +146,7 @@ if [ "$1" = "--keyring" ]; then else #echo "generate list" TRUSTEDFILE="/etc/apt/trusted.gpg" + eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring) if [ -r "$TRUSTEDFILE" ]; then GPG="$GPG --keyring $TRUSTEDFILE" fi diff --git a/cmdline/apt-mark b/cmdline/apt-mark index 18552177c..12768b708 100755 --- a/cmdline/apt-mark +++ b/cmdline/apt-mark @@ -86,6 +86,9 @@ if __name__ == "__main__": else: STATE_FILE=options.filename + if len(args) == 0: + parser.error("first argument must be 'markauto', 'unmarkauto' or 'showauto'") + if args[0] == "showauto": show_automatic(STATE_FILE) else: |