Change the name of the define directory(/opt/usr/dotnet) accepted/tizen/unified/20200319.131234 submit/tizen/20200318.232027
authorj-h.choi <j-h.choi@samsung.com>
Tue, 17 Mar 2020 05:52:37 +0000 (14:52 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Wed, 18 Mar 2020 09:47:33 +0000 (18:47 +0900)
Change-Id: Ia1b4090f30236c3390a2d89ab993f41e23698fab

NativeLauncher/CMakeLists.txt
NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc
NativeLauncher/tool/ni_common.cc
NativeLauncher/tool/tac_common.cc
packaging/dotnet-launcher.spec

index 2cc282f..d6cefa3 100644 (file)
@@ -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")
index b042405..fbe3bd3 100644 (file)
@@ -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();
index f57e8c5..0e60025 100644 (file)
@@ -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<std::string> 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<std::string> 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;
index e2d59d8..1846cd8 100644 (file)
@@ -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<std::string> 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)) {
index d1b849a..a77161e 100644 (file)
@@ -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
-