Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-09-19 15:44:38 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-09-19 15:44:38 (GMT)
commit11013dc3ca49c2775ba140ffed78e0f4e833f6f1 (patch)
treea29883fe978c654f33d0efb12423a3db9011b818
parent1ac23471fc017f8f9eee6669a0f75d72e4316228 (diff)
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.
-rw-r--r--NEWS2
-rw-r--r--src/olpc/datastore/backingstore.py27
2 files changed, 21 insertions, 8 deletions
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