}
// And finish up
- if (Itm.Size >= 0 && BadRecord == false)
+ if (BadRecord == false)
if (Stream.FinishedFile(Itm,Fd) == false)
return false;
environment.push_back("en");
}
- // Support settings like Acquire::Translation=none on the command line to
+ // Support settings like Acquire::Languages=none on the command line to
// override the configuration settings vector of languages.
string const forceLang = _config->Find("Acquire::Languages","");
if (forceLang.empty() == false) {
/* */
bool debTranslationsIndex::GetIndexes(pkgAcquire *Owner) const
{
- if (TranslationsAvailable()) {
- string const TranslationFile = string("Translation-").append(Language);
- new pkgAcqIndexTrans(Owner, IndexURI(Language),
- Info(TranslationFile.c_str()),
- TranslationFile);
- }
+ string const TranslationFile = string("Translation-").append(Language);
+ new pkgAcqIndexTrans(Owner, IndexURI(Language),
+ Info(TranslationFile.c_str()),
+ TranslationFile);
return true;
}
/*}}}*/
bool debTranslationsIndex::HasPackages() const /*{{{*/
{
- if(!TranslationsAvailable())
- return false;
-
return FileExists(IndexFile(Language));
}
/*}}}*/
{
// Check the translation file, if in use
string TranslationFile = IndexFile(Language);
- if (TranslationsAvailable() && FileExists(TranslationFile))
+ if (FileExists(TranslationFile))
{
FileFd Trans(TranslationFile,FileFd::ReadOnlyGzip);
debListParser TransParser(&Trans);
if (Section.FindS("Description").empty() == false)
return "";
- std::vector<string> const lang = APT::Configuration::getLanguages();
+ std::vector<string> const lang = APT::Configuration::getLanguages(true);
for (std::vector<string>::const_iterator l = lang.begin();
l != lang.end(); l++)
if (Section.FindS(string("Description-").append(*l).c_str()).empty() == false)
/* Strip out any spaces from the text, this undoes dpkgs reformatting
of certain fields. dpkg also has the rather interesting notion of
reformatting depends operators < -> <= */
- char *I = S;
+ char *J = S;
for (; Start != End; Start++)
{
if (isspace(*Start) == 0)
- *I++ = tolower_ascii(*Start);
+ *J++ = tolower_ascii(*Start);
if (*Start == '<' && Start[1] != '<' && Start[1] != '=')
- *I++ = '=';
+ *J++ = '=';
if (*Start == '>' && Start[1] != '>' && Start[1] != '=')
- *I++ = '=';
+ *J++ = '=';
}
- Result = AddCRC16(Result,S,I - S);
+ Result = AddCRC16(Result,S,J - S);
}
return Result;
#include <apt-pkg/depcache.h>
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/strutl.h>
-#include <apti18n.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/cachefile.h>
#include <unistd.h>
#include <stdlib.h>
#include <algorithm>
#include <sstream>
#include <map>
+#include <pwd.h>
+#include <grp.h>
#include <termios.h>
#include <unistd.h>
return _error->WarningE("OpenLog", _("Could not open file '%s'"), logfile_name.c_str());
setvbuf(term_out, NULL, _IONBF, 0);
SetCloseExec(fileno(term_out), true);
- chmod(logfile_name.c_str(), 0600);
+ struct passwd *pw;
+ struct group *gr;
+ pw = getpwnam("root");
+ gr = getgrnam("adm");
+ if (pw != NULL && gr != NULL)
+ chown(logfile_name.c_str(), pw->pw_uid, gr->gr_gid);
+ chmod(logfile_name.c_str(), 0644);
fprintf(term_out, "\nLog started: %s\n", timestr);
}
return _error->WarningE("OpenLog", _("Could not open file '%s'"), history_name.c_str());
chmod(history_name.c_str(), 0644);
fprintf(history_out, "\nStart-Date: %s\n", timestr);
- string remove, purge, install, upgrade, downgrade;
+ string remove, purge, install, reinstall, upgrade, downgrade;
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
{
- if (Cache[I].NewInstall())
- {
- install += I.FullName(false) + string(" (") + Cache[I].CandVersion;
- if (Cache[I].Flags & pkgCache::Flag::Auto)
- install+= ", automatic";
- install += string("), ");
- }
- else if (Cache[I].Upgrade())
- upgrade += I.FullName(false) + string(" (") + Cache[I].CurVersion + string(", ") + Cache[I].CandVersion + string("), ");
- else if (Cache[I].Downgrade())
- downgrade += I.FullName(false) + string(" (") + Cache[I].CurVersion + string(", ") + Cache[I].CandVersion + string("), ");
- else if (Cache[I].Delete())
- {
- if ((Cache[I].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge)
- purge += I.FullName(false) + string(" (") + Cache[I].CurVersion + string("), ");
- else
- remove += I.FullName(false) + string(" (") + Cache[I].CurVersion + string("), ");
+ enum { CANDIDATE, CANDIDATE_AUTO, CURRENT_CANDIDATE, CURRENT } infostring;
+ string *line = NULL;
+ #define HISTORYINFO(X, Y) { line = &X; infostring = Y; }
+ if (Cache[I].NewInstall() == true)
+ HISTORYINFO(install, CANDIDATE_AUTO)
+ else if (Cache[I].ReInstall() == true)
+ HISTORYINFO(reinstall, CANDIDATE)
+ else if (Cache[I].Upgrade() == true)
+ HISTORYINFO(upgrade, CURRENT_CANDIDATE)
+ else if (Cache[I].Downgrade() == true)
+ HISTORYINFO(downgrade, CURRENT_CANDIDATE)
+ else if (Cache[I].Delete() == true)
+ HISTORYINFO((Cache[I].Purge() ? purge : remove), CURRENT)
+ else
+ continue;
+ #undef HISTORYINFO
+ line->append(I.FullName(false)).append(" (");
+ switch (infostring) {
+ case CANDIDATE: line->append(Cache[I].CandVersion); break;
+ case CANDIDATE_AUTO:
+ line->append(Cache[I].CandVersion);
+ if ((Cache[I].Flags & pkgCache::Flag::Auto) == pkgCache::Flag::Auto)
+ line->append(", automatic");
+ break;
+ case CURRENT_CANDIDATE: line->append(Cache[I].CurVersion).append(", ").append(Cache[I].CandVersion); break;
+ case CURRENT: line->append(Cache[I].CurVersion); break;
}
+ line->append("), ");
}
if (_config->Exists("Commandline::AsString") == true)
WriteHistoryTag("Commandline", _config->Find("Commandline::AsString"));
WriteHistoryTag("Install", install);
+ WriteHistoryTag("Reinstall", reinstall);
WriteHistoryTag("Upgrade", upgrade);
WriteHistoryTag("Downgrade",downgrade);
WriteHistoryTag("Remove",remove);
if (RunScripts("DPkg::Post-Invoke") == false)
return false;
+ if (_config->FindB("Debug::pkgDPkgPM",false) == false)
+ {
+ std::string const oldpkgcache = _config->FindFile("Dir::cache::pkgcache");
+ if (oldpkgcache.empty() == false && RealFileExists(oldpkgcache) == true &&
+ unlink(oldpkgcache.c_str()) == 0)
+ {
+ std::string const srcpkgcache = _config->FindFile("Dir::cache::srcpkgcache");
+ if (srcpkgcache.empty() == false && RealFileExists(srcpkgcache) == true)
+ {
+ _error->PushToStack();
+ pkgCacheFile CacheFile;
+ CacheFile.BuildCaches(NULL, true);
+ _error->RevertToStack();
+ }
+ }
+ }
+
Cache.writeStateFile(NULL);
return true;
}
// Various test members for the current status of the package
inline bool NewInstall() const {return Status == 2 && Mode == ModeInstall;};
inline bool Delete() const {return Mode == ModeDelete;};
+ inline bool Purge() const {return Delete() == true && (iFlags & pkgDepCache::Purge) == pkgDepCache::Purge; };
inline bool Keep() const {return Mode == ModeKeep;};
inline bool Upgrade() const {return Status > 0 && Mode == ModeInstall;};
inline bool Upgradable() const {return Status >= 1;};
inline bool InstBroken() const {return (DepState & DepInstMin) != DepInstMin;};
inline bool InstPolicyBroken() const {return (DepState & DepInstPolicy) != DepInstPolicy;};
inline bool Install() const {return Mode == ModeInstall;};
+ inline bool ReInstall() const {return Delete() == false && (iFlags & pkgDepCache::ReInstall) == pkgDepCache::ReInstall;};
inline VerIterator InstVerIter(pkgCache &Cache)
{return VerIterator(Cache,InstallVer);};
inline VerIterator CandidateVerIter(pkgCache &Cache)
Cnf.Set("Dir::Ignore-Files-Silently::", "\\.bak$");
Cnf.Set("Dir::Ignore-Files-Silently::", "\\.dpkg-[a-z]+$");
- // Translation
- Cnf.Set("APT::Acquire::Translation", "environment");
-
// Default cdrom mount point
Cnf.Set("Acquire::cdrom::mount", "/media/cdrom/");
just needs one */
if (D.IsNegative() == false)
{
+ // ignore provides by older versions of this package
+ if (((D.Reverse() == false && Pkg == D.ParentPkg()) ||
+ (D.Reverse() == true && Pkg == D.TargetPkg())) &&
+ Cache[Pkg].InstallVer != *I)
+ continue;
+
/* Try to find something that does not have the after flag set
if at all possible */
if (IsFlag(Pkg,After) == true)
#include <apt-pkg/error.h>
#include <apt-pkg/init.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/aptconfiguration.h>
#include <config.h>
#include <apti18n.h>
#include <locale.h>
#include <iostream>
#include <string>
+#include <vector>
/*}}}*/
using namespace std;
CmdL.FileSize() == 0)
return ShowHelp();
+ std::vector<std::string> const langs = APT::Configuration::getLanguages(true);
+ _config->Clear("Acquire::Languages");
+ for (std::vector<std::string>::const_iterator l = langs.begin(); l != langs.end(); ++l)
+ _config->Set("Acquire::Languages::", *l);
+
+ std::vector<std::string> const archs = APT::Configuration::getArchitectures();
+ _config->Clear("APT::Architectures");
+ for (std::vector<std::string>::const_iterator a = archs.begin(); a != archs.end(); ++a)
+ _config->Set("APT::Architectures::", *a);
+
// Match the operation
CmdL.DispatchArg(Cmds);
-- Michael Vogt <mvo@debian.org> Fri, 10 Jun 2011 15:32:07 +0200
+apt (0.8.14.2) UNRELEASED; urgency=low
+
+ [ Julian Andres Klode ]
+ * apt-pkg/depcache.cc:
+ - Really release action groups only once (Closes: #622744)
+ - Make purge work again for config-files (LP: #244598) (Closes: #150831)
+ * apt-pkg/acquire-item.cc:
+ - Reject files known to be invalid (LP: #346386) (Closes: #627642)
+ * debian/apt.cron.daily:
+ - Check power after wait, patch by manuel-soto (LP: #705269)
+ * debian/control:
+ - Move ${shlibs:Depends} to Pre-Depends, as we do not want APT
+ unpacked if a library is too old and thus break upgrades
+ * doc/apt-key.8.xml:
+ - Document apt-key net-update (LP: #192810)
+
+ [ Christian Perrier ]
+ * Galician translation update (Miguel Anxo Bouzada). Closes: #626505
+ * Italian translation update (Milo Casagrande). Closes: #627834
+ * German documentation translation update (Chris Leick). Closes: #629949
+ * Catalan translation update (Jordi Mallach). Closes: #630657
+
+ [ David Kalnischkies ]
+ * fix a bunch of cppcheck warnings/errors based on a patch by
+ Niels Thykier, thanks! (Closes: #622805)
+ * apt-pkg/depcache.cc:
+ - really include 'rc' packages in the delete count by fixing a
+ typo which exists since 1999 in the source… (LP: #761175)
+ - if critical or-group can't be satisfied, exit directly.
+ * apt-pkg/acquire-method.cc:
+ - write directly to stdout instead of creating the message in
+ memory first before writing to avoid hitting limits
+ - fix order of CurrentURI and UsedMirror in Status() and Log()
+ * apt-pkg/orderlist.cc:
+ - let VisitRProvides report if the calls were successful
+ * apt-pkg/deb/dpkgpm.cc:
+ - replace obsolete usleep with nanosleep
+ - remove invalid pkgcache.bin and rebuild it if possible
+ - log reinstall commands in history.log
+ * debian/apt{,-utils}.symbols:
+ - update both experimental symbol-files to reflect 0.8.14 state
+ * debian/rules:
+ - remove unused embedded jquery by doxygen from libapt-pkg-doc
+ * cmdline/apt-mark.cc:
+ - reimplement apt-mark in c++
+ - provide a 'showmanual' command (Closes: #582791)
+ - provide a 'dpkg --set-selections' wrapper to set/release holds
+ * cmdline/apt-get.cc:
+ - deprecate mostly undocumented 'markauto' in favor of 'apt-mark'
+ * cmdline/apt-cache.cc:
+ - deprecate mostly undocumented 'showauto' in favor of 'apt-mark'
+ * apt-pkg/pkgcache.cc:
+ - really ignore :arch in FindPkg() in non-multiarch environment
+ * doc/po/de.po:
+ - undo the translation of the command 'dump' in manpage of apt-config
+ as report by Burghard Grossmann on debian-l10n-german, thanks!
+ * apt-pkg/deb/debmetaindex.cc:
+ - do not download TranslationIndex if no Translation-* will be
+ downloaded later on anyway (Closes: #624218)
+ * test/versions.lst:
+ - disable obscure version number tests with versions dpkg doesn't
+ allow any more as they don't start with a number
+ * apt-pkg/acquire-worker.cc:
+ - print filename in the unmatching size warning (Closes: #623137)
+ * apt-pkg/acquire-item.cc:
+ - apply fix for poorly worded 'locate file' error message from
+ Ben Finney, thanks! (Closes: #623171)
+ * methods/http.cc:
+ - add config option to ignore a closed stdin to be able to easily
+ use the method as a simple standalone downloader
+ - Location header in redirects should be absolute URI, but some
+ servers just send an absolute path so still deal with it properly
+ - dequote URL taken from Location in redirects as we will otherwise
+ quote an already quoted string in the request later (Closes: #602412)
+ * apt-pkg/contrib/netrc.cc:
+ - replace non-posix gnu-extension strdupa with strdup
+ * apt-pkg/packagemanager.cc:
+ - ensure for Multi-Arch:same packages that they are unpacked in
+ lock step even in immediate configuration (Closes: #618288)
+ * apt-pkg/init.cc:
+ - don't set deprecated APT::Acquire::Translation, thanks Jörg Sommer!
+ * cmdline/apt-config.cc:
+ - show Acquire::Languages and APT::Architectures settings
+ in 'dump' (Closes: 626739)
+ * apt-pkg/orderlist.cc:
+ - ensure that an old version of a package with a provides can
+ never satisfy a dependency of a newer version of this package
+
+ [ Michael Vogt ]
+ * methods/mirror.cc:
+ - ignore lines starting with "#" in the mirror file
+ - ignore non http urls in the mirrors
+ - append the dist (e.g. sid, wheezy) as a query string when
+ asking for a suitable mirror
+ * apt-pkg/deb/deblistparser.cc:
+ - include all known languages when building the apt cache
+ (LP: #794907)
+ * apt-pkg/deb/debindexfile.cc:
+ - remove some no longer valid checks for "TranslationsAvailable()"
+
+ [ Kenneth Solbø Andersen ]
+ * apt-pkg/deb/dpkgpm.cc:
+ - set permissions of term.log to root.adm and 644 (LP: #404724)
+
+ [ Chris Leick ]
+ * various typo and syntax corrections in doc/*.xml
+
+ -- David Kalnischkies <kalnischkies@gmail.com> Sat, 28 May 2011 10:54:23 +0200
+
apt (0.8.14.1) unstable; urgency=low
* apt-pkg/acquire-item.cc:
<term><option>--no-replaces</option></term>
<term><option>--no-enhances</option></term>
<listitem><para>Per default the <literal>depends</literal> and
- <literal>rdepends</literal> print all dependencies. This can be twicked with
+ <literal>rdepends</literal> print all dependencies. This can be tweaked with
these flags which will omit the specified dependency type.
Configuration Item: <literal>APT::Cache::Show<replaceable>DependencyType</replaceable></literal>
e.g. <literal>APT::Cache::ShowRecommends</literal>.</para></listitem>
index files will not have the checksum fields where possible.
Configuration Items: <literal>APT::FTPArchive::<replaceable>Checksum</replaceable></literal> and
<literal>APT::FTPArchive::<replaceable>Index</replaceable>::<replaceable>Checksum</replaceable></literal> where
- <literal>Index</literal> can be <literal>Packages</literal>, <literal>Sources</literal> or <literal>Release</literal> and
- <literal>Checksum</literal> can be <literal>MD5</literal>, <literal>SHA1</literal> or <literal>SHA256</literal>.</para></listitem>
+ <literal><replaceable>Index</replaceable></literal> can be <literal>Packages</literal>, <literal>Sources</literal> or
+ <literal>Release</literal> and <literal><replaceable>Checksum</replaceable></literal> can be <literal>MD5</literal>,
+ <literal>SHA1</literal> or <literal>SHA256</literal>.</para></listitem>
</varlistentry>
<varlistentry><term><option>-d</option></term><term><option>--db</option></term>
<varlistentry><term>download</term>
<listitem><para><literal>download</literal> will download the given
- binary package into the current directoy.
+ binary package into the current directory.
</para></listitem>
</varlistentry>
<listitem><para>the file specified by the <envar>APT_CONFIG</envar>
environment variable (if any)</para></listitem>
<listitem><para>all files in <literal>Dir::Etc::Parts</literal> in
- alphanumeric ascending order which have no or "<literal>conf</literal>"
+ alphanumeric ascending order which have either no or "<literal>conf</literal>"
as filename extension and which only contain alphanumeric,
hyphen (-), underscore (_) and period (.) characters.
Otherwise APT will print a notice that it has ignored a file if the file
It is not needed to add <literal>bz2</literal> explicit to the list as it will be added automatic.</para>
<para>Note that at run time the <literal>Dir::Bin::<replaceable>Methodname</replaceable></literal> will
be checked: If this setting exists the method will only be used if this file exists, e.g. for
- the bzip2 method (the inbuilt) setting is <literallayout>Dir::Bin::bzip2 "/bin/bzip2";</literallayout>
+ the bzip2 method (the inbuilt) setting is: <literallayout>Dir::Bin::bzip2 "/bin/bzip2";</literallayout>
Note also that list entries specified on the command line will be added at the end of the list
specified in the configuration files, but before the default entries. To prefer a type in this case
over the ones specified in the configuration files you can set the option direct - not in list style.
This will not override the defined list, it will only prefix the list with this type.</para>
<para>The special type <literal>uncompressed</literal> can be used to give uncompressed files a
- preference, but note that most archives doesn't provide uncompressed files so this is mostly only
+ preference, but note that most archives don't provide uncompressed files so this is mostly only
useable for local mirrors.</para></listitem>
</varlistentry>
<para>Note that the files in the <filename>/etc/apt/preferences.d</filename>
directory are parsed in alphanumeric ascending order and need to obey the
-following naming convention: The files have no or "<literal>pref</literal>"
-as filename extension and which only contain alphanumeric, hyphen (-),
+following naming convention: The files have either no or "<literal>pref</literal>"
+as filename extension and only contain alphanumeric, hyphen (-),
underscore (_) and period (.) characters.
Otherwise APT will print a notice that it has ignored a file if the file
doesn't match a pattern in the <literal>Dir::Ignore-Files-Silently</literal>
expressions surrounded by /. For example, the following
example assigns the priority 500 to all packages from
experimental where the name starts with gnome (as a glob()-like
-expression or contains the word kde (as a POSIX extended regular
+expression) or contains the word kde (as a POSIX extended regular
expression surrounded by slashes).
</para>
<para>
The rule for those expressions is that they can occur anywhere
-where a string can occur. Those, the following pin assigns the
+where a string can occur. Thus, the following pin assigns the
priority 990 to all packages from a release starting with karmic.
</para>
string AutoDetectProxyCmd;
public:
- friend class ServerState;
+ friend struct ServerState;
FileFd *File;
ServerState *Server;
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b -d
testmarkedauto 'b'
+rm rootdir/var/log/apt/history.log
+
aptget install b --reinstall -y -qq 2>&1 > /dev/null
testdpkgnotinstalled a
testdpkginstalled b c
testmarkedauto 'b'
+sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d'
+testfileequal 'rootdir/var/log/apt/history.log' '
+Reinstall: b:i386 (1.0)'
+
testequal 'Reading package lists...
Building dependency tree...
Reading state information...