Skip to content

Commit

Permalink
Use the bundle registry in sugar-install-bundle (when sugar is running)
Browse files Browse the repository at this point in the history
  • Loading branch information
samdroid-apps committed Dec 21, 2014
1 parent 4461bf2 commit 64b4b2f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bin/sugar-install-bundle
@@ -1,4 +1,5 @@
#!/usr/bin/env python2
import os
import sys

from sugar3.bundle.activitybundle import ActivityBundle
Expand All @@ -15,7 +16,15 @@ if len(sys.argv) != 2:
cmd_help()
sys.exit(2)

bundle = ActivityBundle(sys.argv[1])
bundle.install()
if 'SUGAR_PROFILE' in os.environ:
# We are in sugar, so use the bundle registry so the correct signals
# are sent to the activity list
from jarabe.model.bundleregistry import get_registry
registry = get_registry()
bundle = ActivityBundle(sys.argv[1])
registry.install(bundle, force_downgrade=True)
else:
bundle = ActivityBundle(sys.argv[1])
bundle.install()

print "%s: '%s' installed." % (sys.argv[0], sys.argv[1])

0 comments on commit 64b4b2f

Please sign in to comment.