From b906d31a3f5fed9d64fedad35664947de95e89ec Mon Sep 17 00:00:00 2001 From: "j-h.choi" Date: Tue, 17 Mar 2020 14:52:37 +0900 Subject: [PATCH] Change the name of the define directory(/opt/usr/dotnet) Change-Id: Ia1b4090f30236c3390a2d89ab993f41e23698fab --- NativeLauncher/CMakeLists.txt | 6 +++--- NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc | 12 ++++++------ NativeLauncher/tool/ni_common.cc | 10 +++++----- NativeLauncher/tool/tac_common.cc | 8 ++++---- packaging/dotnet-launcher.spec | 9 ++++----- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/NativeLauncher/CMakeLists.txt b/NativeLauncher/CMakeLists.txt index 2cc282f..d6cefa3 100644 --- a/NativeLauncher/CMakeLists.txt +++ b/NativeLauncher/CMakeLists.txt @@ -47,9 +47,9 @@ IF(DEFINED NATIVE_LIB_DIR) SET(EXTRA_CFLAGS_COMMON "${EXTRA_CFLAGS_COMMON} -DNATIVE_LIB_DIR=${NATIVE_LIB_DIR}") ENDIF(DEFINED NATIVE_LIB_DIR) -IF(DEFINED TAC_DIR) - SET(EXTRA_CFLAGS_COMMON "${EXTRA_CFLAGS_COMMON} -DTAC_DIR=${TAC_DIR}") -ENDIF(DEFINED TAC_DIR) +IF(DEFINED DOTNET_DIR) + SET(EXTRA_CFLAGS_COMMON "${EXTRA_CFLAGS_COMMON} -DDOTNET_DIR=${DOTNET_DIR}") +ENDIF(DEFINED DOTNET_DIR) IF(DEFINED USE_DEFAULT_BASE_ADDR) SET(EXTRA_CFLAGS_COMMON "${EXTRA_CFLAGS_COMMON} -DUSE_DEFAULT_BASE_ADDR") diff --git a/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc b/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc index b042405..fbe3bd3 100644 --- a/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc +++ b/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc @@ -39,7 +39,7 @@ #define __XSTR(x) #x #define __STR(x) __XSTR(x) -static const char* __TAC_DIR = __STR(TAC_DIR); +static const char* __DOTNET_DIR = __STR(DOTNET_DIR); #undef __STR #undef __XSTR @@ -295,7 +295,7 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char *pkgId, const char *app _INFO("TAC name : %s", tac_name.c_str()); _INFO("TAC version : %s", tac_version.c_str()); - std::string tac_version_dir = concatPath(__TAC_DIR, np); + std::string tac_version_dir = concatPath(__DOTNET_DIR, np); std::string sha256_info = concatPath(tac_version_dir, TAC_SHA_256_INFO); if (!bf::exists(tac_version_dir)) { _INFO("Create tac_version_dir [%s]", tac_version_dir.c_str()); @@ -370,7 +370,7 @@ int updateTacDB(sqlite3 *sqlite) return -1; } if (count == 0) { - std::string tac_version_dir_prev = concatPath(__TAC_DIR, unp); + std::string tac_version_dir_prev = concatPath(__DOTNET_DIR, unp); std::string tac_version_dir_backup = tac_version_dir_prev + ".bck"; if (!copyDir(tac_version_dir_prev, tac_version_dir_backup)) { _ERR("Failed to copy of %s to %s", tac_version_dir_prev.c_str(), tac_version_dir_backup.c_str()); @@ -438,7 +438,7 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char *pkgId, const char *app _INFO("TAC name : %s", tac_name.c_str()); _INFO("TAC version : %s", tac_version.c_str()); - std::string tac_version_dir = concatPath(__TAC_DIR, np); + std::string tac_version_dir = concatPath(__DOTNET_DIR, np); std::string sha256_info = concatPath(tac_version_dir, TAC_SHA_256_INFO); if (!bf::exists(tac_version_dir)) { _INFO("Create tac_version_dir [%s]", tac_version_dir.c_str()); @@ -587,7 +587,7 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_REMOVED(const char *pkgId, const char *app void cleanStep(std::string tac) { - std::string current_tac = concatPath(__TAC_DIR, tac.substr(0, tac.find('/'))); + std::string current_tac = concatPath(__DOTNET_DIR, tac.substr(0, tac.find('/'))); try { for (auto& bck : bf::recursive_directory_iterator(current_tac)) { std::string bck_path = bck.path().string(); @@ -661,7 +661,7 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_CLEAN(const char *pkgId, const char *appId void undoStep(std::string tac) { - std::string current_tac = concatPath(__TAC_DIR, tac.substr(0, tac.find('/'))); + std::string current_tac = concatPath(__DOTNET_DIR, tac.substr(0, tac.find('/'))); try { for (auto& bck : bf::recursive_directory_iterator(current_tac)) { std::string bck_path = bck.path().string(); diff --git a/NativeLauncher/tool/ni_common.cc b/NativeLauncher/tool/ni_common.cc index f57e8c5..0e60025 100644 --- a/NativeLauncher/tool/ni_common.cc +++ b/NativeLauncher/tool/ni_common.cc @@ -55,7 +55,7 @@ #define __STR(x) __XSTR(x) static const char* __NATIVE_LIB_DIR = __STR(NATIVE_LIB_DIR); static const char* __CROSSGEN_PATH = __STR(CROSSGEN_PATH); -static const char* __TAC_DIR = __STR(TAC_DIR); +static const char* __DOTNET_DIR = __STR(DOTNET_DIR); #ifdef UNIQUE_DEFAULT_BASE_ADDR_SUPPORT static const char* __SYSTEM_BASE_FILE = __STR(SYSTEM_BASE_FILE); @@ -246,7 +246,7 @@ static ni_error_e crossgen(const std::string& dllPath, const std::string& appPat } bool isAppNI = flags & NI_FLAGS_APPNI; - if (isAppNI && strstr(absNiPath.c_str(), __TAC_DIR) == NULL) { + if (isAppNI && strstr(absNiPath.c_str(), __DOTNET_DIR) == NULL) { absNiPath = getAppNIPath(absNiPath); } @@ -468,7 +468,7 @@ void createNiUnderTAC(std::vector nugets, DWORD flags) { std::string appPaths; for (auto& nuget : nugets) { - appPaths += concatPath(__TAC_DIR, nuget); + appPaths += concatPath(__DOTNET_DIR, nuget); appPaths += ':'; } if (appPaths.back() == ':') { @@ -483,7 +483,7 @@ void createNiUnderTAC(std::vector nugets, DWORD flags) } }; for (auto& nuget : nugets) { - scanFilesInDir(concatPath(__TAC_DIR, nuget), convert, -1); + scanFilesInDir(concatPath(__DOTNET_DIR, nuget), convert, -1); } } @@ -783,7 +783,7 @@ static int regenTacCb(pkgmgrinfo_appinfo_h handle, void *userData) ni_error_e regenerateTACNI(DWORD flags) { - const std::string tacDir[] = {__TAC_DIR}; + const std::string tacDir[] = {__DOTNET_DIR}; removeNiUnderDirs(tacDir, 1); pkgmgrinfo_appinfo_metadata_filter_h handle; diff --git a/NativeLauncher/tool/tac_common.cc b/NativeLauncher/tool/tac_common.cc index e2d59d8..1846cd8 100644 --- a/NativeLauncher/tool/tac_common.cc +++ b/NativeLauncher/tool/tac_common.cc @@ -32,7 +32,7 @@ #define __XSTR(x) #x #define __STR(x) __XSTR(x) -static const char* __TAC_DIR = __STR(TAC_DIR); +static const char* __DOTNET_DIR = __STR(DOTNET_DIR); #undef __STR #undef __XSTR @@ -43,7 +43,7 @@ static void cleanupDirectory() { std::vector removeNuget; try { - for (auto& nuget : bf::recursive_directory_iterator(__TAC_DIR)) { + for (auto& nuget : bf::recursive_directory_iterator(__DOTNET_DIR)) { bool isExist = false; std::string nugetPath = nuget.path().string(); for (auto& restore : restore_nuget) { @@ -125,7 +125,7 @@ static int restoreDBCb(pkgmgrinfo_appinfo_h handle, void *userData) "INSERT INTO TAC (PKGID, NUGET, NAME, VERSION) " \ "VALUES (%Q, %Q, %Q, %Q);", pkgId, nuget.c_str(), name.c_str(), version.c_str()); dbInsert(tac_db, TAC_APP_LIST_RESTORE_DB, sql); - restore_nuget.push_back(concatPath(__TAC_DIR, nuget)); + restore_nuget.push_back(concatPath(__DOTNET_DIR, nuget)); sqlite3_free(sql); } } @@ -335,7 +335,7 @@ tac_error_e enableTACPackage(const std::string& pkgId) for (auto& npAssembly : depsJsonParser(rootPath, execName, getTPA())) { std::string nugetPackage = npAssembly.substr(0, npAssembly.rfind(':')); std::string assemblyName = npAssembly.substr(npAssembly.rfind(':') + 1); - std::string nugetPath = concatPath(__TAC_DIR, nugetPackage); + std::string nugetPath = concatPath(__DOTNET_DIR, nugetPackage); if (bf::exists(nugetPath)) { std::string originPath = concatPath(nugetPath, assemblyName); if (bf::exists(originPath)) { diff --git a/packaging/dotnet-launcher.spec b/packaging/dotnet-launcher.spec index d1b849a..a77161e 100644 --- a/packaging/dotnet-launcher.spec +++ b/packaging/dotnet-launcher.spec @@ -54,7 +54,7 @@ Requires(preun): /usr/bin/systemctl %define _framework_dir /usr/share/dotnet.tizen/framework %define _install_mdplugin_dir /etc/package-manager/parserlib/metadata %define _native_lib_dir /usr/share/dotnet.tizen/lib -%define _tac_dir /opt/usr/dotnet +%define _dotnet_dir /opt/usr/dotnet %define _system_base_addr_file /opt/usr/dotnet.system.base.addr %define _default_base_addr_start 0x3000000 @@ -109,7 +109,7 @@ cmake \ -DFRAMEWORK_DIR=%{_framework_dir} \ -DCROSSGEN_PATH=%{_runtime_dir}/crossgen \ -DINSTALL_MDPLUGIN_DIR=%{_install_mdplugin_dir} \ - -DTAC_DIR=%{_tac_dir} \ + -DDOTNET_DIR=%{_dotnet_dir} \ -DVERSION=%{version} \ -DNATIVE_LIB_DIR=%{_native_lib_dir} \ %ifarch %{arm} @@ -131,7 +131,7 @@ mkdir -p %{buildroot}%{_framework_dir} mv Managed/Tizen.Init/bin/Release/Tizen.Init.dll %{buildroot}%{_framework_dir} mv Managed/Dotnet.Launcher/bin/Release/Dotnet.Launcher.dll %{buildroot}%{_framework_dir} -mkdir -p %{buildroot}%{_tac_dir} +mkdir -p %{buildroot}%{_dotnet_dir} mkdir -p %{buildroot}%{_native_lib_dir} ln -sf %{_libdir}/libsqlite3.so.0 %{buildroot}%{_native_lib_dir}/libsqlite3.so @@ -164,7 +164,7 @@ chsmack -t -a User::App::Shared /opt/etc/skel/.dotnet /usr/share/parser-plugins/dotnet-launcher.info %{_framework_dir}/Tizen.Init.dll %{_framework_dir}/Dotnet.Launcher.dll -%{_tac_dir} +%{_dotnet_dir} %files devel %manifest dotnet-launcher.manifest @@ -177,4 +177,3 @@ chsmack -t -a User::App::Shared /opt/etc/skel/.dotnet %{_libdir}/libni_common.so %{_libdir}/libtac_common.so %{_libdir}/pkgconfig/dotnet-launcher.pc - -- 2.7.4