From: David Kalnischkies Date: Mon, 5 Jul 2010 10:06:45 +0000 (+0200) Subject: merge with debian-experimental-ma X-Git-Tag: 0.8.0~9^2~22^2~4 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/7ea4af9da25a802516461434b12a61e21743f960?hp=-c merge with debian-experimental-ma --- 7ea4af9da25a802516461434b12a61e21743f960 diff --combined apt-pkg/contrib/fileutl.cc index e95ddf562,0b62d1bd8..62d42e4da --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@@ -27,6 -27,7 +27,7 @@@ #include #include + #include #include #include @@@ -281,7 -282,6 +282,7 @@@ std::vector GetListOfFilesInDir } std::vector List; + Configuration::MatchAgainstConfig SilentIgnore("Dir::Ignore-Files-Silently"); DIR *D = opendir(Dir.c_str()); if (D == 0) { @@@ -307,7 -307,6 +308,7 @@@ { if (Debug == true) std::clog << "Bad file: " << Ent->d_name << " → no extension" << std::endl; + _error->Notice("Ignoring file '%s' in directory '%s' as it has no filename extension", Ent->d_name, Dir.c_str()); continue; } } @@@ -315,8 -314,6 +316,8 @@@ { if (Debug == true) std::clog << "Bad file: " << Ent->d_name << " → bad extension »" << flExtension(Ent->d_name) << "«" << std::endl; + if (SilentIgnore.Match(Ent->d_name) == false) + _error->Notice("Ignoring file '%s' in directory '%s' as it has an invalid filename extension", Ent->d_name, Dir.c_str()); continue; } } @@@ -658,10 -655,11 +659,11 @@@ bool FileFd::Open(string FileName,OpenM case WriteEmpty: { - struct stat Buf; - if (lstat(FileName.c_str(),&Buf) == 0 && S_ISLNK(Buf.st_mode)) - unlink(FileName.c_str()); - iFd = open(FileName.c_str(),O_RDWR | O_CREAT | O_TRUNC,Perms); + Flags |= Replace; + char *name = strdup((FileName + ".XXXXXX").c_str()); + TemporaryFileName = string(mktemp(name)); + iFd = open(TemporaryFileName.c_str(),O_RDWR | O_CREAT | O_EXCL,Perms); + free(name); break; } @@@ -843,11 -841,19 +845,19 @@@ bool FileFd::Close( if (iFd >= 0 && close(iFd) != 0) Res &= _error->Errno("close",_("Problem closing the file")); iFd = -1; - + + if ((Flags & Replace) == Replace) { + if (rename(TemporaryFileName.c_str(), FileName.c_str()) != 0) + Res &= _error->Errno("rename",_("Problem renaming the file")); + FileName = TemporaryFileName; // for the unlink() below. + } + if ((Flags & Fail) == Fail && (Flags & DelOnFail) == DelOnFail && FileName.empty() == false) if (unlink(FileName.c_str()) != 0) Res &= _error->WarningE("unlnk",_("Problem unlinking the file")); + + return Res; } /*}}}*/ diff --combined apt-pkg/deb/deblistparser.cc index d1931f909,6ede14c4d..24df57a5c --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@@ -19,6 -19,7 +19,7 @@@ #include #include + #include #include /*}}}*/ @@@ -38,8 -39,6 +39,8 @@@ debListParser::debListParser(FileFd *Fi Arch(Arch) { if (Arch == "native") this->Arch = _config->Find("APT::Architecture"); + Architectures = APT::Configuration::getArchitectures(); + MultiArchEnabled = Architectures.size() > 1; } /*}}}*/ // ListParser::UniqFindTagWrite - Find the tag and write a unq string /*{{{*/ @@@ -157,9 -156,10 +158,9 @@@ bool debListParser::NewVersion(pkgCache to a NOP in the download/install step - this package will ensure that it is downloaded only one time and installed only one time -- even if the architecture bound versions coming in and out on regular basis. */ - bool const static multiArch = APT::Configuration::getArchitectures().size() > 1; if (strcmp(Ver.Arch(true),"all") == 0) return true; - else if (multiArch == true) + else if (MultiArchEnabled == true) { // our pseudo packages have no size to not confuse the fetcher Ver->Size = 0; @@@ -473,6 -473,20 +474,20 @@@ const char *debListParser::ConvertRelat return I; } + /* + * CompleteArch: + * + * The complete architecture, consisting of -. + */ + static string CompleteArch(std::string& arch) { + if (arch == "armel") return "linux-arm"; + if (arch == "lpia") return "linux-i386"; + if (arch == "powerpcspe") return "linux-powerpc"; + if (arch == "uclibc-linux-armel") return "linux-arm"; + if (arch == "uclinux-armel") return "uclinux-arm"; + + return (arch.find("-") != string::npos) ? arch : "linux-" + arch; + } /*}}}*/ // ListParser::ParseDepends - Parse a dependency element /*{{{*/ // --------------------------------------------------------------------- @@@ -546,6 -560,7 +561,7 @@@ const char *debListParser::ParseDepends if (ParseArchFlags == true) { string arch = _config->Find("APT::Architecture"); + string completeArch = CompleteArch(arch); // Parse an architecture if (I != Stop && *I == '[') @@@ -573,8 -588,13 +589,13 @@@ I++; } - if (stringcmp(arch,I,End) == 0) + if (stringcmp(arch,I,End) == 0) { Found = true; + } else { + std::string wildcard = SubstVar(string(I, End), "any", "*"); + if (fnmatch(wildcard.c_str(), completeArch.c_str(), 0) == 0) + Found = true; + } if (*End++ == ']') { I = End; @@@ -621,6 -641,9 +642,6 @@@ bool debListParser::ParseDepends(pkgCac if (Section.Find(Tag,Start,Stop) == false) return true; - static std::vector const archs = APT::Configuration::getArchitectures(); - static bool const multiArch = archs.size() <= 1; - string Package; string const pkgArch = Ver.Arch(true); string Version; @@@ -632,13 -655,13 +653,13 @@@ if (Start == 0) return _error->Error("Problem parsing dependency %s",Tag); - if (multiArch == true && + if (MultiArchEnabled == true && (Type == pkgCache::Dep::Conflicts || Type == pkgCache::Dep::DpkgBreaks || Type == pkgCache::Dep::Replaces)) { - for (std::vector::const_iterator a = archs.begin(); - a != archs.end(); ++a) + for (std::vector::const_iterator a = Architectures.begin(); + a != Architectures.end(); ++a) if (NewDepends(Ver,Package,*a,Version,Op,Type) == false) return false; } @@@ -690,13 -713,14 +711,13 @@@ bool debListParser::ParseProvides(pkgCa if (Ver->MultiArch != pkgCache::Version::Foreign) return true; - std::vector const archs = APT::Configuration::getArchitectures(); - if (archs.size() <= 1) + if (MultiArchEnabled == false) return true; string const Package = Ver.ParentPkg().Name(); string const Version = Ver.VerStr(); - for (std::vector::const_iterator a = archs.begin(); - a != archs.end(); ++a) + for (std::vector::const_iterator a = Architectures.begin(); + a != Architectures.end(); ++a) { if (NewProvides(Ver, Package, *a, Version) == false) return false; @@@ -736,7 -760,7 +757,7 @@@ bool debListParser::Step( if (Architecture.empty() == true) return true; - if (Arch.empty() == true) + if (Arch.empty() == true || MultiArchEnabled == false) { if (APT::Configuration::checkArchitecture(Architecture) == true) return true; diff --combined debian/changelog index 51c75dad0,1bf6815a5..878d5238a --- a/debian/changelog +++ b/debian/changelog @@@ -1,43 -1,19 +1,58 @@@ -apt (0.7.26~exp8) experimental; urgency=low +apt (0.7.26~exp8) UNRELEASED; urgency=low ++ [ David Kalnischkies ] + * cmdline/cacheset.cc: + - doesn't include it in the library for now as it is too volatile + - get the candidate either from an already built depcache + or use the policy which is a bit faster than depcache generation + - get packages by task^ with FromTask() + - only print errors if all tries to get a package by string failed + - factor out code to get a single package FromName() + - check in Grouped* first without modifier interpretation + * cmdline/apt-get.cc: + - use the cachsets in the install commands + - make the specify order of packages irrelevant (Closes: #196021) + * apt-pkg/orderlist.cc: + - untouched packages are never missing + * apt-pkg/packagemanager.cc: + - packages that are not touched doesn't need to be unpacked + * debian/control: + - remove intltool's dependency as it is an ubuntu artefact + * apt-pkg/depcache.cc: + - SetCandidateVer for all pseudo packages + - SetReInstall for the "all" package of a pseudo package + - use the new MatchAgainstConfig for the DefaultRootSetFunc + - always mark the all package if a pseudo package is marked for install + * apt-pkg/contrib/error.{cc,h}: + - complete rewrite but use the same API + - add NOTICE and DEBUG as new types of a message + - add a simple stack handling to be able to delay error handling + * apt-pkg/aptconfiguration.cc: + - show a deprecation notice for APT::Acquire::Translation + * apt-pkg/contrib/configuration.{cc,h}: + - add a wrapper to match strings against configurable regex patterns + * apt-pkg/contrib/fileutl.cc: + - show notice about ignored file instead of being always silent + - add a Dir::Ignore-Files-Silently list option to control the notice + * apt-pkg/policy.h: + - add another round of const& madness as the previous round accidentally + NOT overrides the virtual GetCandidateVer() method (Closes: #587725) + - -- David Kalnischkies Mon, 28 Jun 2010 22:12:24 +0200 ++ [ Julian Andres Klode ] + * methods/ftp.h: + - Handle different logins on the same server (Closes: #586904). + * apt-pkg/deb/deblistparser.cc: + - Handle architecture wildcards (Closes: #547724). + * apt-pkg/versionmatch.cc: + - Support matching pins by regular expressions or glob() like patterns, + regular expressions have to be put between to slashes; for example, + /.*/. + * apt-pkg/contrib/fileutl.cc: + - Make FileFd replace files atomically in WriteTemp mode (for cache, etc). + * debian/control: + - Set Standards-Version to 3.9.0 + - -- Julian Andres Klode Thu, 24 Jun 2010 10:56:39 +0200 ++ -- David Kalnischkies Mon, 05 Jul 2010 12:05:30 +0200 apt (0.7.26~exp7) experimental; urgency=low diff --combined debian/control index 4f41c130b,8bc43568f..d482f2d0b --- a/debian/control +++ b/debian/control @@@ -5,8 -5,8 +5,8 @@@ Maintainer: APT Development Team , Otavio Salvador , Christian Perrier , Daniel Burrows , Luca Bruno , Julian Andres Klode - Standards-Version: 3.8.4 + Standards-Version: 3.9.0 -Build-Depends: debhelper (>= 5.0), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev | libcurl3-gnutls-dev (>= 7.15.5), debiandoc-sgml, xsltproc, docbook-xsl, po4a (>= 0.34-2), autotools-dev, autoconf, automake, doxygen, intltool +Build-Depends: debhelper (>= 5.0), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev | libcurl3-gnutls-dev (>= 7.15.5), debiandoc-sgml, xsltproc, docbook-xsl, po4a (>= 0.34-2), autotools-dev, autoconf, automake, doxygen Build-Conflicts: autoconf2.13, automake1.4 Package: apt