From 7146a53c4c6803bff0ddec739f5ca83231cb2b14 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 29 Jul 2008 16:56:03 +0200 Subject: * cmdline/apt-cache.cc: - do not show Breaks in unmet --- cmdline/apt-cache.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index f10ea48be..d73111b6a 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -102,15 +102,13 @@ bool UnMet(CommandLine &CmdL) if (End->Type != pkgCache::Dep::PreDepends && End->Type != pkgCache::Dep::Depends && End->Type != pkgCache::Dep::Suggests && - End->Type != pkgCache::Dep::Recommends && - End->Type != pkgCache::Dep::DpkgBreaks) + End->Type != pkgCache::Dep::Recommends) continue; // Important deps only if (Important == true) if (End->Type != pkgCache::Dep::PreDepends && - End->Type != pkgCache::Dep::Depends && - End->Type != pkgCache::Dep::DpkgBreaks) + End->Type != pkgCache::Dep::Depends) continue; // Verify the or group -- cgit v1.2.3-70-g09d2 From 5aa95c863d9bc5b0de7dd1279d3ad672193cc3a6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 31 Jul 2008 14:57:38 +0200 Subject: * Apply --important option to apt-cache depends (LP: #16947) --- cmdline/apt-cache.cc | 8 +++++++- debian/changelog | 2 +- doc/apt-cache.8.xml | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index d73111b6a..a73e35a53 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -555,6 +555,7 @@ bool Depends(CommandLine &CmdL) bool Recurse = _config->FindB("APT::Cache::RecurseDepends",false); bool Installed = _config->FindB("APT::Cache::Installed",false); + bool Important = _config->FindB("APT::Cache::Important",false); bool DidSomething; do { @@ -577,7 +578,12 @@ bool Depends(CommandLine &CmdL) for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; D++) { - + // Important deps only + if (Important == true) + if (D->Type != pkgCache::Dep::PreDepends && + D->Type != pkgCache::Dep::Depends) + continue; + pkgCache::PkgIterator Trg = D.TargetPkg(); if((Installed && Trg->CurrentVer != 0) || !Installed) diff --git a/debian/changelog b/debian/changelog index c788c1d7d..24f876e44 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,7 +29,7 @@ apt (0.7.15) UNRELEASED; urgency=low [ Dereck Wonnacott ] * apt-ftparchive might write corrupt Release files (LP: #46439) - + * Apply --important option to apt-cache depends (LP: #16947) -- diff --git a/doc/apt-cache.8.xml b/doc/apt-cache.8.xml index c1e65332d..c359ac3d8 100644 --- a/doc/apt-cache.8.xml +++ b/doc/apt-cache.8.xml @@ -289,7 +289,7 @@ Reverse Provides: - Print only important dependencies; for use with unmet. Causes only Depends and + Print only important dependencies; for use with unmet and depends. Causes only Depends and Pre-Depends relations to be printed. Configuration Item: APT::Cache::Important. -- cgit v1.2.3-70-g09d2 From 9b5d79ec68d5380f26b92cd0d9cb7af6a19ac849 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 5 Aug 2008 10:52:09 +0200 Subject: fix various -Wall warnings --- apt-inst/contrib/extracttar.cc | 4 ++-- apt-pkg/acquire.cc | 3 ++- apt-pkg/contrib/cdromutl.cc | 3 ++- apt-pkg/contrib/mmap.cc | 5 +++-- apt-pkg/deb/dpkgpm.cc | 4 ++-- apt-pkg/depcache.cc | 2 +- apt-pkg/indexcopy.cc | 2 +- cmdline/apt-cache.cc | 2 +- debian/changelog | 1 + methods/http.cc | 3 ++- methods/https.cc | 2 +- 11 files changed, 18 insertions(+), 13 deletions(-) (limited to 'cmdline') diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 68c871a5d..8338fd89d 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -208,14 +208,14 @@ bool ExtractTar::Go(pkgDirStream &Stream) Itm.Name = (char *)LastLongName.c_str(); else { - Tar->Name[sizeof(Tar->Name)] = 0; + Tar->Name[sizeof(Tar->Name)-1] = 0; Itm.Name = Tar->Name; } if (Itm.Name[0] == '.' && Itm.Name[1] == '/' && Itm.Name[2] != 0) Itm.Name += 2; // Grab the link target - Tar->Name[sizeof(Tar->LinkName)] = 0; + Tar->Name[sizeof(Tar->LinkName)-1] = 0; Itm.LinkTarget = Tar->LinkName; if (LastLongLink.empty() == false) diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 6840ae120..91f603889 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -444,8 +444,9 @@ bool pkgAcquire::Clean(string Dir) unlink(Dir->d_name); }; - chdir(StartDir.c_str()); closedir(D); + if (chdir(StartDir.c_str()) != 0) + return _error->Errno("chdir",_("Unable to change to %s"),StartDir.c_str()); return true; } /*}}}*/ diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc index 6f00e1451..b6524a178 100644 --- a/apt-pkg/contrib/cdromutl.cc +++ b/apt-pkg/contrib/cdromutl.cc @@ -176,7 +176,8 @@ bool IdentCdrom(string CD,string &Res,unsigned int Version) Hash.Add(Dir->d_name); }; - chdir(StartDir.c_str()); + if (chdir(StartDir.c_str()) != 0) + return _error->Errno("chdir",_("Unable to change to %s"),StartDir.c_str()); closedir(D); // Some stats from the fsys diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index abcae46fe..eed438250 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -192,7 +192,8 @@ DynamicMMap::~DynamicMMap() unsigned long EndOfFile = iSize; iSize = WorkSpace; Close(false); - ftruncate(Fd->Fd(),EndOfFile); + if(ftruncate(Fd->Fd(),EndOfFile) < 0) + _error->Errno("ftruncate", _("Failed to truncate file")); } /*}}}*/ // DynamicMMap::RawAllocate - Allocate a raw chunk of unaligned space /*{{{*/ @@ -209,7 +210,7 @@ unsigned long DynamicMMap::RawAllocate(unsigned long Size,unsigned long Aln) // Just in case error check if (Result + Size > WorkSpace) { - _error->Error("Dynamic MMap ran out of room"); + _error->Error(_("Dynamic MMap ran out of room")); return 0; } diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index c2c33f342..2abb3a0ef 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -496,7 +496,7 @@ bool pkgDPkgPM::OpenLog() struct tm *tmp = localtime(&t); strftime(outstr, sizeof(outstr), "%F %T", tmp); fprintf(term_out, "\nLog started: "); - fprintf(term_out, outstr); + fprintf(term_out, "%s", outstr); fprintf(term_out, "\n"); } return true; @@ -511,7 +511,7 @@ bool pkgDPkgPM::CloseLog() struct tm *tmp = localtime(&t); strftime(outstr, sizeof(outstr), "%F %T", tmp); fprintf(term_out, "Log ended: "); - fprintf(term_out, outstr); + fprintf(term_out, "%s", outstr); fprintf(term_out, "\n"); fclose(term_out); } diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index d8b4dc6d2..4ac77b3aa 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -269,7 +269,7 @@ bool pkgDepCache::writeStateFile(OpProgress *prog, bool InstalledOnly) ostr.str(string("")); ostr << "Package: " << pkg.Name() << "\nAuto-Installed: 1\n\n"; - fprintf(OutFile,ostr.str().c_str()); + fprintf(OutFile,"%s",ostr.str().c_str()); fprintf(OutFile,"\n"); } } diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index b30777d8d..9e5c03e0b 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -639,7 +639,7 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, // Open the Release file and add it to the MetaIndex if(!MetaIndex->Load(*I+"Release")) { - _error->Error(MetaIndex->ErrorText.c_str()); + _error->Error("%s",MetaIndex->ErrorText.c_str()); return false; } diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index a73e35a53..b16a0e5d0 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1276,7 +1276,7 @@ bool DisplayRecord(pkgCache::VerIterator V) /*}}}*/ // Search - Perform a search /*{{{*/ // --------------------------------------------------------------------- -/* This searches the package names and pacakge descriptions for a pattern */ +/* This searches the package names and package descriptions for a pattern */ struct ExDescFile { pkgCache::DescFile *Df; diff --git a/debian/changelog b/debian/changelog index 24f876e44..cd433ac25 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,7 @@ apt (0.7.15) UNRELEASED; urgency=low (thanks to Joey Hess) * document --install-recommends and --no-install-recommends (thanks to Dereck Wonnacott, LP: #126180) + * fix various -Wall warnings [ Dereck Wonnacott ] * apt-ftparchive might write corrupt Release files (LP: #46439) diff --git a/methods/http.cc b/methods/http.cc index 26d435dea..b3c791fa0 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -941,7 +941,8 @@ int HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv) if (Srv->StartPos >= 0) { Res.ResumePoint = Srv->StartPos; - ftruncate(File->Fd(),Srv->StartPos); + if (ftruncate(File->Fd(),Srv->StartPos) < 0) + _error->Errno("ftruncate", _("Failed to truncate file")); } // Set the start point diff --git a/methods/https.cc b/methods/https.cc index e53ba1a11..98dfeefa1 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -249,7 +249,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm) if(success != 0) { unlink(File->Name().c_str()); - _error->Error(curl_errorstr); + _error->Error("%s", curl_errorstr); Fail(); return true; } -- cgit v1.2.3-70-g09d2 From 496a05c628d39c981a8f472f16629043d8508808 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 6 Aug 2008 13:58:44 +0200 Subject: make "apt-get build-dep" installed packages marked automatic by default. This can be changed by setting the value of APT::Get::Build-Dep-Automatic to false (thanks to Aaron Haviland, closes: #44874, LP: #248268) --- cmdline/apt-get.cc | 2 ++ debian/changelog | 6 +++++- doc/examples/configure-index | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 104baba8a..eda37a31e 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2513,6 +2513,8 @@ bool DoBuildDep(CommandLine &CmdL) { // We successfully installed something; skip remaining alternatives skipAlternatives = hasAlternatives; + if(_config->FindB("APT::Get::Build-Dep-Automatic", true) == true) + Cache->MarkAuto(Pkg, true); continue; } else if (hasAlternatives) diff --git a/debian/changelog b/debian/changelog index cd433ac25..e034dc733 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,7 +27,11 @@ apt (0.7.15) UNRELEASED; urgency=low * document --install-recommends and --no-install-recommends (thanks to Dereck Wonnacott, LP: #126180) * fix various -Wall warnings - + * make "apt-get build-dep" installed packages marked automatic + by default. This can be changed by setting the value of + APT::Get::Build-Dep-Automatic to false (thanks to Aaron + Haviland, closes: #44874, LP: #248268) + [ Dereck Wonnacott ] * apt-ftparchive might write corrupt Release files (LP: #46439) * Apply --important option to apt-cache depends (LP: #16947) diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 9c53154da..0bab8e0f8 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -54,6 +54,7 @@ APT Only-Source ""; Diff-Only "false"; Tar-Only "false"; + Build-Dep-Automatic "true"; }; Cache -- cgit v1.2.3-70-g09d2 From 78acd6505b8c08f47dd44911b567df31d07aa78d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 9 Sep 2008 21:26:40 +0200 Subject: * cmdline/apt-cache.cc: - remove the gettext from a string that consists entirely of variables (LP: #56792) --- cmdline/apt-cache.cc | 3 ++- debian/changelog | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index b16a0e5d0..11bc4fe03 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1533,7 +1533,8 @@ bool Policy(CommandLine &CmdL) if (SrcList->FindIndex(F,Indx) == false && _system->FindIndex(F,Indx) == false) return _error->Error(_("Cache is out of sync, can't x-ref a package file")); - printf(_("%4i %s\n"), + + printf("%4i %s\n", Plcy.GetPriority(F),Indx->Describe(true).c_str()); // Print the reference information for the package diff --git a/debian/changelog b/debian/changelog index e79d37d04..1e23129b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -35,6 +35,9 @@ apt (0.7.15) UNRELEASED; urgency=low - support having CDs with no Packages file (just a Packages.gz) by not forcing a verification on non-existing files (LP: #255545) + * cmdline/apt-cache.cc: + - remove the gettext from a string that consists entirely + of variables (LP: #56792) [ Dereck Wonnacott ] * apt-ftparchive might write corrupt Release files (LP: #46439) -- cgit v1.2.3-70-g09d2 From 99921bf936f050c77f424f85a658fcdbef98326e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 8 Dec 2008 09:33:43 -0800 Subject: - fix "apt-get source pkg=ver" if binary name != source name (LP: #202219) * doc/makefile: - add examples/apt-https-method-example.conf --- cmdline/apt-get.cc | 6 +++--- debian/changelog | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index eda37a31e..40ae02400 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1295,9 +1295,9 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, { string Ver = Parse->Version(); - // Skip name mismatches - if (IsMatch == true && Parse->Package() != Src) - continue; + // show name mismatches + if (IsMatch == true && Parse->Package() != Src) + ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package(), Src); if (VerTag.empty() == false) { diff --git a/debian/changelog b/debian/changelog index 0f20db8a3..1ab8e0968 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,10 @@ apt (0.7.17) UNRELEASED; urgency=low * cmdline/apt-cache.cc: - remove the gettext from a string that consists entirely of variables (LP: #56792) + - fix "apt-get source pkg=ver" if binary name != source name + (LP: #202219) + * doc/makefile: + - add examples/apt-https-method-example.conf * apt-pkg/cacheiterators.h: - add missing checks for Owner == 0 in end() * apt-pkg/deb/dpkgpm.cc: -- cgit v1.2.3-70-g09d2 From f23153d046f014f96d442fca5b9ef6ede7fcf546 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 9 Dec 2008 14:38:10 -0800 Subject: * methods/gpgv.cc: - fix compiler warning * cmdline/apt-get.cc: - fix "apt-get source pkg=ver" if binary name != source name and show a message (LP: #202219) * apt-pkg/deb/debsystem.cc: - make strings i18n able --- apt-pkg/deb/debsystem.cc | 15 ++++++++------- cmdline/apt-get.cc | 2 +- debian/changelog | 11 ++++++++--- methods/gpgv.cc | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc index 11a84f1c6..b882367b8 100644 --- a/apt-pkg/deb/debsystem.cc +++ b/apt-pkg/deb/debsystem.cc @@ -17,7 +17,8 @@ #include #include #include - +#include + #include #include #include @@ -66,11 +67,11 @@ bool debSystem::Lock() if (LockFD == -1) { if (errno == EACCES || errno == EAGAIN) - return _error->Error("Unable to lock the administration directory (%s), " - "is another process using it?",AdminDir.c_str()); + return _error->Error(_("Unable to lock the administration directory (%s), " + "is another process using it?"),AdminDir.c_str()); else - return _error->Error("Unable to lock the administration directory (%s), " - "are you root?",AdminDir.c_str()); + return _error->Error(_("Unable to lock the administration directory (%s), " + "are you root?"),AdminDir.c_str()); } // See if we need to abort with a dirty journal @@ -78,8 +79,8 @@ bool debSystem::Lock() { close(LockFD); LockFD = -1; - return _error->Error("dpkg was interrupted, you must manually " - "run 'dpkg --configure -a' to correct the problem. "); + return _error->Error(_("dpkg was interrupted, you must manually " + "run 'dpkg --configure -a' to correct the problem. ")); } LockCount++; diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 40ae02400..2ef32a615 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1297,7 +1297,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, // show name mismatches if (IsMatch == true && Parse->Package() != Src) - ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package(), Src); + ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package().c_str(), Src.c_str()); if (VerTag.empty() == false) { diff --git a/debian/changelog b/debian/changelog index 77a5bac1f..e2a0365ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,8 +26,6 @@ apt (0.7.17) UNRELEASED; urgency=low * cmdline/apt-cache.cc: - remove the gettext from a string that consists entirely of variables (LP: #56792) - - fix "apt-get source pkg=ver" if binary name != source name - (LP: #202219) * doc/makefile: - add examples/apt-https-method-example.conf * apt-pkg/cacheiterators.h: @@ -39,7 +37,14 @@ apt (0.7.17) UNRELEASED; urgency=low - fix some i18n issues * apt-pkg/contrib/strutl.h: - add new strprintf() function to make i18n strings easier - + * methods/gpgv.cc: + - fix compiler warning + * cmdline/apt-get.cc: + - fix "apt-get source pkg=ver" if binary name != source name + and show a message (LP: #202219) + * apt-pkg/deb/debsystem.cc: + - make strings i18n able + [ Dereck Wonnacott ] * apt-ftparchive might write corrupt Release files (LP: #46439) * Apply --important option to apt-cache depends (LP: #16947) diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 9f4683e6e..f3277b300 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -264,7 +264,7 @@ bool GPGVMethod::Fetch(FetchItem *Itm) // least one bad signature. good signatures and NoPubKey signatures // happen easily when a file is signed with multiple signatures if(GoodSigners.empty() or !BadSigners.empty()) - return _error->Error(errmsg.c_str()); + return _error->Error("%s", errmsg.c_str()); } // Just pass the raw output up, because passing it as a real data -- cgit v1.2.3-70-g09d2 From 73fc19d055b20178e5efae08013fe24663f6d89c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 16 Dec 2008 07:37:02 +0100 Subject: Clarify the --help for 'purge' (LP: #243948) --- cmdline/apt-get.cc | 2 +- debian/changelog | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 4dbc4873f..06fa41017 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2632,7 +2632,7 @@ bool ShowHelp(CommandLine &CmdL) " install - Install new packages (pkg is libc6 not libc6.deb)\n" " remove - Remove packages\n" " autoremove - Remove automatically all unused packages\n" - " purge - Remove and purge packages\n" + " purge - Remove packages and config files\n" " source - Download source archives\n" " build-dep - Configure build-dependencies for source packages\n" " dist-upgrade - Distribution upgrade, see apt-get(8)\n" diff --git a/debian/changelog b/debian/changelog index c113a9597..7600db699 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,6 +37,7 @@ apt (0.7.21) UNRELEASED; urgency=low [ Dereck Wonnacott ] * apt-ftparchive might write corrupt Release files (LP: #46439) * Apply --important option to apt-cache depends (LP: #16947) + * Clarify the --help for 'purge' (LP: #243948) -- Michael Vogt Fri, 12 Sep 2008 11:34:24 +0200 -- cgit v1.2.3-70-g09d2 From 89ad8e7c1ad4aa6a90732ea5802a58c799ead189 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 9 Mar 2009 16:11:29 +0100 Subject: fix "apt-get source pkg" if there is a binary package and a source package of the same name but from different packages (LP: #330103) --- cmdline/apt-get.cc | 21 ++++++++++++++------- debian/changelog | 3 +++ 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 06fa41017..1c2c11689 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1272,16 +1272,23 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, } } } - - // No source package name.. - if (Src.empty() == true) - Src = TmpSrc; - + // The best hit pkgSrcRecords::Parser *Last = 0; unsigned long Offset = 0; string Version; bool IsMatch = false; + bool MatchSrcOnly = false; + + // No source package name.. + if (Src.empty() == true) + Src = TmpSrc; + else + // if we have a source pkg name, make sure to only search + // for srcpkg names, otherwise apt gets confused if there + // is a binary package "pkg1" and a source package "pkg1" + // with the same name but that comes from different packages + MatchSrcOnly = true; // If we are matching by version then we need exact matches to be happy if (VerTag.empty() == false) @@ -1291,13 +1298,13 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, binary packages in the search */ pkgSrcRecords::Parser *Parse; SrcRecs.Restart(); - while ((Parse = SrcRecs.Find(Src.c_str(),false)) != 0) + while ((Parse = SrcRecs.Find(Src.c_str(), MarchSrcOnly)) != 0) { string Ver = Parse->Version(); // show name mismatches if (IsMatch == true && Parse->Package() != Src) - ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package().c_str(), Src.c_str()); + ioprintf(c1out, _("No source package '%s' picking '%s' instead\n"), Parse->Package().c_str(), Src.c_str()); if (VerTag.empty() == false) { diff --git a/debian/changelog b/debian/changelog index c0da66973..19c06b5e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,9 @@ apt (0.7.21) UNRELEASED; urgency=low * cmdline/apt-get.cc: - fix "apt-get source pkg=ver" if binary name != source name and show a message (LP: #202219) + - fix "apt-get source pkg" if there is a binary package and + a source package of the same name but from different + packages (LP: #330103) * apt-pkg/deb/debsystem.cc: - make strings i18n able * apt-pkg/contrib/strutl.cc: -- cgit v1.2.3-70-g09d2 From c53cb75d7405f2def6751c3bfc5ca0418287a169 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 9 Mar 2009 16:18:38 +0100 Subject: cmdline/apt-get.cc: fix typo --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 1c2c11689..27e16d3f3 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1298,7 +1298,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, binary packages in the search */ pkgSrcRecords::Parser *Parse; SrcRecs.Restart(); - while ((Parse = SrcRecs.Find(Src.c_str(), MarchSrcOnly)) != 0) + while ((Parse = SrcRecs.Find(Src.c_str(), MatchSrcOnly)) != 0) { string Ver = Parse->Version(); -- cgit v1.2.3-70-g09d2 From 8a9e5ffdb6d0f1744f56bcb6522b134cfdae4a19 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 27 Mar 2009 22:45:07 +0100 Subject: * cmdline/acqprogress.cc: - Call pkgAcquireStatus::Pulse even if quiet, so that we still get dlstatus messages on the status-fd (LP: #290234). --- cmdline/acqprogress.cc | 4 ++-- debian/changelog | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc index a5fee1db5..b3ded4142 100644 --- a/cmdline/acqprogress.cc +++ b/cmdline/acqprogress.cc @@ -145,11 +145,11 @@ void AcqTextStatus::Stop() bandwidth and ETA indicator. */ bool AcqTextStatus::Pulse(pkgAcquire *Owner) { + pkgAcquireStatus::Pulse(Owner); + if (Quiet > 0) return true; - pkgAcquireStatus::Pulse(Owner); - enum {Long = 0,Medium,Short} Mode = Long; char Buffer[sizeof(BlankLine)]; diff --git a/debian/changelog b/debian/changelog index 19c06b5e9..82a82ef8c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -52,6 +52,12 @@ apt (0.7.21) UNRELEASED; urgency=low * Apply --important option to apt-cache depends (LP: #16947) * Clarify the --help for 'purge' (LP: #243948) + + [ Colin Watson ] + * cmdline/acqprogress.cc: + - Call pkgAcquireStatus::Pulse even if quiet, so that we still get + dlstatus messages on the status-fd (LP: #290234). + -- Michael Vogt Fri, 12 Sep 2008 11:34:24 +0200 apt (0.7.20) unstable; urgency=low -- cgit v1.2.3-70-g09d2 From a9b5e24b6bb392c4de88d965c33120d4a7fcb4f6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 3 Jun 2009 12:05:20 +0200 Subject: * cmdline/apt-mark: - add "showauto" option to show automatically installed packages --- cmdline/apt-mark | 72 +++++++++++++++++++++++++++++++++++--------------------- debian/changelog | 2 ++ 2 files changed, 47 insertions(+), 27 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-mark b/cmdline/apt-mark index f6e749eb5..226d2079b 100755 --- a/cmdline/apt-mark +++ b/cmdline/apt-mark @@ -14,34 +14,21 @@ actions = { "markauto" : 1, "unmarkauto": 0 } -if __name__ == "__main__": - apt_pkg.init() - - # option parsing - parser = OptionParser() - parser.usage = "%prog [options] {markauto|unmarkauto} packages..." - parser.add_option("-f", "--file", action="store", type="string", - dest="filename", - help="read/write a different file") - parser.add_option("-v", "--verbose", - action="store_true", dest="verbose", default=False, - help="print verbose status messages to stdout") - (options, args) = parser.parse_args() - if len(args) < 2: - parser.error("not enough argument") - - # get pkgs to change - if args[0] not in actions.keys(): - parser.error("first argument must be 'markauto' or 'unmarkauto'") - pkgs = args[1:] - action = actions[args[0]] - - # get the state-file - if not options.filename: - STATE_FILE = apt_pkg.Config.FindDir("Dir::State") + "extended_states" - else: - STATE_FILE=options.filename +def show_automatic(filename): + if not os.path.exists(STATE_FILE): + return + auto = set() + tagfile = apt_pkg.ParseTagFile(open(STATE_FILE)) + while tagfile.Step(): + pkgname = tagfile.Section.get("Package") + autoInst = tagfile.Section.get("Auto-Installed") + if int(autoInst): + auto.add(pkgname) + print "\n".join(sorted(auto)) + +def mark_unmark_automatic(filename, action, pkgs): + " mark or unmark automatic flag" # open the statefile if os.path.exists(STATE_FILE): tagfile = apt_pkg.ParseTagFile(open(STATE_FILE)) @@ -63,3 +50,34 @@ if __name__ == "__main__": os.chmod(outfile.name, 0644) os.rename(outfile.name, STATE_FILE) os.chmod(STATE_FILE, 0644) + + +if __name__ == "__main__": + apt_pkg.init() + + # option parsing + parser = OptionParser() + parser.usage = "%prog [options] {markauto|unmarkauto} packages..." + parser.add_option("-f", "--file", action="store", type="string", + dest="filename", + help="read/write a different file") + parser.add_option("-v", "--verbose", + action="store_true", dest="verbose", default=False, + help="print verbose status messages to stdout") + (options, args) = parser.parse_args() + + # get the state-file + if not options.filename: + STATE_FILE = apt_pkg.Config.FindDir("Dir::State") + "extended_states" + else: + STATE_FILE=options.filename + + if args[0] == "showauto": + show_automatic(STATE_FILE) + else: + # get pkgs to change + if args[0] not in actions.keys(): + parser.error("first argument must be 'markauto', 'unmarkauto' or 'showauto'") + pkgs = args[1:] + action = actions[args[0]] + mark_unmark_automatic(STATE_FILE, action, pkgs) diff --git a/debian/changelog b/debian/changelog index 7e953aa9b..3678e33f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -52,6 +52,8 @@ apt (0.7.21) UNRELEASED; urgency=low hash by using locale independant tolower_ascii() function. Thanks to M. Vefa Bicakci (LP: #80248) * build fixes for g++-4.4 + * cmdline/apt-mark: + - add "showauto" option to show automatically installed packages [ Dereck Wonnacott ] * apt-ftparchive might write corrupt Release files (LP: #46439) -- cgit v1.2.3-70-g09d2