Fix installation of widgets using "defaultlocale" attribute.
authorZbigniew Kostrzewa <z.kostrzewa@samsung.com>
Thu, 27 Jun 2013 07:02:02 +0000 (09:02 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 1 Jul 2013 13:12:20 +0000 (13:12 +0000)
commita702e45a1c07816e5659561012f3a3170ec77eda
tree8e245a4c823fd41bf2dc0d61cbb2034fb36dc7bb
parentcd453b689231dffae294e78121e488590b2645fb
Fix installation of widgets using "defaultlocale" attribute.

[Issue#] WEB-3324
[Problem] Installation of widgets with attribute "defaultlocale" in
"widget" element fails.
[Cause] Installer backendlib for package-manager does not include all
required sources. To be exact launguage_subtag_rst_tree.cpp which
defines object used only when attribute "defaultlocale" is used. What's
more the language tag verification requires connection to WRT DB which
was not established in this particular case.
[Solution] Add missing dependencies and establish connection to WRT DB.
[SCMRequest] N/A
[Verification]
1. Build the change
2. Install package on the device
3. Run test widgets (from menu screen):
test/webapi/webapi-w3c-widgetpackaging-tests/widgetpackaging/w3c/dlocuse01.wgt
test/webapi/webapi-w3c-widgetpackaging-tests/widgetpackaging/w3c/dlocignore00.wgt
test/webapi/webapi-w3c-widgetpackaging-tests/widgetpackaging/w3c/ta-de-000.wgt
test/webapi/webapi-w3c-widgetpackaging-tests/widgetpackaging/w3c/ta-de-001.wgt
test/webapi/webapi-w3c-widgetpackaging-tests/widgetpackaging/w3c/ta-de-002.wgt
test/webapi/webapi-w3c-widgetpackaging-tests/widgetpackaging/w3c/ta-de-003.wgt
test/webapi/webapi-w3c-widgetpackaging-tests/widgetpackaging/w3c/ta-de-004.wgt

and one other that does not include "defaultlocale" attribute, e.g.
test/webapi/webapi-w3c-widgetpackaging-tests/widgetpackaging/w3c/br.wgt

CAUTION: This commit does not fix the issue entirely. Application that
performs the installation, when it is initiated from menu screen
(i.e. Installer), does not have enough access rights to establish connection
to WRT DB (SMACK issue). Lack of rights results in sqlite returning
SQLITE_BUSY to the application each time the application tries to establish
a connection (this results in an infinite loop in the application).
Temporary fix could be to set SMACK label "*" to WRT DB (label "_" is
not enough for some reason). However, generally the issue should
probably be passed to security team.

Change-Id: I1f16e7ad47830e226bbf57522719cf9e0af77cff
src/pkg-manager/CMakeLists.txt
src/pkg-manager/backendlib.cpp