summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-06-10 21:24:47 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-06-10 21:24:47 +0200
commitd3a869e35503638e3483228fbfc95b7143568ad0 (patch)
treed3fa852ba88b4da60e2ec7b6422e756a0dac3f4b /apt-pkg/acquire-item.cc
parent59148d9630bbbd53c6aa10da0fcdbd579797502a (diff)
store all targets data in IndexTarget struct
We still need an API for the targets, so slowly prepare the IndexTargets to let them take this job. Git-Dch: Ignore
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index a1357fb15..e92ccc08b 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -382,6 +382,15 @@ bool pkgAcqDiffIndex::TransactionState(TransactionStates const state)
}
/*}}}*/
+// IndexTarget - Constructor /*{{{*/
+IndexTarget::IndexTarget(std::string const &MetaKey, std::string const &ShortDesc,
+ std::string const &LongDesc, std::string const &URI, bool const IsOptional,
+ std::map<std::string, std::string> const &Options) :
+ URI(URI), Description(LongDesc), ShortDesc(ShortDesc), MetaKey(MetaKey), IsOptional(IsOptional), Options(Options)
+{
+}
+ /*}}}*/
+
class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/
/* The sole purpose of this class is having an item which does nothing to
reach its done state to prevent cleanup deleting the mentioned file.
@@ -955,7 +964,7 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/
if (TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey) == false)
{
// optional targets that we do not have in the Release file are skipped
- if ((*Target)->IsOptional())
+ if ((*Target)->IsOptional)
continue;
Status = StatAuthError;
@@ -2388,7 +2397,7 @@ string pkgAcqIndex::Custom600Headers() const
if (stat(Final.c_str(),&Buf) == 0)
msg += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
- if(Target->IsOptional())
+ if(Target->IsOptional)
msg += "\nFail-Ignore: true";
return msg;
@@ -2410,7 +2419,7 @@ void pkgAcqIndex::Failed(string const &Message,pkgAcquire::MethodConfig const *
}
}
- if(Target->IsOptional() && GetExpectedHashes().empty() && Stage == STAGE_DOWNLOAD)
+ if(Target->IsOptional && GetExpectedHashes().empty() && Stage == STAGE_DOWNLOAD)
Status = StatDone;
else
TransactionManager->AbortTransaction();