summaryrefslogtreecommitdiff
path: root/python/tarfile.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-10-14 21:20:06 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-10-14 21:31:26 +0200
commitdcf7f92994bf3b7bf08ecf1ac9c19c985a1d0f45 (patch)
tree7224043e1c43ee8ffb36d12b1ff6172eab915eff /python/tarfile.cc
parent515204913c9168e8db77c96fdd7c29feba5bb6f4 (diff)
downloadpython-apt-dcf7f92994bf3b7bf08ecf1ac9c19c985a1d0f45.tar.gz
python/tarfile.cc: use long long in Process() for APT >= 4.14
The pkgDirStream::Process() signature has changed in apt and is using a long long now for Size and Pos.
Diffstat (limited to 'python/tarfile.cc')
-rw-r--r--python/tarfile.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/python/tarfile.cc b/python/tarfile.cc
index 7f65a5c7..adc8e819 100644
--- a/python/tarfile.cc
+++ b/python/tarfile.cc
@@ -52,9 +52,13 @@ public:
virtual bool DoItem(Item &Itm,int &Fd);
virtual bool FinishedFile(Item &Itm,int Fd);
+#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 14)
+ virtual bool Process(Item &Itm,const unsigned char *Data,
+ unsigned long long Size,unsigned long long Pos);
+#else
virtual bool Process(Item &Itm,const unsigned char *Data,
unsigned long Size,unsigned long Pos);
-
+#endif
PyDirStream(PyObject *callback, const char *member=0) : callback(callback),
py_data(0), member(member), error(false), copy(0), copy_size(0)
{
@@ -84,8 +88,13 @@ bool PyDirStream::DoItem(Item &Itm, int &Fd)
return true;
}
+#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 14)
+bool PyDirStream::Process(Item &Itm,const unsigned char *Data,
+ unsigned long long Size,unsigned long long Pos)
+#else
bool PyDirStream::Process(Item &Itm,const unsigned char *Data,
unsigned long Size,unsigned long Pos)
+#endif
{
memcpy(copy + Pos, Data,Size);
return true;