From 11013dc3ca49c2775ba140ffed78e0f4e833f6f1 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 19 Sep 2007 15:44:38 +0000 Subject: Do not index hidden directories (the trash most importantly). Turn off metadata updates for USB files for trial-3. It's broken and useless right now. See comment in the code. --- diff --git a/NEWS b/NEWS index a415d46..36f2534 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +* #3599 Fix the import logic on USB sticks. (marco) + Snapshot 48ab782a01 * Fix for undefined variable error (dcbw) diff --git a/src/olpc/datastore/backingstore.py b/src/olpc/datastore/backingstore.py index 8310aa7..bf0c94d 100644 --- a/src/olpc/datastore/backingstore.py +++ b/src/olpc/datastore/backingstore.py @@ -637,9 +637,10 @@ class InplaceFileBackingStore(FileBackingStore): if self.STORE_NAME in dirname: dirname.remove(self.STORE_NAME) - # other files and dirs to blacklist - if '.Trashes' in dirpath: continue - + # blacklist all the hidden directories + if '/.' in dirpath: continue + + logging.info([ dirpath, dirname, filenames ]) for fn in filenames: # give the thread a chance to exit @@ -670,11 +671,21 @@ class InplaceFileBackingStore(FileBackingStore): # checksum is different # XXX: what if there is more than one? (shouldn't # happen) - content = result.next() - uid = content.id - saved_mtime = content.get_property('mtime') - if mtime != saved_mtime: - self.update(uid, metadata, source) + + # FIXME This is throwing away all the entry metadata. + # Disabled for trial-3. We are not doing indexing + # anyway so it would just update the mtime which is + # not that useful. Also the journal is currently + # setting the mime type before saving the file making + # the mtime check useless. + # + # content = result.next() + # uid = content.id + # saved_mtime = content.get_property('mtime') + # if mtime != saved_mtime: + # self.update(uid, metadata, source) + pass + self.indexmanager.flush() return -- cgit v0.9.1