summaryrefslogtreecommitdiff
path: root/ftparchive/writer.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-11-10 16:32:52 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-11-10 16:32:52 +0100
commit71ecaad29d8066a494f516efc5efd80860653fe2 (patch)
treeb0769df88e2b6496f23e3d899aeb1c240a3488d9 /ftparchive/writer.cc
parenta865ed25fa54514224cf4d6f83dd9cf48b7ed02b (diff)
parent37adedc9d0b66eeae7efb88aebd08dfbc6e06f77 (diff)
merged from http://bzr.debian.org/bzr/apt/apt/debian-experimental2
Diffstat (limited to 'ftparchive/writer.cc')
-rw-r--r--ftparchive/writer.cc32
1 files changed, 17 insertions, 15 deletions
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index 60db8b990..27e53faf8 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -11,9 +11,8 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include "writer.h"
-
-#include <apti18n.h>
+#include <config.h>
+
#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
@@ -30,10 +29,13 @@
#include <iostream>
#include <sstream>
#include <memory>
-
+
+#include "writer.h"
#include "cachedb.h"
#include "apt-ftparchive.h"
#include "multicompress.h"
+
+#include <apti18n.h>
/*}}}*/
using namespace std;
FTWScanner *FTWScanner::Owner;
@@ -246,8 +248,8 @@ bool FTWScanner::LoadFileList(string const &Dir, string const &File)
// ---------------------------------------------------------------------
/* */
bool FTWScanner::Delink(string &FileName,const char *OriginalPath,
- unsigned long &DeLinkBytes,
- off_t const &FileSize)
+ unsigned long long &DeLinkBytes,
+ unsigned long long const &FileSize)
{
// See if this isn't an internaly prefix'd file name.
if (InternalPrefix.empty() == false &&
@@ -377,7 +379,7 @@ bool PackagesWriter::DoPackage(string FileName)
return false;
}
- off_t FileSize = Db.GetFileSize();
+ unsigned long long FileSize = Db.GetFileSize();
if (Delink(FileName,OriginalPath,Stats.DeLinkBytes,FileSize) == false)
return false;
@@ -413,7 +415,7 @@ bool PackagesWriter::DoPackage(string FileName)
}
char Size[40];
- sprintf(Size,"%lu", (unsigned long) FileSize);
+ sprintf(Size,"%llu", (unsigned long long) FileSize);
// Strip the DirStrip prefix from the FileName and add the PathPrefix
string NewFileName;
@@ -494,7 +496,7 @@ bool PackagesWriter::DoPackage(string FileName)
}
for (map<string,string>::const_iterator I = OverItem->FieldOverride.begin();
- I != OverItem->FieldOverride.end(); I++)
+ I != OverItem->FieldOverride.end(); ++I)
SetTFRewriteData(Changes[End++],I->first.c_str(),I->second.c_str());
SetTFRewriteData(Changes[End++], 0, 0);
@@ -610,7 +612,7 @@ bool SourcesWriter::DoPackage(string FileName)
if (St.st_size > 128*1024)
return _error->Error("DSC file '%s' is too large!",FileName.c_str());
- if (BufSize < (unsigned)St.st_size+1)
+ if (BufSize < (unsigned long long)St.st_size+1)
{
BufSize = St.st_size+1;
Buffer = (char *)realloc(Buffer,St.st_size+1);
@@ -830,7 +832,7 @@ bool SourcesWriter::DoPackage(string FileName)
SetTFRewriteData(Changes[End++], "Maintainer", NewMaint.c_str());
for (map<string,string>::const_iterator I = SOverItem->FieldOverride.begin();
- I != SOverItem->FieldOverride.end(); I++)
+ I != SOverItem->FieldOverride.end(); ++I)
SetTFRewriteData(Changes[End++],I->first.c_str(),I->second.c_str());
SetTFRewriteData(Changes[End++], 0, 0);
@@ -1065,7 +1067,7 @@ void ReleaseWriter::Finish()
for(map<string,struct CheckSum>::const_iterator I = CheckSums.begin();
I != CheckSums.end(); ++I)
{
- fprintf(Output, " %s %16ld %s\n",
+ fprintf(Output, " %s %16llu %s\n",
(*I).second.MD5.c_str(),
(*I).second.size,
(*I).first.c_str());
@@ -1077,7 +1079,7 @@ void ReleaseWriter::Finish()
for(map<string,struct CheckSum>::const_iterator I = CheckSums.begin();
I != CheckSums.end(); ++I)
{
- fprintf(Output, " %s %16ld %s\n",
+ fprintf(Output, " %s %16llu %s\n",
(*I).second.SHA1.c_str(),
(*I).second.size,
(*I).first.c_str());
@@ -1089,7 +1091,7 @@ void ReleaseWriter::Finish()
for(map<string,struct CheckSum>::const_iterator I = CheckSums.begin();
I != CheckSums.end(); ++I)
{
- fprintf(Output, " %s %16ld %s\n",
+ fprintf(Output, " %s %16llu %s\n",
(*I).second.SHA256.c_str(),
(*I).second.size,
(*I).first.c_str());
@@ -1101,7 +1103,7 @@ void ReleaseWriter::Finish()
I != CheckSums.end();
++I)
{
- fprintf(Output, " %s %32ld %s\n",
+ fprintf(Output, " %s %16llu %s\n",
(*I).second.SHA512.c_str(),
(*I).second.size,
(*I).first.c_str());