From 6f34deead51a1c200589994a4cf46b7d79a45e69 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 16 Apr 2014 13:15:55 +0200 Subject: apt-private/acqprogress.cc: reset color in apt update --- apt-private/acqprogress.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-private') diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc index fe7a45e12..0f5b53e50 100644 --- a/apt-private/acqprogress.cc +++ b/apt-private/acqprogress.cc @@ -267,7 +267,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner) else cout << '\r' << BlankLine << '\r' << Buffer << flush; if (_config->FindB("Apt::Color", false) == true) - cout << _config->Find("APT::Color::Neutral"); + cout << _config->Find("APT::Color::Neutral") << flush; memset(BlankLine,' ',strlen(Buffer)); BlankLine[strlen(Buffer)] = 0; -- cgit v1.2.3 From 0d29b9d4368284782862c7b507c47002b79ddb27 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 26 Apr 2014 00:00:51 +0200 Subject: WIP local deb install --- apt-private/private-install.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'apt-private') diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 107ed398e..40165af31 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -19,6 +19,10 @@ #include #include #include +#include + +// FIXME: include of deb specific header +#include #include #include @@ -669,10 +673,23 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, bool DoInstall(CommandLine &CmdL) { CacheFile Cache; + // first check for local pkgs and add them to the cache + for (const char **I = CmdL.FileList; *I != 0; I++) + { + if(FileExists(*I)) + { + // FIMXE: direct usage of .deb specific stuff + metaIndex *mi = new debDebFileMetaIndex(*I); + pkgSourceList *sources = Cache.GetSourceList(); + sources->Add(mi); + } + } + + // then open the cache if (Cache.OpenForInstall() == false || Cache.CheckDeps(CmdL.FileSize() != 1) == false) return false; - + std::map verset; if(!DoCacheManipulationFromCommandLine(CmdL, Cache, verset)) -- cgit v1.2.3 From eafc5435878d4013262131e5506c52d77b8a4bd4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 28 Apr 2014 14:50:11 +0200 Subject: avoid deb specific code in private-install --- apt-private/private-install.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'apt-private') diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 40165af31..4a68bb9d1 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -21,9 +21,6 @@ #include #include -// FIXME: include of deb specific header -#include - #include #include #include @@ -33,6 +30,7 @@ #include #include #include +#include #include #include @@ -678,10 +676,19 @@ bool DoInstall(CommandLine &CmdL) { if(FileExists(*I)) { - // FIMXE: direct usage of .deb specific stuff - metaIndex *mi = new debDebFileMetaIndex(*I); - pkgSourceList *sources = Cache.GetSourceList(); - sources->Add(mi); + // FIXME: make this more elegant + std::string TypeStr = flExtension(*I) + "-file"; + pkgSourceList::Type *Type = pkgSourceList::Type::GetType(TypeStr.c_str()); + if(Type != 0) + { + std::vector List; + std::map Options; + if(Type->CreateItem(List, *I, "", "", Options)) + { + pkgSourceList *sources = Cache.GetSourceList(); + sources->Add(List[0]); + } + } } } -- cgit v1.2.3 From 94f6611592b4b77ac257ec37445776ac2845f682 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 7 May 2014 16:23:37 +0200 Subject: rename pkgSourceList::Add() to pkgSourceList::AddMetaIndex() --- apt-private/private-install.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-private') diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 4a68bb9d1..e7606a1d1 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -686,7 +686,7 @@ bool DoInstall(CommandLine &CmdL) if(Type->CreateItem(List, *I, "", "", Options)) { pkgSourceList *sources = Cache.GetSourceList(); - sources->Add(List[0]); + sources->AddMetaIndex(List[0]); } } } -- cgit v1.2.3 From aaf677da5b62d3d0fdeb26f9b4c63fed544b63cd Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 7 May 2014 16:41:25 +0200 Subject: move pkgSourceList::AddMetaIndex() into a private subclass until we decide about a good API --- apt-private/private-cachefile.h | 23 +++++++++++++++++++++++ apt-private/private-install.cc | 4 +++- 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'apt-private') diff --git a/apt-private/private-cachefile.h b/apt-private/private-cachefile.h index dce7e0a3a..1fddabfbd 100644 --- a/apt-private/private-cachefile.h +++ b/apt-private/private-cachefile.h @@ -6,7 +6,20 @@ #include #include #include +#include +#include +// FIXME: we need to find a way to export this +class APT_PUBLIC SourceList : public pkgSourceList +{ + + public: + // Add custom metaIndex (e.g. local files) + void AddMetaIndex(metaIndex *mi) { + SrcList.push_back(mi); + } + +}; // class CacheFile - Cover class for some dependency cache functions /*{{{*/ // --------------------------------------------------------------------- @@ -28,6 +41,16 @@ class APT_PUBLIC CacheFile : public pkgCacheFile return false; return true; } + // FIXME: this can go once the "libapt-pkg" pkgSourceList has a way + // to add custom metaIndexes (or custom local files or so) + bool BuildSourceList(OpProgress */*Progress*/ = NULL) { + if (SrcList != NULL) + return true; + SrcList = new SourceList(); + if (SrcList->ReadMainList() == false) + return _error->Error(_("The list of sources could not be read.")); + return true; + } bool Open(bool WithLock = true) { OpTextProgress Prog(*_config); diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index e7606a1d1..35649fcdb 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -685,7 +685,9 @@ bool DoInstall(CommandLine &CmdL) std::map Options; if(Type->CreateItem(List, *I, "", "", Options)) { - pkgSourceList *sources = Cache.GetSourceList(); + // we have our own CacheFile that gives us a SourceList + // with superpowerz + SourceList *sources = (SourceList*)Cache.GetSourceList(); sources->AddMetaIndex(List[0]); } } -- cgit v1.2.3