From 2c4eaffff40d4ee4a2c8410a48f1a6170d9beff9 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 15 Sep 2006 17:29:53 +0200 Subject: * apt-pkg/tagfile.cc: - applied patch from jvw to make the tag key stuff case-insensitive --- apt-pkg/tagfile.cc | 4 ++-- configure.in | 2 +- debian/changelog | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 8fcbeb23b..0bc6ce6fd 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -192,12 +192,12 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long Offset) // --------------------------------------------------------------------- /* This looks for the first double new line in the data stream. It also indexes the tags in the section. This very simple hash function for the - first 3 letters gives very good performance on the debian package files */ + last 8 letters gives very good performance on the debian package files */ inline static unsigned long AlphaHash(const char *Text, const char *End = 0) { unsigned long Res = 0; for (; Text != End && *Text != ':' && *Text != 0; Text++) - Res = (unsigned long)(*Text) ^ (Res << 2); + Res = ((unsigned long)(*Text) & 0xDF) ^ (Res << 1); return Res & 0xFF; } diff --git a/configure.in b/configure.in index fc4eff203..f0b0d6703 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib) AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) dnl -- SET THIS TO THE RELEASE VERSION -- -AC_DEFINE_UNQUOTED(VERSION,"0.6.45") +AC_DEFINE_UNQUOTED(VERSION,"0.6.45.1") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) diff --git a/debian/changelog b/debian/changelog index b55e0c582..5f5421355 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,9 @@ apt (0.6.45.1) unstable; urgency=low * fi.po: Updated to 512t. Closes: #382702 * share/archive-archive.gpg: - removed the outdated amd64 and debian-2004 keys + * apt-pkg/tagfile.cc: + - applied patch from Jeroen van Wolffelaar to make the tags + caseinsensitive (closes: #384182) -- -- cgit v1.2.3 From 2ca99a0dceb4101f1ecaff0348b1684cb975099c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 15 Sep 2006 18:24:47 +0200 Subject: * apt-pkg/tagfile.cc, tagfile.h: - reverted the mmap patch again, it caused too much trouble with pipes etc --- apt-pkg/tagfile.cc | 74 ++++++++++++++++-------------------------------------- apt-pkg/tagfile.h | 2 -- debian/changelog | 4 ++- 3 files changed, 24 insertions(+), 56 deletions(-) diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 0bc6ce6fd..040562fff 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -33,33 +33,22 @@ using std::string; /* */ pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long Size) : Fd(*pFd), - Size(Size), - Map(NULL), - Buffer(0) + Size(Size) { if (Fd.IsOpen() == false) { + Buffer = 0; Start = End = Buffer = 0; Done = true; iOffset = 0; - Map = NULL; return; } - // check if we can MMap it - if(Fd.Size() == 0) - { - Buffer = new char[Size]; - Start = End = Buffer; - Done = false; - Fill(); - } else { - Map = new MMap (Fd, MMap::Public | MMap::ReadOnly); - Buffer = (char *) Map->Data (); - Start = Buffer; - End = Buffer + Map->Size (); - } + Buffer = new char[Size]; + Start = End = Buffer; + Done = false; iOffset = 0; + Fill(); } /*}}}*/ // TagFile::~pkgTagFile - Destructor /*{{{*/ @@ -67,8 +56,7 @@ pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long Size) : /* */ pkgTagFile::~pkgTagFile() { - if(!Map) delete [] Buffer; - delete Map; + delete [] Buffer; } /*}}}*/ // TagFile::Step - Advance to the next section /*{{{*/ @@ -76,15 +64,8 @@ pkgTagFile::~pkgTagFile() /* If the Section Scanner fails we refill the buffer and try again. */ bool pkgTagFile::Step(pkgTagSection &Tag) { - if ((Map != NULL) && (Start == End)) - return false; - if (Tag.Scan(Start,End - Start) == false) { - if (Map != NULL) - return _error->Error(_("Unable to parse package file %s (1)"), - Fd.Name().c_str()); - if (Fill() == false) return false; @@ -158,30 +139,23 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long Offset) return Step(Tag); } + // Reposition and reload.. iOffset = Offset; - if (Map != NULL) - { - Start = Buffer + iOffset; - } - else - { - // Reposition and reload.. - Done = false; - if (Fd.Seek(Offset) == false) - return false; - End = Start = Buffer; + Done = false; + if (Fd.Seek(Offset) == false) + return false; + End = Start = Buffer; - if (Fill() == false) - return false; + if (Fill() == false) + return false; - if (Tag.Scan(Start,End - Start) == true) - return true; + if (Tag.Scan(Start,End - Start) == true) + return true; + + // This appends a double new line (for the real eof handling) + if (Fill() == false) + return false; - // This appends a double new line (for the real eof handling) - if (Fill() == false) - return false; - } - if (Tag.Scan(Start,End - Start) == false) return _error->Error(_("Unable to parse package file %s (2)"),Fd.Name().c_str()); @@ -207,7 +181,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength) Stop = Section = Start; memset(AlphaIndexes,0,sizeof(AlphaIndexes)); - if (Stop == 0 || MaxLength == 0) + if (Stop == 0) return false; TagCount = 0; @@ -238,12 +212,6 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength) Stop++; } - if ((Stop+1 >= End) && (End[-1] == '\n' || End[-1] == '\r')) - { - Indexes[TagCount] = (End - 1) - Section; - return true; - } - return false; } /*}}}*/ diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index dd481ba51..f7f8155a5 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -25,7 +25,6 @@ #endif #include -#include #include class pkgTagSection @@ -70,7 +69,6 @@ class pkgTagSection class pkgTagFile { FileFd &Fd; - MMap *Map; char *Buffer; char *Start; char *End; diff --git a/debian/changelog b/debian/changelog index 5f5421355..4c5841057 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,8 +25,10 @@ apt (0.6.45.1) unstable; urgency=low * apt-pkg/tagfile.cc: - applied patch from Jeroen van Wolffelaar to make the tags caseinsensitive (closes: #384182) + - reverted MMap use in the tagfile because it does not work + across pipes (closes: #383487) - -- + -- apt (0.6.45) unstable; urgency=low -- cgit v1.2.3 From 42142a6cf63458599c6a11c398a25b301df2df55 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 16 Sep 2006 12:02:02 +0200 Subject: * cmdline/apt-get.cc: - merged patch from otavio to make the order of package selections less important --- cmdline/apt-get.cc | 19 +++++++++++++++---- configure.in | 2 +- debian/changelog | 4 +++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 64882e3e8..b33a324ea 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1144,10 +1144,7 @@ bool TryToInstall(pkgCache::PkgIterator Pkg,pkgDepCache &Cache, } else ExpectedInst++; - - // Install it with autoinstalling enabled. - if (State.InstBroken() == true && BrokenFix == false) - Cache.MarkInstall(Pkg,true); + return true; } /*}}}*/ @@ -1538,6 +1535,20 @@ bool DoInstall(CommandLine &CmdL) } } + for (unsigned J = 0; J < Cache->Head().PackageCount; J++) + { + pkgCache::PkgIterator I(Cache,Cache.List[J]); + if ((*Cache)[I].Install() == false) + continue; + + pkgDepCache::StateCache &State = Cache[I]; + // Install it with autoinstalling enabled (if we not respect the minial + // required deps or the policy) + if (State.InstBroken() == true && BrokenFix == false) + Cache->MarkInstall(I,true); + } + + /* If we are in the Broken fixing mode we do not attempt to fix the problems. This is if the user invoked install without -f and gave packages */ diff --git a/configure.in b/configure.in index f0b0d6703..dc410b22f 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib) AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) dnl -- SET THIS TO THE RELEASE VERSION -- -AC_DEFINE_UNQUOTED(VERSION,"0.6.45.1") +AC_DEFINE_UNQUOTED(VERSION,"0.6.46") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) diff --git a/debian/changelog b/debian/changelog index 4c5841057..1ec80ca01 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -apt (0.6.45.1) unstable; urgency=low +apt (0.6.46) unstable; urgency=low * debian/control: - switched to libdb4.4 for building (closes: #381019) @@ -7,6 +7,8 @@ apt (0.6.45.1) unstable; urgency=low versions of the package (closes: #257054) - properly handle recommends/suggests or-groups when printing the list of suggested/recommends packages (closes: #311619) + - fix the way multiple packages are installed so that the order of + packages on the commandline doesn't matter anymore * methods/http.cc: - check more careful for incorrect proxy settings (closes: #378868) * methods/gzip.cc: -- cgit v1.2.3 From 3772dc74d3e7767980a011e01302dd688b3764fc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 16 Sep 2006 12:30:38 +0200 Subject: * reverted otavios patch again because it breaks the following behaviour: A depends on X|Y B depends on Y With the old code we get: "apt-get install A B": we get "A B X Y" "apt-get install B A": we get "A B Y" With the new code there is no way to get this right and we always end up with "A B X Y" because we just go over the packages in the order that they are in the cache and run MarkInstall(AutoInstall=true) on them then. When A comes before B we always end up with the unneeded X dependency. --- cmdline/apt-get.cc | 19 ++++--------------- configure.in | 2 +- debian/changelog | 4 +--- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index b33a324ea..64882e3e8 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1144,7 +1144,10 @@ bool TryToInstall(pkgCache::PkgIterator Pkg,pkgDepCache &Cache, } else ExpectedInst++; - + + // Install it with autoinstalling enabled. + if (State.InstBroken() == true && BrokenFix == false) + Cache.MarkInstall(Pkg,true); return true; } /*}}}*/ @@ -1535,20 +1538,6 @@ bool DoInstall(CommandLine &CmdL) } } - for (unsigned J = 0; J < Cache->Head().PackageCount; J++) - { - pkgCache::PkgIterator I(Cache,Cache.List[J]); - if ((*Cache)[I].Install() == false) - continue; - - pkgDepCache::StateCache &State = Cache[I]; - // Install it with autoinstalling enabled (if we not respect the minial - // required deps or the policy) - if (State.InstBroken() == true && BrokenFix == false) - Cache->MarkInstall(I,true); - } - - /* If we are in the Broken fixing mode we do not attempt to fix the problems. This is if the user invoked install without -f and gave packages */ diff --git a/configure.in b/configure.in index dc410b22f..f0b0d6703 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib) AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) dnl -- SET THIS TO THE RELEASE VERSION -- -AC_DEFINE_UNQUOTED(VERSION,"0.6.46") +AC_DEFINE_UNQUOTED(VERSION,"0.6.45.1") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) diff --git a/debian/changelog b/debian/changelog index 1ec80ca01..4c5841057 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -apt (0.6.46) unstable; urgency=low +apt (0.6.45.1) unstable; urgency=low * debian/control: - switched to libdb4.4 for building (closes: #381019) @@ -7,8 +7,6 @@ apt (0.6.46) unstable; urgency=low versions of the package (closes: #257054) - properly handle recommends/suggests or-groups when printing the list of suggested/recommends packages (closes: #311619) - - fix the way multiple packages are installed so that the order of - packages on the commandline doesn't matter anymore * methods/http.cc: - check more careful for incorrect proxy settings (closes: #378868) * methods/gzip.cc: -- cgit v1.2.3