From 29d0b55e368aa2ae26ad61f7ecd60b723a3a4e05 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 31 Jul 2009 15:50:19 +0200 Subject: [apt-pkg/sourcelist.cc] only display the warning about missing sources.list file, if no SourceListEntry exists (e.g. sources.list.d dir does not exists or it exists but does not include a .list-file with valid entries) --- apt-pkg/sourcelist.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 47a08ad90..85a20f0b8 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -157,10 +157,15 @@ bool pkgSourceList::ReadMainList() // CNC:2003-11-28 - Entries in sources.list have priority over // entries in sources.list.d. string Main = _config->FindFile("Dir::Etc::sourcelist"); + string noSourceMsg; if (FileExists(Main) == true) Res &= ReadAppend(Main); else + { + // only print the warning if we can't load a valid sourcefile in the end _error->WarningE("FileExists",_("Unable to read %s"),Main.c_str()); + _error->PopMessage(noSourceMsg); + } string Parts = _config->FindDir("Dir::Etc::sourceparts"); if (FileExists(Parts) == true) @@ -168,6 +173,9 @@ bool pkgSourceList::ReadMainList() else _error->WarningE("FileExists",_("Unable to read %s"),Parts.c_str()); + if (SrcList.empty() == true && noSourceMsg.empty() == false) + _error->Warning(noSourceMsg.c_str()); + return Res; } /*}}}*/ -- cgit v1.2.3 From 03dbbc98ba48eeb7c360c7fb02f21cdc9cd86465 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 31 Jul 2009 18:52:16 +0200 Subject: [cmdline/apt-get.cc] add APT::Get::HideAutoRemove=small to display only a short line instead of the full package list. (Closes: #537450) --- cmdline/apt-get.cc | 58 ++++++++++++++++------- debian/changelog | 6 +++ po/apt-all.pot | 136 ++++++++++++++++++++++++++++------------------------- 3 files changed, 117 insertions(+), 83 deletions(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ab6dca388..d3972ad81 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1400,20 +1400,29 @@ bool DoAutomaticRemove(CacheFile &Cache) bool Debug = _config->FindI("Debug::pkgAutoRemove",false); bool doAutoRemove = _config->FindB("APT::Get::AutomaticRemove", false); bool hideAutoRemove = _config->FindB("APT::Get::HideAutoRemove"); - pkgDepCache::ActionGroup group(*Cache); + pkgDepCache::ActionGroup group(*Cache); if(Debug) std::cout << "DoAutomaticRemove()" << std::endl; - if (_config->FindB("APT::Get::Remove",true) == false && - doAutoRemove == true) + // we don't want to autoremove and we don't want to see it, so why calculating? + if (doAutoRemove == false && hideAutoRemove == true) + return true; + + if (doAutoRemove == true && + _config->FindB("APT::Get::Remove",true) == false) { c1out << _("We are not supposed to delete stuff, can't start " "AutoRemover") << std::endl; - doAutoRemove = false; + return false; } + bool purgePkgs = _config->FindB("APT::Get::Purge", false); + bool smallList = (hideAutoRemove == false && + strcasecmp(_config->Find("APT::Get::HideAutoRemove","").c_str(),"small") == 0); + string autoremovelist, autoremoveversions; + unsigned long autoRemoveCount = 0; // look over the cache to see what can be removed for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); ! Pkg.end(); ++Pkg) { @@ -1422,30 +1431,43 @@ bool DoAutomaticRemove(CacheFile &Cache) if(Pkg.CurrentVer() != 0 || Cache[Pkg].Install()) if(Debug) std::cout << "We could delete %s" << Pkg.Name() << std::endl; - - // only show stuff in the list that is not yet marked for removal - if(Cache[Pkg].Delete() == false) - { - autoremovelist += string(Pkg.Name()) + " "; - autoremoveversions += string(Cache[Pkg].CandVersion) + "\n"; - } + if (doAutoRemove) { if(Pkg.CurrentVer() != 0 && Pkg->CurrentState != pkgCache::State::ConfigFiles) - Cache->MarkDelete(Pkg, _config->FindB("APT::Get::Purge", false)); + Cache->MarkDelete(Pkg, purgePkgs); else Cache->MarkKeep(Pkg, false, false); } + else + { + // only show stuff in the list that is not yet marked for removal + if(Cache[Pkg].Delete() == false) + { + // we don't need to fill the strings if we don't need them + if (smallList == true) + ++autoRemoveCount; + else + { + autoremovelist += string(Pkg.Name()) + " "; + autoremoveversions += string(Cache[Pkg].CandVersion) + "\n"; + } + } + } } } - if (!hideAutoRemove) - ShowList(c1out, _("The following packages were automatically installed and are no longer required:"), autoremovelist, autoremoveversions); - if (!doAutoRemove && !hideAutoRemove && autoremovelist.size() > 0) + // if we don't remove them, we should show them! + if (doAutoRemove == false && (autoremovelist.empty() == false || autoRemoveCount != 0)) + { + if (smallList == false) + ShowList(c1out, _("The following packages were automatically installed and are no longer required:"), autoremovelist, autoremoveversions); + else + ioprintf(c1out, _("%lu packages were automatically installed and are no longer required.\n"), autoRemoveCount); c1out << _("Use 'apt-get autoremove' to remove them.") << std::endl; - - // Now see if we destroyed anything - if (Cache->BrokenCount() != 0) + } + // Now see if we had destroyed anything (if we had done anything) + else if (Cache->BrokenCount() != 0) { c1out << _("Hmm, seems like the AutoRemover destroyed something which really\n" "shouldn't happen. Please file a bug report against apt.") << endl; diff --git a/debian/changelog b/debian/changelog index cb5e74cb6..46bd16df9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,15 @@ apt (0.7.23) unstable; urgency=low + [ Michael Vogt ] * cmdline/apt-get.cc: - honor APT::Get::Only-Source properly in FindSrc() (thanks to Martin Pitt for reporting the problem) + [ David Kalnischkies ] + * cmdline/apt-get.cc: + - add APT::Get::HideAutoRemove=small to display only a short line + instead of the full package list. (Closes: #537450) + -- Michael Vogt Thu, 30 Jul 2009 15:27:30 +0200 apt (0.7.22) unstable; urgency=low diff --git a/po/apt-all.pot b/po/apt-all.pot index a18646290..605bdb8c2 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-26 01:10+0200\n" +"POT-Creation-Date: 2009-07-31 18:47+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,7 +151,7 @@ msgstr "" #: cmdline/apt-cache.cc:1714 cmdline/apt-cdrom.cc:134 cmdline/apt-config.cc:70 #: cmdline/apt-extracttemplates.cc:225 ftparchive/apt-ftparchive.cc:547 -#: cmdline/apt-get.cc:2584 cmdline/apt-sortpkgs.cc:144 +#: cmdline/apt-get.cc:2606 cmdline/apt-sortpkgs.cc:144 #, c-format msgid "%s %s for %s compiled on %s %s\n" msgstr "" @@ -549,7 +549,7 @@ msgstr "" msgid "Y" msgstr "" -#: cmdline/apt-get.cc:149 cmdline/apt-get.cc:1659 +#: cmdline/apt-get.cc:149 cmdline/apt-get.cc:1681 #, c-format msgid "Regex compilation error - %s" msgstr "" @@ -708,11 +708,11 @@ msgstr "" msgid "Internal error, Ordering didn't finish" msgstr "" -#: cmdline/apt-get.cc:811 cmdline/apt-get.cc:2001 cmdline/apt-get.cc:2034 +#: cmdline/apt-get.cc:811 cmdline/apt-get.cc:2023 cmdline/apt-get.cc:2056 msgid "Unable to lock the download directory" msgstr "" -#: cmdline/apt-get.cc:821 cmdline/apt-get.cc:2082 cmdline/apt-get.cc:2328 +#: cmdline/apt-get.cc:821 cmdline/apt-get.cc:2104 cmdline/apt-get.cc:2350 #: apt-pkg/cachefile.cc:65 msgid "The list of sources could not be read." msgstr "" @@ -741,7 +741,7 @@ msgstr "" msgid "After this operation, %sB disk space will be freed.\n" msgstr "" -#: cmdline/apt-get.cc:866 cmdline/apt-get.cc:2177 +#: cmdline/apt-get.cc:866 cmdline/apt-get.cc:2199 #, c-format msgid "Couldn't determine free space in %s" msgstr "" @@ -775,7 +775,7 @@ msgstr "" msgid "Do you want to continue [Y/n]? " msgstr "" -#: cmdline/apt-get.cc:986 cmdline/apt-get.cc:2225 apt-pkg/algorithms.cc:1389 +#: cmdline/apt-get.cc:986 cmdline/apt-get.cc:2247 apt-pkg/algorithms.cc:1389 #, c-format msgid "Failed to fetch %s %s\n" msgstr "" @@ -784,7 +784,7 @@ msgstr "" msgid "Some files failed to download" msgstr "" -#: cmdline/apt-get.cc:1005 cmdline/apt-get.cc:2234 +#: cmdline/apt-get.cc:1005 cmdline/apt-get.cc:2256 msgid "Download complete and in download only mode" msgstr "" @@ -889,21 +889,26 @@ msgstr "" msgid "Unable to lock the list directory" msgstr "" -#: cmdline/apt-get.cc:1411 +#: cmdline/apt-get.cc:1415 msgid "We are not supposed to delete stuff, can't start AutoRemover" msgstr "" -#: cmdline/apt-get.cc:1443 +#: cmdline/apt-get.cc:1464 msgid "" "The following packages were automatically installed and are no longer " "required:" msgstr "" -#: cmdline/apt-get.cc:1445 +#: cmdline/apt-get.cc:1466 +#, c-format +msgid "%lu packages were automatically installed and are no longer required.\n" +msgstr "" + +#: cmdline/apt-get.cc:1467 msgid "Use 'apt-get autoremove' to remove them." msgstr "" -#: cmdline/apt-get.cc:1450 +#: cmdline/apt-get.cc:1472 msgid "" "Hmm, seems like the AutoRemover destroyed something which really\n" "shouldn't happen. Please file a bug report against apt." @@ -919,49 +924,49 @@ msgstr "" #. "that package should be filed.") << endl; #. } #. -#: cmdline/apt-get.cc:1453 cmdline/apt-get.cc:1743 +#: cmdline/apt-get.cc:1475 cmdline/apt-get.cc:1765 msgid "The following information may help to resolve the situation:" msgstr "" -#: cmdline/apt-get.cc:1457 +#: cmdline/apt-get.cc:1479 msgid "Internal Error, AutoRemover broke stuff" msgstr "" -#: cmdline/apt-get.cc:1476 +#: cmdline/apt-get.cc:1498 msgid "Internal error, AllUpgrade broke stuff" msgstr "" -#: cmdline/apt-get.cc:1531 +#: cmdline/apt-get.cc:1553 #, c-format msgid "Couldn't find task %s" msgstr "" -#: cmdline/apt-get.cc:1646 cmdline/apt-get.cc:1682 +#: cmdline/apt-get.cc:1668 cmdline/apt-get.cc:1704 #, c-format msgid "Couldn't find package %s" msgstr "" -#: cmdline/apt-get.cc:1669 +#: cmdline/apt-get.cc:1691 #, c-format msgid "Note, selecting %s for regex '%s'\n" msgstr "" -#: cmdline/apt-get.cc:1700 +#: cmdline/apt-get.cc:1722 #, c-format msgid "%s set to manually installed.\n" msgstr "" -#: cmdline/apt-get.cc:1713 +#: cmdline/apt-get.cc:1735 msgid "You might want to run `apt-get -f install' to correct these:" msgstr "" -#: cmdline/apt-get.cc:1716 +#: cmdline/apt-get.cc:1738 msgid "" "Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a " "solution)." msgstr "" -#: cmdline/apt-get.cc:1728 +#: cmdline/apt-get.cc:1750 msgid "" "Some packages could not be installed. This may mean that you have\n" "requested an impossible situation or if you are using the unstable\n" @@ -969,152 +974,152 @@ msgid "" "or been moved out of Incoming." msgstr "" -#: cmdline/apt-get.cc:1746 +#: cmdline/apt-get.cc:1768 msgid "Broken packages" msgstr "" -#: cmdline/apt-get.cc:1775 +#: cmdline/apt-get.cc:1797 msgid "The following extra packages will be installed:" msgstr "" -#: cmdline/apt-get.cc:1864 +#: cmdline/apt-get.cc:1886 msgid "Suggested packages:" msgstr "" -#: cmdline/apt-get.cc:1865 +#: cmdline/apt-get.cc:1887 msgid "Recommended packages:" msgstr "" -#: cmdline/apt-get.cc:1894 +#: cmdline/apt-get.cc:1916 msgid "Calculating upgrade... " msgstr "" -#: cmdline/apt-get.cc:1897 methods/ftp.cc:702 methods/connect.cc:112 +#: cmdline/apt-get.cc:1919 methods/ftp.cc:702 methods/connect.cc:112 msgid "Failed" msgstr "" -#: cmdline/apt-get.cc:1902 +#: cmdline/apt-get.cc:1924 msgid "Done" msgstr "" -#: cmdline/apt-get.cc:1969 cmdline/apt-get.cc:1977 +#: cmdline/apt-get.cc:1991 cmdline/apt-get.cc:1999 msgid "Internal error, problem resolver broke stuff" msgstr "" -#: cmdline/apt-get.cc:2077 +#: cmdline/apt-get.cc:2099 msgid "Must specify at least one package to fetch source for" msgstr "" -#: cmdline/apt-get.cc:2107 cmdline/apt-get.cc:2346 +#: cmdline/apt-get.cc:2129 cmdline/apt-get.cc:2368 #, c-format msgid "Unable to find a source package for %s" msgstr "" -#: cmdline/apt-get.cc:2156 +#: cmdline/apt-get.cc:2178 #, c-format msgid "Skipping already downloaded file '%s'\n" msgstr "" -#: cmdline/apt-get.cc:2184 +#: cmdline/apt-get.cc:2206 #, c-format msgid "You don't have enough free space in %s" msgstr "" -#: cmdline/apt-get.cc:2190 +#: cmdline/apt-get.cc:2212 #, c-format msgid "Need to get %sB/%sB of source archives.\n" msgstr "" -#: cmdline/apt-get.cc:2193 +#: cmdline/apt-get.cc:2215 #, c-format msgid "Need to get %sB of source archives.\n" msgstr "" -#: cmdline/apt-get.cc:2199 +#: cmdline/apt-get.cc:2221 #, c-format msgid "Fetch source %s\n" msgstr "" -#: cmdline/apt-get.cc:2230 +#: cmdline/apt-get.cc:2252 msgid "Failed to fetch some archives." msgstr "" -#: cmdline/apt-get.cc:2258 +#: cmdline/apt-get.cc:2280 #, c-format msgid "Skipping unpack of already unpacked source in %s\n" msgstr "" -#: cmdline/apt-get.cc:2270 +#: cmdline/apt-get.cc:2292 #, c-format msgid "Unpack command '%s' failed.\n" msgstr "" -#: cmdline/apt-get.cc:2271 +#: cmdline/apt-get.cc:2293 #, c-format msgid "Check if the 'dpkg-dev' package is installed.\n" msgstr "" -#: cmdline/apt-get.cc:2288 +#: cmdline/apt-get.cc:2310 #, c-format msgid "Build command '%s' failed.\n" msgstr "" -#: cmdline/apt-get.cc:2307 +#: cmdline/apt-get.cc:2329 msgid "Child process failed" msgstr "" -#: cmdline/apt-get.cc:2323 +#: cmdline/apt-get.cc:2345 msgid "Must specify at least one package to check builddeps for" msgstr "" -#: cmdline/apt-get.cc:2351 +#: cmdline/apt-get.cc:2373 #, c-format msgid "Unable to get build-dependency information for %s" msgstr "" -#: cmdline/apt-get.cc:2371 +#: cmdline/apt-get.cc:2393 #, c-format msgid "%s has no build depends.\n" msgstr "" -#: cmdline/apt-get.cc:2423 +#: cmdline/apt-get.cc:2445 #, c-format msgid "" "%s dependency for %s cannot be satisfied because the package %s cannot be " "found" msgstr "" -#: cmdline/apt-get.cc:2476 +#: cmdline/apt-get.cc:2498 #, c-format msgid "" "%s dependency for %s cannot be satisfied because no available versions of " "package %s can satisfy version requirements" msgstr "" -#: cmdline/apt-get.cc:2512 +#: cmdline/apt-get.cc:2534 #, c-format msgid "Failed to satisfy %s dependency for %s: Installed package %s is too new" msgstr "" -#: cmdline/apt-get.cc:2539 +#: cmdline/apt-get.cc:2561 #, c-format msgid "Failed to satisfy %s dependency for %s: %s" msgstr "" -#: cmdline/apt-get.cc:2553 +#: cmdline/apt-get.cc:2575 #, c-format msgid "Build-dependencies for %s could not be satisfied." msgstr "" -#: cmdline/apt-get.cc:2557 +#: cmdline/apt-get.cc:2579 msgid "Failed to process build dependencies" msgstr "" -#: cmdline/apt-get.cc:2589 +#: cmdline/apt-get.cc:2611 msgid "Supported modules:" msgstr "" -#: cmdline/apt-get.cc:2630 +#: cmdline/apt-get.cc:2652 msgid "" "Usage: apt-get [options] command\n" " apt-get [options] install|remove pkg1 [pkg2 ...]\n" @@ -1158,7 +1163,7 @@ msgid "" " This APT has Super Cow Powers.\n" msgstr "" -#: cmdline/apt-get.cc:2797 +#: cmdline/apt-get.cc:2819 msgid "" "NOTE: This is only a simulation!\n" " apt-get needs root privileges for real execution.\n" @@ -1381,9 +1386,10 @@ msgstr "" msgid "File %s/%s overwrites the one in the package %s" msgstr "" +#. only print the warning if we can't load a valid sourcefile in the end #: apt-inst/extract.cc:464 apt-pkg/contrib/configuration.cc:822 -#: apt-pkg/contrib/cdromutl.cc:157 apt-pkg/sourcelist.cc:163 -#: apt-pkg/sourcelist.cc:169 apt-pkg/sourcelist.cc:324 apt-pkg/acquire.cc:419 +#: apt-pkg/contrib/cdromutl.cc:157 apt-pkg/sourcelist.cc:166 +#: apt-pkg/sourcelist.cc:174 apt-pkg/sourcelist.cc:332 apt-pkg/acquire.cc:419 #: apt-pkg/init.cc:89 apt-pkg/init.cc:97 apt-pkg/clean.cc:33 #: apt-pkg/policy.cc:281 apt-pkg/policy.cc:287 #, c-format @@ -2211,16 +2217,16 @@ msgstr "" msgid "Dependency generation" msgstr "" -#: apt-pkg/depcache.cc:173 apt-pkg/depcache.cc:192 apt-pkg/depcache.cc:196 +#: apt-pkg/depcache.cc:173 apt-pkg/depcache.cc:193 apt-pkg/depcache.cc:197 msgid "Reading state information" msgstr "" -#: apt-pkg/depcache.cc:220 +#: apt-pkg/depcache.cc:223 #, c-format msgid "Failed to open StateFile %s" msgstr "" -#: apt-pkg/depcache.cc:226 +#: apt-pkg/depcache.cc:229 #, c-format msgid "Failed to write temporary StateFile %s" msgstr "" @@ -2260,27 +2266,27 @@ msgstr "" msgid "Malformed line %lu in source list %s (dist parse)" msgstr "" -#: apt-pkg/sourcelist.cc:203 +#: apt-pkg/sourcelist.cc:211 #, c-format msgid "Opening %s" msgstr "" -#: apt-pkg/sourcelist.cc:220 apt-pkg/cdrom.cc:445 +#: apt-pkg/sourcelist.cc:228 apt-pkg/cdrom.cc:445 #, c-format msgid "Line %u too long in source list %s." msgstr "" -#: apt-pkg/sourcelist.cc:240 +#: apt-pkg/sourcelist.cc:248 #, c-format msgid "Malformed line %u in source list %s (type)" msgstr "" -#: apt-pkg/sourcelist.cc:244 +#: apt-pkg/sourcelist.cc:252 #, c-format msgid "Type '%s' is not known on line %u in source list %s" msgstr "" -#: apt-pkg/sourcelist.cc:252 apt-pkg/sourcelist.cc:255 +#: apt-pkg/sourcelist.cc:260 apt-pkg/sourcelist.cc:263 #, c-format msgid "Malformed line %u in source list %s (vendor id)" msgstr "" -- cgit v1.2.3 From 0dae8ac5f8a3092057a80d932ae4e55c1e7d3ca5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 31 Jul 2009 20:29:50 +0200 Subject: [cmdline/apt-get.cc] ShowBroken() in build-dep (Closes: #145916) Patch from Mike O'Connor, thanks! --- cmdline/apt-get.cc | 5 ++++- debian/changelog | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index d3972ad81..ebb634b4f 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2572,7 +2572,10 @@ bool DoBuildDep(CommandLine &CmdL) // Now we check the state of the packages, if (Cache->BrokenCount() != 0) - return _error->Error(_("Build-dependencies for %s could not be satisfied."),*I); + { + ShowBroken(cout, Cache, false); + return _error->Error(_("Build-dependencies for %s could not be satisfied."),*I); + } } if (InstallPackages(Cache, false, true) == false) diff --git a/debian/changelog b/debian/changelog index 46bd16df9..b105faaef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ apt (0.7.23) unstable; urgency=low * cmdline/apt-get.cc: - add APT::Get::HideAutoRemove=small to display only a short line instead of the full package list. (Closes: #537450) + - ShowBroken() in build-dep (by Mike O'Connor, Closes: #145916) -- Michael Vogt Thu, 30 Jul 2009 15:27:30 +0200 -- cgit v1.2.3 From d95cf70db1c0cc7d80d862b826ea67ac70c3e92d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 31 Jul 2009 20:42:06 +0200 Subject: [apt-pkg/contrib/strutl.cc] enable thousand separator according to the current locale. Patch from Luca Bruno (Closes: #223712) --- apt-pkg/contrib/strutl.cc | 4 ++-- debian/changelog | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index a991b8988..1683868c8 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -304,13 +304,13 @@ string SizeToStr(double Size) { if (ASize < 100 && I != 0) { - sprintf(S,"%.1f%c",ASize,Ext[I]); + sprintf(S,"%'.1f%c",ASize,Ext[I]); break; } if (ASize < 10000) { - sprintf(S,"%.0f%c",ASize,Ext[I]); + sprintf(S,"%'.0f%c",ASize,Ext[I]); break; } ASize /= 1000.0; diff --git a/debian/changelog b/debian/changelog index b105faaef..384f8864f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ apt (0.7.23) unstable; urgency=low - add APT::Get::HideAutoRemove=small to display only a short line instead of the full package list. (Closes: #537450) - ShowBroken() in build-dep (by Mike O'Connor, Closes: #145916) + * apt-pkg/contrib/strutl.cc: + - enable thousand separator according to the current locale + (by Luca Bruno, Closes: #223712) -- Michael Vogt Thu, 30 Jul 2009 15:27:30 +0200 -- cgit v1.2.3 From 311e188ce858772bad0f622cf3d742a8acca80c0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 1 Aug 2009 19:47:20 +0200 Subject: [debian/changelog] add a Closes tag to mvo's --only-source patch --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 384f8864f..9987b7444 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,7 @@ apt (0.7.23) unstable; urgency=low [ Michael Vogt ] * cmdline/apt-get.cc: - honor APT::Get::Only-Source properly in FindSrc() (thanks to - Martin Pitt for reporting the problem) + Martin Pitt for reporting the problem) (Closes: #535362) [ David Kalnischkies ] * cmdline/apt-get.cc: -- cgit v1.2.3 From 33250e2f415611f820e24ba2f9f4d0e568d67d02 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 1 Aug 2009 19:50:42 +0200 Subject: [debian/changelog] correct two typos in the changelog for 0.7.22 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9987b7444..7f9cc0c02 100644 --- a/debian/changelog +++ b/debian/changelog @@ -73,7 +73,7 @@ apt (0.7.22) unstable; urgency=low (off by default) - send "dpkg-exec" message on the status fd when dpkg is run - provide DPkg::Chroot-Directory config option (useful for testing) - - fix potential hang when in a backgroud process group + - fix potential hang when in a background process group * apt-pkg/algorithms.cc: - consider recommends when making the scores for the problem resolver @@ -102,7 +102,7 @@ apt (0.7.22) unstable; urgency=low * apt-pkg/deb/debsystem.cc: - make strings i18n able * fix problematic use of tolower() when calculating the version - hash by using locale independant tolower_ascii() function. + hash by using locale independent tolower_ascii() function. Thanks to M. Vefa Bicakci (LP: #80248) * build fixes for g++-4.4 * cmdline/apt-mark: -- cgit v1.2.3 From 40e7fe0e053129c28c59acc79e94cc10e89e7738 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 3 Aug 2009 14:31:40 +0200 Subject: =?UTF-8?q?[apt-pkg/contrib/fileutl.cc]=20In=20function=20ExecWait?= =?UTF-8?q?():=20fix=20compile=20warning:=20warning:=20suggest=20explicit?= =?UTF-8?q?=20braces=20to=20avoid=20ambiguous=20=E2=80=98else=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apt-pkg/contrib/fileutl.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index a7de09c44..4240d9f49 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -451,10 +451,12 @@ bool ExecWait(pid_t Pid,const char *Name,bool Reap) if (Reap == true) return false; if (WIFSIGNALED(Status) != 0) + { if( WTERMSIG(Status) == SIGSEGV) return _error->Error(_("Sub-process %s received a segmentation fault."),Name); else return _error->Error(_("Sub-process %s received signal %u."),Name, WTERMSIG(Status)); + } if (WIFEXITED(Status) != 0) return _error->Error(_("Sub-process %s returned an error code (%u)"),Name,WEXITSTATUS(Status)); -- cgit v1.2.3 From 2b5c0d21114e200f524c2ff199bf1ce9e0d923fa Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 3 Aug 2009 14:44:28 +0200 Subject: [debian/changlog] add entry for the "missing source.list file" fix * apt-pkg/sourcelist.cc: - only show warning about missing sources.list file if no we have no valid sourceentry (Closes: #539731) --- debian/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7f9cc0c02..5822fcae6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,9 @@ apt (0.7.23) unstable; urgency=low * apt-pkg/contrib/strutl.cc: - enable thousand separator according to the current locale (by Luca Bruno, Closes: #223712) + * apt-pkg/sourcelist.cc: + - only show warning about missing sources.list file if no we have + no valid sourceentry (Closes: #539731) -- Michael Vogt Thu, 30 Jul 2009 15:27:30 +0200 -- cgit v1.2.3 From cfb3d242ded4b9d3e5f4f55a3139561fe78155db Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 8 Aug 2009 12:25:48 +0200 Subject: [apt-pkg/indexcopy.cc] fix a (hypothetical) memory leak then the Release file not exists, patch from George Danchev, thanks! (Closes: #511556) --- apt-pkg/indexcopy.cc | 3 +++ debian/changelog | 3 +++ 2 files changed, 6 insertions(+) diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 15696585a..0142d7dbe 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -592,7 +592,10 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, // a Release.gpg without a Release should never happen if(!FileExists(*I+"Release")) + { + delete MetaIndex; continue; + } // verify the gpg signature of "Release" diff --git a/debian/changelog b/debian/changelog index 403911833..408070b69 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ apt (0.7.22.3) unstable; urgency=low * apt-pkg/contrib/strutl.cc: - enable thousand separator according to the current locale (by Luca Bruno, Closes: #223712) + * apt-pkg/indexcopy.cc: + - fix a (hypothetical) memory leak then the Release file not exists + (by George Danchev, Closes: #511556) -- David Kalnischkies Sat, 08 Aug 2009 09:40:08 +0200 -- cgit v1.2.3 From 034960416c99c4737f99536c55b77cc9a27b8d66 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 8 Aug 2009 12:40:00 +0200 Subject: [cmdline/apt-cache.cc] fix a memory leak in the xvcg method Patch from George Danchev, thanks (Closes: #511557) --- cmdline/apt-cache.cc | 6 +++++- debian/changelog | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 0e950310b..7d7f58a62 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -929,7 +929,11 @@ bool XVcg(CommandLine &CmdL) Shapes[ShapeMap[Pkg->ID]]); } - + + delete[] Show; + delete[] Flags; + delete[] ShapeMap; + printf("}\n"); return true; } diff --git a/debian/changelog b/debian/changelog index 408070b69..e82057d8e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,9 +8,12 @@ apt (0.7.22.3) unstable; urgency=low * apt-pkg/contrib/strutl.cc: - enable thousand separator according to the current locale (by Luca Bruno, Closes: #223712) + + [ George Danchev ] + * cmdline/apt-cache.cc: + - fix a memory leak in the xvcg method (Closes: #511557) * apt-pkg/indexcopy.cc: - - fix a (hypothetical) memory leak then the Release file not exists - (by George Danchev, Closes: #511556) + - fix a memory leak then the Release file not exists (Closes: #511556) -- David Kalnischkies Sat, 08 Aug 2009 09:40:08 +0200 -- cgit v1.2.3 From 6e2525a1d9c0930fea9fa65514d7b813f27997f0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 8 Aug 2009 18:27:47 +0200 Subject: [doc/apt.conf.5.xml] mention the apt.conf.d dir Patch from Vincent McIntyre, thanks! (Closes: #520831) --- debian/changelog | 2 ++ doc/apt.conf.5.xml | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e82057d8e..e4b498a93 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ apt (0.7.22.3) unstable; urgency=low * apt-pkg/contrib/strutl.cc: - enable thousand separator according to the current locale (by Luca Bruno, Closes: #223712) + * doc/apt.conf.5.xml: + - mention the apt.conf.d dir (by Vincent McIntyre, Closes: #520831) [ George Danchev ] * cmdline/apt-cache.cc: diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index 2b2430c83..85a7d961c 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -822,7 +822,17 @@ is commented. Files - /etc/apt/apt.conf + + /etc/apt/apt.conf + APT configuration file. + Configuration Item: Dir::Etc::Main. + + + /etc/apt/apt.conf.d/ + APT configuration file fragments. + Configuration Item: Dir::Etc::Parts. + + See Also -- cgit v1.2.3 From f64196e879103151f3b90ba423dc74ef61ea8c76 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Aug 2009 10:21:00 +0200 Subject: [cmdline/apt-get.cc] check for availability ofstatfs.f_type Patch from Robert Millan, thanks! (Closes: #509313) --- cmdline/apt-get.cc | 14 +++- configure.in | 4 + debian/changelog | 1 + po/apt-all.pot | 212 ++++++++++++++++++++++++++--------------------------- 4 files changed, 121 insertions(+), 110 deletions(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ebb634b4f..384953a6b 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -868,8 +868,11 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize) { struct statfs Stat; - if (statfs(OutputDir.c_str(),&Stat) != 0 || - unsigned(Stat.f_type) != RAMFS_MAGIC) + if (statfs(OutputDir.c_str(),&Stat) != 0 +#if HAVE_STRUCT_STATFS_F_TYPE + || unsigned(Stat.f_type) != RAMFS_MAGIC +#endif + ) return _error->Error(_("You don't have enough free space in %s."), OutputDir.c_str()); } @@ -2201,8 +2204,11 @@ bool DoSource(CommandLine &CmdL) if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize) { struct statfs Stat; - if (statfs(OutputDir.c_str(),&Stat) != 0 || - unsigned(Stat.f_type) != RAMFS_MAGIC) + if (statfs(OutputDir.c_str(),&Stat) != 0 +#if HAVE_STRUCT_STATFS_F_TYPE + || unsigned(Stat.f_type) != RAMFS_MAGIC +#endif + ) return _error->Error(_("You don't have enough free space in %s"), OutputDir.c_str()); } diff --git a/configure.in b/configure.in index 9131e2fbe..0dd1beb1a 100644 --- a/configure.in +++ b/configure.in @@ -112,6 +112,10 @@ if test x"$HAVE_STATVFS" != x"yes"; then ]) fi +AC_CHECK_MEMBERS([struct statfs.f_type],,, + [$ac_includes_default + #include ]) + dnl We should use the real timegm function if we have it. AC_CHECK_FUNC(timegm,AC_DEFINE(HAVE_TIMEGM)) AC_SUBST(HAVE_TIMEGM) diff --git a/debian/changelog b/debian/changelog index e4b498a93..fd6f853e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ apt (0.7.22.3) unstable; urgency=low - add APT::Get::HideAutoRemove=small to display only a short line instead of the full package list. (Closes: #537450) - ShowBroken() in build-dep (by Mike O'Connor, Closes: #145916) + - check for statfs.f_type (by Robert Millan, Closes: #509313) * apt-pkg/contrib/strutl.cc: - enable thousand separator according to the current locale (by Luca Bruno, Closes: #223712) diff --git a/po/apt-all.pot b/po/apt-all.pot index 78c9c94e0..3ec999f76 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-08 09:46+0200\n" +"POT-Creation-Date: 2009-08-09 10:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,8 +21,8 @@ msgid "Package %s version %s has an unmet dep:\n" msgstr "" #: cmdline/apt-cache.cc:181 cmdline/apt-cache.cc:550 cmdline/apt-cache.cc:644 -#: cmdline/apt-cache.cc:797 cmdline/apt-cache.cc:1017 -#: cmdline/apt-cache.cc:1419 cmdline/apt-cache.cc:1571 +#: cmdline/apt-cache.cc:797 cmdline/apt-cache.cc:1021 +#: cmdline/apt-cache.cc:1423 cmdline/apt-cache.cc:1575 #, c-format msgid "Unable to locate package %s" msgstr "" @@ -91,72 +91,72 @@ msgstr "" msgid "Total space accounted for: " msgstr "" -#: cmdline/apt-cache.cc:469 cmdline/apt-cache.cc:1217 +#: cmdline/apt-cache.cc:469 cmdline/apt-cache.cc:1221 #, c-format msgid "Package file %s is out of sync." msgstr "" -#: cmdline/apt-cache.cc:1293 +#: cmdline/apt-cache.cc:1297 msgid "You must give exactly one pattern" msgstr "" -#: cmdline/apt-cache.cc:1447 +#: cmdline/apt-cache.cc:1451 msgid "No packages found" msgstr "" -#: cmdline/apt-cache.cc:1524 +#: cmdline/apt-cache.cc:1528 msgid "Package files:" msgstr "" -#: cmdline/apt-cache.cc:1531 cmdline/apt-cache.cc:1618 +#: cmdline/apt-cache.cc:1535 cmdline/apt-cache.cc:1622 msgid "Cache is out of sync, can't x-ref a package file" msgstr "" #. Show any packages have explicit pins -#: cmdline/apt-cache.cc:1545 +#: cmdline/apt-cache.cc:1549 msgid "Pinned packages:" msgstr "" -#: cmdline/apt-cache.cc:1557 cmdline/apt-cache.cc:1598 +#: cmdline/apt-cache.cc:1561 cmdline/apt-cache.cc:1602 msgid "(not found)" msgstr "" #. Installed version -#: cmdline/apt-cache.cc:1578 +#: cmdline/apt-cache.cc:1582 msgid " Installed: " msgstr "" -#: cmdline/apt-cache.cc:1580 cmdline/apt-cache.cc:1588 +#: cmdline/apt-cache.cc:1584 cmdline/apt-cache.cc:1592 msgid "(none)" msgstr "" #. Candidate Version -#: cmdline/apt-cache.cc:1585 +#: cmdline/apt-cache.cc:1589 msgid " Candidate: " msgstr "" -#: cmdline/apt-cache.cc:1595 +#: cmdline/apt-cache.cc:1599 msgid " Package pin: " msgstr "" #. Show the priority tables -#: cmdline/apt-cache.cc:1604 +#: cmdline/apt-cache.cc:1608 msgid " Version table:" msgstr "" -#: cmdline/apt-cache.cc:1619 +#: cmdline/apt-cache.cc:1623 #, c-format msgid " %4i %s\n" msgstr "" -#: cmdline/apt-cache.cc:1714 cmdline/apt-cdrom.cc:134 cmdline/apt-config.cc:70 +#: cmdline/apt-cache.cc:1718 cmdline/apt-cdrom.cc:134 cmdline/apt-config.cc:70 #: cmdline/apt-extracttemplates.cc:225 ftparchive/apt-ftparchive.cc:547 -#: cmdline/apt-get.cc:2609 cmdline/apt-sortpkgs.cc:144 +#: cmdline/apt-get.cc:2615 cmdline/apt-sortpkgs.cc:144 #, c-format msgid "%s %s for %s compiled on %s %s\n" msgstr "" -#: cmdline/apt-cache.cc:1721 +#: cmdline/apt-cache.cc:1725 msgid "" "Usage: apt-cache [options] command\n" " apt-cache [options] add file1 [file2 ...]\n" @@ -549,7 +549,7 @@ msgstr "" msgid "Y" msgstr "" -#: cmdline/apt-get.cc:149 cmdline/apt-get.cc:1681 +#: cmdline/apt-get.cc:149 cmdline/apt-get.cc:1684 #, c-format msgid "Regex compilation error - %s" msgstr "" @@ -692,7 +692,7 @@ msgstr "" msgid "Some packages could not be authenticated" msgstr "" -#: cmdline/apt-get.cc:734 cmdline/apt-get.cc:883 +#: cmdline/apt-get.cc:734 cmdline/apt-get.cc:886 msgid "There are problems and -y was used without --force-yes" msgstr "" @@ -708,11 +708,11 @@ msgstr "" msgid "Internal error, Ordering didn't finish" msgstr "" -#: cmdline/apt-get.cc:811 cmdline/apt-get.cc:2023 cmdline/apt-get.cc:2056 +#: cmdline/apt-get.cc:811 cmdline/apt-get.cc:2026 cmdline/apt-get.cc:2059 msgid "Unable to lock the download directory" msgstr "" -#: cmdline/apt-get.cc:821 cmdline/apt-get.cc:2104 cmdline/apt-get.cc:2350 +#: cmdline/apt-get.cc:821 cmdline/apt-get.cc:2107 cmdline/apt-get.cc:2356 #: apt-pkg/cachefile.cc:65 msgid "The list of sources could not be read." msgstr "" @@ -741,25 +741,25 @@ msgstr "" msgid "After this operation, %sB disk space will be freed.\n" msgstr "" -#: cmdline/apt-get.cc:866 cmdline/apt-get.cc:2199 +#: cmdline/apt-get.cc:866 cmdline/apt-get.cc:2202 #, c-format msgid "Couldn't determine free space in %s" msgstr "" -#: cmdline/apt-get.cc:873 +#: cmdline/apt-get.cc:876 #, c-format msgid "You don't have enough free space in %s." msgstr "" -#: cmdline/apt-get.cc:889 cmdline/apt-get.cc:909 +#: cmdline/apt-get.cc:892 cmdline/apt-get.cc:912 msgid "Trivial Only specified but this is not a trivial operation." msgstr "" -#: cmdline/apt-get.cc:891 +#: cmdline/apt-get.cc:894 msgid "Yes, do as I say!" msgstr "" -#: cmdline/apt-get.cc:893 +#: cmdline/apt-get.cc:896 #, c-format msgid "" "You are about to do something potentially harmful.\n" @@ -767,74 +767,74 @@ msgid "" " ?] " msgstr "" -#: cmdline/apt-get.cc:899 cmdline/apt-get.cc:918 +#: cmdline/apt-get.cc:902 cmdline/apt-get.cc:921 msgid "Abort." msgstr "" -#: cmdline/apt-get.cc:914 +#: cmdline/apt-get.cc:917 msgid "Do you want to continue [Y/n]? " msgstr "" -#: cmdline/apt-get.cc:986 cmdline/apt-get.cc:2247 apt-pkg/algorithms.cc:1389 +#: cmdline/apt-get.cc:989 cmdline/apt-get.cc:2253 apt-pkg/algorithms.cc:1389 #, c-format msgid "Failed to fetch %s %s\n" msgstr "" -#: cmdline/apt-get.cc:1004 +#: cmdline/apt-get.cc:1007 msgid "Some files failed to download" msgstr "" -#: cmdline/apt-get.cc:1005 cmdline/apt-get.cc:2256 +#: cmdline/apt-get.cc:1008 cmdline/apt-get.cc:2262 msgid "Download complete and in download only mode" msgstr "" -#: cmdline/apt-get.cc:1011 +#: cmdline/apt-get.cc:1014 msgid "" "Unable to fetch some archives, maybe run apt-get update or try with --fix-" "missing?" msgstr "" -#: cmdline/apt-get.cc:1015 +#: cmdline/apt-get.cc:1018 msgid "--fix-missing and media swapping is not currently supported" msgstr "" -#: cmdline/apt-get.cc:1020 +#: cmdline/apt-get.cc:1023 msgid "Unable to correct missing packages." msgstr "" -#: cmdline/apt-get.cc:1021 +#: cmdline/apt-get.cc:1024 msgid "Aborting install." msgstr "" -#: cmdline/apt-get.cc:1055 +#: cmdline/apt-get.cc:1058 #, c-format msgid "Note, selecting %s instead of %s\n" msgstr "" -#: cmdline/apt-get.cc:1065 +#: cmdline/apt-get.cc:1068 #, c-format msgid "Skipping %s, it is already installed and upgrade is not set.\n" msgstr "" -#: cmdline/apt-get.cc:1083 +#: cmdline/apt-get.cc:1086 #, c-format msgid "Package %s is not installed, so not removed\n" msgstr "" -#: cmdline/apt-get.cc:1094 +#: cmdline/apt-get.cc:1097 #, c-format msgid "Package %s is a virtual package provided by:\n" msgstr "" -#: cmdline/apt-get.cc:1106 +#: cmdline/apt-get.cc:1109 msgid " [Installed]" msgstr "" -#: cmdline/apt-get.cc:1111 +#: cmdline/apt-get.cc:1114 msgid "You should explicitly select one to install." msgstr "" -#: cmdline/apt-get.cc:1116 +#: cmdline/apt-get.cc:1119 #, c-format msgid "" "Package %s is not available, but is referred to by another package.\n" @@ -842,73 +842,73 @@ msgid "" "is only available from another source\n" msgstr "" -#: cmdline/apt-get.cc:1135 +#: cmdline/apt-get.cc:1138 msgid "However the following packages replace it:" msgstr "" -#: cmdline/apt-get.cc:1138 +#: cmdline/apt-get.cc:1141 #, c-format msgid "Package %s has no installation candidate" msgstr "" -#: cmdline/apt-get.cc:1158 +#: cmdline/apt-get.cc:1161 #, c-format msgid "Reinstallation of %s is not possible, it cannot be downloaded.\n" msgstr "" -#: cmdline/apt-get.cc:1166 +#: cmdline/apt-get.cc:1169 #, c-format msgid "%s is already the newest version.\n" msgstr "" -#: cmdline/apt-get.cc:1195 +#: cmdline/apt-get.cc:1198 #, c-format msgid "Release '%s' for '%s' was not found" msgstr "" -#: cmdline/apt-get.cc:1197 +#: cmdline/apt-get.cc:1200 #, c-format msgid "Version '%s' for '%s' was not found" msgstr "" -#: cmdline/apt-get.cc:1203 +#: cmdline/apt-get.cc:1206 #, c-format msgid "Selected version %s (%s) for %s\n" msgstr "" -#: cmdline/apt-get.cc:1309 +#: cmdline/apt-get.cc:1312 #, c-format msgid "No source package '%s' picking '%s' instead\n" msgstr "" -#: cmdline/apt-get.cc:1346 +#: cmdline/apt-get.cc:1349 msgid "The update command takes no arguments" msgstr "" -#: cmdline/apt-get.cc:1359 +#: cmdline/apt-get.cc:1362 msgid "Unable to lock the list directory" msgstr "" -#: cmdline/apt-get.cc:1415 +#: cmdline/apt-get.cc:1418 msgid "We are not supposed to delete stuff, can't start AutoRemover" msgstr "" -#: cmdline/apt-get.cc:1464 +#: cmdline/apt-get.cc:1467 msgid "" "The following packages were automatically installed and are no longer " "required:" msgstr "" -#: cmdline/apt-get.cc:1466 +#: cmdline/apt-get.cc:1469 #, c-format msgid "%lu packages were automatically installed and are no longer required.\n" msgstr "" -#: cmdline/apt-get.cc:1467 +#: cmdline/apt-get.cc:1470 msgid "Use 'apt-get autoremove' to remove them." msgstr "" -#: cmdline/apt-get.cc:1472 +#: cmdline/apt-get.cc:1475 msgid "" "Hmm, seems like the AutoRemover destroyed something which really\n" "shouldn't happen. Please file a bug report against apt." @@ -924,49 +924,49 @@ msgstr "" #. "that package should be filed.") << endl; #. } #. -#: cmdline/apt-get.cc:1475 cmdline/apt-get.cc:1765 +#: cmdline/apt-get.cc:1478 cmdline/apt-get.cc:1768 msgid "The following information may help to resolve the situation:" msgstr "" -#: cmdline/apt-get.cc:1479 +#: cmdline/apt-get.cc:1482 msgid "Internal Error, AutoRemover broke stuff" msgstr "" -#: cmdline/apt-get.cc:1498 +#: cmdline/apt-get.cc:1501 msgid "Internal error, AllUpgrade broke stuff" msgstr "" -#: cmdline/apt-get.cc:1553 +#: cmdline/apt-get.cc:1556 #, c-format msgid "Couldn't find task %s" msgstr "" -#: cmdline/apt-get.cc:1668 cmdline/apt-get.cc:1704 +#: cmdline/apt-get.cc:1671 cmdline/apt-get.cc:1707 #, c-format msgid "Couldn't find package %s" msgstr "" -#: cmdline/apt-get.cc:1691 +#: cmdline/apt-get.cc:1694 #, c-format msgid "Note, selecting %s for regex '%s'\n" msgstr "" -#: cmdline/apt-get.cc:1722 +#: cmdline/apt-get.cc:1725 #, c-format msgid "%s set to manually installed.\n" msgstr "" -#: cmdline/apt-get.cc:1735 +#: cmdline/apt-get.cc:1738 msgid "You might want to run `apt-get -f install' to correct these:" msgstr "" -#: cmdline/apt-get.cc:1738 +#: cmdline/apt-get.cc:1741 msgid "" "Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a " "solution)." msgstr "" -#: cmdline/apt-get.cc:1750 +#: cmdline/apt-get.cc:1753 msgid "" "Some packages could not be installed. This may mean that you have\n" "requested an impossible situation or if you are using the unstable\n" @@ -974,152 +974,152 @@ msgid "" "or been moved out of Incoming." msgstr "" -#: cmdline/apt-get.cc:1768 +#: cmdline/apt-get.cc:1771 msgid "Broken packages" msgstr "" -#: cmdline/apt-get.cc:1797 +#: cmdline/apt-get.cc:1800 msgid "The following extra packages will be installed:" msgstr "" -#: cmdline/apt-get.cc:1886 +#: cmdline/apt-get.cc:1889 msgid "Suggested packages:" msgstr "" -#: cmdline/apt-get.cc:1887 +#: cmdline/apt-get.cc:1890 msgid "Recommended packages:" msgstr "" -#: cmdline/apt-get.cc:1916 +#: cmdline/apt-get.cc:1919 msgid "Calculating upgrade... " msgstr "" -#: cmdline/apt-get.cc:1919 methods/ftp.cc:702 methods/connect.cc:112 +#: cmdline/apt-get.cc:1922 methods/ftp.cc:702 methods/connect.cc:112 msgid "Failed" msgstr "" -#: cmdline/apt-get.cc:1924 +#: cmdline/apt-get.cc:1927 msgid "Done" msgstr "" -#: cmdline/apt-get.cc:1991 cmdline/apt-get.cc:1999 +#: cmdline/apt-get.cc:1994 cmdline/apt-get.cc:2002 msgid "Internal error, problem resolver broke stuff" msgstr "" -#: cmdline/apt-get.cc:2099 +#: cmdline/apt-get.cc:2102 msgid "Must specify at least one package to fetch source for" msgstr "" -#: cmdline/apt-get.cc:2129 cmdline/apt-get.cc:2368 +#: cmdline/apt-get.cc:2132 cmdline/apt-get.cc:2374 #, c-format msgid "Unable to find a source package for %s" msgstr "" -#: cmdline/apt-get.cc:2178 +#: cmdline/apt-get.cc:2181 #, c-format msgid "Skipping already downloaded file '%s'\n" msgstr "" -#: cmdline/apt-get.cc:2206 +#: cmdline/apt-get.cc:2212 #, c-format msgid "You don't have enough free space in %s" msgstr "" -#: cmdline/apt-get.cc:2212 +#: cmdline/apt-get.cc:2218 #, c-format msgid "Need to get %sB/%sB of source archives.\n" msgstr "" -#: cmdline/apt-get.cc:2215 +#: cmdline/apt-get.cc:2221 #, c-format msgid "Need to get %sB of source archives.\n" msgstr "" -#: cmdline/apt-get.cc:2221 +#: cmdline/apt-get.cc:2227 #, c-format msgid "Fetch source %s\n" msgstr "" -#: cmdline/apt-get.cc:2252 +#: cmdline/apt-get.cc:2258 msgid "Failed to fetch some archives." msgstr "" -#: cmdline/apt-get.cc:2280 +#: cmdline/apt-get.cc:2286 #, c-format msgid "Skipping unpack of already unpacked source in %s\n" msgstr "" -#: cmdline/apt-get.cc:2292 +#: cmdline/apt-get.cc:2298 #, c-format msgid "Unpack command '%s' failed.\n" msgstr "" -#: cmdline/apt-get.cc:2293 +#: cmdline/apt-get.cc:2299 #, c-format msgid "Check if the 'dpkg-dev' package is installed.\n" msgstr "" -#: cmdline/apt-get.cc:2310 +#: cmdline/apt-get.cc:2316 #, c-format msgid "Build command '%s' failed.\n" msgstr "" -#: cmdline/apt-get.cc:2329 +#: cmdline/apt-get.cc:2335 msgid "Child process failed" msgstr "" -#: cmdline/apt-get.cc:2345 +#: cmdline/apt-get.cc:2351 msgid "Must specify at least one package to check builddeps for" msgstr "" -#: cmdline/apt-get.cc:2373 +#: cmdline/apt-get.cc:2379 #, c-format msgid "Unable to get build-dependency information for %s" msgstr "" -#: cmdline/apt-get.cc:2393 +#: cmdline/apt-get.cc:2399 #, c-format msgid "%s has no build depends.\n" msgstr "" -#: cmdline/apt-get.cc:2445 +#: cmdline/apt-get.cc:2451 #, c-format msgid "" "%s dependency for %s cannot be satisfied because the package %s cannot be " "found" msgstr "" -#: cmdline/apt-get.cc:2498 +#: cmdline/apt-get.cc:2504 #, c-format msgid "" "%s dependency for %s cannot be satisfied because no available versions of " "package %s can satisfy version requirements" msgstr "" -#: cmdline/apt-get.cc:2534 +#: cmdline/apt-get.cc:2540 #, c-format msgid "Failed to satisfy %s dependency for %s: Installed package %s is too new" msgstr "" -#: cmdline/apt-get.cc:2561 +#: cmdline/apt-get.cc:2567 #, c-format msgid "Failed to satisfy %s dependency for %s: %s" msgstr "" -#: cmdline/apt-get.cc:2577 +#: cmdline/apt-get.cc:2583 #, c-format msgid "Build-dependencies for %s could not be satisfied." msgstr "" -#: cmdline/apt-get.cc:2582 +#: cmdline/apt-get.cc:2588 msgid "Failed to process build dependencies" msgstr "" -#: cmdline/apt-get.cc:2614 +#: cmdline/apt-get.cc:2620 msgid "Supported modules:" msgstr "" -#: cmdline/apt-get.cc:2655 +#: cmdline/apt-get.cc:2661 msgid "" "Usage: apt-get [options] command\n" " apt-get [options] install|remove pkg1 [pkg2 ...]\n" @@ -1163,7 +1163,7 @@ msgid "" " This APT has Super Cow Powers.\n" msgstr "" -#: cmdline/apt-get.cc:2822 +#: cmdline/apt-get.cc:2828 msgid "" "NOTE: This is only a simulation!\n" " apt-get needs root privileges for real execution.\n" @@ -2641,22 +2641,22 @@ msgstr "" msgid "Source list entries for this disc are:\n" msgstr "" -#: apt-pkg/indexcopy.cc:263 apt-pkg/indexcopy.cc:832 +#: apt-pkg/indexcopy.cc:263 apt-pkg/indexcopy.cc:835 #, c-format msgid "Wrote %i records.\n" msgstr "" -#: apt-pkg/indexcopy.cc:265 apt-pkg/indexcopy.cc:834 +#: apt-pkg/indexcopy.cc:265 apt-pkg/indexcopy.cc:837 #, c-format msgid "Wrote %i records with %i missing files.\n" msgstr "" -#: apt-pkg/indexcopy.cc:268 apt-pkg/indexcopy.cc:837 +#: apt-pkg/indexcopy.cc:268 apt-pkg/indexcopy.cc:840 #, c-format msgid "Wrote %i records with %i mismatched files\n" msgstr "" -#: apt-pkg/indexcopy.cc:271 apt-pkg/indexcopy.cc:840 +#: apt-pkg/indexcopy.cc:271 apt-pkg/indexcopy.cc:843 #, c-format msgid "Wrote %i records with %i missing files and %i mismatched files\n" msgstr "" -- cgit v1.2.3 From 472e2c3aa9c8ea38c2b5f0639bdb09eadb7ffca4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Aug 2009 10:22:53 +0200 Subject: [apt-inst/contrib/arfile.cc] use sizeof instead strlen Patch from Marius Vollmer, thanks! (Closes: #504325) --- apt-inst/contrib/arfile.cc | 2 +- debian/changelog | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index 7c85f2e86..e6c63d1ab 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -96,7 +96,7 @@ bool ARArchive::LoadHeaders() char S[300]; unsigned long Len; if (StrToNum(Head.Name+3,Len,sizeof(Head.Size)-3) == false || - Len >= strlen(S)) + Len >= sizeof(S)) { delete Memb; return _error->Error(_("Invalid archive member header")); diff --git a/debian/changelog b/debian/changelog index fd6f853e0..841661c5a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,8 @@ apt (0.7.22.3) unstable; urgency=low (by Luca Bruno, Closes: #223712) * doc/apt.conf.5.xml: - mention the apt.conf.d dir (by Vincent McIntyre, Closes: #520831) + * apt-inst/contrib/arfile.cc: + - use sizeof instead strlen (by Marius Vollmer, Closes: #504325) [ George Danchev ] * cmdline/apt-cache.cc: -- cgit v1.2.3 From b2fa014bbefa8fe91f9c5c96f5cc053f14117f11 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Aug 2009 10:24:59 +0200 Subject: [doc/apt-mark.8.xml] improve manpage based on patch by Carl Chenet, thanks! (Closes: #510286) add also showauto and command synopsis --- debian/changelog | 2 ++ doc/apt-mark.8.xml | 48 ++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 841661c5a..7f8764c8e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ apt (0.7.22.3) unstable; urgency=low - mention the apt.conf.d dir (by Vincent McIntyre, Closes: #520831) * apt-inst/contrib/arfile.cc: - use sizeof instead strlen (by Marius Vollmer, Closes: #504325) + * doc/apt-mark.8.xml: + - improve manpage based on patch by Carl Chenet (Closes: #510286) [ George Danchev ] * cmdline/apt-cache.cc: diff --git a/doc/apt-mark.8.xml b/doc/apt-mark.8.xml index 1b7b02812..f078f2de5 100644 --- a/doc/apt-mark.8.xml +++ b/doc/apt-mark.8.xml @@ -15,7 +15,7 @@ &apt-email; &apt-product; - 2 November 2007 + 9 August 2009 @@ -32,11 +32,19 @@ - apt-mark - - - markautounmarkauto - package + apt-mark + + + + + + markauto + unmarkauto + + package + + showauto + @@ -49,7 +57,8 @@ other packages are installed to satisfy its dependencies, the dependencies are marked as being automatically installed. Once these automatically installed packages are no longer depended on - by any manually installed packages, they will be removed. + by any manually installed packages, they will be removed by e.g. + apt-get or aptitude. markauto @@ -67,16 +76,24 @@ depend on it. + + showauto + showauto is used to print a + list of manually installed packages with each package on a new line. + + options - + + + - Read/Write package stats from FILENAME + Read/Write package stats from FILENAME instead of the default location, which is extended_status in the directory defined by the Configuration Item: Dir::State. @@ -101,8 +118,19 @@ + Files + + /var/lib/apt/extended_states + Status list of auto-installed packages. + Configuration Item: Dir::State + sets the path to the extended_states file. + + + + + See Also - &apt-conf; + &apt-get;,&aptitude;,&apt-conf; Diagnostics -- cgit v1.2.3 From 717ec7d41a232a1571f98e1efe2ff3c71d94968f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Aug 2009 13:43:21 +0200 Subject: [cmdline/apt-get.cc] correct the order of picked package binary vs source in the source command in the msg "No source package x picking y instead" --- cmdline/apt-get.cc | 2 +- debian/changelog | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 384953a6b..34ffaf11a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1309,7 +1309,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\n"), Parse->Package().c_str(), Src.c_str()); + ioprintf(c1out, _("No source package '%s' picking '%s' instead\n"), Src.c_str(), Parse->Package().c_str()); if (VerTag.empty() == false) { diff --git a/debian/changelog b/debian/changelog index 7f8764c8e..fa2a3f612 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ apt (0.7.22.3) unstable; urgency=low instead of the full package list. (Closes: #537450) - ShowBroken() in build-dep (by Mike O'Connor, Closes: #145916) - check for statfs.f_type (by Robert Millan, Closes: #509313) + - correct the order of picked package binary vs source in source * apt-pkg/contrib/strutl.cc: - enable thousand separator according to the current locale (by Luca Bruno, Closes: #223712) -- cgit v1.2.3 From e85b4cd500cc96a8ce0d35c5e63fe274bed5b917 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Aug 2009 00:52:26 +0200 Subject: Add a Acquire::CompressionTypes config variable from there the acquire-items choose which compression file they should (try first to) download to easily add new or change the order of the compression types. And because it is easy now we directly add builtin lzma support. The compression ratio is better than bzip2 but we prefer the later for now as no (official) mirror uses lzma, so this would only generate useless hits on the servers. Maybe sometime in the future lzma will be the default... [apt-pkg/acquire-item.cc] - use configsettings for dynamic compression type use and order. Based on a patch by Jyrki Muukkonen, thanks! (LP: #71746) [apt-pkg/init.cc] - add default configuration for compression types and add lzma support. Order is now bzip2, lzma, gzip, none (Closes: #510526) [ftparchive/writer.cc] - add lzma support also here, patch for this (and inspiration for the one above) by Robert Millan, thanks! --- apt-pkg/acquire-item.cc | 79 ++++++++++++++++++++++++++++++------------------- apt-pkg/acquire-item.h | 10 ++----- apt-pkg/init.cc | 24 ++++++++++++++- debian/changelog | 9 ++++++ doc/apt.conf.5.xml | 15 ++++++++++ ftparchive/writer.cc | 2 ++ po/apt-all.pot | 18 +++++------ 7 files changed, 110 insertions(+), 47 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 39ae327cb..ffbe66d7d 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -551,13 +551,24 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, if(comprExt.empty()) { // autoselect the compression method - if(FileExists("/bin/bzip2")) - CompressionExtension = ".bz2"; - else - CompressionExtension = ".gz"; - } else { - CompressionExtension = (comprExt == "plain" ? "" : comprExt); + Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); + if (Opts != 0) + Opts = Opts->Child; + + const char dirBin[] = "Dir::Bin::"; + for (; Opts != 0; Opts = Opts->Next) + { + if (Opts->Tag.empty() == true || Opts->Value.empty() == true) + continue; + const string bin = _config->FindFile(string(dirBin).append(Opts->Value).c_str(),""); + if (bin != "" && !FileExists(bin)) + continue; + comprExt = '.' + Opts->Tag; + break; + } } + CompressionExtension = ((comprExt == "plain" || comprExt == ".") ? "" : comprExt); + Desc.URI = URI + CompressionExtension; Desc.Description = URIDesc; @@ -584,24 +595,32 @@ string pkgAcqIndex::Custom600Headers() /*}}}*/ void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/ { - bool descChanged = false; - // no .bz2 found, retry with .gz - if(Desc.URI.substr(Desc.URI.size()-3) == "bz2") { - Desc.URI = Desc.URI.substr(0,Desc.URI.size()-3) + "gz"; - - new pkgAcqIndex(Owner, RealURI, Desc.Description,Desc.ShortDesc, - ExpectedHash, string(".gz")); - descChanged = true; - } - // no .gz found, retry with uncompressed - else if(Desc.URI.substr(Desc.URI.size()-2) == "gz") { - Desc.URI = Desc.URI.substr(0,Desc.URI.size()-2); + Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); + if (Opts != 0) + Opts = Opts->Child; + + const char dirBin[] = "Dir::Bin::"; + for (; Opts != 0; Opts = Opts->Next) + { + if (Opts->Tag.empty() == true || Opts->Value.empty() == true) + continue; + + // jump over all already checked compression types + const unsigned int nameLen = Desc.URI.size() - Opts->Tag.size(); + if(Desc.URI.substr(nameLen) != Opts->Tag || Opts->Next == 0) + continue; + + // check if we need an external binary for this compression type + const string bin = _config->FindFile(string(dirBin).append(Opts->Next->Value).c_str(),""); + if (bin != "" && !FileExists(bin)) + continue; + + // retry with the next extension + Desc.URI = Desc.URI.substr(0, nameLen) + Opts->Next->Tag; + + new pkgAcqIndex(Owner, RealURI, Desc.Description, Desc.ShortDesc, + ExpectedHash, string(".").append(Opts->Next->Tag)); - new pkgAcqIndex(Owner, RealURI, Desc.Description,Desc.ShortDesc, - ExpectedHash, string("plain")); - descChanged = true; - } - if (descChanged) { Status = StatDone; Complete = false; Dequeue(); @@ -698,11 +717,11 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash, Local = true; string compExt = flExtension(flNotDir(URI(Desc.URI).Path)); - const char *decompProg; - if(compExt == "bz2") - decompProg = "bzip2"; - else if(compExt == "gz") - decompProg = "gzip"; + string decompProg; + + // get the binary name for your used compression type + decompProg = _config->Find(string("Acquire::CompressionTypes::").append(compExt),""); + if(decompProg.empty() == false); // flExtensions returns the full name if no extension is found // this is why we have this complicated compare operation here // FIMXE: add a new flJustExtension() that return "" if no @@ -717,9 +736,9 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash, Decompression = true; DestFile += ".decomp"; - Desc.URI = string(decompProg) + ":" + FileName; + Desc.URI = decompProg + ":" + FileName; QueueURI(Desc); - Mode = decompProg; + Mode = decompProg.c_str(); } /*}}}*/ // AcqIndexTrans::pkgAcqIndexTrans - Constructor /*{{{*/ diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 36a926a0f..3f073de5b 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -540,7 +540,9 @@ class pkgAcqIndex : public pkgAcquire::Item * * \param compressExt The compression-related extension with which * this index file should be downloaded, or "" to autodetect - * (".bz2" is used if bzip2 is installed, ".gz" otherwise). + * Compression types can be set with config Acquire::CompressionTypes, + * default is ".lzma" or ".bz2" (if the needed binaries are present) + * fallback is ".gz" or none. */ pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc, string ShortDesc, HashString ExpectedHash, string compressExt=""); @@ -569,12 +571,6 @@ class pkgAcqIndexTrans : public pkgAcqIndex * \param URIDesc A "URI-style" description of this index file. * * \param ShortDesc A brief description of this index file. - * - * \param ExpectedHash The expected hashsum of this index file. - * - * \param compressExt The compression-related extension with which - * this index file should be downloaded, or "" to autodetect - * (".bz2" is used if bzip2 is installed, ".gz" otherwise). */ pkgAcqIndexTrans(pkgAcquire *Owner,string URI,string URIDesc, string ShortDesc); diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 63caade36..46017bf0c 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -103,7 +103,29 @@ bool pkgInitConfig(Configuration &Cnf) if (Res == false) return false; - + + // we load all config files, now check the configs and setup post-defaults: + // * check for CompressionTypes setup + { + Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); + if (Opts != 0) + Opts = Opts->Child; + bool foundLzma=false, foundBzip2=false, foundGzip=false; + for (; Opts != 0; Opts = Opts->Next) + { + if (Opts->Value == "lzma") foundLzma = true; + else if (Opts->Value == "bz2") foundBzip2 = true; + else if (Opts->Value == "gz") foundGzip = true; + } + if (!foundBzip2) Cnf.Set("Acquire::CompressionTypes::bz2","bzip2"); + if (!foundLzma) Cnf.Set("Acquire::CompressionTypes::lzma","lzma"); + if (!foundGzip) Cnf.Set("Acquire::CompressionTypes::gz","gzip"); + Cnf.CndSet("Dir::Bin::lzma", "/usr/bin/lzma"); + Cnf.CndSet("Dir::Bin::bzip2", "/bin/bzip2"); + } + + + if (Cnf.FindB("Debug::pkgInitConfig",false) == true) Cnf.Dump(); diff --git a/debian/changelog b/debian/changelog index fa2a3f612..16394b067 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,15 @@ apt (0.7.22.3) unstable; urgency=low - use sizeof instead strlen (by Marius Vollmer, Closes: #504325) * doc/apt-mark.8.xml: - improve manpage based on patch by Carl Chenet (Closes: #510286) + * apt-pkg/acquire-item.cc: + - use configsettings for dynamic compression type use and order. + Based on a patch by Jyrki Muukkonen, thanks! (LP: #71746) + * apt-pkg/init.cc: + - add default configuration for compression types and add lzma + support. Order is now bzip2, lzma, gzip, none (Closes: #510526) + * ftparchive/writer.cc: + - add lzma support also here, patch for this (and inspiration for + the one above) by Robert Millan, thanks! [ George Danchev ] * cmdline/apt-cache.cc: diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index 85a7d961c..d347bda67 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -303,6 +303,20 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; + CompressionTypes + List of compression types which are understood by the acquire methods. + Files like Packages can be available in various compression formats. + This list defines in which order the acquire methods will try to download these files. + Per default bzip2 compressed files will be prefered over + lzma, gzip and uncompressed files. The syntax for + the configuration fileentry (this option can't be set at runtime with the -o option) is + Acquire::CompressionTypes::FileExtension "Methodname"; + e.g. Acquire::CompressionTypes::bz2 "bzip2"; + Note that at runtime the Dir::Bin::Methodname will + be checked: If this setting exists the method will only be used if this file exists, e.g. for + the bzip2 method above (the inbuilt) setting is Dir::Bin::bzip2 "/bin/bzip2"; + + @@ -337,6 +351,7 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; Binary programs are pointed to by Dir::Bin. Dir::Bin::Methods specifies the location of the method handlers and gzip, + bzip2, lzma, dpkg, apt-get dpkg-source dpkg-buildpackage and apt-cache specify the location of the respective programs. diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 9d248ab86..293e851f5 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -815,9 +815,11 @@ ReleaseWriter::ReleaseWriter(string DB) AddPattern("Packages"); AddPattern("Packages.gz"); AddPattern("Packages.bz2"); + AddPattern("Packages.lzma"); AddPattern("Sources"); AddPattern("Sources.gz"); AddPattern("Sources.bz2"); + AddPattern("Sources.lzma"); AddPattern("Release"); AddPattern("md5sum.txt"); diff --git a/po/apt-all.pot b/po/apt-all.pot index 3ec999f76..8f3d4cf60 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-09 10:20+0200\n" +"POT-Creation-Date: 2009-08-10 23:54+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2364,12 +2364,12 @@ msgstr "" msgid "Please insert the disc labeled: '%s' in the drive '%s' and press enter." msgstr "" -#: apt-pkg/init.cc:132 +#: apt-pkg/init.cc:154 #, c-format msgid "Packaging system '%s' is not supported" msgstr "" -#: apt-pkg/init.cc:148 +#: apt-pkg/init.cc:170 msgid "Unable to determine a suitable packaging system type" msgstr "" @@ -2506,35 +2506,35 @@ msgstr "" msgid "MD5Sum mismatch" msgstr "" -#: apt-pkg/acquire-item.cc:644 apt-pkg/acquire-item.cc:1406 +#: apt-pkg/acquire-item.cc:663 apt-pkg/acquire-item.cc:1425 msgid "Hash Sum mismatch" msgstr "" -#: apt-pkg/acquire-item.cc:1101 +#: apt-pkg/acquire-item.cc:1120 msgid "There is no public key available for the following key IDs:\n" msgstr "" -#: apt-pkg/acquire-item.cc:1211 +#: apt-pkg/acquire-item.cc:1230 #, c-format msgid "" "I wasn't able to locate a file for the %s package. This might mean you need " "to manually fix this package. (due to missing arch)" msgstr "" -#: apt-pkg/acquire-item.cc:1270 +#: apt-pkg/acquire-item.cc:1289 #, c-format msgid "" "I wasn't able to locate file for the %s package. This might mean you need to " "manually fix this package." msgstr "" -#: apt-pkg/acquire-item.cc:1311 +#: apt-pkg/acquire-item.cc:1330 #, c-format msgid "" "The package index files are corrupted. No Filename: field for package %s." msgstr "" -#: apt-pkg/acquire-item.cc:1398 +#: apt-pkg/acquire-item.cc:1417 msgid "Size mismatch" msgstr "" -- cgit v1.2.3 From 83cb4069352c9e30482dcbb75a5c60de26a3cf90 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Aug 2009 01:07:54 +0200 Subject: With the introduction of the Is{Delete,Install}Ok hooks the apt flag --ignore-hold only works partly: The holds are to strongly enforced in these hooks - this commit brings the old (and expected) behaviour back. [apt-pkg/depcache.cc] - restore the --ignore-hold effect in the Is{Delete,Install}Ok hooks --- apt-pkg/depcache.cc | 4 ++-- debian/changelog | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 13abbe5ed..228750b74 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -823,7 +823,7 @@ void pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge, bool pkgDepCache::IsDeleteOk(PkgIterator const &Pkg,bool rPurge, unsigned long Depth, bool FromUser) { - if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold) + if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold && _config->FindB("APT::Ignore-Hold",false) == false) { if (DebugMarker == true) std::clog << OutputInDepth(Depth) << "Hold prevents MarkDelete of " << Pkg << " FU=" << FromUser << std::endl; @@ -1085,7 +1085,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, bool pkgDepCache::IsInstallOk(PkgIterator const &Pkg,bool AutoInst, unsigned long Depth, bool FromUser) { - if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold) + if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold && _config->FindB("APT::Ignore-Hold",false) == false) { if (DebugMarker == true) std::clog << OutputInDepth(Depth) << "Hold prevents MarkInstall of " << Pkg << " FU=" << FromUser << std::endl; diff --git a/debian/changelog b/debian/changelog index 16394b067..0f7669930 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,8 @@ apt (0.7.22.3) unstable; urgency=low * ftparchive/writer.cc: - add lzma support also here, patch for this (and inspiration for the one above) by Robert Millan, thanks! + * apt-pkg/depcache.cc: + - restore the --ignore-hold effect in the Is{Delete,Install}Ok hooks [ George Danchev ] * cmdline/apt-cache.cc: -- cgit v1.2.3 From 619596fcd20e3fda2ab352103cfeb9437015dfbc Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Aug 2009 13:17:36 +0200 Subject: [cmdline/apt-get.cc] - use SourceVersion instead of the BinaryVersion to get the source Patch by Matt Kraai, thanks! (Closes: #382826) --- cmdline/apt-get.cc | 5 ++- debian/changelog | 2 + po/apt-all.pot | 118 ++++++++++++++++++++++++++--------------------------- 3 files changed, 65 insertions(+), 60 deletions(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 34ffaf11a..71566fd55 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1255,7 +1255,10 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, //std::cout << VF.File().Archive() << std::endl; if(VF.File().Archive() && (VF.File().Archive() == DefRel)) { - VerTag = Ver.VerStr(); + pkgRecords::Parser &Parse = Recs.Lookup(VF); + VerTag = Parse.SourceVer(); + if (VerTag.empty()) + VerTag = Ver.VerStr(); break; } } diff --git a/debian/changelog b/debian/changelog index 0f7669930..3407cdcec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ apt (0.7.22.3) unstable; urgency=low - ShowBroken() in build-dep (by Mike O'Connor, Closes: #145916) - check for statfs.f_type (by Robert Millan, Closes: #509313) - correct the order of picked package binary vs source in source + - use SourceVersion instead of the BinaryVersion to get the source + Patch by Matt Kraai, thanks! (Closes: #382826) * apt-pkg/contrib/strutl.cc: - enable thousand separator according to the current locale (by Luca Bruno, Closes: #223712) diff --git a/po/apt-all.pot b/po/apt-all.pot index 8f3d4cf60..767d9f060 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-10 23:54+0200\n" +"POT-Creation-Date: 2009-08-12 13:14+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,7 +151,7 @@ msgstr "" #: cmdline/apt-cache.cc:1718 cmdline/apt-cdrom.cc:134 cmdline/apt-config.cc:70 #: cmdline/apt-extracttemplates.cc:225 ftparchive/apt-ftparchive.cc:547 -#: cmdline/apt-get.cc:2615 cmdline/apt-sortpkgs.cc:144 +#: cmdline/apt-get.cc:2618 cmdline/apt-sortpkgs.cc:144 #, c-format msgid "%s %s for %s compiled on %s %s\n" msgstr "" @@ -549,7 +549,7 @@ msgstr "" msgid "Y" msgstr "" -#: cmdline/apt-get.cc:149 cmdline/apt-get.cc:1684 +#: cmdline/apt-get.cc:149 cmdline/apt-get.cc:1687 #, c-format msgid "Regex compilation error - %s" msgstr "" @@ -708,11 +708,11 @@ msgstr "" msgid "Internal error, Ordering didn't finish" msgstr "" -#: cmdline/apt-get.cc:811 cmdline/apt-get.cc:2026 cmdline/apt-get.cc:2059 +#: cmdline/apt-get.cc:811 cmdline/apt-get.cc:2029 cmdline/apt-get.cc:2062 msgid "Unable to lock the download directory" msgstr "" -#: cmdline/apt-get.cc:821 cmdline/apt-get.cc:2107 cmdline/apt-get.cc:2356 +#: cmdline/apt-get.cc:821 cmdline/apt-get.cc:2110 cmdline/apt-get.cc:2359 #: apt-pkg/cachefile.cc:65 msgid "The list of sources could not be read." msgstr "" @@ -741,7 +741,7 @@ msgstr "" msgid "After this operation, %sB disk space will be freed.\n" msgstr "" -#: cmdline/apt-get.cc:866 cmdline/apt-get.cc:2202 +#: cmdline/apt-get.cc:866 cmdline/apt-get.cc:2205 #, c-format msgid "Couldn't determine free space in %s" msgstr "" @@ -775,7 +775,7 @@ msgstr "" msgid "Do you want to continue [Y/n]? " msgstr "" -#: cmdline/apt-get.cc:989 cmdline/apt-get.cc:2253 apt-pkg/algorithms.cc:1389 +#: cmdline/apt-get.cc:989 cmdline/apt-get.cc:2256 apt-pkg/algorithms.cc:1389 #, c-format msgid "Failed to fetch %s %s\n" msgstr "" @@ -784,7 +784,7 @@ msgstr "" msgid "Some files failed to download" msgstr "" -#: cmdline/apt-get.cc:1008 cmdline/apt-get.cc:2262 +#: cmdline/apt-get.cc:1008 cmdline/apt-get.cc:2265 msgid "Download complete and in download only mode" msgstr "" @@ -876,39 +876,39 @@ msgstr "" msgid "Selected version %s (%s) for %s\n" msgstr "" -#: cmdline/apt-get.cc:1312 +#: cmdline/apt-get.cc:1315 #, c-format msgid "No source package '%s' picking '%s' instead\n" msgstr "" -#: cmdline/apt-get.cc:1349 +#: cmdline/apt-get.cc:1352 msgid "The update command takes no arguments" msgstr "" -#: cmdline/apt-get.cc:1362 +#: cmdline/apt-get.cc:1365 msgid "Unable to lock the list directory" msgstr "" -#: cmdline/apt-get.cc:1418 +#: cmdline/apt-get.cc:1421 msgid "We are not supposed to delete stuff, can't start AutoRemover" msgstr "" -#: cmdline/apt-get.cc:1467 +#: cmdline/apt-get.cc:1470 msgid "" "The following packages were automatically installed and are no longer " "required:" msgstr "" -#: cmdline/apt-get.cc:1469 +#: cmdline/apt-get.cc:1472 #, c-format msgid "%lu packages were automatically installed and are no longer required.\n" msgstr "" -#: cmdline/apt-get.cc:1470 +#: cmdline/apt-get.cc:1473 msgid "Use 'apt-get autoremove' to remove them." msgstr "" -#: cmdline/apt-get.cc:1475 +#: cmdline/apt-get.cc:1478 msgid "" "Hmm, seems like the AutoRemover destroyed something which really\n" "shouldn't happen. Please file a bug report against apt." @@ -924,49 +924,49 @@ msgstr "" #. "that package should be filed.") << endl; #. } #. -#: cmdline/apt-get.cc:1478 cmdline/apt-get.cc:1768 +#: cmdline/apt-get.cc:1481 cmdline/apt-get.cc:1771 msgid "The following information may help to resolve the situation:" msgstr "" -#: cmdline/apt-get.cc:1482 +#: cmdline/apt-get.cc:1485 msgid "Internal Error, AutoRemover broke stuff" msgstr "" -#: cmdline/apt-get.cc:1501 +#: cmdline/apt-get.cc:1504 msgid "Internal error, AllUpgrade broke stuff" msgstr "" -#: cmdline/apt-get.cc:1556 +#: cmdline/apt-get.cc:1559 #, c-format msgid "Couldn't find task %s" msgstr "" -#: cmdline/apt-get.cc:1671 cmdline/apt-get.cc:1707 +#: cmdline/apt-get.cc:1674 cmdline/apt-get.cc:1710 #, c-format msgid "Couldn't find package %s" msgstr "" -#: cmdline/apt-get.cc:1694 +#: cmdline/apt-get.cc:1697 #, c-format msgid "Note, selecting %s for regex '%s'\n" msgstr "" -#: cmdline/apt-get.cc:1725 +#: cmdline/apt-get.cc:1728 #, c-format msgid "%s set to manually installed.\n" msgstr "" -#: cmdline/apt-get.cc:1738 +#: cmdline/apt-get.cc:1741 msgid "You might want to run `apt-get -f install' to correct these:" msgstr "" -#: cmdline/apt-get.cc:1741 +#: cmdline/apt-get.cc:1744 msgid "" "Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a " "solution)." msgstr "" -#: cmdline/apt-get.cc:1753 +#: cmdline/apt-get.cc:1756 msgid "" "Some packages could not be installed. This may mean that you have\n" "requested an impossible situation or if you are using the unstable\n" @@ -974,152 +974,152 @@ msgid "" "or been moved out of Incoming." msgstr "" -#: cmdline/apt-get.cc:1771 +#: cmdline/apt-get.cc:1774 msgid "Broken packages" msgstr "" -#: cmdline/apt-get.cc:1800 +#: cmdline/apt-get.cc:1803 msgid "The following extra packages will be installed:" msgstr "" -#: cmdline/apt-get.cc:1889 +#: cmdline/apt-get.cc:1892 msgid "Suggested packages:" msgstr "" -#: cmdline/apt-get.cc:1890 +#: cmdline/apt-get.cc:1893 msgid "Recommended packages:" msgstr "" -#: cmdline/apt-get.cc:1919 +#: cmdline/apt-get.cc:1922 msgid "Calculating upgrade... " msgstr "" -#: cmdline/apt-get.cc:1922 methods/ftp.cc:702 methods/connect.cc:112 +#: cmdline/apt-get.cc:1925 methods/ftp.cc:702 methods/connect.cc:112 msgid "Failed" msgstr "" -#: cmdline/apt-get.cc:1927 +#: cmdline/apt-get.cc:1930 msgid "Done" msgstr "" -#: cmdline/apt-get.cc:1994 cmdline/apt-get.cc:2002 +#: cmdline/apt-get.cc:1997 cmdline/apt-get.cc:2005 msgid "Internal error, problem resolver broke stuff" msgstr "" -#: cmdline/apt-get.cc:2102 +#: cmdline/apt-get.cc:2105 msgid "Must specify at least one package to fetch source for" msgstr "" -#: cmdline/apt-get.cc:2132 cmdline/apt-get.cc:2374 +#: cmdline/apt-get.cc:2135 cmdline/apt-get.cc:2377 #, c-format msgid "Unable to find a source package for %s" msgstr "" -#: cmdline/apt-get.cc:2181 +#: cmdline/apt-get.cc:2184 #, c-format msgid "Skipping already downloaded file '%s'\n" msgstr "" -#: cmdline/apt-get.cc:2212 +#: cmdline/apt-get.cc:2215 #, c-format msgid "You don't have enough free space in %s" msgstr "" -#: cmdline/apt-get.cc:2218 +#: cmdline/apt-get.cc:2221 #, c-format msgid "Need to get %sB/%sB of source archives.\n" msgstr "" -#: cmdline/apt-get.cc:2221 +#: cmdline/apt-get.cc:2224 #, c-format msgid "Need to get %sB of source archives.\n" msgstr "" -#: cmdline/apt-get.cc:2227 +#: cmdline/apt-get.cc:2230 #, c-format msgid "Fetch source %s\n" msgstr "" -#: cmdline/apt-get.cc:2258 +#: cmdline/apt-get.cc:2261 msgid "Failed to fetch some archives." msgstr "" -#: cmdline/apt-get.cc:2286 +#: cmdline/apt-get.cc:2289 #, c-format msgid "Skipping unpack of already unpacked source in %s\n" msgstr "" -#: cmdline/apt-get.cc:2298 +#: cmdline/apt-get.cc:2301 #, c-format msgid "Unpack command '%s' failed.\n" msgstr "" -#: cmdline/apt-get.cc:2299 +#: cmdline/apt-get.cc:2302 #, c-format msgid "Check if the 'dpkg-dev' package is installed.\n" msgstr "" -#: cmdline/apt-get.cc:2316 +#: cmdline/apt-get.cc:2319 #, c-format msgid "Build command '%s' failed.\n" msgstr "" -#: cmdline/apt-get.cc:2335 +#: cmdline/apt-get.cc:2338 msgid "Child process failed" msgstr "" -#: cmdline/apt-get.cc:2351 +#: cmdline/apt-get.cc:2354 msgid "Must specify at least one package to check builddeps for" msgstr "" -#: cmdline/apt-get.cc:2379 +#: cmdline/apt-get.cc:2382 #, c-format msgid "Unable to get build-dependency information for %s" msgstr "" -#: cmdline/apt-get.cc:2399 +#: cmdline/apt-get.cc:2402 #, c-format msgid "%s has no build depends.\n" msgstr "" -#: cmdline/apt-get.cc:2451 +#: cmdline/apt-get.cc:2454 #, c-format msgid "" "%s dependency for %s cannot be satisfied because the package %s cannot be " "found" msgstr "" -#: cmdline/apt-get.cc:2504 +#: cmdline/apt-get.cc:2507 #, c-format msgid "" "%s dependency for %s cannot be satisfied because no available versions of " "package %s can satisfy version requirements" msgstr "" -#: cmdline/apt-get.cc:2540 +#: cmdline/apt-get.cc:2543 #, c-format msgid "Failed to satisfy %s dependency for %s: Installed package %s is too new" msgstr "" -#: cmdline/apt-get.cc:2567 +#: cmdline/apt-get.cc:2570 #, c-format msgid "Failed to satisfy %s dependency for %s: %s" msgstr "" -#: cmdline/apt-get.cc:2583 +#: cmdline/apt-get.cc:2586 #, c-format msgid "Build-dependencies for %s could not be satisfied." msgstr "" -#: cmdline/apt-get.cc:2588 +#: cmdline/apt-get.cc:2591 msgid "Failed to process build dependencies" msgstr "" -#: cmdline/apt-get.cc:2620 +#: cmdline/apt-get.cc:2623 msgid "Supported modules:" msgstr "" -#: cmdline/apt-get.cc:2661 +#: cmdline/apt-get.cc:2664 msgid "" "Usage: apt-get [options] command\n" " apt-get [options] install|remove pkg1 [pkg2 ...]\n" @@ -1163,7 +1163,7 @@ msgid "" " This APT has Super Cow Powers.\n" msgstr "" -#: cmdline/apt-get.cc:2828 +#: cmdline/apt-get.cc:2831 msgid "" "NOTE: This is only a simulation!\n" " apt-get needs root privileges for real execution.\n" -- cgit v1.2.3 From ebf6c42d9db4766c315ea15f25c4a7a9a799660b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Aug 2009 14:52:43 +0200 Subject: Add the pkg/release syntax to the source command in apt-get and also add the understanding for codenames instead of archives here [cmdline/apt-get.cc] - add pkg/archive and codename in source (Closes: #414105, #441178) --- cmdline/apt-get.cc | 22 ++++++---- debian/changelog | 1 + po/apt-all.pot | 118 ++++++++++++++++++++++++++--------------------------- 3 files changed, 75 insertions(+), 66 deletions(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 71566fd55..1582fff85 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1220,17 +1220,25 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, { // We want to pull the version off the package specification.. string VerTag; + string DefRel; string TmpSrc = Name; - string::size_type Slash = TmpSrc.rfind('='); + const size_t found = TmpSrc.find_last_of("/="); // honor default release - string DefRel = _config->Find("APT::Default-Release"); + if (found != string::npos && TmpSrc[found] == '/') + { + DefRel = TmpSrc.substr(found+1); + TmpSrc = TmpSrc.substr(0,found); + } + else + DefRel = _config->Find("APT::Default-Release"); + pkgCache::PkgIterator Pkg = Cache.FindPkg(TmpSrc); - if (Slash != string::npos) + if (found != string::npos && TmpSrc[found] == '=') { - VerTag = string(TmpSrc.begin() + Slash + 1,TmpSrc.end()); - TmpSrc = string(TmpSrc.begin(),TmpSrc.begin() + Slash); + VerTag = TmpSrc.substr(found+1); + TmpSrc = TmpSrc.substr(0,found); } else if(!Pkg.end() && DefRel.empty() == false) { @@ -1252,8 +1260,8 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, pkgCache::Flag::NotSource && Pkg.CurrentVer() != Ver) continue; - //std::cout << VF.File().Archive() << std::endl; - if(VF.File().Archive() && (VF.File().Archive() == DefRel)) + if((VF.File().Archive() != 0 && VF.File().Archive() == DefRel) || + (VF.File().Codename() != 0 && VF.File().Codename() == DefRel)) { pkgRecords::Parser &Parse = Recs.Lookup(VF); VerTag = Parse.SourceVer(); diff --git a/debian/changelog b/debian/changelog index 3407cdcec..7dbbcdf7a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ apt (0.7.22.3) unstable; urgency=low - correct the order of picked package binary vs source in source - use SourceVersion instead of the BinaryVersion to get the source Patch by Matt Kraai, thanks! (Closes: #382826) + - add pkg/archive and codename in source (Closes: #414105, #441178) * apt-pkg/contrib/strutl.cc: - enable thousand separator according to the current locale (by Luca Bruno, Closes: #223712) diff --git a/po/apt-all.pot b/po/apt-all.pot index 767d9f060..b20a3fd92 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-12 13:14+0200\n" +"POT-Creation-Date: 2009-08-12 14:46+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,7 +151,7 @@ msgstr "" #: cmdline/apt-cache.cc:1718 cmdline/apt-cdrom.cc:134 cmdline/apt-config.cc:70 #: cmdline/apt-extracttemplates.cc:225 ftparchive/apt-ftparchive.cc:547 -#: cmdline/apt-get.cc:2618 cmdline/apt-sortpkgs.cc:144 +#: cmdline/apt-get.cc:2626 cmdline/apt-sortpkgs.cc:144 #, c-format msgid "%s %s for %s compiled on %s %s\n" msgstr "" @@ -549,7 +549,7 @@ msgstr "" msgid "Y" msgstr "" -#: cmdline/apt-get.cc:149 cmdline/apt-get.cc:1687 +#: cmdline/apt-get.cc:149 cmdline/apt-get.cc:1695 #, c-format msgid "Regex compilation error - %s" msgstr "" @@ -708,11 +708,11 @@ msgstr "" msgid "Internal error, Ordering didn't finish" msgstr "" -#: cmdline/apt-get.cc:811 cmdline/apt-get.cc:2029 cmdline/apt-get.cc:2062 +#: cmdline/apt-get.cc:811 cmdline/apt-get.cc:2037 cmdline/apt-get.cc:2070 msgid "Unable to lock the download directory" msgstr "" -#: cmdline/apt-get.cc:821 cmdline/apt-get.cc:2110 cmdline/apt-get.cc:2359 +#: cmdline/apt-get.cc:821 cmdline/apt-get.cc:2118 cmdline/apt-get.cc:2367 #: apt-pkg/cachefile.cc:65 msgid "The list of sources could not be read." msgstr "" @@ -741,7 +741,7 @@ msgstr "" msgid "After this operation, %sB disk space will be freed.\n" msgstr "" -#: cmdline/apt-get.cc:866 cmdline/apt-get.cc:2205 +#: cmdline/apt-get.cc:866 cmdline/apt-get.cc:2213 #, c-format msgid "Couldn't determine free space in %s" msgstr "" @@ -775,7 +775,7 @@ msgstr "" msgid "Do you want to continue [Y/n]? " msgstr "" -#: cmdline/apt-get.cc:989 cmdline/apt-get.cc:2256 apt-pkg/algorithms.cc:1389 +#: cmdline/apt-get.cc:989 cmdline/apt-get.cc:2264 apt-pkg/algorithms.cc:1389 #, c-format msgid "Failed to fetch %s %s\n" msgstr "" @@ -784,7 +784,7 @@ msgstr "" msgid "Some files failed to download" msgstr "" -#: cmdline/apt-get.cc:1008 cmdline/apt-get.cc:2265 +#: cmdline/apt-get.cc:1008 cmdline/apt-get.cc:2273 msgid "Download complete and in download only mode" msgstr "" @@ -876,39 +876,39 @@ msgstr "" msgid "Selected version %s (%s) for %s\n" msgstr "" -#: cmdline/apt-get.cc:1315 +#: cmdline/apt-get.cc:1323 #, c-format msgid "No source package '%s' picking '%s' instead\n" msgstr "" -#: cmdline/apt-get.cc:1352 +#: cmdline/apt-get.cc:1360 msgid "The update command takes no arguments" msgstr "" -#: cmdline/apt-get.cc:1365 +#: cmdline/apt-get.cc:1373 msgid "Unable to lock the list directory" msgstr "" -#: cmdline/apt-get.cc:1421 +#: cmdline/apt-get.cc:1429 msgid "We are not supposed to delete stuff, can't start AutoRemover" msgstr "" -#: cmdline/apt-get.cc:1470 +#: cmdline/apt-get.cc:1478 msgid "" "The following packages were automatically installed and are no longer " "required:" msgstr "" -#: cmdline/apt-get.cc:1472 +#: cmdline/apt-get.cc:1480 #, c-format msgid "%lu packages were automatically installed and are no longer required.\n" msgstr "" -#: cmdline/apt-get.cc:1473 +#: cmdline/apt-get.cc:1481 msgid "Use 'apt-get autoremove' to remove them." msgstr "" -#: cmdline/apt-get.cc:1478 +#: cmdline/apt-get.cc:1486 msgid "" "Hmm, seems like the AutoRemover destroyed something which really\n" "shouldn't happen. Please file a bug report against apt." @@ -924,49 +924,49 @@ msgstr "" #. "that package should be filed.") << endl; #. } #. -#: cmdline/apt-get.cc:1481 cmdline/apt-get.cc:1771 +#: cmdline/apt-get.cc:1489 cmdline/apt-get.cc:1779 msgid "The following information may help to resolve the situation:" msgstr "" -#: cmdline/apt-get.cc:1485 +#: cmdline/apt-get.cc:1493 msgid "Internal Error, AutoRemover broke stuff" msgstr "" -#: cmdline/apt-get.cc:1504 +#: cmdline/apt-get.cc:1512 msgid "Internal error, AllUpgrade broke stuff" msgstr "" -#: cmdline/apt-get.cc:1559 +#: cmdline/apt-get.cc:1567 #, c-format msgid "Couldn't find task %s" msgstr "" -#: cmdline/apt-get.cc:1674 cmdline/apt-get.cc:1710 +#: cmdline/apt-get.cc:1682 cmdline/apt-get.cc:1718 #, c-format msgid "Couldn't find package %s" msgstr "" -#: cmdline/apt-get.cc:1697 +#: cmdline/apt-get.cc:1705 #, c-format msgid "Note, selecting %s for regex '%s'\n" msgstr "" -#: cmdline/apt-get.cc:1728 +#: cmdline/apt-get.cc:1736 #, c-format msgid "%s set to manually installed.\n" msgstr "" -#: cmdline/apt-get.cc:1741 +#: cmdline/apt-get.cc:1749 msgid "You might want to run `apt-get -f install' to correct these:" msgstr "" -#: cmdline/apt-get.cc:1744 +#: cmdline/apt-get.cc:1752 msgid "" "Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a " "solution)." msgstr "" -#: cmdline/apt-get.cc:1756 +#: cmdline/apt-get.cc:1764 msgid "" "Some packages could not be installed. This may mean that you have\n" "requested an impossible situation or if you are using the unstable\n" @@ -974,152 +974,152 @@ msgid "" "or been moved out of Incoming." msgstr "" -#: cmdline/apt-get.cc:1774 +#: cmdline/apt-get.cc:1782 msgid "Broken packages" msgstr "" -#: cmdline/apt-get.cc:1803 +#: cmdline/apt-get.cc:1811 msgid "The following extra packages will be installed:" msgstr "" -#: cmdline/apt-get.cc:1892 +#: cmdline/apt-get.cc:1900 msgid "Suggested packages:" msgstr "" -#: cmdline/apt-get.cc:1893 +#: cmdline/apt-get.cc:1901 msgid "Recommended packages:" msgstr "" -#: cmdline/apt-get.cc:1922 +#: cmdline/apt-get.cc:1930 msgid "Calculating upgrade... " msgstr "" -#: cmdline/apt-get.cc:1925 methods/ftp.cc:702 methods/connect.cc:112 +#: cmdline/apt-get.cc:1933 methods/ftp.cc:702 methods/connect.cc:112 msgid "Failed" msgstr "" -#: cmdline/apt-get.cc:1930 +#: cmdline/apt-get.cc:1938 msgid "Done" msgstr "" -#: cmdline/apt-get.cc:1997 cmdline/apt-get.cc:2005 +#: cmdline/apt-get.cc:2005 cmdline/apt-get.cc:2013 msgid "Internal error, problem resolver broke stuff" msgstr "" -#: cmdline/apt-get.cc:2105 +#: cmdline/apt-get.cc:2113 msgid "Must specify at least one package to fetch source for" msgstr "" -#: cmdline/apt-get.cc:2135 cmdline/apt-get.cc:2377 +#: cmdline/apt-get.cc:2143 cmdline/apt-get.cc:2385 #, c-format msgid "Unable to find a source package for %s" msgstr "" -#: cmdline/apt-get.cc:2184 +#: cmdline/apt-get.cc:2192 #, c-format msgid "Skipping already downloaded file '%s'\n" msgstr "" -#: cmdline/apt-get.cc:2215 +#: cmdline/apt-get.cc:2223 #, c-format msgid "You don't have enough free space in %s" msgstr "" -#: cmdline/apt-get.cc:2221 +#: cmdline/apt-get.cc:2229 #, c-format msgid "Need to get %sB/%sB of source archives.\n" msgstr "" -#: cmdline/apt-get.cc:2224 +#: cmdline/apt-get.cc:2232 #, c-format msgid "Need to get %sB of source archives.\n" msgstr "" -#: cmdline/apt-get.cc:2230 +#: cmdline/apt-get.cc:2238 #, c-format msgid "Fetch source %s\n" msgstr "" -#: cmdline/apt-get.cc:2261 +#: cmdline/apt-get.cc:2269 msgid "Failed to fetch some archives." msgstr "" -#: cmdline/apt-get.cc:2289 +#: cmdline/apt-get.cc:2297 #, c-format msgid "Skipping unpack of already unpacked source in %s\n" msgstr "" -#: cmdline/apt-get.cc:2301 +#: cmdline/apt-get.cc:2309 #, c-format msgid "Unpack command '%s' failed.\n" msgstr "" -#: cmdline/apt-get.cc:2302 +#: cmdline/apt-get.cc:2310 #, c-format msgid "Check if the 'dpkg-dev' package is installed.\n" msgstr "" -#: cmdline/apt-get.cc:2319 +#: cmdline/apt-get.cc:2327 #, c-format msgid "Build command '%s' failed.\n" msgstr "" -#: cmdline/apt-get.cc:2338 +#: cmdline/apt-get.cc:2346 msgid "Child process failed" msgstr "" -#: cmdline/apt-get.cc:2354 +#: cmdline/apt-get.cc:2362 msgid "Must specify at least one package to check builddeps for" msgstr "" -#: cmdline/apt-get.cc:2382 +#: cmdline/apt-get.cc:2390 #, c-format msgid "Unable to get build-dependency information for %s" msgstr "" -#: cmdline/apt-get.cc:2402 +#: cmdline/apt-get.cc:2410 #, c-format msgid "%s has no build depends.\n" msgstr "" -#: cmdline/apt-get.cc:2454 +#: cmdline/apt-get.cc:2462 #, c-format msgid "" "%s dependency for %s cannot be satisfied because the package %s cannot be " "found" msgstr "" -#: cmdline/apt-get.cc:2507 +#: cmdline/apt-get.cc:2515 #, c-format msgid "" "%s dependency for %s cannot be satisfied because no available versions of " "package %s can satisfy version requirements" msgstr "" -#: cmdline/apt-get.cc:2543 +#: cmdline/apt-get.cc:2551 #, c-format msgid "Failed to satisfy %s dependency for %s: Installed package %s is too new" msgstr "" -#: cmdline/apt-get.cc:2570 +#: cmdline/apt-get.cc:2578 #, c-format msgid "Failed to satisfy %s dependency for %s: %s" msgstr "" -#: cmdline/apt-get.cc:2586 +#: cmdline/apt-get.cc:2594 #, c-format msgid "Build-dependencies for %s could not be satisfied." msgstr "" -#: cmdline/apt-get.cc:2591 +#: cmdline/apt-get.cc:2599 msgid "Failed to process build dependencies" msgstr "" -#: cmdline/apt-get.cc:2623 +#: cmdline/apt-get.cc:2631 msgid "Supported modules:" msgstr "" -#: cmdline/apt-get.cc:2664 +#: cmdline/apt-get.cc:2672 msgid "" "Usage: apt-get [options] command\n" " apt-get [options] install|remove pkg1 [pkg2 ...]\n" @@ -1163,7 +1163,7 @@ msgid "" " This APT has Super Cow Powers.\n" msgstr "" -#: cmdline/apt-get.cc:2831 +#: cmdline/apt-get.cc:2839 msgid "" "NOTE: This is only a simulation!\n" " apt-get needs root privileges for real execution.\n" -- cgit v1.2.3 From 90c2436367d7c136467296d7726e6934bd65fe66 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Aug 2009 17:13:18 +0200 Subject: [doc/apt-get.8.xml] - update the source description to reflect what it actually does and how it can be used. (Closes: #413021) --- debian/changelog | 3 +++ doc/apt-get.8.xml | 39 +++++++++++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7dbbcdf7a..597ca91ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,9 @@ apt (0.7.22.3) unstable; urgency=low the one above) by Robert Millan, thanks! * apt-pkg/depcache.cc: - restore the --ignore-hold effect in the Is{Delete,Install}Ok hooks + * doc/apt-get.8.xml: + - update the source description to reflect what it actually does + and how it can be used. (Closes: #413021) [ George Danchev ] * cmdline/apt-cache.cc: diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index 920f6b36e..8db2883c4 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -85,9 +85,19 @@ purge pkg source pkg - - =pkg_version_number - + + + + =pkg_version_number + + + /target_release_name + + + /target_release_codename + + + build-dep pkg @@ -240,13 +250,22 @@ source causes apt-get to fetch source packages. APT will examine the available packages to decide which source package to fetch. It will then find and download into the current directory the - newest available version of that source package. Source packages are - tracked separately from binary packages via deb-src type lines - in the &sources-list; file. This probably will mean that you will not - get the same source as the package you have installed or as you could - install. If the --compile options is specified then the package will be - compiled to a binary .deb using dpkg-buildpackage, if --download-only is - specified then the source package will not be unpacked. + newest available version of that source package while respect the + default release, set with the option APT::Default-Release, + the option or per package with with the + pkg/release syntax, if possible. + + Source packages are tracked separately + from binary packages via deb-src type lines + in the &sources-list; file. This means that you will need to add such a line + for each repository you want to get sources from. If you don't do this + you will properly get another (newer, older or none) source version than + the one you have installed or could install. + + If the options is specified + then the package will be compiled to a binary .deb using + dpkg-buildpackage, if + is specified then the source package will not be unpacked. A specific source version can be retrieved by postfixing the source name with an equals and then the version to fetch, similar to the mechanism -- cgit v1.2.3 From dda7233c5d3879f2580543ead0ad7cd76196a160 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 18 Aug 2009 20:15:13 +0200 Subject: Allow empty Reason-Phase in the Status-Lines, which is allowed by rtf http://www.w3.org/Protocols/rfc2616/rfc2616.html . Fixed by removing a space which will now be visibly in the errormessages, but as this errors should never happen anyway and an extra space doesn't harm we don't removed it. * methods/http.cc: - allow empty Reason-Phase in Status-Line to please squid, thanks Modestas Vainius for noticing! (Closes: #531157, LP: #411435) --- debian/changelog | 3 +++ methods/http.cc | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 597ca91ff..4923f913f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,6 +33,9 @@ apt (0.7.22.3) unstable; urgency=low * doc/apt-get.8.xml: - update the source description to reflect what it actually does and how it can be used. (Closes: #413021) + * methods/http.cc: + - allow empty Reason-Phase in Status-Line to please squid, + thanks Modestas Vainius for noticing! (Closes: #531157, LP: #411435) [ George Danchev ] * cmdline/apt-cache.cc: diff --git a/methods/http.cc b/methods/http.cc index 006e89394..df62034e3 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -547,7 +547,7 @@ bool ServerState::HeaderLine(string Line) // Evil servers return no version if (Line[4] == '/') { - if (sscanf(Line.c_str(),"HTTP/%u.%u %u %[^\n]",&Major,&Minor, + if (sscanf(Line.c_str(),"HTTP/%u.%u %u%[^\n]",&Major,&Minor, &Result,Code) != 4) return _error->Error(_("The HTTP server sent an invalid reply header")); } @@ -555,7 +555,7 @@ bool ServerState::HeaderLine(string Line) { Major = 0; Minor = 9; - if (sscanf(Line.c_str(),"HTTP %u %[^\n]",&Result,Code) != 2) + if (sscanf(Line.c_str(),"HTTP %u%[^\n]",&Result,Code) != 2) return _error->Error(_("The HTTP server sent an invalid reply header")); } -- cgit v1.2.3 From e878aedb8b53b311295a2df55ce5e865b1ad92b9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 25 Aug 2009 15:32:40 +0200 Subject: "backport" the APT::Configuration class to apt-sid We can use it to simplify the internal code to operate with Acquire::CompressionTypes group. This also made it possible to set this setting with the -o flag. --- apt-pkg/acquire-item.cc | 62 ++++++++++++++--------------------- apt-pkg/aptconfiguration.cc | 78 +++++++++++++++++++++++++++++++++++++++++++++ apt-pkg/aptconfiguration.h | 46 ++++++++++++++++++++++++++ apt-pkg/init.cc | 22 ------------- apt-pkg/makefile | 5 +-- doc/apt.conf.5.xml | 2 +- po/apt-all.pot | 22 ++++++------- 7 files changed, 163 insertions(+), 74 deletions(-) create mode 100644 apt-pkg/aptconfiguration.cc create mode 100644 apt-pkg/aptconfiguration.h diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index ffbe66d7d..94341c81a 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -15,6 +15,7 @@ // Include Files /*{{{*/ #include #include +#include #include #include #include @@ -551,21 +552,11 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, if(comprExt.empty()) { // autoselect the compression method - Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); - if (Opts != 0) - Opts = Opts->Child; - - const char dirBin[] = "Dir::Bin::"; - for (; Opts != 0; Opts = Opts->Next) - { - if (Opts->Tag.empty() == true || Opts->Value.empty() == true) - continue; - const string bin = _config->FindFile(string(dirBin).append(Opts->Value).c_str(),""); - if (bin != "" && !FileExists(bin)) - continue; - comprExt = '.' + Opts->Tag; - break; - } + std::vector types = APT::Configuration::getCompressionTypes(); + if (types.empty() == true) + comprExt = "plain"; + else + comprExt = "." + types[0]; } CompressionExtension = ((comprExt == "plain" || comprExt == ".") ? "" : comprExt); @@ -595,36 +586,31 @@ string pkgAcqIndex::Custom600Headers() /*}}}*/ void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/ { - Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); - if (Opts != 0) - Opts = Opts->Child; + std::vector types = APT::Configuration::getCompressionTypes(); - const char dirBin[] = "Dir::Bin::"; - for (; Opts != 0; Opts = Opts->Next) + for (std::vector::const_iterator t = types.begin(); + t != types.end(); t++) { - if (Opts->Tag.empty() == true || Opts->Value.empty() == true) + // jump over all already tried compression types + const unsigned int nameLen = Desc.URI.size() - (*t).size(); + if(Desc.URI.substr(nameLen) != *t) continue; - // jump over all already checked compression types - const unsigned int nameLen = Desc.URI.size() - Opts->Tag.size(); - if(Desc.URI.substr(nameLen) != Opts->Tag || Opts->Next == 0) - continue; - - // check if we need an external binary for this compression type - const string bin = _config->FindFile(string(dirBin).append(Opts->Next->Value).c_str(),""); - if (bin != "" && !FileExists(bin)) - continue; + // we want to try it with the next extension + t++; - // retry with the next extension - Desc.URI = Desc.URI.substr(0, nameLen) + Opts->Next->Tag; + if (t != types.end()) + { + Desc.URI = Desc.URI.substr(0, nameLen) + *t; - new pkgAcqIndex(Owner, RealURI, Desc.Description, Desc.ShortDesc, - ExpectedHash, string(".").append(Opts->Next->Tag)); + new pkgAcqIndex(Owner, RealURI, Desc.Description, Desc.ShortDesc, + ExpectedHash, string(".").append(*t)); - Status = StatDone; - Complete = false; - Dequeue(); - return; + Status = StatDone; + Complete = false; + Dequeue(); + return; + } } // on decompression failure, remove bad versions in partial/ diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc new file mode 100644 index 000000000..1a8e8262f --- /dev/null +++ b/apt-pkg/aptconfiguration.cc @@ -0,0 +1,78 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +/* ###################################################################### + + Provide access methods to various configuration settings, + setup defaults and returns validate settings. + + ##################################################################### */ + /*}}}*/ +// Include Files /*{{{*/ +#include +#include +#include + +#include +#include + /*}}}*/ +namespace APT { +// getCompressionTypes - Return Vector of usbale compressiontypes /*{{{*/ +// --------------------------------------------------------------------- +/* return a vector of compression types in the prefered order. */ +std::vector +const Configuration::getCompressionTypes(bool const &Cached) { + static std::vector types; + if (types.empty() == false) { + if (Cached == true) + return types; + else + types.clear(); + } + + // Set default application paths to check for optional compression types + _config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma"); + _config->CndSet("Dir::Bin::bzip2", "/bin/bzip2"); + + ::Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); + if (Opts != 0) + Opts = Opts->Child; + + // at first, move over the options to setup at least the default options + bool foundLzma=false, foundBzip2=false, foundGzip=false; + for (; Opts != 0; Opts = Opts->Next) { + if (Opts->Value == "lzma") + foundLzma = true; + else if (Opts->Value == "bz2") + foundBzip2 = true; + else if (Opts->Value == "gz") + foundGzip = true; + } + + // setup the defaults now + if (!foundBzip2) + _config->Set("Acquire::CompressionTypes::bz2","bzip2"); + if (!foundLzma) + _config->Set("Acquire::CompressionTypes::lzma","lzma"); + if (!foundGzip) + _config->Set("Acquire::CompressionTypes::gz","gzip"); + + // move again over the option tree to finially calculate our result + ::Configuration::Item const *Types = _config->Tree("Acquire::CompressionTypes"); + if (Types != 0) + Types = Types->Child; + + for (; Types != 0; Types = Types->Next) { + string const appsetting = string("Dir::Bin::").append(Types->Value); + // ignore compression types we have no app ready to use + if (appsetting.empty() == false && _config->Exists(appsetting) == true) { + std::string const app = _config->FindFile(appsetting.c_str(), ""); + if (app.empty() == false && FileExists(app) == false) + continue; + } + types.push_back(Types->Tag); + } + + return types; +} + /*}}}*/ +} diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h new file mode 100644 index 000000000..6a123adce --- /dev/null +++ b/apt-pkg/aptconfiguration.h @@ -0,0 +1,46 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +/** \class APT::Configuration + * \brief Provide access methods to various configuration settings + * + * This class and their methods providing a layer around the usual access + * methods with _config to ensure that settings are correct and to be able + * to set defaults without the need to recheck it in every method again. + */ + /*}}}*/ +#ifndef APT_CONFIGURATION_H +#define APT_CONFIGURATION_H +// Include Files /*{{{*/ +#include +#include + /*}}}*/ +namespace APT { +class Configuration { /*{{{*/ +public: /*{{{*/ + /** \brief Returns a vector of usable Compression Types + * + * Files can be compressed in various ways to decrease the size of the + * download. Therefore the Acquiremethods support a few compression types + * and some archives provide also a few different types. This option + * group exists to give the user the choice to prefer one type over the + * other (some compression types are very resource intensive - great if you + * have a limited download, bad if you have a really lowpowered hardware.) + * + * This method ensures that the defaults are set and checks at runtime + * if the type can be used. E.g. the current default is to prefer bzip2 + * over lzma and gz - if the bzip2 binary is not available it has not much + * sense in downloading the bz2 file, therefore we will not return bz2 as + * a usable compression type. The availability is checked with the settings + * in the Dir::Bin group. + * + * \param Cached saves the result so we need to calculated it only once + * this parameter should ony be used for testing purposes. + * + * \return a vector of (all) Language Codes in the prefered usage order + */ + std::vector static const getCompressionTypes(bool const &Cached = true); + /*}}}*/ +}; + /*}}}*/ +} +#endif diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 46017bf0c..15efb1a3d 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -104,28 +104,6 @@ bool pkgInitConfig(Configuration &Cnf) if (Res == false) return false; - // we load all config files, now check the configs and setup post-defaults: - // * check for CompressionTypes setup - { - Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); - if (Opts != 0) - Opts = Opts->Child; - bool foundLzma=false, foundBzip2=false, foundGzip=false; - for (; Opts != 0; Opts = Opts->Next) - { - if (Opts->Value == "lzma") foundLzma = true; - else if (Opts->Value == "bz2") foundBzip2 = true; - else if (Opts->Value == "gz") foundGzip = true; - } - if (!foundBzip2) Cnf.Set("Acquire::CompressionTypes::bz2","bzip2"); - if (!foundLzma) Cnf.Set("Acquire::CompressionTypes::lzma","lzma"); - if (!foundGzip) Cnf.Set("Acquire::CompressionTypes::gz","gzip"); - Cnf.CndSet("Dir::Bin::lzma", "/usr/bin/lzma"); - Cnf.CndSet("Dir::Bin::bzip2", "/bin/bzip2"); - } - - - if (Cnf.FindB("Debug::pkgInitConfig",false) == true) Cnf.Dump(); diff --git a/apt-pkg/makefile b/apt-pkg/makefile index 92ef58967..679d97e70 100644 --- a/apt-pkg/makefile +++ b/apt-pkg/makefile @@ -34,14 +34,15 @@ SOURCE+= pkgcache.cc version.cc depcache.cc \ acquire-worker.cc acquire-method.cc init.cc clean.cc \ srcrecords.cc cachefile.cc versionmatch.cc policy.cc \ pkgsystem.cc indexfile.cc pkgcachegen.cc acquire-item.cc \ - indexrecords.cc vendor.cc vendorlist.cc cdrom.cc indexcopy.cc + indexrecords.cc vendor.cc vendorlist.cc cdrom.cc indexcopy.cc \ + aptconfiguration.cc HEADERS+= algorithms.h depcache.h pkgcachegen.h cacheiterators.h \ orderlist.h sourcelist.h packagemanager.h tagfile.h \ init.h pkgcache.h version.h progress.h pkgrecords.h \ acquire.h acquire-worker.h acquire-item.h acquire-method.h \ clean.h srcrecords.h cachefile.h versionmatch.h policy.h \ pkgsystem.h indexfile.h metaindex.h indexrecords.h vendor.h \ - vendorlist.h cdrom.h indexcopy.h + vendorlist.h cdrom.h indexcopy.h aptconfiguration.h # Source code for the debian specific components # In theory the deb headers do not need to be exported.. diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index d347bda67..59235f115 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -309,7 +309,7 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; This list defines in which order the acquire methods will try to download these files. Per default bzip2 compressed files will be prefered over lzma, gzip and uncompressed files. The syntax for - the configuration fileentry (this option can't be set at runtime with the -o option) is + the configuration fileentry is Acquire::CompressionTypes::FileExtension "Methodname"; e.g. Acquire::CompressionTypes::bz2 "bzip2"; Note that at runtime the Dir::Bin::Methodname will diff --git a/po/apt-all.pot b/po/apt-all.pot index b20a3fd92..518a3a1c1 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-12 14:46+0200\n" +"POT-Creation-Date: 2009-08-21 11:35+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2364,12 +2364,12 @@ msgstr "" msgid "Please insert the disc labeled: '%s' in the drive '%s' and press enter." msgstr "" -#: apt-pkg/init.cc:154 +#: apt-pkg/init.cc:132 #, c-format msgid "Packaging system '%s' is not supported" msgstr "" -#: apt-pkg/init.cc:170 +#: apt-pkg/init.cc:148 msgid "Unable to determine a suitable packaging system type" msgstr "" @@ -2497,44 +2497,44 @@ msgstr "" msgid "IO Error saving source cache" msgstr "" -#: apt-pkg/acquire-item.cc:127 +#: apt-pkg/acquire-item.cc:128 #, c-format msgid "rename failed, %s (%s -> %s)." msgstr "" -#: apt-pkg/acquire-item.cc:394 +#: apt-pkg/acquire-item.cc:395 msgid "MD5Sum mismatch" msgstr "" -#: apt-pkg/acquire-item.cc:663 apt-pkg/acquire-item.cc:1425 +#: apt-pkg/acquire-item.cc:649 apt-pkg/acquire-item.cc:1411 msgid "Hash Sum mismatch" msgstr "" -#: apt-pkg/acquire-item.cc:1120 +#: apt-pkg/acquire-item.cc:1106 msgid "There is no public key available for the following key IDs:\n" msgstr "" -#: apt-pkg/acquire-item.cc:1230 +#: apt-pkg/acquire-item.cc:1216 #, c-format msgid "" "I wasn't able to locate a file for the %s package. This might mean you need " "to manually fix this package. (due to missing arch)" msgstr "" -#: apt-pkg/acquire-item.cc:1289 +#: apt-pkg/acquire-item.cc:1275 #, c-format msgid "" "I wasn't able to locate file for the %s package. This might mean you need to " "manually fix this package." msgstr "" -#: apt-pkg/acquire-item.cc:1330 +#: apt-pkg/acquire-item.cc:1316 #, c-format msgid "" "The package index files are corrupted. No Filename: field for package %s." msgstr "" -#: apt-pkg/acquire-item.cc:1417 +#: apt-pkg/acquire-item.cc:1403 msgid "Size mismatch" msgstr "" -- cgit v1.2.3 From 8c75bf9e9558d062a5f3d1fe5276aeffba6403a0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 26 Aug 2009 12:03:40 +0200 Subject: fix changelog entry for compression types reordering patch to reflect that we now use the new APT::Configuration class for this instead of the init.cc --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4923f913f..00afc704b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,7 +22,7 @@ apt (0.7.22.3) unstable; urgency=low * apt-pkg/acquire-item.cc: - use configsettings for dynamic compression type use and order. Based on a patch by Jyrki Muukkonen, thanks! (LP: #71746) - * apt-pkg/init.cc: + * apt-pkg/aptconfiguration.cc: - add default configuration for compression types and add lzma support. Order is now bzip2, lzma, gzip, none (Closes: #510526) * ftparchive/writer.cc: -- cgit v1.2.3