summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregorio Guidi <greg_g@gentoo.org>2005-05-27 17:03:25 +0000
committerGregorio Guidi <greg_g@gentoo.org>2005-05-27 17:03:25 +0000
commit90bb9025c57bc7a591baa39fc58738a95c52b5ce (patch)
treea6e3d85f9548ee0e343f023b6af6a32077b39fca /kde-base
parentinitial commit - ebuild provided by Jesús Pérez via bug #89103 (diff)
downloadgentoo-2-90bb9025c57bc7a591baa39fc58738a95c52b5ce.tar.gz
gentoo-2-90bb9025c57bc7a591baa39fc58738a95c52b5ce.tar.bz2
gentoo-2-90bb9025c57bc7a591baa39fc58738a95c52b5ce.zip
Add last minute fix for critical kpilot bug.
(Portage version: 2.0.51.19)
Diffstat (limited to 'kde-base')
-rw-r--r--kde-base/kdepim/ChangeLog6
-rw-r--r--kde-base/kdepim/files/kdepim-3.4.1-kpilot-fix.patch136
-rw-r--r--kde-base/kdepim/kdepim-3.4.1.ebuild11
-rw-r--r--kde-base/kpilot/ChangeLog6
-rw-r--r--kde-base/kpilot/files/kdepim-3.4.1-kpilot-fix.patch136
-rw-r--r--kde-base/kpilot/kpilot-3.4.1.ebuild5
6 files changed, 295 insertions, 5 deletions
diff --git a/kde-base/kdepim/ChangeLog b/kde-base/kdepim/ChangeLog
index a4b89a6436a8..87095e26cd76 100644
--- a/kde-base/kdepim/ChangeLog
+++ b/kde-base/kdepim/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for kde-base/kdepim
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kdepim/ChangeLog,v 1.148 2005/05/27 08:55:22 greg_g Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kdepim/ChangeLog,v 1.149 2005/05/27 17:02:03 greg_g Exp $
+
+ 27 May 2005; Gregorio Guidi <greg_g@gentoo.org>
+ +files/kdepim-3.4.1-kpilot-fix.patch, kdepim-3.4.1.ebuild:
+ Add last minute fix for critical kpilot bug.
*kdepim-3.4.1 (27 May 2005)
diff --git a/kde-base/kdepim/files/kdepim-3.4.1-kpilot-fix.patch b/kde-base/kdepim/files/kdepim-3.4.1-kpilot-fix.patch
new file mode 100644
index 000000000000..a6dcc7702e35
--- /dev/null
+++ b/kde-base/kdepim/files/kdepim-3.4.1-kpilot-fix.patch
@@ -0,0 +1,136 @@
+diff -Nur kdepim-3.4.1.orig/kpilot/conduits/memofileconduit/memofile-conduit.cc kdepim-3.4.1/kpilot/conduits/memofileconduit/memofile-conduit.cc
+--- kdepim-3.4.1.orig/kpilot/conduits/memofileconduit/memofile-conduit.cc 2005-05-23 14:12:37.000000000 +0200
++++ kdepim-3.4.1/kpilot/conduits/memofileconduit/memofile-conduit.cc 2005-05-27 17:27:52.000000000 +0200
+@@ -114,7 +114,7 @@
+ setFirstSync( _memofiles->isFirstSync() );
+ addSyncLogEntry(i18n(" Syncing with %1.").arg(_memo_directory));
+
+- if ( (syncMode() == SyncAction::SyncMode::eCopyHHToPC) || isFirstSync() ) {
++ if ( (syncMode() == SyncAction::SyncMode::eCopyHHToPC) || _memofiles->isFirstSync() ) {
+ addSyncLogEntry(i18n(" Copying Pilot to PC..."));
+ #ifdef DEBUG
+ DEBUGCONDUIT << fname << ": copying Pilot to PC." << endl;
+@@ -474,17 +474,11 @@
+ // Note: This will reset both fCategories and fMemoAppInfo, so
+ // after this, we need to reinitialize our memofiles object...
+ setAppInfo();
+- cleanup();
+
+ // re-create our memofiles helper...
+ delete _memofiles;
+ _memofiles = new Memofiles(fCategories, *fMemoAppInfo, _memo_directory);
+
+- // make sure we are starting with a clean database on both ends...
+- fDatabase->deleteRecord(0, true);
+- fLocalDatabase->deleteRecord(0, true);
+- cleanup();
+-
+ _memofiles->load(true);
+
+ QPtrList<Memofile> memofiles = _memofiles->getAll();
+@@ -496,11 +490,39 @@
+ }
+
+ _memofiles->save();
+-
++
++ // now that we've copied from the PC to our handheld, remove anything extra from the
++ // handheld...
++ deleteUnsyncedHHRecords();
++
+ return true;
+
+ }
+
++void MemofileConduit::deleteUnsyncedHHRecords()
++{
++ FUNCTIONSETUP;
++ if ( syncMode()==SyncMode::eCopyPCToHH )
++ {
++ RecordIDList ids=fDatabase->idList();
++ RecordIDList::iterator it;
++ for ( it = ids.begin(); it != ids.end(); ++it )
++ {
++ if (!_memofiles->find(*it))
++ {
++#ifdef DEBUG
++ DEBUGCONDUIT << fname
++ << "Deleting record with ID "<<*it <<" from handheld "
++ << "(is not on PC, and syncing with PC->HH direction)"
++ << endl;
++#endif
++ fDatabase->deleteRecord(*it);
++ fLocalDatabase->deleteRecord(*it);
++ }
++ }
++ }
++}
++
+ int MemofileConduit::writeToPilot(Memofile * memofile)
+ {
+ FUNCTIONSETUP;
+diff -Nur kdepim-3.4.1.orig/kpilot/conduits/memofileconduit/memofile-conduit.h kdepim-3.4.1/kpilot/conduits/memofileconduit/memofile-conduit.h
+--- kdepim-3.4.1.orig/kpilot/conduits/memofileconduit/memofile-conduit.h 2005-05-23 14:12:37.000000000 +0200
++++ kdepim-3.4.1/kpilot/conduits/memofileconduit/memofile-conduit.h 2005-05-27 17:27:52.000000000 +0200
+@@ -88,6 +88,7 @@
+
+ bool copyHHToPC();
+ bool copyPCToHH();
++ void deleteUnsyncedHHRecords();
+ bool sync();
+
+ int writeToPilot(Memofile * memofile);
+diff -Nur kdepim-3.4.1.orig/kpilot/lib/pilotDatabase.cc kdepim-3.4.1/kpilot/lib/pilotDatabase.cc
+--- kdepim-3.4.1.orig/kpilot/lib/pilotDatabase.cc 2005-05-23 14:12:43.000000000 +0200
++++ kdepim-3.4.1/kpilot/lib/pilotDatabase.cc 2005-05-27 17:27:52.000000000 +0200
+@@ -185,7 +185,7 @@
+ int len = CATEGORY_NAME_SIZE - 1;
+ QCString t = PilotAppCategory::codec()->fromUnicode(s,len);
+ memset(categoryInfo()->name[i],0,CATEGORY_NAME_SIZE);
+- qstrncpy(categoryInfo()->name[i],t,kMin(len,(int)CATEGORY_NAME_SIZE));
++ qstrncpy(categoryInfo()->name[i],t,CATEGORY_NAME_SIZE);
+ return true;
+ }
+
+diff -Nur kdepim-3.4.1.orig/kpilot/lib/pilotDatabase.h kdepim-3.4.1/kpilot/lib/pilotDatabase.h
+--- kdepim-3.4.1.orig/kpilot/lib/pilotDatabase.h 2005-05-23 14:12:43.000000000 +0200
++++ kdepim-3.4.1/kpilot/lib/pilotDatabase.h 2005-05-27 17:27:52.000000000 +0200
+@@ -279,9 +279,12 @@
+ int appLen = MAX_APPINFO_SIZE;
+ unsigned char buffer[MAX_APPINFO_SIZE];
+
+- appLen = d->readAppBlock(buffer,appLen);
+-
+- (*unpack)(&fInfo, buffer, appLen);
++ if (d && d->isDBOpen())
++ {
++ appLen = d->readAppBlock(buffer,appLen);
++ (*unpack)(&fInfo, buffer, appLen);
++ }
++ // fInfo is just a struct, so we can point to it anyway.
+ init(&fInfo.category,appLen);
+ } ;
+
+@@ -289,6 +292,10 @@
+ {
+ FUNCTIONSETUP;
+ unsigned char buffer[MAX_APPINFO_SIZE];
++ if (!d || !d->isDBOpen())
++ {
++ return -1;
++ }
+ int appLen = (*pack)(&fInfo, buffer, length());
+ if (appLen > 0)
+ {
+diff -Nur kdepim-3.4.1.orig/kpilot/lib/pilotLocalDatabase.cc kdepim-3.4.1/kpilot/lib/pilotLocalDatabase.cc
+--- kdepim-3.4.1.orig/kpilot/lib/pilotLocalDatabase.cc 2005-05-23 14:12:43.000000000 +0200
++++ kdepim-3.4.1/kpilot/lib/pilotLocalDatabase.cc 2005-05-27 17:27:52.000000000 +0200
+@@ -618,7 +618,7 @@
+
+ int count;
+ pi_file_get_entries(dbFile, &count);
+- if (count > 0)
++ if (count >= 0)
+ {
+ KPILOT_DELETE(d);
+ d = new Private(count);
diff --git a/kde-base/kdepim/kdepim-3.4.1.ebuild b/kde-base/kdepim/kdepim-3.4.1.ebuild
index b6d641281e59..a5e36a9010e1 100644
--- a/kde-base/kdepim/kdepim-3.4.1.ebuild
+++ b/kde-base/kdepim/kdepim-3.4.1.ebuild
@@ -1,8 +1,8 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kdepim/kdepim-3.4.1.ebuild,v 1.1 2005/05/27 08:55:22 greg_g Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kdepim/kdepim-3.4.1.ebuild,v 1.2 2005/05/27 17:02:03 greg_g Exp $
-inherit kde-dist
+inherit kde-dist eutils
DESCRIPTION="KDE PIM (Personal Information Management) apps: korganizer, kmail, knode..."
@@ -16,6 +16,13 @@ DEPEND="~kde-base/kdebase-${PV}
crypt? ( >=app-crypt/gpgme-0.9.0-r1 )
!net-www/akregator"
+src_unpack() {
+ kde_src_unpack
+
+ # Last minute fix. Applied for 3.4.2.
+ epatch "${FILESDIR}/${P}-kpilot-fix.patch"
+}
+
src_compile() {
# needed to detect pi-notepad.h, used by the kpilot notepad conduit.
use pda && myconf="${myconf} --with-extra-includes=/usr/include/libpisock"
diff --git a/kde-base/kpilot/ChangeLog b/kde-base/kpilot/ChangeLog
index 3ac235b85aab..7a1a3ff83b54 100644
--- a/kde-base/kpilot/ChangeLog
+++ b/kde-base/kpilot/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for kde-base/kpilot
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kpilot/ChangeLog,v 1.8 2005/05/25 21:23:10 danarmak Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kpilot/ChangeLog,v 1.9 2005/05/27 17:03:25 greg_g Exp $
+
+ 27 May 2005; Gregorio Guidi <greg_g@gentoo.org>
+ +files/kdepim-3.4.1-kpilot-fix.patch, kpilot-3.4.1.ebuild:
+ Add last minute fix for critical kpilot bug.
*kpilot-3.4.1 (25 May 2005)
diff --git a/kde-base/kpilot/files/kdepim-3.4.1-kpilot-fix.patch b/kde-base/kpilot/files/kdepim-3.4.1-kpilot-fix.patch
new file mode 100644
index 000000000000..a6dcc7702e35
--- /dev/null
+++ b/kde-base/kpilot/files/kdepim-3.4.1-kpilot-fix.patch
@@ -0,0 +1,136 @@
+diff -Nur kdepim-3.4.1.orig/kpilot/conduits/memofileconduit/memofile-conduit.cc kdepim-3.4.1/kpilot/conduits/memofileconduit/memofile-conduit.cc
+--- kdepim-3.4.1.orig/kpilot/conduits/memofileconduit/memofile-conduit.cc 2005-05-23 14:12:37.000000000 +0200
++++ kdepim-3.4.1/kpilot/conduits/memofileconduit/memofile-conduit.cc 2005-05-27 17:27:52.000000000 +0200
+@@ -114,7 +114,7 @@
+ setFirstSync( _memofiles->isFirstSync() );
+ addSyncLogEntry(i18n(" Syncing with %1.").arg(_memo_directory));
+
+- if ( (syncMode() == SyncAction::SyncMode::eCopyHHToPC) || isFirstSync() ) {
++ if ( (syncMode() == SyncAction::SyncMode::eCopyHHToPC) || _memofiles->isFirstSync() ) {
+ addSyncLogEntry(i18n(" Copying Pilot to PC..."));
+ #ifdef DEBUG
+ DEBUGCONDUIT << fname << ": copying Pilot to PC." << endl;
+@@ -474,17 +474,11 @@
+ // Note: This will reset both fCategories and fMemoAppInfo, so
+ // after this, we need to reinitialize our memofiles object...
+ setAppInfo();
+- cleanup();
+
+ // re-create our memofiles helper...
+ delete _memofiles;
+ _memofiles = new Memofiles(fCategories, *fMemoAppInfo, _memo_directory);
+
+- // make sure we are starting with a clean database on both ends...
+- fDatabase->deleteRecord(0, true);
+- fLocalDatabase->deleteRecord(0, true);
+- cleanup();
+-
+ _memofiles->load(true);
+
+ QPtrList<Memofile> memofiles = _memofiles->getAll();
+@@ -496,11 +490,39 @@
+ }
+
+ _memofiles->save();
+-
++
++ // now that we've copied from the PC to our handheld, remove anything extra from the
++ // handheld...
++ deleteUnsyncedHHRecords();
++
+ return true;
+
+ }
+
++void MemofileConduit::deleteUnsyncedHHRecords()
++{
++ FUNCTIONSETUP;
++ if ( syncMode()==SyncMode::eCopyPCToHH )
++ {
++ RecordIDList ids=fDatabase->idList();
++ RecordIDList::iterator it;
++ for ( it = ids.begin(); it != ids.end(); ++it )
++ {
++ if (!_memofiles->find(*it))
++ {
++#ifdef DEBUG
++ DEBUGCONDUIT << fname
++ << "Deleting record with ID "<<*it <<" from handheld "
++ << "(is not on PC, and syncing with PC->HH direction)"
++ << endl;
++#endif
++ fDatabase->deleteRecord(*it);
++ fLocalDatabase->deleteRecord(*it);
++ }
++ }
++ }
++}
++
+ int MemofileConduit::writeToPilot(Memofile * memofile)
+ {
+ FUNCTIONSETUP;
+diff -Nur kdepim-3.4.1.orig/kpilot/conduits/memofileconduit/memofile-conduit.h kdepim-3.4.1/kpilot/conduits/memofileconduit/memofile-conduit.h
+--- kdepim-3.4.1.orig/kpilot/conduits/memofileconduit/memofile-conduit.h 2005-05-23 14:12:37.000000000 +0200
++++ kdepim-3.4.1/kpilot/conduits/memofileconduit/memofile-conduit.h 2005-05-27 17:27:52.000000000 +0200
+@@ -88,6 +88,7 @@
+
+ bool copyHHToPC();
+ bool copyPCToHH();
++ void deleteUnsyncedHHRecords();
+ bool sync();
+
+ int writeToPilot(Memofile * memofile);
+diff -Nur kdepim-3.4.1.orig/kpilot/lib/pilotDatabase.cc kdepim-3.4.1/kpilot/lib/pilotDatabase.cc
+--- kdepim-3.4.1.orig/kpilot/lib/pilotDatabase.cc 2005-05-23 14:12:43.000000000 +0200
++++ kdepim-3.4.1/kpilot/lib/pilotDatabase.cc 2005-05-27 17:27:52.000000000 +0200
+@@ -185,7 +185,7 @@
+ int len = CATEGORY_NAME_SIZE - 1;
+ QCString t = PilotAppCategory::codec()->fromUnicode(s,len);
+ memset(categoryInfo()->name[i],0,CATEGORY_NAME_SIZE);
+- qstrncpy(categoryInfo()->name[i],t,kMin(len,(int)CATEGORY_NAME_SIZE));
++ qstrncpy(categoryInfo()->name[i],t,CATEGORY_NAME_SIZE);
+ return true;
+ }
+
+diff -Nur kdepim-3.4.1.orig/kpilot/lib/pilotDatabase.h kdepim-3.4.1/kpilot/lib/pilotDatabase.h
+--- kdepim-3.4.1.orig/kpilot/lib/pilotDatabase.h 2005-05-23 14:12:43.000000000 +0200
++++ kdepim-3.4.1/kpilot/lib/pilotDatabase.h 2005-05-27 17:27:52.000000000 +0200
+@@ -279,9 +279,12 @@
+ int appLen = MAX_APPINFO_SIZE;
+ unsigned char buffer[MAX_APPINFO_SIZE];
+
+- appLen = d->readAppBlock(buffer,appLen);
+-
+- (*unpack)(&fInfo, buffer, appLen);
++ if (d && d->isDBOpen())
++ {
++ appLen = d->readAppBlock(buffer,appLen);
++ (*unpack)(&fInfo, buffer, appLen);
++ }
++ // fInfo is just a struct, so we can point to it anyway.
+ init(&fInfo.category,appLen);
+ } ;
+
+@@ -289,6 +292,10 @@
+ {
+ FUNCTIONSETUP;
+ unsigned char buffer[MAX_APPINFO_SIZE];
++ if (!d || !d->isDBOpen())
++ {
++ return -1;
++ }
+ int appLen = (*pack)(&fInfo, buffer, length());
+ if (appLen > 0)
+ {
+diff -Nur kdepim-3.4.1.orig/kpilot/lib/pilotLocalDatabase.cc kdepim-3.4.1/kpilot/lib/pilotLocalDatabase.cc
+--- kdepim-3.4.1.orig/kpilot/lib/pilotLocalDatabase.cc 2005-05-23 14:12:43.000000000 +0200
++++ kdepim-3.4.1/kpilot/lib/pilotLocalDatabase.cc 2005-05-27 17:27:52.000000000 +0200
+@@ -618,7 +618,7 @@
+
+ int count;
+ pi_file_get_entries(dbFile, &count);
+- if (count > 0)
++ if (count >= 0)
+ {
+ KPILOT_DELETE(d);
+ d = new Private(count);
diff --git a/kde-base/kpilot/kpilot-3.4.1.ebuild b/kde-base/kpilot/kpilot-3.4.1.ebuild
index 4c6043665145..263111b6b493 100644
--- a/kde-base/kpilot/kpilot-3.4.1.ebuild
+++ b/kde-base/kpilot/kpilot-3.4.1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kpilot/kpilot-3.4.1.ebuild,v 1.2 2005/05/26 17:14:29 danarmak Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kpilot/kpilot-3.4.1.ebuild,v 1.3 2005/05/27 17:03:25 greg_g Exp $
KMNAME=kdepim
MAXKDEVER=$PV
@@ -29,6 +29,9 @@ KMEXTRA="
kfile-plugins/palm-databases
kontact/plugins/kpilot/" # We add here the kontact's plugin instead of compiling it with kontact because it needs a lot of this programs deps.
+# Last minute fix. Applied for 3.4.2.
+PATCHES1="${FILESDIR}/kdepim-3.4.1-kpilot-fix.patch"
+
src_compile() {
# needed to detect pi-notepad.h, used by the kpilot notepad conduit.
myconf="${myconf} --with-extra-includes=/usr/include/libpisock"