[Sugar-devel] Hard code freeze exception request: 0.82 data store not detected / migrated [#1838]

Tomeu Vizoso tomeu at tomeuvizoso.net
Mon Mar 22 06:33:38 EDT 2010


On Wed, Mar 17, 2010 at 13:20, Aleksey Lim <alsroot at member.fsf.org> wrote:
> +1

+1 from me as well

Thanks!

Tomeu

> On Wed, Mar 17, 2010 at 12:59:38PM +0100, Sascha Silbe wrote:
>> Hi!
>>
>> I hereby request a hard code freeze exception for SL#1838. [1]
>>
>> Migrating from a 0.82 data store has been broken since 0.86: the 0.82
>> data store contents are not recognized on first start-up and thus are
>> never imported, leaving the user with an empty Journal instead.
>>
>> While the previous content is not gone is a technical sense, recovering
>> from this bug requires issuing commands in the Terminal that can be
>> dangerous if not done right (version file and index need to be deleted).
>>
>> The fix is trivial, see below.
>>
>>
>> [1] https://bugs.sugarlabs.org/ticket/1838
>>
>> CU Sascha
>>
>> --
>> http://sascha.silbe.org/
>> http://www.infra-silbe.de/
>
>> From: Sascha Silbe <sascha-pgp at silbe.org>
>> Subject: [PATCH] fix migration from 0.82 data store (#1838)
>>
>> Upgrading directly from 0.82 to 0.86/0.88 didn't migrate the data store
>> contents because LayoutManager._is_empty() doesn't check for 0.82 data store
>> entries.
>> This patch fixes _is_empty() to recognize 0.82 data store contents.
>>
>> Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
>>
>> ---
>>  src/carquinyol/layoutmanager.py |    8 ++++++++
>>  1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/carquinyol/layoutmanager.py b/src/carquinyol/layoutmanager.py
>> index 0b0b91a..8402b6d 100644
>> --- a/src/carquinyol/layoutmanager.py
>> +++ b/src/carquinyol/layoutmanager.py
>> @@ -114,6 +114,14 @@ class LayoutManager(object):
>>          return uids
>>
>>      def _is_empty(self):
>> +        """Check if there is any existing entry.
>> +
>> +        All data store layout versions are handled. Will err on the safe
>> +        side (i.e. return False if there might be any entry)."""
>> +        if os.path.exists(os.path.join(self._root_path, 'store')):
>> +            # unmigrated 0.82 data store
>> +            return False
>> +
>>          for f in os.listdir(self._root_path):
>>              if os.path.isdir(os.path.join(self._root_path, f)) and len(f) == 2:
>>                  for g in os.listdir(os.path.join(self._root_path, f)):
>> --
>> tg: (0cffadc..) t/bug-1838 (depends on: upstream/master)
>
>
>
>
>> _______________________________________________
>> Sugar-devel mailing list
>> Sugar-devel at lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
> --
> Aleksey
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>


More information about the Sugar-devel mailing list