Merge "Add robustness to mkdir" into tizen protex_M14.4 accepted/tizen/common/20141103.141400 accepted/tizen/ivi/20141112.110521 protex_M14.4 submit/tizen_common/20141031.164224 submit/tizen_ivi/20141111.000000 submit/tizen_mobile/20141119.000000 submit/tizen_mobile/20141120.000000
authorBaptiste DURAND <baptiste.durand@open.eurogiciel.org>
Fri, 31 Oct 2014 16:41:29 +0000 (09:41 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Fri, 31 Oct 2014 16:41:29 +0000 (09:41 -0700)
CMakeLists.txt
packaging/ail.spec
src/ail_db.c
src/ail_db.h
src/ail_desktop.c
src/ail_package.c
tool/src/initdb_user.c

index dd55024..0199c7d 100644 (file)
@@ -2,10 +2,6 @@
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(ail C)
-OPTION(SMACK "Enable smack support" ON)
-IF(SMACK)
-    ADD_DEFINITIONS("-DWRT_SMACK_ENABLED")  # enable smack
-ENDIF(SMACK)
 SET(LIBNAME "lib${PROJECT_NAME}")
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(BINDIR "${PREFIX}/bin")
@@ -33,12 +29,12 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 
 INCLUDE(FindPkgConfig)
 
-pkg_check_modules(LDPC REQUIRED libtzplatform-config libsmack)
+pkg_check_modules(LDPC REQUIRED libtzplatform-config)
 FOREACH(flag ${LDPC_LIBRARIES})
        SET(PC_LIB "${PC_LIB} -l${flag}")
 ENDFOREACH(flag)
 
-pkg_check_modules(LPKGS REQUIRED glib-2.0 sqlite3 dlog db-util xdgmime vconf libtzplatform-config)
+pkg_check_modules(LPKGS REQUIRED glib-2.0 sqlite3 dlog db-util xdgmime vconf libtzplatform-config libsmack)
 STRING(REPLACE ";" " " EXTRA_CFLAGS "${LPKGS_CFLAGS}")
 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
 
index 177a9d8..2a5ce8a 100755 (executable)
@@ -16,7 +16,6 @@ BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(xdgmime)
 BuildRequires:  pkgconfig(libtzplatform-config)
 Provides:       libail = %{version}-%{release}
-Requires:              libcap-tools
 
 %description
 Application Information Library package
@@ -25,7 +24,7 @@ Application Information Library package
 Summary:        Application Information Library Development files
 Requires:       libail = %{version}-%{release}
 Requires:       pkgconfig(libtzplatform-config)
-Requires:              pkgconfig(libsmack)
+Requires:       pkgconfig(libsmack)
 
 %description devel
 Application Information Library Development files package
@@ -35,7 +34,7 @@ Application Information Library Development files package
 cp %{SOURCE1001} .
 
 %build
-CFLAGS+=" -fpic"
+CFLAGS="$CFLAGS -fpic"
 
 %if 0%{?tizen_build_binary_release_type_eng}
 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
@@ -44,8 +43,7 @@ export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
 %endif
 
 %cmake .  -DTZ_SYS_RW_DESKTOP_APP=%TZ_SYS_RW_DESKTOP_APP \
-          -DBUILD_PKGTYPE=rpm \
-                 -DSMACK=Off
+          -DBUILD_PKGTYPE=rpm
 
 %__make %{?_smp_mflags}
 
@@ -57,8 +55,8 @@ ldconfig
 # Create tizenglobalapp user needed for global installation
 useradd -d %TZ_SYS_RW_APP -m %TZ_SYS_GLOBALAPP_USER -r -c "system user for common applications" -g root
 
-#mkdir -p %TZ_SYS_RW_APP/.config/xwalk-service/applications
-#cd %TZ_SYS_RW_APP/
+#mkdir -p %%TZ_SYS_RW_APP/.config/xwalk-service/applications
+#cd %%TZ_SYS_RW_APP/
 #ln -s .config/xwalk-service/applications/
 
 vconftool set -t string db/ail/ail_info "0" -f -s system::vconf_inhouse
index 060d0ca..462c545 100755 (executable)
@@ -225,7 +225,7 @@ char* ail_get_app_DB(uid_t uid)
        return result;
 }
 
-char* al_get_desktop_path(uid_t uid)
+char* ail_get_desktop_path(uid_t uid)
 {
        char *result = NULL;
        struct group *grpinfo = NULL;
index a04a5e0..dc40c68 100755 (executable)
@@ -39,7 +39,7 @@ typedef int (*sqlite_query_callback)(void *data, int ncols, char **coltxt, char
 char* ail_get_icon_path(uid_t uid);
 char* ail_get_app_DB_journal(uid_t uid);
 char* ail_get_app_DB(uid_t uid);
-char* al_get_desktop_path(uid_t uid);
+char* ail_get_desktop_path(uid_t uid);
 ail_error_e db_open(db_open_mode mode, uid_t uid);
 ail_error_e db_prepare(const char *query, sqlite3_stmt **stmt);
 ail_error_e db_prepare_globalro(const char *query, sqlite3_stmt **stmt);
index bcfb253..48f7d3d 100755 (executable)
@@ -789,7 +789,7 @@ char *_pkgname_to_desktop(const char *package, uid_t uid)
 
        retv_if(!package, NULL);
 
-  desktop_path = al_get_desktop_path(uid);
+  desktop_path = ail_get_desktop_path(uid);
 
        size = strlen(desktop_path) + strlen(package) + 10;
        desktop = malloc(size);
index 15e1078..2b30f5a 100755 (executable)
@@ -64,7 +64,7 @@ static int __fallback_locale_cb(void *data, int ncols, char **coltxt, char **col
        return 0;
 }
 
-static int __check_validation_of_qurey_cb(void *data, int ncols, char **coltxt, char **colname)
+static int __check_validation_of_query_cb(void *data, int ncols, char **coltxt, char **colname)
 {
        int *p = (int*)data;
        *p = atoi(coltxt[0]);
@@ -77,7 +77,7 @@ static int __check_app_locale_from_app_localized_info_by_exact(const char *appid
        char query[MAX_QUERY_LEN];
 
        snprintf(query, MAX_QUERY_LEN, "select exists(select locale from localname where package='%s' and locale='%s')", appid, locale);
-       db_exec_sqlite_query(query, __check_validation_of_qurey_cb, (void *)&result_query);
+       db_exec_sqlite_query(query, __check_validation_of_query_cb, (void *)&result_query);
 
        return result_query;
 }
@@ -91,7 +91,7 @@ static int __check_app_locale_from_app_localized_info_by_fallback(const char *ap
        strncpy(lang, locale, LANGUAGE_LENGTH);
 
        snprintf(query, MAX_QUERY_LEN, "select exists(select locale from localname where package='%s' and locale like '%s%s')", appid, lang, wildcard);
-       db_exec_sqlite_query(query, __check_validation_of_qurey_cb, (void *)&result_query);
+       db_exec_sqlite_query(query, __check_validation_of_query_cb, (void *)&result_query);
 
        return result_query;
 }
index d6b102a..6e076e9 100755 (executable)
@@ -187,7 +187,7 @@ int main(int argc, char *argv[])
                _D("Some Apps in the App Info DB.");
        }
 
-       ret = initdb_user_load_directory(al_get_desktop_path(getuid()));
+       ret = initdb_user_load_directory(ail_get_desktop_path(getuid()));
        if (ret == AIL_ERROR_FAIL) {
                _E("cannot load usr desktop directory.");
        }