This is not really usual, but hook_uninstall() is intended to remove all about the module, so we need to do it to avoid problems on re-installing.

Two alternatives:

- AFAIK drupal file subsystem does not have a recursive directory remove function, so I think looking how this is done in other modules like imce_mkdir(on commit 127221) is the better idea for now.

- Since we know how xapian DB is structured: one directory level with files: asume it and do simple unlink's + rmdir

Thinking a little about it before do it :-p

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marvil07’s picture

Status: Active » Needs review
FileSize
1.41 KB

using the simple approach

rboulton’s picture

In the general case, it's not safe to assume that about xapian databases. In particular, xapian databases which have been produced by replication (not yet a released feature...) will consist of a directory containing one or two subdirectories at any given time. It's also conceivable that future backends may store some data within further subdirectories.

marvil07’s picture

So, if we assume we could have subdirectories on the xapian db, we should not delete that directory, but then, we should change how the index work, to avoid problem on "reinstall", but I think it's not so relevant for now because people uninstalling xapian knows they should remove data before re-installing.

Well, not really sure what to do, some more feedback about other cases would be great!

marvil07’s picture

Status: Needs review » Needs work

Ok, to resolve this I need to have different types of cases in my local environment.

rboulton: can you please point me to the right xapian link documentation to replicate your case?

marvil07’s picture

Status: Needs work » Postponed (maintainer needs more info)

Well, actually until be sure, just let the index files there :-/

It would be great if someone can help me to replicate how to have subdirectories in the xapian index.

marvil07’s picture

Title: remove local xapian db on uninstall » Remove local xapian database on uninstall
Version: 6.x-1.x-dev » 6.x-2.x-dev
Assigned: Unassigned » marvil07
Status: Postponed (maintainer needs more info) » Fixed
FileSize
1.96 KB

Ok, I end up writing a recursive directory removal since I could not find any drupal fancy function for it, but it's done and on upstream now.

Attaching the patch for reference.

marvil07’s picture

upps, see follow up.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.