I experiment with manually adding/deleting Activities, then restarting Sugar. Sometimes I've seen obsolete activity-versions being listed in some sort of snapshot recorded in shell.log. I've empirically found that I can lessen this by deleting ~/.sugar/default/favorite_activities - and letting the Sugar restart rebuild that file.
A couple of times I've found that the 'rm' command I issue for this purpose (e.g., from Terminal, while running as root) appears not to work. [The latest occurred on os353pyg - I don't remember which earlier builds I saw it happen on.] I'm mystified:
0 [~]# rm .sugar/default/favorite_activities rm: remove regular file `.sugar/default/favorite_activities'? y 0 [~]# rm .sugar/default/favorite_activities rm: remove regular file `.sugar/default/favorite_activities'? y 0 [~]# rm .sugar/default/favorite_activities rm: remove regular file `.sugar/default/favorite_activities'? y 0 [~]# ls -la .sugar/default/ total 21 drwxr-xr-x 8 olpc olpc 0 2010-08-14 12:24 . drwx------ 3 olpc olpc 0 2010-08-14 12:14 .. -rw-r--r-- 1 olpc olpc 9959 2010-08-14 05:41 buddy-icon.jpg drwxr-xr-x 3 olpc olpc 0 2010-08-14 05:42 cache drwxr-xr-x 2 olpc olpc 0 2010-08-14 05:39 data drwxr-xr-x 5 olpc olpc 0 2010-08-14 05:42 datastore -rw-r--r-- 1 olpc olpc 7792 2010-08-14 12:24 favorite_activities drwxr-xr-x 2 olpc olpc 0 2010-08-14 05:42 logs drwxr-xr-x 2 olpc olpc 0 2010-08-14 05:42 nm drwxr-xr-x 5 olpc olpc 0 2010-08-14 05:42 org.laptop.Terminal -rw------- 1 olpc olpc 668 2010-08-14 05:42 owner.key -rw-r--r-- 1 olpc olpc 590 2010-08-14 05:42 owner.key.pub -rw-r--r-- 1 olpc olpc 218 2010-08-14 05:42 terminalrc 0 [~]#
mikus
I'm mystified too. But it doesn't happen when I try it on os851 on XO-1.5 ...
1. the file can be deleted by user olpc in Terminal and stays deleted until Sugar restart, (an rm -f works, then an rm -f fails with "No such file or directory),
2. the file can be deleted by user root in text console and stays deleted until Sugar restart.
On Sat, Aug 14, 2010 at 03:56, James Cameron quozl@laptop.org wrote:
I'm mystified too. But it doesn't happen when I try it on os851 on XO-1.5 ...
- the file can be deleted by user olpc in Terminal and stays deleted
until Sugar restart, (an rm -f works, then an rm -f fails with "No such file or directory),
- the file can be deleted by user root in text console and stays
deleted until Sugar restart.
Some git grep turned out this:
def _write_favorites_file(self): path = env.get_profile_path('favorite_activities') favorites_data = {'defaults-mtime': self._last_defaults_mtime, 'favorites': self._favorite_bundles} simplejson.dump(favorites_data, open(path, 'w'), indent=1)
I know this seems counter-intuitive to lots of engineers, but reading code actually ends up saving time.
Regards,
Tomeu
-- James Cameron http://quozl.linux.org.au/ _______________________________________________ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
El Fri, 13-08-2010 a las 09:39 -0500, Mikus Grinbergs escribió:
A couple of times I've found that the 'rm' command I issue for this purpose (e.g., from Terminal, while running as root) appears not to work. [The latest occurred on os353pyg - I don't remember which earlier builds I saw it happen on.] I'm mystified:
0 [~]# rm .sugar/default/favorite_activities rm: remove regular file `.sugar/default/favorite_activities'? y 0 [~]# rm .sugar/default/favorite_activities rm: remove regular file `.sugar/default/favorite_activities'? y 0 [~]# rm .sugar/default/favorite_activities rm: remove regular file `.sugar/default/favorite_activities'? y 0 [~]# ls -la .sugar/default/
I can't reproduce it here (os373pyg, but should have same kernel as yours).
However, I have an idea: what's the contents of $LANG and $LANGUAGE? The expected answer might not be "y" :-)
On 14 August 2010 00:39, Mikus Grinbergs mikus@bga.com wrote:
I experiment with manually adding/deleting Activities, then restarting Sugar. Sometimes I've seen obsolete activity-versions being listed in some sort of snapshot recorded in shell.log. I've empirically found that I can lessen this by deleting ~/.sugar/default/favorite_activities
- and letting the Sugar restart rebuild that file.
Is manually deleting the /home/olpc/Activities/{activityname}.activity directory acceptable practice.
Likewise, can I safely copy one of those directories from one XO to another?
This all seems to work, but I don't know if there are any side effects.
Cheers, Sridhar
Sridhar Dhanapalan Technical Manager One Laptop per Child (OLPC) Australia p: +61 425 239 701 w: http://laptop.org.au
El Mon, 16-08-2010 a las 01:16 +1000, Sridhar Dhanapalan escribió:
Is manually deleting the /home/olpc/Activities/{activityname}.activity directory acceptable practice.
The only problem is that Sugar will not notice the change until restarted.
Likewise, can I safely copy one of those directories from one XO to another?
Yes. But you'd have to restart Sugar to make it see the new activity.
The xo bundles are nothing but glorified zip files that get unpacked by Sugar in the Activities directory. Simplicity is the only upside of our crappy packaging format :-)