From: Michael Vogt Date: Wed, 17 Feb 2010 21:09:25 +0000 (+0100) Subject: merged from debian-sid X-Git-Tag: 0.7.25.3ubuntu1~1^2 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/762d7367f5f74f877ec75986e19fc9d46eef5164?ds=sidebyside;hp=-c merged from debian-sid --- 762d7367f5f74f877ec75986e19fc9d46eef5164 diff --combined apt-pkg/deb/dpkgpm.cc index 88098c379,565f01b84..9d144a227 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@@ -550,103 -550,46 +550,104 @@@ void pkgDPkgPM::DoDpkgStatusFd(int stat dpkgbuf_pos = dpkgbuf+dpkgbuf_pos-p; } /*}}}*/ +// DPkgPM::WriteHistoryTag /*{{{*/ +void pkgDPkgPM::WriteHistoryTag(string tag, string value) +{ + if (value.size() > 0) + { + // poor mans rstrip(", ") + if (value[value.size()-2] == ',' && value[value.size()-1] == ' ') + value.erase(value.size() - 2, 2); + fprintf(history_out, "%s: %s\n", tag.c_str(), value.c_str()); + } +} /*}}}*/ // DPkgPM::OpenLog /*{{{*/ bool pkgDPkgPM::OpenLog() { string logdir = _config->FindDir("Dir::Log"); if(not FileExists(logdir)) return _error->Error(_("Directory '%s' missing"), logdir.c_str()); + + // get current time + char timestr[200]; + time_t t = time(NULL); + struct tm *tmp = localtime(&t); + strftime(timestr, sizeof(timestr), "%F %T", tmp); + + // open terminal log string logfile_name = flCombine(logdir, _config->Find("Dir::Log::Terminal")); if (!logfile_name.empty()) { term_out = fopen(logfile_name.c_str(),"a"); + if (term_out == NULL) + return _error->WarningE(_("Could not open file '%s'"), logfile_name.c_str()); + chmod(logfile_name.c_str(), 0600); - fprintf(term_out, "\n\nLog started: "); - fprintf(term_out, "%s", timestr); - fprintf(term_out, "\n"); - // output current time - char outstr[200]; - time_t t = time(NULL); - struct tm *tmp = localtime(&t); - strftime(outstr, sizeof(outstr), "%F %T", tmp); - fprintf(term_out, "\nLog started: %s\n", outstr); ++ fprintf(term_out, "\nLog started: %s\n", timestr); } + + // write + string history_name = flCombine(logdir, + _config->Find("Dir::Log::History")); + if (!history_name.empty()) + { + history_out = fopen(history_name.c_str(),"a"); + chmod(history_name.c_str(), 0644); + fprintf(history_out, "\nStart-Date: %s\n", timestr); + string remove, purge, install, upgrade, downgrade; + for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++) + { + if (Cache[I].NewInstall()) + install += I.Name() + string(" (") + Cache[I].CandVersion + string("), "); + else if (Cache[I].Upgrade()) + upgrade += I.Name() + string(" (") + Cache[I].CurVersion + string(", ") + Cache[I].CandVersion + string("), "); + else if (Cache[I].Downgrade()) + downgrade += I.Name() + string(" (") + Cache[I].CurVersion + string(", ") + Cache[I].CandVersion + string("), "); + else if (Cache[I].Delete()) + { + if ((Cache[I].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge) + purge += I.Name() + string(" (") + Cache[I].CurVersion + string("), "); + else + remove += I.Name() + string(" (") + Cache[I].CurVersion + string("), "); + } + } + WriteHistoryTag("Install", install); + WriteHistoryTag("Upgrade", upgrade); + WriteHistoryTag("Downgrade",downgrade); + WriteHistoryTag("Remove",remove); + WriteHistoryTag("Purge",purge); + fflush(history_out); + } + return true; } /*}}}*/ // DPkg::CloseLog /*{{{*/ bool pkgDPkgPM::CloseLog() { + char timestr[200]; + time_t t = time(NULL); + struct tm *tmp = localtime(&t); + strftime(timestr, sizeof(timestr), "%F %T", tmp); + if(term_out) { - char outstr[200]; - time_t t = time(NULL); - struct tm *tmp = localtime(&t); - strftime(outstr, sizeof(outstr), "%F %T", tmp); fprintf(term_out, "Log ended: "); - fprintf(term_out, "%s", outstr); + fprintf(term_out, "%s", timestr); fprintf(term_out, "\n"); fclose(term_out); } term_out = NULL; + + if(history_out) + { + if (dpkg_error.size() > 0) + fprintf(history_out, "Error: %s\n", dpkg_error.c_str()); + fprintf(history_out, "End-Date: %s\n", timestr); + fclose(history_out); + } + return true; } /*}}}*/ @@@ -1116,14 -1059,11 +1117,14 @@@ bool pkgDPkgPM::Go(int OutStatusFd RunScripts("DPkg::Post-Invoke"); if (WIFSIGNALED(Status) != 0 && WTERMSIG(Status) == SIGSEGV) - _error->Error("Sub-process %s received a segmentation fault.",Args[0]); + strprintf(dpkg_error, "Sub-process %s received a segmentation fault.",Args[0]); else if (WIFEXITED(Status) != 0) - _error->Error("Sub-process %s returned an error code (%u)",Args[0],WEXITSTATUS(Status)); + strprintf(dpkg_error, "Sub-process %s returned an error code (%u)",Args[0],WEXITSTATUS(Status)); else - _error->Error("Sub-process %s exited unexpectedly",Args[0]); + strprintf(dpkg_error, "Sub-process %s exited unexpectedly",Args[0]); + + if(dpkg_error.size() > 0) + _error->Error(dpkg_error.c_str()); if(stopOnError) { diff --combined debian/changelog index 75a5dfa8b,f14e3fe52..c2c3524a6 --- a/debian/changelog +++ b/debian/changelog @@@ -1,31 -1,129 +1,141 @@@ - apt (0.7.25.1) UNRELEASED; urgency=low + apt (0.7.25.4) UNRELEASED; urgency=low + [ Ivan Masár ] + * Slovak translation update. Closes: #568294 ++ ++ [ Michael Vogt ] + * merged lp:~mvo/apt/history + - this writes a /var/log/apt/history tagfile that contains details + from the transaction (complements term.log) ++ * methods/http.cc: ++ - add cache-control headers even if no cache is given to allow ++ adding options for intercepting proxies ++ - add Acquire::http::ProxyAutoDetect configuration that ++ can be used to call a external helper to figure out the ++ proxy configuration and return it to apt via stdout ++ (this is a step towards WPAD and zeroconf/avahi support) + - -- Christian Perrier Wed, 03 Feb 2010 20:08:19 +0100 ++ -- Michael Vogt Fri, 18 Dec 2009 16:54:18 +0100 + + apt (0.7.25.3) unstable; urgency=low + + [ Christian Perrier ] + * Italian translation update. Closes: #567532 + + [ David Kalnischkies ] + * apt-pkg/contrib/macros.h: - - install the header system.h with a new name to be able to use ++ - install the header system.h with a new name to be able to use + it in other headers (Closes: #567662) + * cmdline/acqprogress.cc: + - Set Mode to Medium so that the correct prefix is used. + Thanks Stefan Haller for the patch! (Closes: #567304 LP: #275243) + * ftparchive/writer.cc: + - generate sha1 and sha256 checksums for dsc (Closes: #567343) * cmdline/apt-get.cc: - - fix apt-get source pkg=version regression (closes: #561971) + - don't mark as manually if in download only (Closes: #468180) - ++ + -- Michael Vogt Mon, 01 Feb 2010 18:41:15 +0100 + + apt (0.7.25.2) unstable; urgency=low + + [ Michael Vogt ] * apt-pkg/contrib/cdromutl.cc: - fix UnmountCdrom() fails, give it a bit more time and try the umount again * apt-pkg/cdrom.cc: - fix crash in pkgUdevCdromDevices * methods/cdrom.cc: - - fixes in multi cdrom setup code - - add new "Acquire::cdrom::AutoDetect" variable that enables/disables - the dlopen of libudev for automatic cdrom detection + - fixes in multi cdrom setup code (closes: #549312) + - add new "Acquire::cdrom::AutoDetect" config that enables/disables + the dlopen of libudev for automatic cdrom detection. Off by default + currently, feedback/testing welcome * cmdline/apt-cdrom.cc: - add new --auto-detect option that uses libudev to figure out the cdrom/mount-point - * methods/http.cc: - - add cache-control headers even if no cache is given to allow - adding options for intercepting proxies - - add Acquire::http::ProxyAutoDetect configuration that - can be used to call a external helper to figure out the - proxy configuration and return it to apt via stdout - (this is a step towards WPAD and zeroconf/avahi support) + * cmdline/apt-mark: + - merge fix from Gene Cash that supports markauto for + packages that are not in the extended_states file yet + (closes: #534920) + * ftparchive/writer.{cc,h}: - - merge crash fix for apt-ftparchive on hurd, thanks to ++ - merge crash fix for apt-ftparchive on hurd, thanks to + Samuel Thibault for the patch (closes: #566664) - -- Michael Vogt Fri, 18 Dec 2009 16:54:18 +0100 + [ David Kalnischkies ] + * apt-pkg/contrib/fileutl.cc: + - Fix the newly introduced method GetListOfFilesInDir to not + accept every file if no extension is enforced + (= restore old behaviour). (Closes: #565213) + * apt-pkg/policy.cc: + - accept also partfiles with "pref" file extension as valid + * apt-pkg/contrib/configuration.cc: + - accept also partfiles with "conf" file extension as valid + * doc/apt.conf.5.xml: + - reorder description and split out syntax + - add partfile name convention (Closes: #558348) + * doc/apt_preferences.conf.5.xml: + - describe partfile name convention also here + * apt-pkg/deb/dpkgpm.cc: + - don't segfault if term.log file can't be opened. + Thanks Sam Brightman for the patch! (Closes: #475770) + * doc/*: + - replace the per language addendum with a global addendum + - add a explanation why translations include (maybe) english + parts to the new global addendum (Closes: #561636) + * apt-pkg/contrib/strutl.cc: + - fix malloc asseration fail with ja_JP.eucJP locale in + apt-cache search. Thanks Kusanagi Kouichi! (Closes: #548884) + + [ Christian Perrier ] + * French translation update + + -- Michael Vogt Wed, 27 Jan 2010 16:16:10 +0100 + + apt (0.7.25.1) unstable; urgency=low + + [ Christian Perrier ] + * French manpage translation update + * Russian translation update by Yuri Kozlov + Closes: #564171 - ++ + [Chris Leick] + * spot & fix various typos in all manpages + * German manpage translation update + + [ David Kalnischkies ] + * cmdline/apt-cache.cc: + - remove translatable marker from the "%4i %s\n" string + * buildlib/po4a_manpage.mak: + - instruct debiandoc to build files with utf-8 encoding + * buildlib/tools.m4: + - fix some warning from the buildtools + * apt-pkg/acquire-item.cc: + - add configuration PDiffs::Limit-options to not download + too many or too big patches (Closes: #554349) + * debian/control: + - let all packages depend on ${misc:Depends} + * share/*-archive.gpg: + - remove the horrible outdated files. We already depend on + the keyring so we don't need to ship our own version + * cmdline/apt-key: + - errors out if wget is not installed (Closes: #545754) + - add --keyring option as we have now possibly many + * methods/gpgv.cc: + - pass all keyrings (TrustedParts) to gpgv instead of + using only one trusted.gpg keyring (Closes: #304846) + * methods/https.cc: + - finally merge the rest of the patchset from Arnaud Ebalard + with the CRL and Issuers options, thanks! (Closes: #485963) + * apt-pkg/deb/debindexfile.cc, apt-pkg/pkgcachegen.cc: + - add debug option Debug::pkgCacheGen + + [ Michael Vogt ] + * cmdline/apt-get.cc: + - merge fix for apt-get source pkg=version regression + (closes: #561971) + * po/ru.po: + - merged updated ru.po, thanks to Yuri Kozlov (closes: #564171) + + -- Michael Vogt Sat, 09 Jan 2010 21:52:36 +0100 apt (0.7.25) unstable; urgency=low diff --combined doc/examples/configure-index index 0b0025fca,ddee86388..233fa2b7d --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@@ -90,11 -90,6 +90,6 @@@ AP TrustCDROM "false"; // consider the CDROM always trusted }; - GPGV - { - TrustedKeyring "/etc/apt/trusted.gpg"; - }; - // Some general options Ignore-Hold "false"; Clean-Installed "true"; @@@ -176,7 -171,10 +171,10 @@@ Acquir Source-Symlinks "true"; PDiffs "true"; // try to get the IndexFile diffs - + PDiffs::FileLimit "4"; // don't use diffs if we would need more than 4 diffs + PDiffs::SizeLimit "50"; // don't use diffs if size of all patches excess + // 50% of the size of the original file + // HTTP method configuration http { @@@ -312,6 -310,8 +310,8 @@@ Dir "/ SourceParts "sources.list.d"; VendorList "vendors.list"; VendorParts "vendors.list.d"; + Trusted "trusted.gpg"; + TrustedParts "trusted.gpg.d"; }; // Locations of binaries @@@ -329,15 -329,14 +329,22 @@@ // Location of the logfile Log "var/log/apt" { Terminal "term.log"; + History "history.log"; + }; + + // Media + Media + { + // Media AutoDetect mount path + MountPath "/media/apt"; }; + + // Media + Media + { + // Media AutoDetect mount path + MountPath "/media/apt"; + }; }; // Things that effect the APT dselect method @@@ -395,6 -394,7 +402,7 @@@ Debu pkgProblemResolver::ShowScores "false"; pkgDepCache::AutoInstall "false"; // what packages apt install to satify dependencies pkgDepCache::Marker "false"; + pkgCacheGen "false"; pkgAcquire "false"; pkgAcquire::Worker "false"; pkgAcquire::Auth "false"; diff --combined methods/cdrom.cc index 4bbc01c2c,6d694e7c9..bf4281e40 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@@ -38,7 -38,7 +38,7 @@@ class CDROMMethod : public pkgAcqMetho pkgUdevCdromDevices UdevCdroms; bool IsCorrectCD(URI want, string MountPath, string& NewID); - bool AutoDetectAndMount(URI, string &NewID); + bool AutoDetectAndMount(const URI, string &NewID); virtual bool Fetch(FetchItem *Itm); string GetID(string Name); virtual void Exit(); @@@ -92,7 -92,7 +92,7 @@@ string CDROMMethod::GetID(string Name // CDROMMethod::AutoDetectAndMount /*{{{*/ // --------------------------------------------------------------------- /* Modifies class varaiable CDROM to the mountpoint */ - bool CDROMMethod::AutoDetectAndMount(URI Get, string &NewID) + bool CDROMMethod::AutoDetectAndMount(const URI Get, string &NewID) { vector v = UdevCdroms.Scan(); @@@ -219,7 -219,7 +219,7 @@@ bool CDROMMethod::Fetch(FetchItem *Itm return true; } - bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", false); + bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", true); CDROM = _config->FindDir("Acquire::cdrom::mount","/cdrom/"); if (Debug) clog << "Looking for CDROM at " << CDROM << endl;