[Pkg-sugar-devel] sugar-log-activity update

James Cameron quozl at laptop.org
Tue Apr 28 08:41:10 BST 2020


On Tue, Apr 28, 2020 at 08:43:11AM +0200, Jonas Smedegaard wrote:
> Hi James and ElĂ­as,
> 
> Quoting James Cameron (2020-04-27 06:13:21)
> > Thanks for reporting shebang, fixed upstream now.  2d17792.
> > 
> > (There is debate in Sugar Labs as to using /usr/bin/python3 or 
> > /usr/bin/env python3.  If you have any comments on that, please speak 
> > up.  My preference is /usr/bin/python3 as I don't wish to support 
> > local python builds, and one more execve syscall can be avoided.)
> 
> In my understanding, the correct generally is to support PATH lookup.
> 
> Therefore I think the optimal is to use env for upstream code and to use 
> hardcoded path only for distribution-specific package: Only distribution 
> packaging can be certain when (if at all, depending on rules for said 
> distribution) it is more correct to bypass PATH lookup.

Thanks.

> > Suggestion for your packaging; a new dependency on python3-urllib3 is
> > missing.
> 
> Really?  I would expect that to be needed only for code that imports 
> urllib3, and I fail to locate "urllib3" anywhere in the code for log 
> activity.

I agree.  My mistake.  "import urllib.parse" is satisfied by
package libpython3.x-minimal, which will be drawn in by python3

> > My packages for OLPC OS also include a postinst for refresh of Sugar
> > activity ring;
> > 
> > #!/bin/sh
> > 
> > set -e
> > 
> > # notify Sugar Bundle Registry
> > if [ "$1" = "configure" ]; then
> >     touch /usr/share/sugar/activities/Log.activity
> > fi
> > 
> > exit 0
> 
> Interesting!
> 
> Could you elaborate on what is the benefit of that?
> 
> Seems like something better handled generally in sugar-toolkit3, perhaps 
> even as a dpkg hook instead of explicit postinst code.  But I need to 
> first understand what it really does...

Happy to explain.

Sugar does set up a Gio.FileMonitor to detect filesystem events on
/usr/share/sugar/activities

https://github.com/sugarlabs/sugar/blob/master/src/jarabe/model/bundleregistry.py#L95

A callback is executed;

https://github.com/sugarlabs/sugar/blob/master/src/jarabe/model/bundleregistry.py#L135

Often, while dpkg is installing an activity, this callback races with
dpkg, because the directory is created before the activity.info file
is created.  The path is treated as a malformed or missing bundle.

https://github.com/sugarlabs/sugar/blob/master/src/jarabe/model/bundleregistry.py#L297

Outcome can be;

- activities removed from home view after being upgraded,

- activity version and other metadata shown in list view is incorrect,

Correlating evidence is "Error loading bundle" or "No bundle in" in
shell.log, which may be invisible until the log is flushed.

-- 
James Cameron
http://quozl.netrek.org/



More information about the pkg-sugar-devel mailing list