From 42ab8223d52672cf28c6e2e574bb364c438bd49a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 23 May 2005 21:06:09 +0000 Subject: * merged with my apt--fixes--0 branch Patches applied: * apt@packages.debian.org/apt--misc-abi-changes--0--patch-4 Merge from mainline * apt@packages.debian.org/apt--misc-abi-changes--0--patch-5 Merge from mainline * apt@packages.debian.org/apt--misc-abi-changes--0--patch-6 Collapse both pkgAcquire::Run() methods into one, with a default value * michael.vogt@ubuntu.com--2005/apt--fixes--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-79 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-1 * merged obvious fixes into the tree to make it easy for matt to merge * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-2 * more merges from otavio that looks good/uncritical * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-3 * merged Matts misc-abi-changes tree * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-4 * finalized the changelog for a ubuntu build * otavio@debian.org--2005/apt--fixes--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-71 * otavio@debian.org--2005/apt--fixes--0--patch-1 Fix comments about the need of xmlto * otavio@debian.org--2005/apt--fixes--0--patch-2 Fix a compile warning * otavio@debian.org--2005/apt--fixes--0--patch-3 Sync with apt--main--0--patch-76 * otavio@debian.org--2005/apt--fixes--0--patch-4 Sync with apt--main--0--patch-78 * otavio@debian.org--2005/apt--fixes--0--patch-5 Add fixes that was wrongly included on DDTP changes. * otavio@debian.org--2005/apt--fixes--0--patch-8 Add information about the other fixes include on this branch now. * otavio@debian.org--2005/apt--fixes--0--patch-9 Merge last changes from apt--main--0. * otavio@debian.org--2005/apt--fixes--0--patch-10 Fix warnings about min/max change in gcc-4.0 * otavio@debian.org--2005/apt--fixes--0--patch-11 Fix remaning warnings while compiling gcc-4.0 * otavio@debian.org--2005/apt--fixes--0--patch-12 Add changelog entry about the fixes for warnings while compiling using GCC 4.0 compiler. --- cmdline/apt-get.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 6268f4953..00e6aaa67 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1380,6 +1380,15 @@ bool DoUpgrade(CommandLine &CmdL) /* Install named packages */ bool DoInstall(CommandLine &CmdL) { + // Lock the list directory + FileFd Lock; + if (_config->FindB("Debug::NoLocking",false) == false) + { + Lock.Fd(GetLock(_config->FindDir("Dir::State::Lists") + "lock")); + if (_error->PendingError() == true) + return _error->Error(_("Unable to lock the list directory")); + } + CacheFile Cache; if (Cache.OpenForInstall() == false || Cache.CheckDeps(CmdL.FileSize() != 1) == false) -- cgit v1.2.3 From 6804503b9bd057fae67294bb8ca95c9f10e00194 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sun, 26 Jun 2005 09:56:37 +0000 Subject: * merged/removed conflicts with apt--main--0 Patches applied: * apt@packages.debian.org/apt--main--0--patch-80 Merge michael.vogt@ubuntu.com--2005/apt--fixes--0 * apt@packages.debian.org/apt--main--0--patch-81 Open 0.6.37 * apt@packages.debian.org/apt--main--0--patch-82 merge bubulle@debian.org--2005/apt--main--0 * apt@packages.debian.org/apt--main--0--patch-83 Update changelog * apt@packages.debian.org/apt--main--0--patch-84 Fix build of French man pages (now using XML, not SGML) * apt@packages.debian.org/apt--main--0--patch-85 Merge patch from Philippe Batailler for French man page build * apt@packages.debian.org/apt--main--0--patch-86 add Welsh translations from Dafydd Harries * apt@packages.debian.org/apt--main--0--patch-87 Update changelog * apt@packages.debian.org/apt--main--0--patch-88 Change debian/bugscript to use #!/bin/bash (Closes: #313402) * apt@packages.debian.org/apt--main--0--patch-89 Branch for Debian * apt@packages.debian.org/apt--main--0--patch-90 Update version in configure * apt@packages.debian.org/apt--main--0--patch-91 Fix French man page build * apt@packages.debian.org/apt--main--0--patch-92 Add the current Debian archive signing key * bubulle@debian.org--2005/apt--main--0--patch-66 Italian translation complete * bubulle@debian.org--2005/apt--main--0--patch-67 Sync with Matt * bubulle@debian.org--2005/apt--main--0--patch-68 Sync with Matt * bubulle@debian.org--2005/apt--main--0--patch-69 Sync with Matt * bubulle@debian.org--2005/apt--main--0--patch-70 Re-generate the POT and PO files from sources * bubulle@debian.org--2005/apt--main--0--patch-71 Update French translation * bubulle@debian.org--2005/apt--main--0--patch-72 Merge with Matt * bubulle@debian.org--2005/apt--main--0--patch-73 Basque translation update * bubulle@debian.org--2005/apt--main--0--patch-74 Hebres translation update * bubulle@debian.org--2005/apt--main--0--patch-75 Merge with Matt * bubulle@debian.org--2005/apt--main--0--patch-76 Correct the Hebrew translation for #306658 * bubulle@debian.org--2005/apt--main--0--patch-77 Update French man pages translations * bubulle@debian.org--2005/apt--main--0--patch-78 Merge with Matt * bubulle@debian.org--2005/apt--main--0--patch-79 Correct syntax errors in Hebrew translation * bubulle@debian.org--2005/apt--main--0--patch-80 Revert changes to debian/changelog and debian/apt.cron.daily * bubulle@debian.org--2005/apt--main--0--patch-81 Portuguese translation update * daf@muse.19inch.net--2005/apt--main--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-85 * daf@muse.19inch.net--2005/apt--main--0--patch-1 add Welsh translation * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-6 * build fix for apt--main--0 * philippe.batailler@free.fr--2005/apt--mainBubulle--0.1--patch-1 Passage sous arch * philippe.batailler@free.fr--2005/apt--mainMatt--0--patch-1 fix xml error --- cmdline/apt-get.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 00e6aaa67..316bb7af9 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -541,7 +541,7 @@ bool ShowEssential(ostream &out,CacheFile &Cache) } delete [] Added; - return ShowList(out,_("WARNING: The following essential packages will be removed\n" + return ShowList(out,_("WARNING: The following essential packages will be removed.\n" "This should NOT be done unless you know exactly what you are doing!"),List,VersionsList); } @@ -862,7 +862,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, const char *Prompt = _("Yes, do as I say!"); ioprintf(c2out, - _("You are about to do something potentially harmful\n" + _("You are about to do something potentially harmful.\n" "To continue type in the phrase '%s'\n" " ?] "),Prompt); c2out << flush; -- cgit v1.2.3 From 339690e4250de4d3eb8e98a91223420c01a5af96 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 1 Aug 2005 15:52:18 +0000 Subject: * merged with matts tree Patches applied: * apt@packages.debian.org/apt--main--0--patch-97 Update priority of apt-utils to important, to match the override file * apt@packages.debian.org/apt--main--0--patch-98 Install only one keyring on each branch (Closes: #316119) * apt@packages.debian.org/apt--main--0--patch-99 Finalize 0.6.39 * apt@packages.debian.org/apt--main--0--patch-100 Use debian.org address in mainline * apt@packages.debian.org/apt--main--0--patch-101 Update pot file * apt@packages.debian.org/apt--main--0--patch-102 Open 0.6.40 * apt@packages.debian.org/apt--main--0--patch-103 Patch from Jordi Mallach to mark some additional strings for translation * apt@packages.debian.org/apt--main--0--patch-104 Updated Catalan translation from Jordi Mallach * apt@packages.debian.org/apt--main--0--patch-105 Merge from bubulle@debian.org--2005/apt--main--0 * bubulle@debian.org--2005/apt--main--0--patch-90 Merge with Matt * bubulle@debian.org--2005/apt--main--0--patch-91 Updated Slovak translation * bubulle@debian.org--2005/apt--main--0--patch-92 Add apt-key French man page * bubulle@debian.org--2005/apt--main--0--patch-93 Update Greek translations * bubulle@debian.org--2005/apt--main--0--patch-94 Merge with Matt * bubulle@debian.org--2005/apt--main--0--patch-95 Sync PO files with the POT file/French translation update --- cmdline/apt-get.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 316bb7af9..75617d194 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -688,7 +688,7 @@ static bool CheckAuth(pkgAcquire& Fetcher) if (_config->FindB("APT::Get::AllowUnauthenticated",false) == true) { - c2out << "Authentication warning overridden.\n"; + c2out << _("Authentication warning overridden.\n"); return true; } @@ -750,7 +750,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, if (Cache->BrokenCount() != 0) { ShowBroken(c1out,Cache,false); - return _error->Error("Internal error, InstallPackages was called with broken packages!"); + return _error->Error(_("Internal error, InstallPackages was called with broken packages!")); } if (Cache->DelCount() == 0 && Cache->InstCount() == 0 && @@ -769,7 +769,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, if (Res == pkgPackageManager::Failed) return false; if (Res != pkgPackageManager::Completed) - return _error->Error("Internal error, Ordering didn't finish"); + return _error->Error(_("Internal error, Ordering didn't finish")); return true; } @@ -810,7 +810,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, if (DebBytes != Cache->DebSize()) { c0out << DebBytes << ',' << Cache->DebSize() << endl; - c0out << "How odd.. The sizes didn't match, email apt@packages.debian.org" << endl; + c0out << _("How odd.. The sizes didn't match, email apt@packages.debian.org") << endl; } // Number of bytes @@ -840,7 +840,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, struct statvfs Buf; string OutputDir = _config->FindDir("Dir::Cache::Archives"); if (statvfs(OutputDir.c_str(),&Buf) != 0) - return _error->Errno("statvfs","Couldn't determine free space in %s", + return _error->Errno("statvfs",_("Couldn't determine free space in %s"), OutputDir.c_str()); if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize) return _error->Error(_("You don't have enough free space in %s."), @@ -1743,7 +1743,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL) if (Fix.Resolve() == false) { ShowBroken(c1out,Cache,false); - return _error->Error("Internal error, problem resolver broke stuff"); + return _error->Error(_("Internal error, problem resolver broke stuff")); } } @@ -1751,7 +1751,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL) if (pkgAllUpgrade(Cache) == false) { ShowBroken(c1out,Cache,false); - return _error->Error("Internal error, problem resolver broke stuff"); + return _error->Error(_("Internal error, problem resolver broke stuff")); } return InstallPackages(Cache,false); @@ -1922,7 +1922,7 @@ bool DoSource(CommandLine &CmdL) struct statvfs Buf; string OutputDir = "."; if (statvfs(OutputDir.c_str(),&Buf) != 0) - return _error->Errno("statvfs","Couldn't determine free space in %s", + return _error->Errno("statvfs",_("Couldn't determine free space in %s"), OutputDir.c_str()); if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize) return _error->Error(_("You don't have enough free space in %s"), -- cgit v1.2.3 From 75ef8f14174f83a5f876a0d7414f4e6064a7d3e0 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 9 Aug 2005 08:38:26 +0000 Subject: * merged from main Patches applied: * apt@packages.debian.org/apt--main--0--patch-106 Restore lost changelog entries * apt@packages.debian.org/apt--main--0--patch-107 Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0 * apt@packages.debian.org/apt--main--0--patch-108 Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0 * apt@packages.debian.org/apt--main--0--patch-109 Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0 * apt@packages.debian.org/apt--main--0--patch-110 Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-5 * merged with apt--main--0 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-85 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-1 * inital proof of concept code, understands what dpkg tells it already * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-2 * progress reporting works now * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-3 * added "APT::Status-Fd" variable * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-4 * do i18n now too * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-5 * define N_(x) if it is not defined already * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-6 * PackageManager::DoInstall(int status_fd) added (does not break the ABI) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-7 * merged with apt--fixes--0 to make it build again * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-8 * added support for "error" and "conffile-prompt" messages from dpkg * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-9 merge with main * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-10 * use sizeof() for all snprintf() uses; fix a potential line break problem in the status reading code; changed the N_() to _() calls * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-11 * added APT::KeepFDs configuration list for file descriptors that apt should leave open (needed for various frontends like debconf, synaptic) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-12 * fixed a API breakage * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-13 * doc added, should be releasable now * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-14 * merged with apt--main--0 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-15 * more source comments, added Debug::DpkgPM debug code to inspect the dpkg<->apt communication, broke the abi (ok with matt) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-16 * the progress reporting has it's own "Debug::pkgDPkgProgressReporting" debug variable now * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-17 * merged PackageOps and TranslatedPackageOps into a single Map with the new DpkgState struct * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-18 * clear the APT::Keep-Fds configuration when it's no longer needed * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-19 * rewrote the reading from dpkg so that it never blocks * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-20 * merged the two status arrays into one * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-21 * added support for download progress reporting too (for Kamion and base-config) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-22 * ABI break; added Configuration::Clear(string List, {int,string} value) added (to remove a single Value from a list); test/conf_clear.cc added * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-23 * remvoed a debug string * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-24 * soname changed, fixed a bug in the parsing code when dpkg send the same state more than once (at the end) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-25 * merged with apt@packages.debian.org/apt--main--0, added changelog entry for the 0.6.40.1 upload * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-26 * fix a bug when out-of-order states are send from dpkg * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-27 * changelog update * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-28 * a real changelog entry now * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-29 * changelog finalized * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-30 * propper (and sane) support for pmerror and pmconffile added --- cmdline/apt-get.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 75617d194..e673e0f5b 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -765,7 +765,8 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, if (_config->FindB("APT::Get::Simulate") == true) { pkgSimulate PM(Cache); - pkgPackageManager::OrderResult Res = PM.DoInstall(); + int status_fd = _config->FindI("APT::Status-Fd",-1); + pkgPackageManager::OrderResult Res = PM.DoInstall(status_fd); if (Res == pkgPackageManager::Failed) return false; if (Res != pkgPackageManager::Completed) @@ -994,7 +995,8 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, } _system->UnLock(); - pkgPackageManager::OrderResult Res = PM->DoInstall(); + int status_fd = _config->FindI("APT::Status-Fd",-1); + pkgPackageManager::OrderResult Res = PM->DoInstall(status_fd); if (Res == pkgPackageManager::Failed || _error->PendingError() == true) return false; if (Res == pkgPackageManager::Completed) -- cgit v1.2.3 From 13e8426f800dd5e21e78fa6488b860e3f0467984 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 23 Aug 2005 08:03:51 +0000 Subject: * merged with apt--fixes--0 Patches applied: * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-7 * fixed incorrect man-page example * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-8 * changelog udpate * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-9 * we only need to check once for xmlto * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-10 * fix a bug in a man-page, fix a problem with overly long lines in apt-cdrom * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-11 * merged with apt--main--0 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-12 * fix a incorrect error message (it always added .gz regardless what was downloaded) * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-13 * merged with main * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-14 * added Hashsum support for file and cdrom * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-15 * added README.arch * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-16 * merged with main * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-17 * move the changelog to the right place * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-18 * Change pkgPolicy::Pin from private to protected * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-19 * added a default constructor for PrvIterator * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-20 * applied otavios patch to reread the statusFile on debSystem::Initialize * otavio@debian.org--2005/apt--fixes--0--patch-28 Reread status configuration, needed for clients using independent apt ... --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index e673e0f5b..7e079b91c 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1659,7 +1659,7 @@ bool DoInstall(CommandLine &CmdL) // See if we need to prompt if (Cache->InstCount() == ExpectedInst && Cache->DelCount() == 0) return InstallPackages(Cache,false,false); - + return InstallPackages(Cache,false); } /*}}}*/ -- cgit v1.2.3 From ceb00be9927199c067827a630ddc254149afcb57 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 16 Sep 2005 11:46:43 +0000 Subject: * better error string for a failed dpkg-source --- cmdline/apt-get.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 7e079b91c..ac931373d 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2013,6 +2013,7 @@ bool DoSource(CommandLine &CmdL) if (system(S) != 0) { fprintf(stderr,_("Unpack command '%s' failed.\n"),S); + fprintf(stderr,_("Check if the 'dpkg-dev' package is installed.\n"); _exit(1); } } -- cgit v1.2.3 From 14cd494a9fa0d6801410bf121beb74ea631d59a6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 22 Sep 2005 13:36:39 +0000 Subject: * make sure that the pkgRecords D'tor does not segfault --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ac931373d..a22d881b6 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2013,7 +2013,7 @@ bool DoSource(CommandLine &CmdL) if (system(S) != 0) { fprintf(stderr,_("Unpack command '%s' failed.\n"),S); - fprintf(stderr,_("Check if the 'dpkg-dev' package is installed.\n"); + fprintf(stderr,_("Check if the 'dpkg-dev' package is installed.\n")); _exit(1); } } -- cgit v1.2.3 From 026f60e2c5601c4db42220cd20af9bfe066b2d83 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 18 Oct 2005 13:36:47 +0000 Subject: * inital support for "apt-get source -t dist" (but no downgrades yet --- cmdline/apt-get.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index a22d881b6..55681d59e 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1194,8 +1194,16 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, { VerTag = string(TmpSrc.begin() + Slash + 1,TmpSrc.end()); TmpSrc = string(TmpSrc.begin(),TmpSrc.begin() + Slash); + } else if(_config->Find("APT::Default-Release") != "") { + // if we have a Default-Release (-t) we want a exact match + // FIXME: we won't support downgrades + // (i.e. -t stable won't work on a unstable system + pkgCache::PkgIterator Pkg = Cache.FindPkg(TmpSrc); + if(Pkg.end() == false) { + pkgCache::VerIterator Ver = Cache.GetCandidateVer(Pkg); + VerTag = Ver.VerStr(); + } } - /* Lookup the version of the package we would install if we were to install a version and determine the source package name, then look in the archive for a source package of the same name. In theory -- cgit v1.2.3 From aca056a93dda08ad03690b4b70295832a723a655 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 18 Oct 2005 22:42:09 +0000 Subject: * full support for apt-get source -t now (and honor pining too) --- cmdline/apt-get.cc | 61 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 17 deletions(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 55681d59e..82f202103 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1190,35 +1190,62 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, string VerTag; string TmpSrc = Name; string::size_type Slash = TmpSrc.rfind('='); + + // honor pining and default release + string DefRel = _config->Find("APT::Default-Release"); + + pkgCache::PkgIterator Pkg = Cache.FindPkg(TmpSrc); + pkgCache::VerIterator CandVer = Cache.GetCandidateVer(Pkg); + if(Pkg.end() == false) + { + VerTag = CandVer.VerStr(); + } + if (Slash != string::npos) { VerTag = string(TmpSrc.begin() + Slash + 1,TmpSrc.end()); TmpSrc = string(TmpSrc.begin(),TmpSrc.begin() + Slash); - } else if(_config->Find("APT::Default-Release") != "") { - // if we have a Default-Release (-t) we want a exact match - // FIXME: we won't support downgrades - // (i.e. -t stable won't work on a unstable system - pkgCache::PkgIterator Pkg = Cache.FindPkg(TmpSrc); - if(Pkg.end() == false) { - pkgCache::VerIterator Ver = Cache.GetCandidateVer(Pkg); - VerTag = Ver.VerStr(); + } + else if(DefRel.empty() == false) + { + // we have a default release, try to locate the pkg. we do it like + // this because GetCandidateVer() will not "downgrade", that means + // "apt-get source -t stable apt" won't work on a unstable system + for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; + Ver++) + { + for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; + VF++) + { + /* If this is the status file, and the current version is not the + version in the status file (ie it is not installed, or somesuch) + then it is not a candidate for installation, ever. This weeds + out bogus entries that may be due to config-file states, or + other. */ + if ((VF.File()->Flags & pkgCache::Flag::NotSource) == + pkgCache::Flag::NotSource && Pkg.CurrentVer() != Ver) + continue; + + //std::cout << VF.File().Archive() << std::endl; + if(VF.File().Archive() == DefRel) + { + VerTag = Ver.VerStr(); + break; + } + } } } + /* Lookup the version of the package we would install if we were to install a version and determine the source package name, then look - in the archive for a source package of the same name. In theory - we could stash the version string as well and match that too but - today there aren't multi source versions in the archive. */ - if (_config->FindB("APT::Get::Only-Source") == false && - VerTag.empty() == true) + in the archive for a source package of the same name. */ + if (_config->FindB("APT::Get::Only-Source") == false) { - pkgCache::PkgIterator Pkg = Cache.FindPkg(TmpSrc); if (Pkg.end() == false) { - pkgCache::VerIterator Ver = Cache.GetCandidateVer(Pkg); - if (Ver.end() == false) + if (CandVer.end() == false) { - pkgRecords::Parser &Parse = Recs.Lookup(Ver.FileList()); + pkgRecords::Parser &Parse = Recs.Lookup(CandVer.FileList()); Src = Parse.SourcePkg(); } } -- cgit v1.2.3 From d87116efb8c7382cc463f5208277470fce129d12 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 19 Oct 2005 12:34:19 +0000 Subject: * fix segfault when there is no Archive for a VerFile --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 82f202103..3ffb740a6 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1227,7 +1227,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, continue; //std::cout << VF.File().Archive() << std::endl; - if(VF.File().Archive() == DefRel) + if(VF.File().Archive() && (VF.File().Archive() == DefRel)) { VerTag = Ver.VerStr(); break; -- cgit v1.2.3 From ce6162bed91fd2e508d751d3d88dd16f3d97c8d3 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 19 Oct 2005 13:51:20 +0000 Subject: * don't get candidate release as version tag for FindSrc by default. because it break for bin-NMUs :/ (e.g. dpkg source is 1.13.11, but i386 version string is 1.13.11.0.1) --- cmdline/apt-get.cc | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 3ffb740a6..6e17611cb 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1191,15 +1191,9 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, string TmpSrc = Name; string::size_type Slash = TmpSrc.rfind('='); - // honor pining and default release + // honor default release string DefRel = _config->Find("APT::Default-Release"); - pkgCache::PkgIterator Pkg = Cache.FindPkg(TmpSrc); - pkgCache::VerIterator CandVer = Cache.GetCandidateVer(Pkg); - if(Pkg.end() == false) - { - VerTag = CandVer.VerStr(); - } if (Slash != string::npos) { @@ -1243,9 +1237,10 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, { if (Pkg.end() == false) { - if (CandVer.end() == false) + pkgCache::VerIterator Ver = Cache.GetCandidateVer(Pkg); + if (Ver.end() == false) { - pkgRecords::Parser &Parse = Recs.Lookup(CandVer.FileList()); + pkgRecords::Parser &Parse = Recs.Lookup(Ver.FileList()); Src = Parse.SourcePkg(); } } @@ -1300,10 +1295,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, } } - if (Last == 0) - return 0; - - if (Last->Jump(Offset) == false) + if (Last == 0 || Last->Jump(Offset) == false) return 0; return Last; -- cgit v1.2.3 From 463870e4b43bd9bd15652010fdcdedb717d0aa7e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 19 Oct 2005 19:41:09 +0000 Subject: * init the default ScreenWidth to 79 columns by default (Closes: #324921) --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 6e17611cb..3475d79ae 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -66,7 +66,7 @@ ostream c0out(0); ostream c1out(0); ostream c2out(0); ofstream devnull("/dev/null"); -unsigned int ScreenWidth = 80; +unsigned int ScreenWidth = 80 - 1; /* - 1 for the cursor */ // class CacheFile - Cover class for some dependency cache functions /*{{{*/ // --------------------------------------------------------------------- -- cgit v1.2.3 From 7049e4e9ca6db15326d8a76f4f5f9ab592a925e3 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sun, 23 Oct 2005 09:27:12 +0000 Subject: * be extra carefull in cmdline/apt-get.cc:FindSrc() and check VF.File() for NULL --- cmdline/apt-get.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 3475d79ae..040f670b1 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1200,7 +1200,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, VerTag = string(TmpSrc.begin() + Slash + 1,TmpSrc.end()); TmpSrc = string(TmpSrc.begin(),TmpSrc.begin() + Slash); } - else if(DefRel.empty() == false) + else if(DefRel.empty() == false) { // we have a default release, try to locate the pkg. we do it like // this because GetCandidateVer() will not "downgrade", that means @@ -1211,6 +1211,10 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++) { + // extra paranioa + if(VF.File() == NULL) + continue; + /* If this is the status file, and the current version is not the version in the status file (ie it is not installed, or somesuch) then it is not a candidate for installation, ever. This weeds -- cgit v1.2.3 From d5f38102698899c4d3693583247a71f54ea1b278 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 24 Oct 2005 08:28:53 +0000 Subject: * cmdline/apt-get.cc: fix bug in FindSrc() (debian #335213) --- cmdline/apt-get.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 040f670b1..48b21a31f 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1200,7 +1200,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, VerTag = string(TmpSrc.begin() + Slash + 1,TmpSrc.end()); TmpSrc = string(TmpSrc.begin(),TmpSrc.begin() + Slash); } - else if(DefRel.empty() == false) + else if(!Pkg.end() && DefRel.empty() == false) { // we have a default release, try to locate the pkg. we do it like // this because GetCandidateVer() will not "downgrade", that means @@ -1211,10 +1211,6 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++) { - // extra paranioa - if(VF.File() == NULL) - continue; - /* If this is the status file, and the current version is not the version in the status file (ie it is not installed, or somesuch) then it is not a candidate for installation, ever. This weeds -- cgit v1.2.3