From 1901322acf58e48c15f3599de9bf03332f3a55ee Mon Sep 17 00:00:00 2001 From: MyoungJune Park Date: Thu, 15 Dec 2016 20:52:42 +0900 Subject: [PATCH 2/9] Init dir structure for plugin-parser - Install plugin - Register tag info - Verify how it works between application and the plugin - Create /opt/usr/share/zoneinfo and copy tzdata files there -Aadd bash script to copy the new resources to target dir Change-Id: I7a67832852281a707492fa7aff288ddccf0f3bad Signed-off-by: MyoungJune Park --- CMakeLists.txt | 31 ++++ LICENSE | 178 +++++++++++++++++++ README | 287 +++++++++++++++++++++++++++++++ packaging/tzdata-update-parser.manifest | 5 + packaging/tzdata-update-parser.spec | 58 +++++++ test.sh | 3 + test/plugins_list.txt | 24 +++ tzdata-parser/CMakeLists.txt | 26 +++ tzdata-parser/src/tzdata-update-parser.c | 281 ++++++++++++++++++++++++++++++ 9 files changed, 893 insertions(+) create mode 100755 CMakeLists.txt create mode 100644 LICENSE create mode 100644 README create mode 100644 packaging/tzdata-update-parser.manifest create mode 100644 packaging/tzdata-update-parser.spec create mode 100755 test.sh create mode 100644 test/plugins_list.txt create mode 100755 tzdata-parser/CMakeLists.txt create mode 100755 tzdata-parser/src/tzdata-update-parser.c diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 0000000..8e20c67 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,31 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(tzdata-update-parser C) + +INCLUDE(FindPkgConfig) + +pkg_check_modules(pkg REQUIRED + dlog + fontconfig + capi-system-system-settings + elementary + pkgmgr-info + pkgmgr-installer +) + +SET(PACKAGE "${PROJECT_NAME}") +SET(CMAKE_C_FLAGS " -Wall -fpie -Winline -fno-builtin-malloc -fno-omit-frame-pointer -g ") +SET(CMAKE_EXE_LINKER_FLAGS "-pie") + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) + +ADD_DEFINITIONS("-DPATH_MAX=256") +ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"") +ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"") + +ADD_DEFINITIONS("-DNDEBUG") +#ADD_DEFINITIONS("-DFLOG") +ADD_DEFINITIONS(${pkg_CFLAGS}) +ADD_DEFINITIONS(${pkg_LDFLAGS}) + +# INCLUDE FOR BUILD & INSTALL .PO FILES +ADD_SUBDIRECTORY(tzdata-parser) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e7ef455 --- /dev/null +++ b/LICENSE @@ -0,0 +1,178 @@ +Copyright (c) 2013 - 2015 Samsung Electronics Co., Ltd. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/README b/README new file mode 100644 index 0000000..d7286f4 --- /dev/null +++ b/README @@ -0,0 +1,287 @@ +/opt/usr/home/owner/apps_rw/org.example.tzresources/res/zoneinfo.tar.gz +tar -xvzf /opt/usr/home/owner/apps_rw/org.example.tzresources/res/zoneinfo.tar.gz -C /usr/share/zoneinfo + +sh-3.2# ls -alh /etc/localtime +lrwxrwxrwx 1 root root 18 Dec 13 08:35 /etc/localtime -> /opt/etc/localtime +sh-3.2# ls -alh /opt/etc/localtime +lrwxrwxrwx 1 app_fw app_fw 30 Dec 13 12:34 /opt/etc/localtime -> /usr/share/zoneinfo/Asia/Dhaka + +$HOME/workspace/tzresources/tizen-manifest.xml + +== HOW TO TRACE LOG MESSAGES == +sh-3.2# dlogutil TZDATA_UPDATE_PARSER APP_INSTALLERS SETTING SYSTEM-SETTING TIZEN_N_SYSTEM_SETTINGS & + +== WHERE TO BE INSTALLED == +---- +sh-3.2# cd /opt/usr/home/owner/apps_rw +sh-3.2# ls +attach-panel-camera org.tizen.browser org.tizen.dpm-toolkit org.tizen.memo org.tizen.setting-homescreen org.tizen.videos +attach-panel-document org.tizen.bt-syspopup org.tizen.email org.tizen.menu-screen org.tizen.setting-location org.tizen.voice-control-panel +attach-panel-gallery org.tizen.calendar org.tizen.gallery org.tizen.message org.tizen.setting-notification org.tizen.voice-setting +attach-panel-voicerecorder org.tizen.call-setting org.tizen.gps-syspopup org.tizen.msg-manager org.tizen.settings-adid org.tizen.volume +cert-svc-ui org.tizen.call-ui org.tizen.heremaps-uc org.tizen.music-player org.tizen.share-panel org.tizen.wallpaper-ui-service +hangul org.tizen.callmgr-popup org.tizen.homescreen-efl org.tizen.myfile org.tizen.stt-engine-default org.tizen.widget_viewer_sdk +ise-default org.tizen.camera-app org.tizen.image-viewer org.tizen.myplace org.tizen.sys-lock org.tizen.worldclock-efl +ise-engine-anthy org.tizen.chromium-efl org.tizen.indicator org.tizen.overheat-syspopup org.tizen.system-signal-sender setting-myaccount-efl +ise-engine-default org.tizen.contacts org.tizen.inputmethod-setting org.tizen.powerkey-syspopup org.tizen.system-syspopup table +ise-engine-sunpinyin org.tizen.crash-syspopup org.tizen.isf-kbd-mode-changer org.tizen.privacy-setting org.tizen.task-mgr ug-bluetooth-efl +net.netpopup org.tizen.d2d-conv-setting org.tizen.kaskit org.tizen.quickpanel org.tizen.tts-engine-default ug-nfc-efl +org.example.tzresources org.tizen.d2d-conv-syspopup org.tizen.keyguard org.tizen.screen-reader org.tizen.ug-gallery-efl ug-setting-mobileap-efl +org.tizen.app-selector org.tizen.download-manager org.tizen.krate-setup-wizard org.tizen.service-plugin-sample org.tizen.ug-lockscreen-options wifi-efl-ug +org.tizen.bluetooth-share-ui org.tizen.dpm-syspopup org.tizen.lockscreen org.tizen.setting org.tizen.ug-myfile-efl xwalk-service +sh-3.2# cd org.example.tzresources/ +sh-3.2# ls +author-signature.xml bin cache data lib res shared signature1.xml tizen-manifest.xml +sh-3.2# +sh-3.2# +sh-3.2# +sh-3.2# tree +sh: tree: command not found +sh-3.2# ls res +zoneinfo.tar.gz +sh-3.2# +---- + +== HOW PLUGIN WORKS == +---- +D/TZDATA_UPDATE_PARSER( 2239): tzdata-update-parser.c: PKGMGR_CATEGORY_PARSER_PLUGIN_UPGRADE(213) > [ENTER tzdata_update_parser] PKGMGR_CATEGORY_PARSER_PLUGIN_UPGRADE +D/TZDATA_UPDATE_PARSER( 2239): tzdata-update-parser.c: COMMON_PKGMGR_PLUGIN_UPGRADE(103) > [ENTER tzdata_update_parser] COMMON_PKGMGR_PLUGIN_UPGRADE +D/TZDATA_UPDATE_PARSER( 2239): tzdata-update-parser.c: COMMON_PKGMGR_PLUGIN_UPGRADE(133) > [LEAVE tzdata_update_parser] COMMON_PKGMGR_PLUGIN_UPGRADE +---- + +---- +sh-3.2# I/APP_INSTALLERS( 1433): | INFO | Configure : step_configure.cc:256 : Changed file creation mask from 22 to 33 +I/APP_INSTALLERS( 1433): | INFO | Configure : step_configure.cc:229 : AppDir("/opt/usr/home/owner/apps_rw") +D/APP_INSTALLERS( 1433): | DEBUG | : recovery_file.cc:99 : Recovery file "/opt/usr/home/owner/apps_rw/recovery-f22f1e" created +D/APP_INSTALLERS( 1433): | DEBUG | Unzip : step_unzip.cc:103 : Required size for application: 434176B +I/APP_INSTALLERS( 1433): | INFO | Unzip : step_unzip.cc:128 : "/root/apps_rw/tmp/org.example.tzresources-1.0.0-arm.tpk" was successfully unzipped into "/opt/usr/home/owner/apps_rw/unpack-ff1ccd" +D/APP_INSTALLERS( 1433): | DEBUG | ParseManifest : step_parse_manifest.cc:148 : manifest path: "/opt/usr/home/owner/apps_rw/unpack-ff1ccd/tizen-manifest.xml" +D/APP_INSTALLERS( 1433): | DEBUG | ParseManifest : step_parse_manifest.cc:1036 : Parsed package id: org.example.tzresources +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=start VALUE=update +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=start VALUE=update +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=9 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=9 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=12 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=12 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=16 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=16 +I/APP_INSTALLERS( 1433): | INFO | : certificate_validation.cc:206 : Number of signature files: 2 +I/APP_INSTALLERS( 1433): | INFO | : certificate_validation.cc:139 : Processing signature: /opt/usr/home/owner/apps_rw/unpack-ff1ccd/author-signature.xml +I/APP_INSTALLERS( 1433): | INFO | : certificate_validation.cc:139 : Processing signature: /opt/usr/home/owner/apps_rw/unpack-ff1ccd/signature1.xml +I/APP_INSTALLERS( 1433): | INFO | Signature : step_check_signature.cc:154 : Privilege level: PUBLIC +I/APP_INSTALLERS( 1433): | INFO | : certificate_validation.cc:278 : Privilege level checked +I/APP_INSTALLERS( 1433): | INFO | Signature : step_check_signature.cc:165 : Signature done +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=19 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=19 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=22 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=22 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=25 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=25 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=29 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=29 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=32 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=32 +D/APP_INSTALLERS( 1433): | DEBUG | ParseManifest : step_parse_manifest.cc:148 : manifest path: "/opt/usr/home/owner/.applications/manifest/org.example.tzresources.xml" +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_query.cc:79 : pkgmgrinfo_pkginfo_get_tep_name failed with error: -1 +D/APP_INSTALLERS( 1433): | DEBUG | ParseManifest : step_parse_manifest.cc:1036 : Parsed package id: org.example.tzresources +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=35 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=35 +D/APP_INSTALLERS( 1433): | DEBUG | BlockCrossUpdate : step_block_cross_update.cc:50 : Update is allowed to proceed +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=38 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=38 +D/APP_INSTALLERS( 1433): | DEBUG | : step_kill_apps.cc:61 : Application 'org.example.tzresources' has been killed +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=41 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=41 +D/APP_INSTALLERS( 1433): | DEBUG | BackupManifest : step_backup_manifest.cc:45 : Manifest backup created +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=45 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=45 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=48 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=48 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=51 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=51 +I/APP_INSTALLERS( 1433): | INFO | AcquireExternalStorage : step_acquire_external_storage.cc:102 : Package storage: internal +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=54 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=54 +I/APP_INSTALLERS( 1433): | INFO | CopyBackup : step_copy_backup.cc:131 : Old package context saved to: "/opt/usr/home/owner/apps_rw/org.example.tzresources.bck" +I/APP_INSTALLERS( 1433): | INFO | CopyBackup : step_copy_backup.cc:190 : Successfully move: "/opt/usr/home/owner/apps_rw/unpack-ff1ccd" to: "/opt/usr/home/owner/apps_rw/org.example.tzresources" directory +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=58 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=58 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=61 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=61 +W/APP_INSTALLERS( 1433): | WARNING | : file_util.cc:256 : Cannot move directory: "/opt/usr/home/owner/apps_rw/org.example.tzresources.bck/shared". Will copy/remove... +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=64 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=64 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=67 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=67 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=70 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=70 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=74 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=74 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=77 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=77 +I/APP_INSTALLERS( 1433): | INFO | : security_registration.cc:139 : install_type(1) +D/APP_INSTALLERS( 1433): | DEBUG | UpdateSecurity : step_update_security.cc:35 : Security context updated +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=80 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=80 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=83 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=83 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=87 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=87 +I/APP_INSTALLERS( 1433): | INFO | UpdateApplication : step_update_app.cc:38 : Successfully install the application +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=90 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=90 +I/APP_INSTALLERS( 1433): | INFO | : plugin_xml_parser.cc:29 : Xml path: "/opt/usr/home/owner/.applications/manifest/org.example.tzresources.xml" +I/APP_INSTALLERS( 1433): | INFO | : plugin_list_parser.cc:142 : Plugin list path: "/usr/share/app-installers/plugins_list.txt" +D/APP_INSTALLERS( 1433): | DEBUG | : plugin_manager.cc:62 : Loading pkgmgr plugins... +D/APP_INSTALLERS( 1433): | DEBUG | : plugin_manager.cc:123 : Running pkgmgr plugins... +I/APP_INSTALLERS( 1433): | INFO | RunParserPlugin : step_run_parser_plugins.cc:32 : Processing plugins done +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=93 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=93 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=96 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=96 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=100 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=100 +D/APP_INSTALLERS( 1433): | DEBUG | : recovery_file.cc:107 : Recovery file "/opt/usr/home/owner/apps_rw/recovery-f22f1e" removed +D/APP_INSTALLERS( 1433): | DEBUG | BackupManifest : step_backup_manifest.cc:56 : Manifest backup removed +D/APP_INSTALLERS( 1433): | DEBUG | BackupIcons : step_backup_icons.cc:63 : Icons backup removed +D/APP_INSTALLERS( 1433): | DEBUG | CopyBackup : step_copy_backup.cc:68 : Applications files backup directory removed +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=end VALUE=ok +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=end VALUE=ok +---- + + +=== /opt/usr/share/zoninfo === + +1. create the dir in R/W area + +---- +sh-3.2# ls -alh +total 288K +drwxrwxrwx 20 root root 4.0K Dec 16 13:05 . +drwxr-xr-x 6 root root 4.0K Dec 16 13:04 .. +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Africa +drwxr--r-- 6 app_fw app_fw 4.0K Nov 16 10:59 America +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Antarctica +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Arctic +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Asia +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Atlantic +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Australia +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Brazil +-rw-r--r-- 2 app_fw app_fw 2.1K Nov 16 10:58 CET +-rw-r--r-- 2 app_fw app_fw 2.3K Nov 16 10:58 CST6CDT +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Canada +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Chile +-rw-r--r-- 4 app_fw app_fw 2.4K Nov 16 10:58 Cuba +-rw-r--r-- 2 app_fw app_fw 1.9K Nov 16 10:58 EET +-rw-r--r-- 2 app_fw app_fw 127 Nov 16 10:58 EST +-rw-r--r-- 2 app_fw app_fw 2.3K Nov 16 10:58 EST5EDT +-rw-r--r-- 4 app_fw app_fw 2.0K Nov 16 10:58 Egypt +-rw-r--r-- 4 app_fw app_fw 3.5K Nov 16 10:58 Eire +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Etc +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Europe +-rw-r--r-- 2 app_fw app_fw 148 Nov 16 10:58 Factory +-rw-r--r-- 14 app_fw app_fw 3.7K Nov 16 10:58 GB +-rw-r--r-- 14 app_fw app_fw 3.7K Nov 16 10:58 GB-Eire +-rw-r--r-- 20 app_fw app_fw 127 Nov 16 10:58 GMT +-rw-r--r-- 20 app_fw app_fw 127 Nov 16 10:58 GMT+0 +-rw-r--r-- 20 app_fw app_fw 127 Nov 16 10:58 GMT-0 +-rw-r--r-- 20 app_fw app_fw 127 Nov 16 10:58 GMT0 +-rw-r--r-- 20 app_fw app_fw 127 Nov 16 10:58 Greenwich +-rw-r--r-- 2 app_fw app_fw 128 Nov 16 10:58 HST +-rw-r--r-- 4 app_fw app_fw 1.2K Nov 16 10:58 Hongkong +-rw-r--r-- 4 app_fw app_fw 1.2K Nov 16 10:58 Iceland +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Indian +-rw-r--r-- 4 app_fw app_fw 1.7K Nov 16 10:58 Iran +-rw-r--r-- 6 app_fw app_fw 2.3K Nov 16 10:58 Israel +-rw-r--r-- 4 app_fw app_fw 507 Nov 16 10:58 Jamaica +-rw-r--r-- 4 app_fw app_fw 355 Nov 16 10:58 Japan +-rw-r--r-- 4 app_fw app_fw 237 Nov 16 10:58 Kwajalein +-rw-r--r-- 4 app_fw app_fw 655 Nov 16 10:58 Libya +-rw-r--r-- 2 app_fw app_fw 2.1K Nov 16 10:58 MET +-rw-r--r-- 2 app_fw app_fw 127 Nov 16 10:58 MST +-rw-r--r-- 2 app_fw app_fw 2.3K Nov 16 10:58 MST7MDT +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Mexico +-rw-r--r-- 8 app_fw app_fw 2.5K Nov 16 10:58 NZ +-rw-r--r-- 4 app_fw app_fw 2.1K Nov 16 10:58 NZ-CHAT +-rw-r--r-- 8 app_fw app_fw 2.4K Nov 16 10:58 Navajo +-rw-r--r-- 10 app_fw app_fw 414 Nov 16 10:58 PRC +-rw-r--r-- 2 app_fw app_fw 2.3K Nov 16 10:58 PST8PDT +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Pacific +-rw-r--r-- 4 app_fw app_fw 2.7K Nov 16 10:58 Poland +-rw-r--r-- 4 app_fw app_fw 3.4K Nov 16 10:58 Portugal +-rw-r--r-- 4 app_fw app_fw 800 Nov 16 10:58 ROC +-rw-r--r-- 4 app_fw app_fw 571 Nov 16 10:58 ROK +-rw-r--r-- 4 app_fw app_fw 428 Nov 16 10:58 Singapore +-rw-r--r-- 6 app_fw app_fw 2.2K Nov 16 10:58 Turkey +-rw-r--r-- 4 app_fw app_fw 127 Nov 16 10:58 UCT +-rw-r--r-- 1 app_fw app_fw 0 Dec 16 13:05 UPDATED.txt +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 US +-rw-r--r-- 13 app_fw app_fw 127 Nov 16 10:58 UTC +-rw-r--r-- 13 app_fw app_fw 127 Nov 16 10:58 Universal +-rw-r--r-- 4 app_fw app_fw 1.6K Nov 16 10:58 W-SU +-rw-r--r-- 2 app_fw app_fw 1.9K Nov 16 10:58 WET +-rw-r--r-- 13 app_fw app_fw 127 Nov 16 10:58 Zulu +-rw-r--r-- 1 app_fw app_fw 4.4K Nov 16 10:58 iso3166.tab +drwxr--r-- 18 app_fw app_fw 4.0K Nov 16 10:59 posix +lrwxrwxrwx 1 app_fw app_fw 14 Dec 16 13:05 posixrules -> /etc/localtime +drwxr--r-- 18 app_fw app_fw 4.0K Nov 16 10:59 right +-rw-r--r-- 1 app_fw app_fw 19K Nov 16 10:58 zone.tab +---- + + +=== Setting > time change > error === +---- +sh-3.2# D/SETTING (27558): setting-time-main.c: setting_time_main_mouse_up_Gendial_list_cb(1483) > [SECURE_LOG] ENTER FUNCTION: setting_time_main_mouse_up_Gendial_list_cb. +I/SETTING (27558): setting-time-main.c: setting_time_main_mouse_up_Gendial_list_cb(1495) > [SECURE_LOG] clicking item[Time zone] +D/SETTING (27558): setting-time-main.c: setting_time_check_automatic_time_update_state(1151) > [SECURE_LOG] ENTER FUNCTION: setting_time_check_automatic_time_update_state. +D/SETTING (27558): setting-time-main.c: setting_time_main_launch_worldclock_sg(1260) > [SECURE_LOG] ENTER FUNCTION: setting_time_main_launch_worldclock_sg. +I/SETTING (27558): setting-common-general-func.c: app_launcher_svc(1896) > [SECURE_LOG] app path - org.tizen.worldclock-efl +I/SETTING (27558): setting-common-general-func.c: app_launcher_svc(1899) > [SECURE_LOG] service name - org.tizen.worldclock-efl +I/SETTING (27558): setting-common-general-func.c: app_launcher_svc(1902) > [SECURE_LOG] after app_service_create - org.tizen.worldclock-efl : Successful +I/SETTING (27558): setting-common-general-func.c: app_launcher_svc(1905) > [SECURE_LOG] on success +D/SETTING (27558): setting-time-main.c: ___time_freeze_event_timer_cb(1183) > [SECURE_LOG] ENTER FUNCTION: ___time_freeze_event_timer_cb. +sh-3.2# D/SETTING (27558): setting-time-main.c: _worldclock_reply_cb(1195) > [SECURE_LOG] ENTER FUNCTION: _worldclock_reply_cb. +I/SETTING (27558): setting-time-main.c: _worldclock_reply_cb(1211) > [SECURE_LOG] tzpath : America/Anchorage +I/SETTING (27558): setting-time-main.c: _worldclock_reply_cb(1213) > [SECURE_LOG] city : IDS_WCL_BODY_CITYNAME_ANCHORAGE +I/SETTING (27558): setting-time-main.c: _worldclock_reply_cb(1217) > [SECURE_LOG] tzpath:(America/Anchorage) +D/SETTING (27558): setting-time-main.c: _set_timezone_helper(213) > [SECURE_LOG] ENTER FUNCTION: _set_timezone_helper. +I/SETTING (27558): setting-time-main.c: _set_timezone_helper(214) > [SECURE_LOG] = America/Anchorage +I/SETTING (27558): setting-time-main.c: _set_timezone_helper(217) > [SECURE_LOG] system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE) = -22, . +I/SETTING (27558): setting-time-main.c: _worldclock_reply_cb(1221) > [SECURE_LOG] tzpath is not valid. +---- + +Device +---- +sh-3.2# D/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1197) > [SECURE_LOG] ENTER FUNCTION: _worldclock_reply_cb. +I/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1213) > [SECURE_LOG] tzpath : America/Guayaquil +I/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1215) > [SECURE_LOG] city : IDS_WCL_BODY_CITYNAME_QUITO +I/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1219) > [SECURE_LOG] tzpath:(America/Guayaquil) +D/SETTING ( 1766): setting-time-main.c: _set_timezone_helper(213) > [SECURE_LOG] ENTER FUNCTION: _set_timezone_helper. +I/SETTING ( 1766): setting-time-main.c: _set_timezone_helper(214) > [SECURE_LOG] = America/Guayaquil +I/SETTING ( 1766): setting-time-main.c: _set_timezone_helper(217) > [SECURE_LOG] system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE) = 0, . +I/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1231) > [SECURE_LOG] _set_timezone_helper - successful : America/Guayaquil +I/SETTING ( 1766): +D/SETTING ( 1766): setting-time-main.c: get_gmt_offset(1601) > [SECURE_LOG] DEBUG: szTimezone is of a valid format: GMT: +9:00 +D/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1666) > [SECURE_LOG] ENTER FUNCTION: get_timezone_displayname. +D/SETTING ( 1766): setting-time-main.c: get_timezone_str(1611) > [SECURE_LOG] ENTER FUNCTION: get_timezone_str. +I/SETTING ( 1766): setting-time-main.c: ICU_set_timezone(1571) > [SECURE_LOG] ICU_set_timezone = America/Guayaquil +I/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1716) > [SECURE_LOG] *************************** timezone : G, GMT-05:00 +D/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1721) > [SECURE_LOG] EXIT FUNCTION: get_timezone_displayname. +D/SETTING ( 1766): setting-time-main.c: get_gmt_offset(1601) > [SECURE_LOG] DEBUG: szTimezone is of a valid format: GMT: +9:00 +I/SETTING ( 1766): setting-time-main.c: setting_update_timezone(157) > [SECURE_LOG] ad->data_tz:0xb8905640 +D/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1257) > [SECURE_LOG] EXIT FUNCTION: _worldclock_reply_cb. +D/SETTING ( 1766): setting-time-main.c: time_changed_callback(119) > [SECURE_LOG] DEBUG: time and timezone have been changed: TIME_CHANGED_HEYNOTY_CALLBACK +I/SETTING ( 1766): setting-time-main.c: system_settings_changed_timezone(85) > [SECURE_LOG] >>>>>>>> NOTIFY CHANGE TIMEZONE +I/SETTING ( 1766): setting-time-main.c: system_settings_changed_timezone(95) > [SECURE_LOG] timezone : (America/Guayaquil) +I/SETTING ( 1766): setting-time-main.c: ICU_set_timezone(1571) > [SECURE_LOG] ICU_set_timezone = America/Guayaquil +D/SETTING ( 1766): setting-time-main.c: get_gmt_offset(1601) > [SECURE_LOG] DEBUG: szTimezone is of a valid format: GMT: -5:00 +D/SETTING ( 1766): setting-time-main.c: time_changed_callback(119) > [SECURE_LOG] DEBUG: time and timezone have been changed: TIME_CHANGED_HEYNOTY_CALLBACK +D/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1666) > [SECURE_LOG] ENTER FUNCTION: get_timezone_displayname. +D/SETTING ( 1766): setting-time-main.c: get_timezone_str(1611) > [SECURE_LOG] ENTER FUNCTION: get_timezone_str. +I/SETTING ( 1766): setting-time-main.c: ICU_set_timezone(1571) > [SECURE_LOG] ICU_set_timezone = America/Guayaquil +I/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1716) > [SECURE_LOG] *************************** timezone : G, GMT-05:00 +D/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1721) > [SECURE_LOG] EXIT FUNCTION: get_timezone_displayname. +D/SETTING ( 1766): setting-time-main.c: get_gmt_offset(1601) > [SECURE_LOG] DEBUG: szTimezone is of a valid format: GMT: -5:00 +I/SETTING ( 1766): setting-time-main.c: setting_update_timezone(157) > [SECURE_LOG] ad->data_tz:0xb8905640 +D/SETTING ( 1766): setting-time-main.c: setting_update_datefield_cb(1354) > [SECURE_LOG] ENTER FUNCTION: setting_update_datefield_cb. +---- diff --git a/packaging/tzdata-update-parser.manifest b/packaging/tzdata-update-parser.manifest new file mode 100644 index 0000000..a76fdba --- /dev/null +++ b/packaging/tzdata-update-parser.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/tzdata-update-parser.spec b/packaging/tzdata-update-parser.spec new file mode 100644 index 0000000..40b0601 --- /dev/null +++ b/packaging/tzdata-update-parser.spec @@ -0,0 +1,58 @@ +Name: tzdata-update-parser +Summary: tzdata downloadable update +Version: 1.0.0 +Release: 1 +Group: Base/Package Management +License: Apache-2.0 +Source0: %{name}-%{version}.tar.gz +Source1001: tzdata-update-parser.manifest +BuildRequires: cmake, gettext-tools, smack, coreutils +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(fontconfig) +BuildRequires: pkgconfig(capi-system-system-settings) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(pkgmgr-info) +BuildRequires: pkgconfig(pkgmgr-installer) + +%description +tzdata downloadable update. + +%prep +%setup -q +cp %{SOURCE1001} . + +%build +%if 0%{?sec_build_binary_debug_enable} +export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE" +export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" +export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" +%endif +%if 0%{?tizen_build_binary_release_type_eng} +export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE" +export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE" +export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE" +%endif +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} + +#CFLAGS="${CFLAGS} -Wall -Winline -Werror" LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs} +CFLAGS="${CFLAGS} -Wall -Winline " LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs} + +%install +rm -rf %{buildroot} +%make_install + +mkdir -p %{buildroot}%{_tmpfilesdir} + +%post +mkdir -p /opt/usr/share/zoneinfo +chmod 777 /opt/usr/share/zoneinfo +chmod +x /etc/package-manager/parserlib/worker.sh +chown owner:users /etc/package-manager/parserlib/worker.sh + + +%files -n tzdata-update-parser +%manifest tzdata-update-parser.manifest +%defattr(-,root,root,-) +/etc/package-manager/parserlib/category/* +/etc/package-manager/parserlib/worker.sh + diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..eed980b --- /dev/null +++ b/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +SDB=/usr/bin/sdb +$SDB push test/plugins_list.txt /usr/share/app-installers diff --git a/test/plugins_list.txt b/test/plugins_list.txt new file mode 100644 index 0000000..23e5f40 --- /dev/null +++ b/test/plugins_list.txt @@ -0,0 +1,24 @@ +flag="0x00000001";type="tag";name="shortcut-list";path="/etc/package-manager/parserlib/libshortcut-list.so" +flag="0x00000002";type="tag";name="account";path="/etc/package-manager/parserlib/libaccount.so" +flag="0x00000004";type="tag";name="notifications";path="/etc/package-manager/parserlib/libnotifications.so" +flag="0x00000008";type="tag";name="privileges";path="/etc/package-manager/parserlib/libprivileges.so" +flag="0x00000010";type="tag";name="ime";path="/etc/package-manager/parserlib/libime.so" +flag="0x00000020";type="category";name="http://tizen.org/category/downloadable_font";path="/etc/package-manager/parserlib/category/libdownloadable_font.so" +flag="0x00000040";type="metadata";name="http://developer.samsung.com/tizen/metadata/sticker";path="/etc/package-manager/parserlib/metadata/libsticker.so" +flag="0x00000080";type="metadata";name="http://developer.samsung.com/tizen/metadata/ttsengine";path="/etc/package-manager/parserlib/metadata/libttsengine.so" +flag="0x00000100";type="metadata";name="http://developer.samsung.com/tizen/metadata/downloadable_filters";path="/etc/package-manager/parserlib/metadata/libdownloadable_filters.so" +flag="0x00000200";type="metadata";name="http://developer.samsung.com/tizen/metadata/dictionary";path="/etc/package-manager/parserlib/metadata/libdictionary.so" +flag="0x00000400";type="category";name="http://tizen.org/category/antivirus";path="/etc/package-manager/parserlib/category/libantivirus.so" +flag="0x00000800";type="metadata";name="http://developer.samsung.com/tizen/metadata/profile";path="/etc/package-manager/parserlib/metadata/libtheme.so" +flag="0x00001000";type="category";name="http://tizen.org/category/tts";path="/etc/package-manager/parserlib/category/libsamsung_tts.so" +flag="0x00002000";type="tag";name="livebox";path="/etc/package-manager/parserlib/liblivebox.so" +flag="0x00004000";type="tag";name="watch-application";path="/etc/package-manager/parserlib/libwatch-application.so" +flag="0x00008000";type="tag";name="widget-application";path="/etc/package-manager/parserlib/libwidget-application.so" +flag="0x00010000";type="metadata";name="http://tizen.org/metadata/nfc_cardemulation";path="/usr/etc/package-manager/parserlib/metadata/libcardemulation_plugin.so" +flag="0x00020000";type="metadata";name="http://developer.samsung.com/tizen/metadata/useese";path="/usr/etc/package-manager/parserlib/metadata/libuseese_plugin.so" +flag="0x00040000";type="tag";name="app-context";path="/etc/package-manager/parserlib/libapp-context.so" +flag="0x00080000";type="metadata";name="http://tizen.org/metadata/stt-engine";path="/etc/package-manager/parserlib/metadata/libstt-engine-parser.so" +flag="0x00100000";type="metadata";name="http://tizen.org/metadata/tts-engine";path="/etc/package-manager/parserlib/metadata/libtts-engine-parser.so" +flag="0x00200000";type="metadata";name="http://tizen.org/metadata/aliasappid";path="/etc/package-manager/parserlib/metadata/libaul-parser.so" +flag="0x00400000";type="metadata";name="http://tizen.org/metadata/allowedappid";path="/etc/package-manager/parserlib/metadata/libaul-parser.so" +flag="0x01000000";type="category";name="http://tizen.org/category/tzdata";path="/etc/package-manager/parserlib/category/libtzdata-update-parser.so" diff --git a/tzdata-parser/CMakeLists.txt b/tzdata-parser/CMakeLists.txt new file mode 100755 index 0000000..0d0688e --- /dev/null +++ b/tzdata-parser/CMakeLists.txt @@ -0,0 +1,26 @@ +PROJECT(tzdata-update-parser C) + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/tzdata-parser/include) + +INCLUDE(FindPkgConfig) +pkg_check_modules(bin_pkgs REQUIRED dlog pkgmgr-info pkgmgr-installer) + +FOREACH(flag ${bin_pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Wall ") + +ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") + +ADD_LIBRARY(${PROJECT_NAME} SHARED + src/tzdata-update-parser.c +) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${bin_pkgs_LDFLAGS}) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION "/etc/package-manager/parserlib/category") +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION "/etc/package-manager/parserlib/category") +INSTALL(FILES ${CMAKE_SOURCE_DIR}/tzdata-parser/src/worker.sh DESTINATION "/etc/package-manager/parserlib/") +#/etc/package-manager/parserlib/worker.sh +# End of a file diff --git a/tzdata-parser/src/tzdata-update-parser.c b/tzdata-parser/src/tzdata-update-parser.c new file mode 100755 index 0000000..81559d7 --- /dev/null +++ b/tzdata-parser/src/tzdata-update-parser.c @@ -0,0 +1,281 @@ +/* + * Copyright 2013 Samsung Electronics Co., Ltd + * + * + * Contact: Minsu Seo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#define WORKER "/etc/package-manager/parserlib/worker.sh" + + +#define TZDATA_UPDATE_PARSER_TAG "TZDATA_UPDATE_PARSER" + +#define DEBUG_LOG(frmt, args...) \ + do { SLOG(LOG_DEBUG,TZDATA_UPDATE_PARSER_TAG, "[tzdata_update_parser] %s: "frmt"\n",\ + __func__, ##args);} while (0) + +#define DEBUG_WARNING(frmt, args...) \ + do { SLOG(LOG_WARN,TZDATA_UPDATE_PARSER_TAG, "[tzdata_update_parser] %s: "frmt"\n",\ + __func__, ##args);} while (0) + +#define DEBUG_ERROR(frmt, args...) \ + do { SLOG(LOG_ERROR,TZDATA_UPDATE_PARSER_TAG, "[tzdata_update_parser] %s: "frmt"\n",\ + __func__, ##args);} while (0) + +#define TRACE_BEGIN do {\ + SLOG(LOG_DEBUG,TZDATA_UPDATE_PARSER_TAG, "[ENTER tzdata_update_parser] %s\n",\ + __func__);} while (0) + +#define TRACE_END do {\ + SLOG(LOG_DEBUG,TZDATA_UPDATE_PARSER_TAG, "[LEAVE tzdata_update_parser] %s\n",\ + __func__);} while (0) + + +static void alt_system() +{ + pid_t pid; + int status; + pid_t ret = -10000; + //char *const args[2] = {"/home/mjpark", NULL}; + //char **env; + //extern char **environ; + /* ... Sanitize arguments ... */ + pid = fork(); + if (pid == -1) { + /* Handle error */ + } else if (pid != 0) { + while ((ret = waitpid(pid, &status, 0)) == -1) { + if (errno != EINTR) { + /* Handle error */ + break; + } + } + if ((ret != -1) && + (!WIFEXITED(status) || !WEXITSTATUS(status)) ) { + /* Report unexpected child status */ + } + DEBUG_LOG(" ----> parent ? : %d ", ret); + + } else { + /* ... Initialize env as a sanitized copy of environ ... */ + //ret = execl("/home/mjpark/cprog/dir_copy/work.sh", "work.sh", (char *)0); + //if (execve("/bin/ls", args, env) == -1) { + //ret = execl("/bin/ls", "-1", (char *)0); + DEBUG_LOG(" ------------> run execl: %s ", WORKER); + ret = execl("/bin/bash", "bash", "-c", WORKER, (char *) NULL); + if (ret) { + /* Handle error */ + DEBUG_LOG("error occured : %s", WORKER); + printf("error occured\n"); + _Exit(127); + } else { + DEBUG_LOG("run OK !!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + } + } +} + +//DEBUG_ERROR("srcdir length is not available \n"); +//DEBUG_LOG("srcdir =%s\n",(char *) srcdir); +int COMMON_PKGMGR_PLUGIN_INSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + int ret; + pkgmgrinfo_pkginfo_h handle = NULL; + const char *app_root_path = NULL; + //const char *dest_path = NULL; + uid_t uid = 0; + + pkgmgr_installer_info_get_target_uid(&uid); + ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle); + + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] handle get fail", pkgid); + return -1; + } + + ret = pkgmgrinfo_pkginfo_get_root_path(handle, (char **)&app_root_path); + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] path get fail", pkgid); + goto FAIL; + } + + if (appid == NULL) + { + DEBUG_ERROR("appid is NULL \n"); + goto FAIL; + } + + + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return ret; + +FAIL: + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return -1; +} + + +int COMMON_PKGMGR_PLUGIN_UPGRADE(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + int ret = 0; + pkgmgrinfo_pkginfo_h handle = NULL; + const char* app_root_path = NULL; + //const char* dest_path = NULL; + uid_t uid = 0; + + pkgmgr_installer_info_get_target_uid(&uid); + ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle); + + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] handle get fail", pkgid); + return -1; + } + + ret = pkgmgrinfo_pkginfo_get_root_path(handle, (char **)&app_root_path); + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] path get fail", pkgid); + goto FAIL; + } + + if (appid == NULL) + { + DEBUG_ERROR("appid is NULL \n"); + goto FAIL; + } + + DEBUG_LOG("-----------------------------------------------------"); + DEBUG_LOG("pkgid : %s ", pkgid); + DEBUG_LOG("APP root path : %s ", app_root_path); + DEBUG_LOG("-----------------------------------------------------"); + // RUN SCRIPT HERE + alt_system(); + DEBUG_LOG("-----------------------------------------------------"); + + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return ret; + +FAIL: + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return -1; +} + + + +int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + pkgmgrinfo_pkginfo_h handle = NULL; + const char* app_root_path = NULL; + //const char *dest_path = NULL; + int ret; + uid_t uid = 0; + + if (appid == NULL) + { + DEBUG_ERROR("appid is NULL \n"); + return -1; + } + + pkgmgr_installer_info_get_target_uid(&uid); + ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle); + + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] handle get fail", pkgid); + return -1; + } + + ret = pkgmgrinfo_pkginfo_get_root_path(handle, (char **)&app_root_path); + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] path get fail", pkgid); + goto FAIL; + } + + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return ret; + +FAIL: + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return -1; +} + +#if USE_META_DATA +int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_INSTALL(pkgid, appid, list); +} + +int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_UPGRADE(pkgid, appid, list); +} + +int PKGMGR_MDPARSER_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_UNINSTALL(pkgid, appid, list); +} +#endif + +int PKGMGR_CATEGORY_PARSER_PLUGIN_INSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_INSTALL(pkgid, appid, list); +} + +int PKGMGR_CATEGORY_PARSER_PLUGIN_UPGRADE(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_UPGRADE(pkgid, appid, list); +} + +int PKGMGR_CATEGORY_PARSER_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_UNINSTALL(pkgid, appid, list); +} + + +/* End of a file */ -- 2.7.4 From 8e9f009382a55779a011c78f6647291d7504fb34 Mon Sep 17 00:00:00 2001 From: MyoungJune Park Date: Thu, 15 Dec 2016 20:52:42 +0900 Subject: [PATCH 3/9] Init dir structure for plugin-parser - Install plugin - Register tag info - Verify how it works between application and the plugin - Create /opt/usr/share/zoneinfo and copy tzdata files there -Aadd bash script to copy the new resources to target dir Change-Id: I7a67832852281a707492fa7aff288ddccf0f3bad Signed-off-by: MyoungJune Park --- CMakeLists.txt | 31 ++++ LICENSE | 178 +++++++++++++++++++ README | 287 +++++++++++++++++++++++++++++++ packaging/tzdata-update-parser.manifest | 5 + packaging/tzdata-update-parser.spec | 58 +++++++ test.sh | 3 + test/plugins_list.txt | 24 +++ tzdata-parser/CMakeLists.txt | 26 +++ tzdata-parser/src/tzdata-update-parser.c | 281 ++++++++++++++++++++++++++++++ 9 files changed, 893 insertions(+) create mode 100755 CMakeLists.txt create mode 100644 LICENSE create mode 100644 README create mode 100644 packaging/tzdata-update-parser.manifest create mode 100644 packaging/tzdata-update-parser.spec create mode 100755 test.sh create mode 100644 test/plugins_list.txt create mode 100755 tzdata-parser/CMakeLists.txt create mode 100755 tzdata-parser/src/tzdata-update-parser.c diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 0000000..8e20c67 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,31 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(tzdata-update-parser C) + +INCLUDE(FindPkgConfig) + +pkg_check_modules(pkg REQUIRED + dlog + fontconfig + capi-system-system-settings + elementary + pkgmgr-info + pkgmgr-installer +) + +SET(PACKAGE "${PROJECT_NAME}") +SET(CMAKE_C_FLAGS " -Wall -fpie -Winline -fno-builtin-malloc -fno-omit-frame-pointer -g ") +SET(CMAKE_EXE_LINKER_FLAGS "-pie") + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) + +ADD_DEFINITIONS("-DPATH_MAX=256") +ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"") +ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"") + +ADD_DEFINITIONS("-DNDEBUG") +#ADD_DEFINITIONS("-DFLOG") +ADD_DEFINITIONS(${pkg_CFLAGS}) +ADD_DEFINITIONS(${pkg_LDFLAGS}) + +# INCLUDE FOR BUILD & INSTALL .PO FILES +ADD_SUBDIRECTORY(tzdata-parser) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e7ef455 --- /dev/null +++ b/LICENSE @@ -0,0 +1,178 @@ +Copyright (c) 2013 - 2015 Samsung Electronics Co., Ltd. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/README b/README new file mode 100644 index 0000000..d7286f4 --- /dev/null +++ b/README @@ -0,0 +1,287 @@ +/opt/usr/home/owner/apps_rw/org.example.tzresources/res/zoneinfo.tar.gz +tar -xvzf /opt/usr/home/owner/apps_rw/org.example.tzresources/res/zoneinfo.tar.gz -C /usr/share/zoneinfo + +sh-3.2# ls -alh /etc/localtime +lrwxrwxrwx 1 root root 18 Dec 13 08:35 /etc/localtime -> /opt/etc/localtime +sh-3.2# ls -alh /opt/etc/localtime +lrwxrwxrwx 1 app_fw app_fw 30 Dec 13 12:34 /opt/etc/localtime -> /usr/share/zoneinfo/Asia/Dhaka + +$HOME/workspace/tzresources/tizen-manifest.xml + +== HOW TO TRACE LOG MESSAGES == +sh-3.2# dlogutil TZDATA_UPDATE_PARSER APP_INSTALLERS SETTING SYSTEM-SETTING TIZEN_N_SYSTEM_SETTINGS & + +== WHERE TO BE INSTALLED == +---- +sh-3.2# cd /opt/usr/home/owner/apps_rw +sh-3.2# ls +attach-panel-camera org.tizen.browser org.tizen.dpm-toolkit org.tizen.memo org.tizen.setting-homescreen org.tizen.videos +attach-panel-document org.tizen.bt-syspopup org.tizen.email org.tizen.menu-screen org.tizen.setting-location org.tizen.voice-control-panel +attach-panel-gallery org.tizen.calendar org.tizen.gallery org.tizen.message org.tizen.setting-notification org.tizen.voice-setting +attach-panel-voicerecorder org.tizen.call-setting org.tizen.gps-syspopup org.tizen.msg-manager org.tizen.settings-adid org.tizen.volume +cert-svc-ui org.tizen.call-ui org.tizen.heremaps-uc org.tizen.music-player org.tizen.share-panel org.tizen.wallpaper-ui-service +hangul org.tizen.callmgr-popup org.tizen.homescreen-efl org.tizen.myfile org.tizen.stt-engine-default org.tizen.widget_viewer_sdk +ise-default org.tizen.camera-app org.tizen.image-viewer org.tizen.myplace org.tizen.sys-lock org.tizen.worldclock-efl +ise-engine-anthy org.tizen.chromium-efl org.tizen.indicator org.tizen.overheat-syspopup org.tizen.system-signal-sender setting-myaccount-efl +ise-engine-default org.tizen.contacts org.tizen.inputmethod-setting org.tizen.powerkey-syspopup org.tizen.system-syspopup table +ise-engine-sunpinyin org.tizen.crash-syspopup org.tizen.isf-kbd-mode-changer org.tizen.privacy-setting org.tizen.task-mgr ug-bluetooth-efl +net.netpopup org.tizen.d2d-conv-setting org.tizen.kaskit org.tizen.quickpanel org.tizen.tts-engine-default ug-nfc-efl +org.example.tzresources org.tizen.d2d-conv-syspopup org.tizen.keyguard org.tizen.screen-reader org.tizen.ug-gallery-efl ug-setting-mobileap-efl +org.tizen.app-selector org.tizen.download-manager org.tizen.krate-setup-wizard org.tizen.service-plugin-sample org.tizen.ug-lockscreen-options wifi-efl-ug +org.tizen.bluetooth-share-ui org.tizen.dpm-syspopup org.tizen.lockscreen org.tizen.setting org.tizen.ug-myfile-efl xwalk-service +sh-3.2# cd org.example.tzresources/ +sh-3.2# ls +author-signature.xml bin cache data lib res shared signature1.xml tizen-manifest.xml +sh-3.2# +sh-3.2# +sh-3.2# +sh-3.2# tree +sh: tree: command not found +sh-3.2# ls res +zoneinfo.tar.gz +sh-3.2# +---- + +== HOW PLUGIN WORKS == +---- +D/TZDATA_UPDATE_PARSER( 2239): tzdata-update-parser.c: PKGMGR_CATEGORY_PARSER_PLUGIN_UPGRADE(213) > [ENTER tzdata_update_parser] PKGMGR_CATEGORY_PARSER_PLUGIN_UPGRADE +D/TZDATA_UPDATE_PARSER( 2239): tzdata-update-parser.c: COMMON_PKGMGR_PLUGIN_UPGRADE(103) > [ENTER tzdata_update_parser] COMMON_PKGMGR_PLUGIN_UPGRADE +D/TZDATA_UPDATE_PARSER( 2239): tzdata-update-parser.c: COMMON_PKGMGR_PLUGIN_UPGRADE(133) > [LEAVE tzdata_update_parser] COMMON_PKGMGR_PLUGIN_UPGRADE +---- + +---- +sh-3.2# I/APP_INSTALLERS( 1433): | INFO | Configure : step_configure.cc:256 : Changed file creation mask from 22 to 33 +I/APP_INSTALLERS( 1433): | INFO | Configure : step_configure.cc:229 : AppDir("/opt/usr/home/owner/apps_rw") +D/APP_INSTALLERS( 1433): | DEBUG | : recovery_file.cc:99 : Recovery file "/opt/usr/home/owner/apps_rw/recovery-f22f1e" created +D/APP_INSTALLERS( 1433): | DEBUG | Unzip : step_unzip.cc:103 : Required size for application: 434176B +I/APP_INSTALLERS( 1433): | INFO | Unzip : step_unzip.cc:128 : "/root/apps_rw/tmp/org.example.tzresources-1.0.0-arm.tpk" was successfully unzipped into "/opt/usr/home/owner/apps_rw/unpack-ff1ccd" +D/APP_INSTALLERS( 1433): | DEBUG | ParseManifest : step_parse_manifest.cc:148 : manifest path: "/opt/usr/home/owner/apps_rw/unpack-ff1ccd/tizen-manifest.xml" +D/APP_INSTALLERS( 1433): | DEBUG | ParseManifest : step_parse_manifest.cc:1036 : Parsed package id: org.example.tzresources +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=start VALUE=update +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=start VALUE=update +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=9 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=9 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=12 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=12 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=16 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=16 +I/APP_INSTALLERS( 1433): | INFO | : certificate_validation.cc:206 : Number of signature files: 2 +I/APP_INSTALLERS( 1433): | INFO | : certificate_validation.cc:139 : Processing signature: /opt/usr/home/owner/apps_rw/unpack-ff1ccd/author-signature.xml +I/APP_INSTALLERS( 1433): | INFO | : certificate_validation.cc:139 : Processing signature: /opt/usr/home/owner/apps_rw/unpack-ff1ccd/signature1.xml +I/APP_INSTALLERS( 1433): | INFO | Signature : step_check_signature.cc:154 : Privilege level: PUBLIC +I/APP_INSTALLERS( 1433): | INFO | : certificate_validation.cc:278 : Privilege level checked +I/APP_INSTALLERS( 1433): | INFO | Signature : step_check_signature.cc:165 : Signature done +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=19 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=19 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=22 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=22 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=25 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=25 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=29 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=29 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=32 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=32 +D/APP_INSTALLERS( 1433): | DEBUG | ParseManifest : step_parse_manifest.cc:148 : manifest path: "/opt/usr/home/owner/.applications/manifest/org.example.tzresources.xml" +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_query.cc:79 : pkgmgrinfo_pkginfo_get_tep_name failed with error: -1 +D/APP_INSTALLERS( 1433): | DEBUG | ParseManifest : step_parse_manifest.cc:1036 : Parsed package id: org.example.tzresources +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=35 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=35 +D/APP_INSTALLERS( 1433): | DEBUG | BlockCrossUpdate : step_block_cross_update.cc:50 : Update is allowed to proceed +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=38 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=38 +D/APP_INSTALLERS( 1433): | DEBUG | : step_kill_apps.cc:61 : Application 'org.example.tzresources' has been killed +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=41 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=41 +D/APP_INSTALLERS( 1433): | DEBUG | BackupManifest : step_backup_manifest.cc:45 : Manifest backup created +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=45 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=45 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=48 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=48 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=51 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=51 +I/APP_INSTALLERS( 1433): | INFO | AcquireExternalStorage : step_acquire_external_storage.cc:102 : Package storage: internal +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=54 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=54 +I/APP_INSTALLERS( 1433): | INFO | CopyBackup : step_copy_backup.cc:131 : Old package context saved to: "/opt/usr/home/owner/apps_rw/org.example.tzresources.bck" +I/APP_INSTALLERS( 1433): | INFO | CopyBackup : step_copy_backup.cc:190 : Successfully move: "/opt/usr/home/owner/apps_rw/unpack-ff1ccd" to: "/opt/usr/home/owner/apps_rw/org.example.tzresources" directory +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=58 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=58 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=61 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=61 +W/APP_INSTALLERS( 1433): | WARNING | : file_util.cc:256 : Cannot move directory: "/opt/usr/home/owner/apps_rw/org.example.tzresources.bck/shared". Will copy/remove... +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=64 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=64 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=67 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=67 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=70 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=70 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=74 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=74 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=77 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=77 +I/APP_INSTALLERS( 1433): | INFO | : security_registration.cc:139 : install_type(1) +D/APP_INSTALLERS( 1433): | DEBUG | UpdateSecurity : step_update_security.cc:35 : Security context updated +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=80 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=80 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=83 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=83 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=87 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=87 +I/APP_INSTALLERS( 1433): | INFO | UpdateApplication : step_update_app.cc:38 : Successfully install the application +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=90 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=90 +I/APP_INSTALLERS( 1433): | INFO | : plugin_xml_parser.cc:29 : Xml path: "/opt/usr/home/owner/.applications/manifest/org.example.tzresources.xml" +I/APP_INSTALLERS( 1433): | INFO | : plugin_list_parser.cc:142 : Plugin list path: "/usr/share/app-installers/plugins_list.txt" +D/APP_INSTALLERS( 1433): | DEBUG | : plugin_manager.cc:62 : Loading pkgmgr plugins... +D/APP_INSTALLERS( 1433): | DEBUG | : plugin_manager.cc:123 : Running pkgmgr plugins... +I/APP_INSTALLERS( 1433): | INFO | RunParserPlugin : step_run_parser_plugins.cc:32 : Processing plugins done +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=93 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=93 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=96 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=96 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=install_percent VALUE=100 +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=install_percent VALUE=100 +D/APP_INSTALLERS( 1433): | DEBUG | : recovery_file.cc:107 : Recovery file "/opt/usr/home/owner/apps_rw/recovery-f22f1e" removed +D/APP_INSTALLERS( 1433): | DEBUG | BackupManifest : step_backup_manifest.cc:56 : Manifest backup removed +D/APP_INSTALLERS( 1433): | DEBUG | BackupIcons : step_backup_icons.cc:63 : Icons backup removed +D/APP_INSTALLERS( 1433): | DEBUG | CopyBackup : step_copy_backup.cc:68 : Applications files backup directory removed +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:186 : Success to send pkgmgr signal PKGID=org.example.tzresources KEY=end VALUE=ok +D/APP_INSTALLERS( 1433): | DEBUG | : pkgmgr_signal.cc:211 : Success to send pkgmgr signal USER=5001 PKGID=org.example.tzresources KEY=end VALUE=ok +---- + + +=== /opt/usr/share/zoninfo === + +1. create the dir in R/W area + +---- +sh-3.2# ls -alh +total 288K +drwxrwxrwx 20 root root 4.0K Dec 16 13:05 . +drwxr-xr-x 6 root root 4.0K Dec 16 13:04 .. +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Africa +drwxr--r-- 6 app_fw app_fw 4.0K Nov 16 10:59 America +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Antarctica +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Arctic +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Asia +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Atlantic +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Australia +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Brazil +-rw-r--r-- 2 app_fw app_fw 2.1K Nov 16 10:58 CET +-rw-r--r-- 2 app_fw app_fw 2.3K Nov 16 10:58 CST6CDT +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Canada +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Chile +-rw-r--r-- 4 app_fw app_fw 2.4K Nov 16 10:58 Cuba +-rw-r--r-- 2 app_fw app_fw 1.9K Nov 16 10:58 EET +-rw-r--r-- 2 app_fw app_fw 127 Nov 16 10:58 EST +-rw-r--r-- 2 app_fw app_fw 2.3K Nov 16 10:58 EST5EDT +-rw-r--r-- 4 app_fw app_fw 2.0K Nov 16 10:58 Egypt +-rw-r--r-- 4 app_fw app_fw 3.5K Nov 16 10:58 Eire +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Etc +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Europe +-rw-r--r-- 2 app_fw app_fw 148 Nov 16 10:58 Factory +-rw-r--r-- 14 app_fw app_fw 3.7K Nov 16 10:58 GB +-rw-r--r-- 14 app_fw app_fw 3.7K Nov 16 10:58 GB-Eire +-rw-r--r-- 20 app_fw app_fw 127 Nov 16 10:58 GMT +-rw-r--r-- 20 app_fw app_fw 127 Nov 16 10:58 GMT+0 +-rw-r--r-- 20 app_fw app_fw 127 Nov 16 10:58 GMT-0 +-rw-r--r-- 20 app_fw app_fw 127 Nov 16 10:58 GMT0 +-rw-r--r-- 20 app_fw app_fw 127 Nov 16 10:58 Greenwich +-rw-r--r-- 2 app_fw app_fw 128 Nov 16 10:58 HST +-rw-r--r-- 4 app_fw app_fw 1.2K Nov 16 10:58 Hongkong +-rw-r--r-- 4 app_fw app_fw 1.2K Nov 16 10:58 Iceland +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Indian +-rw-r--r-- 4 app_fw app_fw 1.7K Nov 16 10:58 Iran +-rw-r--r-- 6 app_fw app_fw 2.3K Nov 16 10:58 Israel +-rw-r--r-- 4 app_fw app_fw 507 Nov 16 10:58 Jamaica +-rw-r--r-- 4 app_fw app_fw 355 Nov 16 10:58 Japan +-rw-r--r-- 4 app_fw app_fw 237 Nov 16 10:58 Kwajalein +-rw-r--r-- 4 app_fw app_fw 655 Nov 16 10:58 Libya +-rw-r--r-- 2 app_fw app_fw 2.1K Nov 16 10:58 MET +-rw-r--r-- 2 app_fw app_fw 127 Nov 16 10:58 MST +-rw-r--r-- 2 app_fw app_fw 2.3K Nov 16 10:58 MST7MDT +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Mexico +-rw-r--r-- 8 app_fw app_fw 2.5K Nov 16 10:58 NZ +-rw-r--r-- 4 app_fw app_fw 2.1K Nov 16 10:58 NZ-CHAT +-rw-r--r-- 8 app_fw app_fw 2.4K Nov 16 10:58 Navajo +-rw-r--r-- 10 app_fw app_fw 414 Nov 16 10:58 PRC +-rw-r--r-- 2 app_fw app_fw 2.3K Nov 16 10:58 PST8PDT +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 Pacific +-rw-r--r-- 4 app_fw app_fw 2.7K Nov 16 10:58 Poland +-rw-r--r-- 4 app_fw app_fw 3.4K Nov 16 10:58 Portugal +-rw-r--r-- 4 app_fw app_fw 800 Nov 16 10:58 ROC +-rw-r--r-- 4 app_fw app_fw 571 Nov 16 10:58 ROK +-rw-r--r-- 4 app_fw app_fw 428 Nov 16 10:58 Singapore +-rw-r--r-- 6 app_fw app_fw 2.2K Nov 16 10:58 Turkey +-rw-r--r-- 4 app_fw app_fw 127 Nov 16 10:58 UCT +-rw-r--r-- 1 app_fw app_fw 0 Dec 16 13:05 UPDATED.txt +drwxr--r-- 2 app_fw app_fw 4.0K Nov 16 10:59 US +-rw-r--r-- 13 app_fw app_fw 127 Nov 16 10:58 UTC +-rw-r--r-- 13 app_fw app_fw 127 Nov 16 10:58 Universal +-rw-r--r-- 4 app_fw app_fw 1.6K Nov 16 10:58 W-SU +-rw-r--r-- 2 app_fw app_fw 1.9K Nov 16 10:58 WET +-rw-r--r-- 13 app_fw app_fw 127 Nov 16 10:58 Zulu +-rw-r--r-- 1 app_fw app_fw 4.4K Nov 16 10:58 iso3166.tab +drwxr--r-- 18 app_fw app_fw 4.0K Nov 16 10:59 posix +lrwxrwxrwx 1 app_fw app_fw 14 Dec 16 13:05 posixrules -> /etc/localtime +drwxr--r-- 18 app_fw app_fw 4.0K Nov 16 10:59 right +-rw-r--r-- 1 app_fw app_fw 19K Nov 16 10:58 zone.tab +---- + + +=== Setting > time change > error === +---- +sh-3.2# D/SETTING (27558): setting-time-main.c: setting_time_main_mouse_up_Gendial_list_cb(1483) > [SECURE_LOG] ENTER FUNCTION: setting_time_main_mouse_up_Gendial_list_cb. +I/SETTING (27558): setting-time-main.c: setting_time_main_mouse_up_Gendial_list_cb(1495) > [SECURE_LOG] clicking item[Time zone] +D/SETTING (27558): setting-time-main.c: setting_time_check_automatic_time_update_state(1151) > [SECURE_LOG] ENTER FUNCTION: setting_time_check_automatic_time_update_state. +D/SETTING (27558): setting-time-main.c: setting_time_main_launch_worldclock_sg(1260) > [SECURE_LOG] ENTER FUNCTION: setting_time_main_launch_worldclock_sg. +I/SETTING (27558): setting-common-general-func.c: app_launcher_svc(1896) > [SECURE_LOG] app path - org.tizen.worldclock-efl +I/SETTING (27558): setting-common-general-func.c: app_launcher_svc(1899) > [SECURE_LOG] service name - org.tizen.worldclock-efl +I/SETTING (27558): setting-common-general-func.c: app_launcher_svc(1902) > [SECURE_LOG] after app_service_create - org.tizen.worldclock-efl : Successful +I/SETTING (27558): setting-common-general-func.c: app_launcher_svc(1905) > [SECURE_LOG] on success +D/SETTING (27558): setting-time-main.c: ___time_freeze_event_timer_cb(1183) > [SECURE_LOG] ENTER FUNCTION: ___time_freeze_event_timer_cb. +sh-3.2# D/SETTING (27558): setting-time-main.c: _worldclock_reply_cb(1195) > [SECURE_LOG] ENTER FUNCTION: _worldclock_reply_cb. +I/SETTING (27558): setting-time-main.c: _worldclock_reply_cb(1211) > [SECURE_LOG] tzpath : America/Anchorage +I/SETTING (27558): setting-time-main.c: _worldclock_reply_cb(1213) > [SECURE_LOG] city : IDS_WCL_BODY_CITYNAME_ANCHORAGE +I/SETTING (27558): setting-time-main.c: _worldclock_reply_cb(1217) > [SECURE_LOG] tzpath:(America/Anchorage) +D/SETTING (27558): setting-time-main.c: _set_timezone_helper(213) > [SECURE_LOG] ENTER FUNCTION: _set_timezone_helper. +I/SETTING (27558): setting-time-main.c: _set_timezone_helper(214) > [SECURE_LOG] = America/Anchorage +I/SETTING (27558): setting-time-main.c: _set_timezone_helper(217) > [SECURE_LOG] system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE) = -22, . +I/SETTING (27558): setting-time-main.c: _worldclock_reply_cb(1221) > [SECURE_LOG] tzpath is not valid. +---- + +Device +---- +sh-3.2# D/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1197) > [SECURE_LOG] ENTER FUNCTION: _worldclock_reply_cb. +I/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1213) > [SECURE_LOG] tzpath : America/Guayaquil +I/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1215) > [SECURE_LOG] city : IDS_WCL_BODY_CITYNAME_QUITO +I/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1219) > [SECURE_LOG] tzpath:(America/Guayaquil) +D/SETTING ( 1766): setting-time-main.c: _set_timezone_helper(213) > [SECURE_LOG] ENTER FUNCTION: _set_timezone_helper. +I/SETTING ( 1766): setting-time-main.c: _set_timezone_helper(214) > [SECURE_LOG] = America/Guayaquil +I/SETTING ( 1766): setting-time-main.c: _set_timezone_helper(217) > [SECURE_LOG] system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE) = 0, . +I/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1231) > [SECURE_LOG] _set_timezone_helper - successful : America/Guayaquil +I/SETTING ( 1766): +D/SETTING ( 1766): setting-time-main.c: get_gmt_offset(1601) > [SECURE_LOG] DEBUG: szTimezone is of a valid format: GMT: +9:00 +D/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1666) > [SECURE_LOG] ENTER FUNCTION: get_timezone_displayname. +D/SETTING ( 1766): setting-time-main.c: get_timezone_str(1611) > [SECURE_LOG] ENTER FUNCTION: get_timezone_str. +I/SETTING ( 1766): setting-time-main.c: ICU_set_timezone(1571) > [SECURE_LOG] ICU_set_timezone = America/Guayaquil +I/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1716) > [SECURE_LOG] *************************** timezone : G, GMT-05:00 +D/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1721) > [SECURE_LOG] EXIT FUNCTION: get_timezone_displayname. +D/SETTING ( 1766): setting-time-main.c: get_gmt_offset(1601) > [SECURE_LOG] DEBUG: szTimezone is of a valid format: GMT: +9:00 +I/SETTING ( 1766): setting-time-main.c: setting_update_timezone(157) > [SECURE_LOG] ad->data_tz:0xb8905640 +D/SETTING ( 1766): setting-time-main.c: _worldclock_reply_cb(1257) > [SECURE_LOG] EXIT FUNCTION: _worldclock_reply_cb. +D/SETTING ( 1766): setting-time-main.c: time_changed_callback(119) > [SECURE_LOG] DEBUG: time and timezone have been changed: TIME_CHANGED_HEYNOTY_CALLBACK +I/SETTING ( 1766): setting-time-main.c: system_settings_changed_timezone(85) > [SECURE_LOG] >>>>>>>> NOTIFY CHANGE TIMEZONE +I/SETTING ( 1766): setting-time-main.c: system_settings_changed_timezone(95) > [SECURE_LOG] timezone : (America/Guayaquil) +I/SETTING ( 1766): setting-time-main.c: ICU_set_timezone(1571) > [SECURE_LOG] ICU_set_timezone = America/Guayaquil +D/SETTING ( 1766): setting-time-main.c: get_gmt_offset(1601) > [SECURE_LOG] DEBUG: szTimezone is of a valid format: GMT: -5:00 +D/SETTING ( 1766): setting-time-main.c: time_changed_callback(119) > [SECURE_LOG] DEBUG: time and timezone have been changed: TIME_CHANGED_HEYNOTY_CALLBACK +D/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1666) > [SECURE_LOG] ENTER FUNCTION: get_timezone_displayname. +D/SETTING ( 1766): setting-time-main.c: get_timezone_str(1611) > [SECURE_LOG] ENTER FUNCTION: get_timezone_str. +I/SETTING ( 1766): setting-time-main.c: ICU_set_timezone(1571) > [SECURE_LOG] ICU_set_timezone = America/Guayaquil +I/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1716) > [SECURE_LOG] *************************** timezone : G, GMT-05:00 +D/SETTING ( 1766): setting-time-main.c: get_timezone_displayname(1721) > [SECURE_LOG] EXIT FUNCTION: get_timezone_displayname. +D/SETTING ( 1766): setting-time-main.c: get_gmt_offset(1601) > [SECURE_LOG] DEBUG: szTimezone is of a valid format: GMT: -5:00 +I/SETTING ( 1766): setting-time-main.c: setting_update_timezone(157) > [SECURE_LOG] ad->data_tz:0xb8905640 +D/SETTING ( 1766): setting-time-main.c: setting_update_datefield_cb(1354) > [SECURE_LOG] ENTER FUNCTION: setting_update_datefield_cb. +---- diff --git a/packaging/tzdata-update-parser.manifest b/packaging/tzdata-update-parser.manifest new file mode 100644 index 0000000..a76fdba --- /dev/null +++ b/packaging/tzdata-update-parser.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/tzdata-update-parser.spec b/packaging/tzdata-update-parser.spec new file mode 100644 index 0000000..40b0601 --- /dev/null +++ b/packaging/tzdata-update-parser.spec @@ -0,0 +1,58 @@ +Name: tzdata-update-parser +Summary: tzdata downloadable update +Version: 1.0.0 +Release: 1 +Group: Base/Package Management +License: Apache-2.0 +Source0: %{name}-%{version}.tar.gz +Source1001: tzdata-update-parser.manifest +BuildRequires: cmake, gettext-tools, smack, coreutils +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(fontconfig) +BuildRequires: pkgconfig(capi-system-system-settings) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(pkgmgr-info) +BuildRequires: pkgconfig(pkgmgr-installer) + +%description +tzdata downloadable update. + +%prep +%setup -q +cp %{SOURCE1001} . + +%build +%if 0%{?sec_build_binary_debug_enable} +export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE" +export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" +export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" +%endif +%if 0%{?tizen_build_binary_release_type_eng} +export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE" +export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE" +export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE" +%endif +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} + +#CFLAGS="${CFLAGS} -Wall -Winline -Werror" LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs} +CFLAGS="${CFLAGS} -Wall -Winline " LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs} + +%install +rm -rf %{buildroot} +%make_install + +mkdir -p %{buildroot}%{_tmpfilesdir} + +%post +mkdir -p /opt/usr/share/zoneinfo +chmod 777 /opt/usr/share/zoneinfo +chmod +x /etc/package-manager/parserlib/worker.sh +chown owner:users /etc/package-manager/parserlib/worker.sh + + +%files -n tzdata-update-parser +%manifest tzdata-update-parser.manifest +%defattr(-,root,root,-) +/etc/package-manager/parserlib/category/* +/etc/package-manager/parserlib/worker.sh + diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..eed980b --- /dev/null +++ b/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +SDB=/usr/bin/sdb +$SDB push test/plugins_list.txt /usr/share/app-installers diff --git a/test/plugins_list.txt b/test/plugins_list.txt new file mode 100644 index 0000000..23e5f40 --- /dev/null +++ b/test/plugins_list.txt @@ -0,0 +1,24 @@ +flag="0x00000001";type="tag";name="shortcut-list";path="/etc/package-manager/parserlib/libshortcut-list.so" +flag="0x00000002";type="tag";name="account";path="/etc/package-manager/parserlib/libaccount.so" +flag="0x00000004";type="tag";name="notifications";path="/etc/package-manager/parserlib/libnotifications.so" +flag="0x00000008";type="tag";name="privileges";path="/etc/package-manager/parserlib/libprivileges.so" +flag="0x00000010";type="tag";name="ime";path="/etc/package-manager/parserlib/libime.so" +flag="0x00000020";type="category";name="http://tizen.org/category/downloadable_font";path="/etc/package-manager/parserlib/category/libdownloadable_font.so" +flag="0x00000040";type="metadata";name="http://developer.samsung.com/tizen/metadata/sticker";path="/etc/package-manager/parserlib/metadata/libsticker.so" +flag="0x00000080";type="metadata";name="http://developer.samsung.com/tizen/metadata/ttsengine";path="/etc/package-manager/parserlib/metadata/libttsengine.so" +flag="0x00000100";type="metadata";name="http://developer.samsung.com/tizen/metadata/downloadable_filters";path="/etc/package-manager/parserlib/metadata/libdownloadable_filters.so" +flag="0x00000200";type="metadata";name="http://developer.samsung.com/tizen/metadata/dictionary";path="/etc/package-manager/parserlib/metadata/libdictionary.so" +flag="0x00000400";type="category";name="http://tizen.org/category/antivirus";path="/etc/package-manager/parserlib/category/libantivirus.so" +flag="0x00000800";type="metadata";name="http://developer.samsung.com/tizen/metadata/profile";path="/etc/package-manager/parserlib/metadata/libtheme.so" +flag="0x00001000";type="category";name="http://tizen.org/category/tts";path="/etc/package-manager/parserlib/category/libsamsung_tts.so" +flag="0x00002000";type="tag";name="livebox";path="/etc/package-manager/parserlib/liblivebox.so" +flag="0x00004000";type="tag";name="watch-application";path="/etc/package-manager/parserlib/libwatch-application.so" +flag="0x00008000";type="tag";name="widget-application";path="/etc/package-manager/parserlib/libwidget-application.so" +flag="0x00010000";type="metadata";name="http://tizen.org/metadata/nfc_cardemulation";path="/usr/etc/package-manager/parserlib/metadata/libcardemulation_plugin.so" +flag="0x00020000";type="metadata";name="http://developer.samsung.com/tizen/metadata/useese";path="/usr/etc/package-manager/parserlib/metadata/libuseese_plugin.so" +flag="0x00040000";type="tag";name="app-context";path="/etc/package-manager/parserlib/libapp-context.so" +flag="0x00080000";type="metadata";name="http://tizen.org/metadata/stt-engine";path="/etc/package-manager/parserlib/metadata/libstt-engine-parser.so" +flag="0x00100000";type="metadata";name="http://tizen.org/metadata/tts-engine";path="/etc/package-manager/parserlib/metadata/libtts-engine-parser.so" +flag="0x00200000";type="metadata";name="http://tizen.org/metadata/aliasappid";path="/etc/package-manager/parserlib/metadata/libaul-parser.so" +flag="0x00400000";type="metadata";name="http://tizen.org/metadata/allowedappid";path="/etc/package-manager/parserlib/metadata/libaul-parser.so" +flag="0x01000000";type="category";name="http://tizen.org/category/tzdata";path="/etc/package-manager/parserlib/category/libtzdata-update-parser.so" diff --git a/tzdata-parser/CMakeLists.txt b/tzdata-parser/CMakeLists.txt new file mode 100755 index 0000000..0d0688e --- /dev/null +++ b/tzdata-parser/CMakeLists.txt @@ -0,0 +1,26 @@ +PROJECT(tzdata-update-parser C) + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/tzdata-parser/include) + +INCLUDE(FindPkgConfig) +pkg_check_modules(bin_pkgs REQUIRED dlog pkgmgr-info pkgmgr-installer) + +FOREACH(flag ${bin_pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Wall ") + +ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") + +ADD_LIBRARY(${PROJECT_NAME} SHARED + src/tzdata-update-parser.c +) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${bin_pkgs_LDFLAGS}) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION "/etc/package-manager/parserlib/category") +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION "/etc/package-manager/parserlib/category") +INSTALL(FILES ${CMAKE_SOURCE_DIR}/tzdata-parser/src/worker.sh DESTINATION "/etc/package-manager/parserlib/") +#/etc/package-manager/parserlib/worker.sh +# End of a file diff --git a/tzdata-parser/src/tzdata-update-parser.c b/tzdata-parser/src/tzdata-update-parser.c new file mode 100755 index 0000000..81559d7 --- /dev/null +++ b/tzdata-parser/src/tzdata-update-parser.c @@ -0,0 +1,281 @@ +/* + * Copyright 2013 Samsung Electronics Co., Ltd + * + * + * Contact: Minsu Seo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#define WORKER "/etc/package-manager/parserlib/worker.sh" + + +#define TZDATA_UPDATE_PARSER_TAG "TZDATA_UPDATE_PARSER" + +#define DEBUG_LOG(frmt, args...) \ + do { SLOG(LOG_DEBUG,TZDATA_UPDATE_PARSER_TAG, "[tzdata_update_parser] %s: "frmt"\n",\ + __func__, ##args);} while (0) + +#define DEBUG_WARNING(frmt, args...) \ + do { SLOG(LOG_WARN,TZDATA_UPDATE_PARSER_TAG, "[tzdata_update_parser] %s: "frmt"\n",\ + __func__, ##args);} while (0) + +#define DEBUG_ERROR(frmt, args...) \ + do { SLOG(LOG_ERROR,TZDATA_UPDATE_PARSER_TAG, "[tzdata_update_parser] %s: "frmt"\n",\ + __func__, ##args);} while (0) + +#define TRACE_BEGIN do {\ + SLOG(LOG_DEBUG,TZDATA_UPDATE_PARSER_TAG, "[ENTER tzdata_update_parser] %s\n",\ + __func__);} while (0) + +#define TRACE_END do {\ + SLOG(LOG_DEBUG,TZDATA_UPDATE_PARSER_TAG, "[LEAVE tzdata_update_parser] %s\n",\ + __func__);} while (0) + + +static void alt_system() +{ + pid_t pid; + int status; + pid_t ret = -10000; + //char *const args[2] = {"/home/mjpark", NULL}; + //char **env; + //extern char **environ; + /* ... Sanitize arguments ... */ + pid = fork(); + if (pid == -1) { + /* Handle error */ + } else if (pid != 0) { + while ((ret = waitpid(pid, &status, 0)) == -1) { + if (errno != EINTR) { + /* Handle error */ + break; + } + } + if ((ret != -1) && + (!WIFEXITED(status) || !WEXITSTATUS(status)) ) { + /* Report unexpected child status */ + } + DEBUG_LOG(" ----> parent ? : %d ", ret); + + } else { + /* ... Initialize env as a sanitized copy of environ ... */ + //ret = execl("/home/mjpark/cprog/dir_copy/work.sh", "work.sh", (char *)0); + //if (execve("/bin/ls", args, env) == -1) { + //ret = execl("/bin/ls", "-1", (char *)0); + DEBUG_LOG(" ------------> run execl: %s ", WORKER); + ret = execl("/bin/bash", "bash", "-c", WORKER, (char *) NULL); + if (ret) { + /* Handle error */ + DEBUG_LOG("error occured : %s", WORKER); + printf("error occured\n"); + _Exit(127); + } else { + DEBUG_LOG("run OK !!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + } + } +} + +//DEBUG_ERROR("srcdir length is not available \n"); +//DEBUG_LOG("srcdir =%s\n",(char *) srcdir); +int COMMON_PKGMGR_PLUGIN_INSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + int ret; + pkgmgrinfo_pkginfo_h handle = NULL; + const char *app_root_path = NULL; + //const char *dest_path = NULL; + uid_t uid = 0; + + pkgmgr_installer_info_get_target_uid(&uid); + ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle); + + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] handle get fail", pkgid); + return -1; + } + + ret = pkgmgrinfo_pkginfo_get_root_path(handle, (char **)&app_root_path); + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] path get fail", pkgid); + goto FAIL; + } + + if (appid == NULL) + { + DEBUG_ERROR("appid is NULL \n"); + goto FAIL; + } + + + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return ret; + +FAIL: + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return -1; +} + + +int COMMON_PKGMGR_PLUGIN_UPGRADE(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + int ret = 0; + pkgmgrinfo_pkginfo_h handle = NULL; + const char* app_root_path = NULL; + //const char* dest_path = NULL; + uid_t uid = 0; + + pkgmgr_installer_info_get_target_uid(&uid); + ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle); + + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] handle get fail", pkgid); + return -1; + } + + ret = pkgmgrinfo_pkginfo_get_root_path(handle, (char **)&app_root_path); + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] path get fail", pkgid); + goto FAIL; + } + + if (appid == NULL) + { + DEBUG_ERROR("appid is NULL \n"); + goto FAIL; + } + + DEBUG_LOG("-----------------------------------------------------"); + DEBUG_LOG("pkgid : %s ", pkgid); + DEBUG_LOG("APP root path : %s ", app_root_path); + DEBUG_LOG("-----------------------------------------------------"); + // RUN SCRIPT HERE + alt_system(); + DEBUG_LOG("-----------------------------------------------------"); + + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return ret; + +FAIL: + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return -1; +} + + + +int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + pkgmgrinfo_pkginfo_h handle = NULL; + const char* app_root_path = NULL; + //const char *dest_path = NULL; + int ret; + uid_t uid = 0; + + if (appid == NULL) + { + DEBUG_ERROR("appid is NULL \n"); + return -1; + } + + pkgmgr_installer_info_get_target_uid(&uid); + ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle); + + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] handle get fail", pkgid); + return -1; + } + + ret = pkgmgrinfo_pkginfo_get_root_path(handle, (char **)&app_root_path); + if (ret < 0) + { + DEBUG_ERROR("pkgid[%s] path get fail", pkgid); + goto FAIL; + } + + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return ret; + +FAIL: + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + TRACE_END; + return -1; +} + +#if USE_META_DATA +int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_INSTALL(pkgid, appid, list); +} + +int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_UPGRADE(pkgid, appid, list); +} + +int PKGMGR_MDPARSER_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_UNINSTALL(pkgid, appid, list); +} +#endif + +int PKGMGR_CATEGORY_PARSER_PLUGIN_INSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_INSTALL(pkgid, appid, list); +} + +int PKGMGR_CATEGORY_PARSER_PLUGIN_UPGRADE(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_UPGRADE(pkgid, appid, list); +} + +int PKGMGR_CATEGORY_PARSER_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *list) +{ + TRACE_BEGIN; + return COMMON_PKGMGR_PLUGIN_UNINSTALL(pkgid, appid, list); +} + + +/* End of a file */ -- 2.7.4 From 448b0686d45d9f4e43f2c8e365b556bb295eeaf7 Mon Sep 17 00:00:00 2001 From: MyoungJune Park Date: Wed, 28 Dec 2016 19:31:59 +0900 Subject: [PATCH 4/9] add worker script Change-Id: Id0aff9c54fab056389b93428514f6a54422b01a4 --- tzdata-parser/src/worker.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 tzdata-parser/src/worker.sh diff --git a/tzdata-parser/src/worker.sh b/tzdata-parser/src/worker.sh new file mode 100755 index 0000000..81986a6 --- /dev/null +++ b/tzdata-parser/src/worker.sh @@ -0,0 +1,4 @@ +#!/bin/bash +#mkdir -p /opt/usr/share/zoneinfo +tar -xvzf /opt/usr/home/owner/apps_rw/org.example.tzresources/res/zoneinfo.tar.gz -C /opt/usr/share/zoneinfo +touch /opt/usr/share/zoneinfo/UPDATED.txt -- 2.7.4 From 0929c696fedf43cc23c0c68fa4d75c5ccd492a79 Mon Sep 17 00:00:00 2001 From: MyoungJune Park Date: Wed, 28 Dec 2016 19:31:59 +0900 Subject: [PATCH 5/9] add worker script Change-Id: Id0aff9c54fab056389b93428514f6a54422b01a4 --- tzdata-parser/src/worker.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 tzdata-parser/src/worker.sh diff --git a/tzdata-parser/src/worker.sh b/tzdata-parser/src/worker.sh new file mode 100755 index 0000000..81986a6 --- /dev/null +++ b/tzdata-parser/src/worker.sh @@ -0,0 +1,4 @@ +#!/bin/bash +#mkdir -p /opt/usr/share/zoneinfo +tar -xvzf /opt/usr/home/owner/apps_rw/org.example.tzresources/res/zoneinfo.tar.gz -C /opt/usr/share/zoneinfo +touch /opt/usr/share/zoneinfo/UPDATED.txt -- 2.7.4 From f91b065dcaec9fae194a9e8352885ebd799da3d6 Mon Sep 17 00:00:00 2001 From: MyoungJune Park Date: Tue, 3 Jan 2017 14:38:36 +0900 Subject: [PATCH 6/9] add PATH in worker.sh for security Change-Id: I561b9f336b902b207933f3780529567ad9a86019 --- tzdata-parser/src/worker.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tzdata-parser/src/worker.sh b/tzdata-parser/src/worker.sh index 81986a6..e67fc62 100755 --- a/tzdata-parser/src/worker.sh +++ b/tzdata-parser/src/worker.sh @@ -1,4 +1,6 @@ #!/bin/bash +PATH="/usr/bin:/bin:/usr/sbin:/sbin" + #mkdir -p /opt/usr/share/zoneinfo tar -xvzf /opt/usr/home/owner/apps_rw/org.example.tzresources/res/zoneinfo.tar.gz -C /opt/usr/share/zoneinfo touch /opt/usr/share/zoneinfo/UPDATED.txt -- 2.7.4 From 9bf2b830851789bf8f58048cfefc3658e612cf43 Mon Sep 17 00:00:00 2001 From: MyoungJune Park Date: Tue, 31 Jan 2017 13:59:29 +0900 Subject: [PATCH 7/9] change smack rule at the dest dir Change-Id: I4f43c69b6b95a2af1e7bb3798403b24d0819de49 --- tzdata-parser/src/worker.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tzdata-parser/src/worker.sh b/tzdata-parser/src/worker.sh index e67fc62..a51cda5 100755 --- a/tzdata-parser/src/worker.sh +++ b/tzdata-parser/src/worker.sh @@ -3,4 +3,5 @@ PATH="/usr/bin:/bin:/usr/sbin:/sbin" #mkdir -p /opt/usr/share/zoneinfo tar -xvzf /opt/usr/home/owner/apps_rw/org.example.tzresources/res/zoneinfo.tar.gz -C /opt/usr/share/zoneinfo +chsmack -a "_" /opt/usr/share/zoneinfo/* -r touch /opt/usr/share/zoneinfo/UPDATED.txt -- 2.7.4 From 1b1f97949348a8466e36abfa8e65ebe260f7607b Mon Sep 17 00:00:00 2001 From: MyoungJune Park Date: Wed, 8 Feb 2017 10:48:54 +0900 Subject: [PATCH 8/9] change smack rule "_" to "System::Shared" Change-Id: Ib7f0fe4fc227423a9c07b0793c5665ba6e7f6098 --- packaging/tzdata-update-parser.spec | 6 ++++++ tzdata-parser/src/worker.sh | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packaging/tzdata-update-parser.spec b/packaging/tzdata-update-parser.spec index 40b0601..58fff24 100644 --- a/packaging/tzdata-update-parser.spec +++ b/packaging/tzdata-update-parser.spec @@ -46,6 +46,12 @@ mkdir -p %{buildroot}%{_tmpfilesdir} %post mkdir -p /opt/usr/share/zoneinfo chmod 777 /opt/usr/share/zoneinfo +chsmack -a "System::Shared" -t /opt/usr/share/zoneinfo +mkdir -p /opt/usr/share/icu_tzdata +chmod 777 /opt/usr/share/icu_tzdata +chsmack -a "System::Shared" -t /opt/usr/share/icu_tzdata + +chmod 777 /opt/usr/share/zoneinfo chmod +x /etc/package-manager/parserlib/worker.sh chown owner:users /etc/package-manager/parserlib/worker.sh diff --git a/tzdata-parser/src/worker.sh b/tzdata-parser/src/worker.sh index a51cda5..31df21a 100755 --- a/tzdata-parser/src/worker.sh +++ b/tzdata-parser/src/worker.sh @@ -1,7 +1,6 @@ #!/bin/bash PATH="/usr/bin:/bin:/usr/sbin:/sbin" -#mkdir -p /opt/usr/share/zoneinfo tar -xvzf /opt/usr/home/owner/apps_rw/org.example.tzresources/res/zoneinfo.tar.gz -C /opt/usr/share/zoneinfo -chsmack -a "_" /opt/usr/share/zoneinfo/* -r +tar -xvzf /opt/usr/home/owner/apps_rw/org.example.tzresources/res/icu_data_tzdata.tar.gz -C /opt/usr/share/icu_tzdata touch /opt/usr/share/zoneinfo/UPDATED.txt -- 2.7.4 From af1ca978bd327a26b3332f78d3280e64b5ffcc26 Mon Sep 17 00:00:00 2001 From: MyoungJune Park Date: Tue, 4 Apr 2017 13:01:16 +0900 Subject: [PATCH 9/9] add license file Change-Id: I957d7f4f8449e3e53e54bbec259a871bdaa94d53 --- packaging/tzdata-update-parser.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/tzdata-update-parser.spec b/packaging/tzdata-update-parser.spec index 58fff24..dc4ed4b 100644 --- a/packaging/tzdata-update-parser.spec +++ b/packaging/tzdata-update-parser.spec @@ -59,6 +59,7 @@ chown owner:users /etc/package-manager/parserlib/worker.sh %files -n tzdata-update-parser %manifest tzdata-update-parser.manifest %defattr(-,root,root,-) +%license LICENSE /etc/package-manager/parserlib/category/* /etc/package-manager/parserlib/worker.sh -- 2.7.4