From: Michael Vogt Date: Wed, 5 Oct 2011 16:14:38 +0000 (+0200) Subject: * apt-pkg/contrib/configuration.cc: X-Git-Tag: 0.9.0~51 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/7be8c02360bdb9bd7f59b087da874f88af2a7206?hp=-c * apt-pkg/contrib/configuration.cc: - fix double delete (LP: #848907) - ignore only the invalid regexp instead of all options * apt-pkg/acquire-item.h, apt-pkg/deb/debmetaindex.cc: - fix fetching language information by adding OptionalSubIndexTarget * methods/https.cc: - cleanup broken downloads properly * ftparchive/cachedb.cc: - fix buffersize in bytes2hex * apt-pkg/deb/deblistparser.cc: - fix crash when the dynamic mmap needs to be grown in LoadReleaseInfo (LP: #854090) --- 7be8c02360bdb9bd7f59b087da874f88af2a7206 diff --combined apt-pkg/contrib/configuration.cc index 0f7b37ee9,2d1dee22d..0949ec223 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@@ -15,19 -15,16 +15,19 @@@ ##################################################################### */ /*}}}*/ // Include files /*{{{*/ +#include + #include #include #include #include -#include #include #include #include +#include + using namespace std; /*}}}*/ @@@ -675,9 -672,9 +675,9 @@@ bool ReadConfigFile(Configuration &Conf // Put the last fragment into the buffer std::string::const_iterator NonWhitespaceStart = Start; std::string::const_iterator NonWhitespaceStop = I; - for (; NonWhitespaceStart != I && isspace(*NonWhitespaceStart) != 0; NonWhitespaceStart++) + for (; NonWhitespaceStart != I && isspace(*NonWhitespaceStart) != 0; ++NonWhitespaceStart) ; - for (; NonWhitespaceStop != NonWhitespaceStart && isspace(NonWhitespaceStop[-1]) != 0; NonWhitespaceStop--) + for (; NonWhitespaceStop != NonWhitespaceStart && isspace(NonWhitespaceStop[-1]) != 0; --NonWhitespaceStop) ; if (LineBuffer.empty() == false && NonWhitespaceStop - NonWhitespaceStart != 0) LineBuffer += ' '; @@@ -853,7 -850,7 +853,7 @@@ bool ReadConfigDir(Configuration &Conf, vector const List = GetListOfFilesInDir(Dir, "conf", true, true); // Read the files - for (vector::const_iterator I = List.begin(); I != List.end(); I++) + for (vector::const_iterator I = List.begin(); I != List.end(); ++I) if (ReadConfigFile(Conf,*I,AsSectional,Depth) == false) return false; return true; @@@ -873,10 -870,10 +873,10 @@@ Configuration::MatchAgainstConfig::Matc { regfree(p); delete p; - clearPatterns(); - _error->Warning("Regex compilation error for '%s' in configuration option '%s'", - s->c_str(), Config); - return; + _error->Warning("Invalid regular expression '%s' in configuration " + "option '%s' will be ignored.", + s->c_str(), Config); + continue; } } if (strings.size() == 0) @@@ -897,6 -894,7 +897,7 @@@ void Configuration::MatchAgainstConfig: regfree(*p); delete *p; } + patterns.clear(); } /*}}}*/ // MatchAgainstConfig::Match - returns true if a pattern matches /*{{{*/ diff --combined apt-pkg/deb/deblistparser.cc index a4a974897,e4f3f9582..6c8bc838b --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@@ -10,8 -10,6 +10,8 @@@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@@ -200,7 -198,7 +200,7 @@@ string debListParser::DescriptionLangua std::vector const lang = APT::Configuration::getLanguages(true); for (std::vector::const_iterator l = lang.begin(); - l != lang.end(); l++) + l != lang.end(); ++l) if (Section.FindS(string("Description-").append(*l).c_str()).empty() == false) return *l; @@@ -818,16 -816,16 +818,16 @@@ bool debListParser::LoadReleaseInfo(pkg ++lineEnd; // which datastorage need to be updated - map_ptrloc* writeTo = NULL; + enum { Suite, Component, Version, Origin, Codename, Label, None } writeTo = None; if (buffer[0] == ' ') ; - #define APT_PARSER_WRITETO(X, Y) else if (strncmp(Y, buffer, len) == 0) writeTo = &X; - APT_PARSER_WRITETO(FileI->Archive, "Suite") - APT_PARSER_WRITETO(FileI->Component, "Component") - APT_PARSER_WRITETO(FileI->Version, "Version") - APT_PARSER_WRITETO(FileI->Origin, "Origin") - APT_PARSER_WRITETO(FileI->Codename, "Codename") - APT_PARSER_WRITETO(FileI->Label, "Label") + #define APT_PARSER_WRITETO(X) else if (strncmp(#X, buffer, len) == 0) writeTo = X; + APT_PARSER_WRITETO(Suite) + APT_PARSER_WRITETO(Component) + APT_PARSER_WRITETO(Version) + APT_PARSER_WRITETO(Origin) + APT_PARSER_WRITETO(Codename) + APT_PARSER_WRITETO(Label) #undef APT_PARSER_WRITETO #define APT_PARSER_FLAGIT(X) else if (strncmp(#X, buffer, len) == 0) \ pkgTagSection::FindFlag(FileI->Flags, pkgCache::Flag:: X, dataStart, lineEnd); @@@ -837,19 -835,19 +837,19 @@@ // load all data from the line and save it string data; - if (writeTo != NULL) + if (writeTo != None) data.append(dataStart, dataEnd); if (sizeof(buffer) - 1 == (dataEnd - buffer)) { while (fgets(buffer, sizeof(buffer), release) != NULL) { - if (writeTo != NULL) + if (writeTo != None) data.append(buffer); if (strlen(buffer) != sizeof(buffer) - 1) break; } } - if (writeTo != NULL) + if (writeTo != None) { // remove spaces and stuff from the end of the data line for (std::string::reverse_iterator s = data.rbegin(); @@@ -859,7 -857,15 +859,15 @@@ break; *s = '\0'; } - *writeTo = WriteUniqString(data); + switch (writeTo) { + case Suite: FileI->Archive = WriteUniqString(data); break; + case Component: FileI->Component = WriteUniqString(data); break; + case Version: FileI->Version = WriteUniqString(data); break; + case Origin: FileI->Origin = WriteUniqString(data); break; + case Codename: FileI->Codename = WriteUniqString(data); break; + case Label: FileI->Label = WriteUniqString(data); break; + case None: break; + } } } fclose(release); diff --combined apt-pkg/deb/debmetaindex.cc index 1d3754b00,8cbf42579..f24e3afef --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@@ -1,5 -1,4 +1,5 @@@ // ijones, walters +#include #include #include @@@ -209,7 -208,7 +209,7 @@@ vector * debRelea for (std::set::const_iterator s = sections.begin(); s != sections.end(); ++s) { for (std::vector::const_iterator l = lang.begin(); - l != lang.end(); l++) { + l != lang.end(); ++l) { if (*l == "none") continue; IndexTarget * Target = new OptionalIndexTarget(); Target->ShortDesc = "Translation-" + *l; @@@ -222,7 -221,7 +222,7 @@@ } else { for (std::set::const_iterator s = sections.begin(); s != sections.end(); ++s) { - IndexTarget * Target = new OptionalIndexTarget(); + IndexTarget * Target = new OptionalSubIndexTarget(); Target->ShortDesc = "TranslationIndex"; Target->MetaKey = TranslationIndexURISuffix("Index", *s); Target->URI = TranslationIndexURI("Index", *s); @@@ -239,7 -238,7 +239,7 @@@ bool debReleaseIndex::GetIndexes(pkgAcq // special case for --print-uris if (GetAll) { vector *targets = ComputeIndexTargets(); - for (vector ::const_iterator Target = targets->begin(); Target != targets->end(); Target++) { + for (vector ::const_iterator Target = targets->begin(); Target != targets->end(); ++Target) { new pkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description, (*Target)->ShortDesc, HashString()); } @@@ -296,7 -295,7 +296,7 @@@ vector *debReleaseInde if (src != ArchEntries.end()) { vector const SectionEntries = src->second; for (vector::const_iterator I = SectionEntries.begin(); - I != SectionEntries.end(); I++) + I != SectionEntries.end(); ++I) Indexes->push_back(new debSourcesIndex (URI, Dist, (*I)->Section, IsTrusted())); } @@@ -311,7 -310,7 +311,7 @@@ if (a->first == "source") continue; for (vector::const_iterator I = a->second.begin(); - I != a->second.end(); I++) { + I != a->second.end(); ++I) { Indexes->push_back(new debPackagesIndex (URI, Dist, (*I)->Section, IsTrusted(), a->first)); sections[(*I)->Section].insert(lang.begin(), lang.end()); } @@@ -320,7 -319,7 +320,7 @@@ for (map >::const_iterator s = sections.begin(); s != sections.end(); ++s) for (set::const_iterator l = s->second.begin(); - l != s->second.end(); l++) { + l != s->second.end(); ++l) { if (*l == "none") continue; Indexes->push_back(new debTranslationsIndex(URI,Dist,s->first,(*l).c_str())); } @@@ -369,7 -368,7 +369,7 @@@ class debSLTypeDebian : public pkgSourc map::const_iterator const trusted = Options.find("trusted"); for (vector::const_iterator I = List.begin(); - I != List.end(); I++) + I != List.end(); ++I) { // We only worry about debian entries here if (strcmp((*I)->GetType(), "deb") != 0) diff --combined debian/changelog index 7e1ce4f4e,4ca81c329..a06abbbc0 --- a/debian/changelog +++ b/debian/changelog @@@ -1,42 -1,39 +1,64 @@@ -apt (0.8.16~exp5) experimental; urgency=low ++apt (0.8.16~exp7) UNRELEASEDexperimental; urgency=low + + [ Michael Vogt ] - * apt-pkg/makefile: - - install sha256.h compat header - * apt-pkg/pkgcachegen.{cc,h}: - - use ref-to-ptr semantic in NewDepends() to ensure that the - libapt does not segfault if the cache is remapped in between - (LP: #812862) - - fix crash when P.Arch() was used but the cache got remapped - * apt-pkg/acquire-item.{cc,h}: - - do not check for a "Package" tag in optional index targets - like the translations index - * apt-pkg/acquire.cc: - - fix potential divide-by-zero - * methods/mirror.cc: - - include the architecture(s) in the query string as well so - that the server can make better decisions + * apt-pkg/contrib/configuration.cc: + - fix double delete (LP: #848907) + - ignore only the invalid regexp instead of all options + * apt-pkg/acquire-item.h, apt-pkg/deb/debmetaindex.cc: + - fix fetching language information by adding OptionalSubIndexTarget + * methods/https.cc: + - cleanup broken downloads properly + + [ Colin Watson ] + * ftparchive/cachedb.cc: + - fix buffersize in bytes2hex + + [ David Kalnischkies ] + * apt-pkg/deb/deblistparser.cc: + - fix crash when the dynamic mmap needs to be grown in + LoadReleaseInfo (LP: #854090) + - -- Michael Vogt Fri, 05 Aug 2011 10:57:08 +0200 ++ -- Michael Vogt Wed, 05 Oct 2011 18:14:11 +0200 ++ +apt (0.8.16~exp6) experimental; urgency=low + + [ Christopher Baines ] + * enable APT in unpack/configure ordering to handle loops as well + as tight dependencies between immediate packages better + enabling also the possibility to mark all packages as immediate + (at least Closes: #353290, #540227, #559733, #621836, #639290) + + [ David Kalnischkies ] + * [abi-break] Support large files in the complete toolset. Indexes of this + size are pretty unlikely for now, but we need it for deb + packages which could become bigger than 4GB now (LP: #815895) + * merged the debian-sid branch + + [ Michael Vogt ] + * bump ABI version + + -- Michael Vogt Wed, 14 Sep 2011 21:06:51 +0200 + +apt (0.8.16~exp5) experimental; urgency=low + + * merged the latest debian-sid fixes + * apt-pkg/makefile: + - install sha256.h compat header + * apt-pkg/pkgcachegen.{cc,h}: + - use ref-to-ptr semantic in NewDepends() to ensure that the + libapt does not segfault if the cache is remapped in between + (LP: #812862) + - fix crash when P.Arch() was used but the cache got remapped + * apt-pkg/acquire-item.{cc,h}: + - do not check for a "Package" tag in optional index targets + like the translations index + * apt-pkg/acquire.cc: + - fix potential divide-by-zero + * methods/mirror.cc: + - include the architecture(s) in the query string as well so + that the server can make better decisions + + -- Michael Vogt Mon, 15 Aug 2011 14:52:54 +0200 apt (0.8.16~exp4) experimental; urgency=low @@@ -134,51 -131,8 +156,51 @@@ apt (0.8.16~exp1) experimental; urgency -- Michael Vogt Wed, 29 Jun 2011 12:40:31 +0200 -apt (0.8.15.5.6) UNRELEASED; urgency=low +apt (0.8.15.7) unstable; urgency=low + + [ David Kalnischkies ] + * apt-pkg/packagemanager.cc, apt-pkg/pkgcache.cc: + - ignore "self"-conflicts for all architectures of a package + instead of just for the architecture of the package look at + in the ordering of installations, too (LP: #802901) + - M-A:same lockstep unpack should operate on installed + packages first (LP: #835625) + * test/* + - reorganize the various testcases and helper we have and + integrate them better into the buildsystem + - run the test/libapt testcases at package build-time + * debian/apt.symbols: + - add the newly added symbols since 0.8.15.3 + * cmdline/apt-get.cc: + - remove the binary caches in 'apt-get clean' as it is the first + thing recommend by many supporters in case of APT segfaults + - remove the caches in 'apt-get update', too, as they will be + invalid in most cases anyway + * apt-pkg/acquire-item.cc: + - if no Release.gpg file is found try to verify with hashes, + but do not fail if a hash can't be found + * apt-pkg/acquire.cc: + - non-existing directories are by definition clean + * cmdline/apt-key: + - if command is 'add' do not error out if the specified + keyring doesn't exist, it will be created by gpg + * apt-pkg/orderlist.cc: + - prefer visiting packages marked for deletion in VisitProvides + if we are operating on a negative dependency so that we can + deal early with the fallout of this remove + * apt-pkg/indexrecords.cc: + - fix Acquire::Max-ValidTime option by interpreting it really + as seconds as specified in the manpage and not as days + - add an Acquire::Min-ValidTime option (Closes: #640122) + * doc/apt.conf.5.xml: + - reword Acquire::Max-ValidTime documentation to make clear + that it doesn't provide the new Min-ValidTime functionality + + -- Michael Vogt Mon, 12 Sep 2011 16:38:46 +0200 + +apt (0.8.15.6) unstable; urgency=low + [ Michael Vogt ] * apt-pkg/contrib/fileutl.{cc,h}: - add GetModificationTime() helper * apt-pkg/pkgcachegen.cc: @@@ -196,11 -150,8 +218,11 @@@ * apt-pkg/acquire-item.cc: - if no Release.gpg file is found, still load the hashes for verification (closes: #636314) and add test + + [ David Kalnischkies ] + * lots of cppcheck fixes - -- Michael Vogt Tue, 12 Jul 2011 11:54:47 +0200 + -- Michael Vogt Mon, 15 Aug 2011 09:20:35 +0200 apt (0.8.15.5) unstable; urgency=low diff --combined ftparchive/cachedb.cc index a1d70f912,24e3a1af8..6eccb8d4a --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@@ -10,8 -10,9 +10,8 @@@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include "cachedb.h" +#include -#include #include #include #include @@@ -20,9 -21,6 +20,9 @@@ #include #include // htonl, etc + +#include +#include "cachedb.h" /*}}}*/ // CacheDB::ReadyDB - Ready the DB2 /*{{{*/ @@@ -299,11 -297,15 +299,15 @@@ bool CacheDB::LoadContents(bool const & /*}}}*/ static string bytes2hex(uint8_t *bytes, size_t length) { - char space[65]; - if (length * 2 > sizeof(space) - 1) length = (sizeof(space) - 1) / 2; - for (size_t i = 0; i < length; i++) - snprintf(&space[i*2], 3, "%02x", bytes[i]); - return string(space); + char buf[3]; + string space; + + space.reserve(length*2 + 1); + for (size_t i = 0; i < length; i++) { + snprintf(buf, sizeof(buf), "%02x", bytes[i]); + space.append(buf); + } + return space; } static inline unsigned char xdig2num(char const &dig) { diff --combined methods/https.cc index 06a0e285a,668a329e6..709744ce3 --- a/methods/https.cc +++ b/methods/https.cc @@@ -10,8 -10,6 +10,8 @@@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@@ -27,11 -25,12 +27,11 @@@ #include #include #include -#include #include #include "config.h" #include "https.h" - +#include /*}}}*/ using namespace std; @@@ -52,7 -51,7 +52,7 @@@ HttpsMethod::progress_callback(void *cl { HttpsMethod *me = (HttpsMethod *)clientp; if(dltotal > 0 && me->Res.Size == 0) { - me->Res.Size = (unsigned long)dltotal; + me->Res.Size = (unsigned long long)dltotal; me->URIStart(me->Res); } return 0; @@@ -271,14 -270,17 +271,17 @@@ bool HttpsMethod::Fetch(FetchItem *Itm long curl_servdate; curl_easy_getinfo(curl, CURLINFO_FILETIME, &curl_servdate); + File->Close(); + // cleanup if(success != 0) { _error->Error("%s", curl_errorstr); + // unlink, no need keep 401/404 page content in partial/ + unlink(File->Name().c_str()); Fail(); return true; } - File->Close(); // Timestamp struct utimbuf UBuf;