// Acquire::Item::Item - Constructor /*{{{*/
APT_IGNORE_DEPRECATED_PUSH
pkgAcquire::Item::Item(pkgAcquire * const Owner) :
- FileSize(0), PartialSize(0), Mode(0), Complete(false), Local(false),
+ FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), Local(false),
QueueCounter(0), ExpectedAdditionalItems(0), Owner(Owner)
{
Owner->Add(this);
return Owner;
}
/*}}}*/
+pkgAcquire::ItemDesc &pkgAcquire::Item::GetItemDesc() /*{{{*/
+{
+ return Desc;
+}
+ /*}}}*/
APT_CONST bool pkgAcquire::Item::IsTrusted() const /*{{{*/
{
return false;
pkgAcquire::MethodConfig const * const /*Cnf*/)
{
// We just downloaded something..
- string FileName = LookupTag(Message,"Filename");
UsedMirror = LookupTag(Message,"UsedMirror");
- unsigned long long const downloadedSize = Hashes.FileSize();
- if (downloadedSize != 0)
+ if (FileSize == 0)
{
- if (Complete == false && !Local && FileName == DestFile)
+ unsigned long long const downloadedSize = Hashes.FileSize();
+ if (downloadedSize != 0)
{
- if (Owner->Log != 0)
- Owner->Log->Fetched(Hashes.FileSize(),atoi(LookupTag(Message,"Resume-Point","0").c_str()));
+ FileSize = downloadedSize;
}
-
- if (FileSize == 0)
- FileSize= downloadedSize;
}
Status = StatDone;
ErrorText = string();
return false;
}
- if (FileName != I->DestFile)
+ if (FileName != I->DestFile && RealFileExists(I->DestFile) == false)
{
I->Local = true;
I->Desc.URI = "copy:" + FileName;
// Methods like e.g. "file:" will give us a (compressed) FileName that is
// not the "DestFile" we set, in this case we uncompress from the local file
- if (FileName != DestFile)
+ if (FileName != DestFile && RealFileExists(DestFile) == false)
Local = true;
else
EraseFileName = FileName;
}
// Reference filename
- if (FileName != DestFile)
+ if (DestFile != FileName && RealFileExists(DestFile) == false)
{
StoreFilename = DestFile = FileName;
Local = true;
strprintf(Desc.Description, "%s %s %s Changelog", URI::SiteOnly(Desc.URI).c_str(), SrcName.c_str(), SrcVersion.c_str());
Desc.Owner = this;
QueueURI(Desc);
-
- if (Status == StatDone) // this happens if we queue the same changelog two times
- {
- Complete = true;
- for (pkgAcquire::UriIterator I = Owner->UriBegin(); I != Owner->UriEnd(); ++I)
- if (I->URI == Desc.URI)
- if (DestFile != I->Owner->DestFile)
- if (symlink(I->Owner->DestFile.c_str(), DestFile.c_str()) != 0)
- {
- ; // ignore error, there isn't anthing we could do to handle the edgecase of an edgecase
- }
- }
}
/*}}}*/
std::string pkgAcqChangelog::URI(pkgCache::VerIterator const &Ver) /*{{{*/
return;
// We have to copy it into place
- if (FileName != DestFile)
+ if (RealFileExists(DestFile.c_str()) == false)
{
Local = true;
if (_config->FindB("Acquire::Source-Symlinks",true) == false ||