[Pkg-sugar-commit] [sugar-toolkit] 02/09: fix failure to start Read on newly installed system, dev.laptop.org #10218

Jonas Smedegaard dr at jones.dk
Thu Apr 16 18:49:57 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.84.12-1
in repository sugar-toolkit.

commit a8d13c9f2b99c2de571f3792e821cd119c0f82c5
Author: Simon Schampijer <simon at schampijer.de>
Date:   Mon Aug 9 11:01:50 2010 +1000

    fix failure to start Read on newly installed system, dev.laptop.org #10218
    
    Read from USB stick using object chooser fails, only on the first
    attempt on a newly installed system.
    
    The error we are seeing is that the '(env.get_profile_path(),
    'data'))' does not exist yet at that time. It gets created when an
    activity like Browse or Terminal has been run for the first time or
    you start Read by resuming the file on the external device. The issue
    is not read specific, same is true for Memorize when you use the
    object chooser in the create tab and try to open an image from the
    external device.
    
    Tested on os850 on XO-1.5.
    
    Reviewed-by: James Cameron <quozl at laptop.org>
    Reviewed-by: Daniel Drake <dsd at laptop.org>
    Tested-by: James Cameron <quozl at laptop.org>
---
 src/sugar/datastore/datastore.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/sugar/datastore/datastore.py b/src/sugar/datastore/datastore.py
index 637c083..c3ca17d 100644
--- a/src/sugar/datastore/datastore.py
+++ b/src/sugar/datastore/datastore.py
@@ -214,9 +214,11 @@ class RawObject(object):
         # to create hardlinks to jobject files
         # and w/o this, it wouldn't work since we have file from mounted device
         if self._file_path is None:
-            self._file_path = tempfile.mktemp(
-                    prefix='rawobject',
-                    dir=os.path.join(env.get_profile_path(), 'data'))
+            data_path = os.path.join(env.get_profile_path(), 'data')
+            self._file_path = tempfile.mktemp(prefix='rawobject',
+                                              dir=data_path)
+            if not os.path.exists(data_path):
+                os.makedirs(data_path)
             os.symlink(self.object_id, self._file_path)
         return self._file_path
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sugar/sugar-toolkit.git



More information about the pkg-sugar-commit mailing list