[Merge] lp:~doanac/phablet-tools/click-x86 into lp:phablet-tools
Sergio Schvezov
sergio.schvezov at canonical.com
Wed May 14 17:41:30 UTC 2014
> On 05/14/2014 09:39 AM, Sergio Schvezov wrote:
> > How about using 'adb shell dpkg --print-architecture's result as another key
> entry to lookup in the map? Just in case we add some other arch sooner than
> later
>
> can you elaborate? I'm not sure I understand what you are saying here.
I guess I was too sleepy when I commented on this :-/
arch = adb.shell('dpkg --print-architecture').strip()
But instead of constructing the 'key' from appending two strings, a map from the arches seems cleaner:
basic_packages = (
{'source': 'unity8', 'binary': 'unity8'},
{'source': 'ubuntu-ui-toolkit',
'binary': {'armhf': 'qtdeclarative5-ubuntu-ui-toolkit-plugin',
'i386': 'qtdeclarative5-ubuntu-ui-toolkit-plugin-gles'})
But this is just a hassle for the case where they are the same, so this could work:
basic_packages = (
{'source': 'unity8', 'binary': {'all': 'unity8'}},
{'source': 'ubuntu-ui-toolkit',
'binary': {'armhf': 'qtdeclarative5-ubuntu-ui-toolkit-plugin',
'i386': 'qtdeclarative5-ubuntu-ui-toolkit-plugin-gles'}})
then when looping over basic_packages just
binary = p['binary'][arch] if arch in p['binary'] else p['binary']['all']
or something like that
--
https://code.launchpad.net/~doanac/phablet-tools/click-x86/+merge/219438
Your team Ubuntu Phablet Team is subscribed to branch lp:phablet-tools.
More information about the Ubuntu-reviews
mailing list