Re: [Sugar-devel] [PATCH] Fix for file list sorting for FAT32 formatted flash drives in Journal.

2010-05-13 Thread Bernie Innocenti
El Thu, 13-05-2010 a las 00:21 -0400, Kenny Meyer escribió:
 Bernie, and I have had a special situation where a flash drive, which
 has been formatted on Windows with (apparently) a FAT32 file-system.
 Some of the files on the flash drive had a negative `changetime`, which
 resulted in automatically making the `changetime` of type long, whereas
 the sort() function expected an integer.
 
 This behaviour was reproduced on sugar-0.84.16. Should be backported to
 older versions. [?]
 ---
  src/jarabe/journal/model.py |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

Of course you get my +1:

Reviewed-by: Bernie Innocenti ber...@codewiz.org

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs   - http://sugarlabs.org/

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH] Fix for file list sorting for FAT32 formatted flash drives in Journal.

2010-05-12 Thread Kenny Meyer
Bernie, and I have had a special situation where a flash drive, which
has been formatted on Windows with (apparently) a FAT32 file-system.
Some of the files on the flash drive had a negative `changetime`, which
resulted in automatically making the `changetime` of type long, whereas
the sort() function expected an integer.

This behaviour was reproduced on sugar-0.84.16. Should be backported to
older versions. [?]
---
 src/jarabe/journal/model.py |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index 50e8dc1..5abab07 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -289,7 +289,7 @@ class InplaceResultSet(BaseResultSet):
 self._stopped = True
 
 def setup_ready(self):
-self._file_list.sort(lambda a, b: b[2] - a[2])
+self._file_list.sort(lambda a, b: cmp(b[2], a[2]))
 self.ready.send(self)
 
 def find(self, query):
-- 
1.7.0.4

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Fix for file list sorting for FAT32 formatted flash drives in Journal.

2010-05-12 Thread James Cameron
On Thu, May 13, 2010 at 12:21:11AM -0400, Kenny Meyer wrote:
 Bernie, and I have had a special situation where a flash drive, which
 has been formatted on Windows with (apparently) a FAT32 file-system.
 Some of the files on the flash drive had a negative `changetime`,
 which resulted in automatically making the `changetime` of type long,
 whereas the sort() function expected an integer.

Fascinating.  Have you a way to change the changetime from Linux to
achieve the same result?  I'd like to test.

 This behaviour was reproduced on sugar-0.84.16. Should be backported
 to older versions. [?]

What is the effect of the bug on 0.82?  (Maybe it explains a
long-standing problem we have).

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Fix for file list sorting for FAT32 formatted flash drives in Journal.

2010-05-12 Thread James Cameron
On Thu, May 13, 2010 at 01:16:14AM -0400, Kenny Meyer wrote:
 Hmm, I haven't found any method to manually manipulate the `ctime` of
 a file on Linux systems. Sorry.

Use stat filename to display the ctime and other times of the file.

Or stat --printf=%Z\\n filename to display ctime alone in UNIX epoch
format, which should be the intervening format that Sugar will work
with.

For both of these the filesystem must be mounted; the USB stick
inserted, and commands typed on Terminal.

I can't find an easy way to change the ctime, but looking at the code
around setup_ready() I'm not even sure that ctime is being worked on
there.

touch can be used to change atime and mtime.

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel