From: Jinhyung Choi Date: Thu, 16 Apr 2015 07:00:09 +0000 (+0900) Subject: extra pkg install: added rpm file contraint X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1310597f76ab45f3613771e8e12bb3a04e245ab8;p=sdk%2Femulator%2Fqemu.git extra pkg install: added rpm file contraint 1. the file length should be longer than 4 because of .rpm 2. last 4 chars must be ".rpm" Change-Id: I63bce04b16d46116bd4ae9c626232e2d4d3cf130 Signed-off-by: Jinhyung Choi --- diff --git a/tizen/src/util/extra_pkgs_install.c b/tizen/src/util/extra_pkgs_install.c index 8b6923cd1d..6da18d7608 100644 --- a/tizen/src/util/extra_pkgs_install.c +++ b/tizen/src/util/extra_pkgs_install.c @@ -124,6 +124,7 @@ void epi_init(void) struct dirent *sub_dir_entry = NULL; char addon[MAX_PATH_PKG_LIST]; char pkgs[MAX_PKG_LIST]; + char *ext; char* addon_path = get_addon_path(); if (!addon_path) { @@ -160,6 +161,13 @@ void epi_init(void) while((sub_dir_entry = readdir(sub_dir))) { if ((strncasecmp(sub_dir_entry->d_name ,".", 1) != 0) && (strncasecmp(sub_dir_entry->d_name ,"..", 2) != 0)) { + if (strlen(sub_dir_entry->d_name) <= 4) + continue; + + ext = &sub_dir_entry->d_name[strlen(sub_dir_entry->d_name) - 4]; + if (strcmp(EXT_RPM, ext)) + continue; + pkg_count++; add_addon_pkgs_name(pkgs, sub_dir_entry->d_name); LOG_TRACE("reading addon sub directory: %s\n", sub_dir_entry->d_name); diff --git a/tizen/src/util/extra_pkgs_install.h b/tizen/src/util/extra_pkgs_install.h index 7000ae64cc..8b02e4bb61 100644 --- a/tizen/src/util/extra_pkgs_install.h +++ b/tizen/src/util/extra_pkgs_install.h @@ -35,6 +35,8 @@ #define IMAGE_DIRECTORY "emulator-images" #define ADDON_DIRECTORY "add-ons" +#define EXT_RPM ".rpm" + #define CMD_PKG "package" #define MAX_PKG_LIST 1024