From 84de0ceaad7e8c74f47e06bccba83b1b310262b6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 8 Jan 2013 16:35:57 +0100 Subject: fix pkgProblemResolver::Scores, thanks to Paul Wise. Closes: #697577 --- apt-pkg/deb/deblistparser.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index b84bd6fdd..56d5297fc 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -28,12 +28,13 @@ using std::string; -static debListParser::WordList PrioList[] = {{"important",pkgCache::State::Important}, - {"required",pkgCache::State::Required}, - {"standard",pkgCache::State::Standard}, - {"optional",pkgCache::State::Optional}, - {"extra",pkgCache::State::Extra}, - {}}; +static debListParser::WordList PrioList[] = { + {"required",pkgCache::State::Required}, + {"important",pkgCache::State::Important}, + {"standard",pkgCache::State::Standard}, + {"optional",pkgCache::State::Optional}, + {"extra",pkgCache::State::Extra}, + {}}; // ListParser::debListParser - Constructor /*{{{*/ // --------------------------------------------------------------------- -- cgit v1.2.3 From 233b78083f6f79730fcb5a6faeb74e2a78b6038a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 18 Mar 2013 22:57:08 +0100 Subject: * apt-pkg/deb/debindexfile.cc, apt-pkg/deb/deblistparser.cc: - use OpenMaybeClearSignedFile to be free from detecting and skipping clearsigning metadata in dsc and Release files We can't write a "clean" file to disk as not all acquire methods copy Release files before checking them (e.g. cdrom), so this reverts recombining, but uses the method we use for dsc files also in the two places we deal with Release files --- apt-pkg/deb/deblistparser.cc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index b84bd6fdd..2c014a734 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -800,13 +800,12 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI, map_ptrloc const storage = WriteUniqString(component); FileI->Component = storage; - // FIXME: Code depends on the fact that Release files aren't compressed + // FIXME: should use FileFd and TagSection FILE* release = fdopen(dup(File.Fd()), "r"); if (release == NULL) return false; char buffer[101]; - bool gpgClose = false; while (fgets(buffer, sizeof(buffer), release) != NULL) { size_t len = 0; @@ -818,15 +817,6 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI, if (buffer[len] == '\0') continue; - // only evalute the first GPG section - if (strncmp("-----", buffer, 5) == 0) - { - if (gpgClose == true) - break; - gpgClose = true; - continue; - } - // seperate the tag from the data const char* dataStart = strchr(buffer + len, ':'); if (dataStart == NULL) -- cgit v1.2.3 From d9682cf8268d6c69e41adb6be9f03d68ba066a12 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 1 Apr 2013 23:27:16 +0200 Subject: micro-optimize and enhance readability of ListParser::VersionHash --- apt-pkg/deb/deblistparser.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 56d5297fc..67f0ac9c6 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -284,7 +284,7 @@ unsigned short debListParser::VersionHash() "Replaces",0}; unsigned long Result = INIT_FCS; char S[1024]; - for (const char **I = Sections; *I != 0; I++) + for (const char * const *I = Sections; *I != 0; ++I) { const char *Start; const char *End; @@ -295,13 +295,13 @@ unsigned short debListParser::VersionHash() of certain fields. dpkg also has the rather interesting notion of reformatting depends operators < -> <= */ char *J = S; - for (; Start != End; Start++) + for (; Start != End; ++Start) { - if (isspace(*Start) == 0) - *J++ = tolower_ascii(*Start); - if (*Start == '<' && Start[1] != '<' && Start[1] != '=') - *J++ = '='; - if (*Start == '>' && Start[1] != '>' && Start[1] != '=') + if (isspace(*Start) != 0) + continue; + *J++ = tolower_ascii(*Start); + + if ((*Start == '<' || *Start == '>') && Start[1] != *Start && Start[1] != '=') *J++ = '='; } -- cgit v1.2.3