OverItem->Priority = Tags.FindS("Priority");
}
- char Size[40];
- sprintf(Size,"%llu", (unsigned long long) FileSize);
-
// Strip the DirStrip prefix from the FileName and add the PathPrefix
string NewFileName;
if (DirStrip.empty() == false &&
// This lists all the changes to the fields we are going to make.
std::vector<TFRewriteData> Changes;
- Changes.push_back(SetTFRewriteData("Size", Size));
+ std::string Size;
+ strprintf(Size, "%llu", (unsigned long long) FileSize);
+ Changes.push_back(SetTFRewriteData("Size", Size.c_str()));
+
for (HashStringList::const_iterator hs = Db.HashesList.begin(); hs != Db.HashesList.end(); ++hs)
{
if (hs->HashType() == "MD5Sum")
// the "db cursor"
Db.Finish();
- // read stuff
- char *Start = Db.Dsc.Data;
- char *BlkEnd = Db.Dsc.Data + Db.Dsc.Length;
-
- // Add extra \n to the end, just in case (as in clearsigned they are missing)
- *BlkEnd++ = '\n';
- *BlkEnd++ = '\n';
-
pkgTagSection Tags;
- if (Tags.Scan(Start,BlkEnd - Start) == false)
+ if (Tags.Scan(Db.Dsc.Data.c_str(), Db.Dsc.Data.length()) == false)
return _error->Error("Could not find a record in the DSC '%s'",FileName.c_str());
-
+
if (Tags.Exists("Source") == false)
return _error->Error("Could not find a Source entry in the DSC '%s'",FileName.c_str());
Tags.Trim();
// (5 hardcoded + checksums + maintainer + end marker)
std::vector<TFRewriteData> Changes;
- Changes.push_back(SetTFRewriteData("Source",Package.c_str(),"Package"));
+ Changes.push_back(SetTFRewriteData("Source", 0));
+ Changes.push_back(SetTFRewriteData("Package",Package.c_str()));
if (Files.empty() == false)
Changes.push_back(SetTFRewriteData("Files",Files.c_str()));
if (ChecksumsSha1.empty() == false)
CheckSums[NewFileName].size = fd.Size();
- Hashes hs;
- hs.AddFD(fd, 0, DoHashes);
+ Hashes hs(DoHashes);
+ hs.AddFD(fd);
CheckSums[NewFileName].Hashes = hs.GetHashStringList();
fd.Close();