Skip to content
Snippets Groups Projects
Commit 2fc779f1 authored by Thierry Escande's avatar Thierry Escande
Browse files

Merge branch 'fixup-for-file-rdeps-mr' into 'kirkstone'

A bit of cleanup and comments

Closes #30

See merge request eclipse/oniro-core/meta-openharmony!35
parents 894c26b3 295ecdb1
No related branches found
No related tags found
1 merge request!35A bit of cleanup and comments
Pipeline #6466 passed
......@@ -346,16 +346,8 @@ build_ch:
allow_failure: true
before_script:
- if [ "${OPENHARMONY_VERSION}" = "3.0" ]; then
TARBALL_URL="https://repo.huaweicloud.com/harmonyos/os/3.0/code-v3.0-LTS.tar.gz";
elif [ "${OPENHARMONY_VERSION}" = "3.0.1" ]; then
TARBALL_URL="https://repo.huaweicloud.com/harmonyos/os/3.0.1/code-v3.0.1-LTS.tar.gz";
elif [ "${OPENHARMONY_VERSION}" = "3.0.2" ]; then
TARBALL_URL="https://repo.huaweicloud.com/harmonyos/os/3.0.2/code-v3.0.2-LTS.tar.gz";
elif [ "${OPENHARMONY_VERSION}" = "3.0.3" ]; then
TARBALL_URL="https://repo.huaweicloud.com/harmonyos/os/3.0.3/code-v3.0.3-LTS.tar.gz";
elif [ "${OPENHARMONY_VERSION}" = "3.1" ]; then
TARBALL_URL="https://repo.huaweicloud.com/harmonyos/os/3.1-Release/code-v3.1-Release.tar.gz";
elif [ "${OPENHARMONY_VERSION}" = "3.1.1" ]; then
TARBALL_URL="https://repo.huaweicloud.com/harmonyos/os/3.1.1/code-v3.1.1-Release.tar.gz";
else
echo "OPENHARMONY_VERSION=${OPENHARMONY_VERSION} is not supported";
......
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
FILES:${PN} += "${libdir}/*.a"
......@@ -20,6 +20,8 @@ DEPENDS += "ruby-native"
DEPENDS += "hapsigner-native"
DEPENDS += "packing-tool-native"
# libfts.a is needed by //third_party/selinux:libselinux in order to
# avoid the use of //third_party/FreeBSD.
DEPENDS += "fts"
FILESEXTRAPATHS:prepend := "${THISDIR}/openharmony-${OPENHARMONY_VERSION}:"
......
......@@ -3,6 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
SRC_URI += "file://patches/ace_napi.patch;apply=no;subdir=src"
SRC_URI += "file://patches/base_miscservices_pasteboard.patch;apply=no;subdir=src"
SRC_URI += "file://patches/base_notification_ans_standard.patch;apply=no;subdir=src"
SRC_URI += "file://patches/base_update_updater.patch;apply=no;subdir=src"
SRC_URI += "file://patches/base_usb_usb_manager.patch;apply=no;subdir=src"
......@@ -15,5 +16,4 @@ SRC_URI += "file://patches/foundation_graphic_standard.patch;apply=no;subdir=src
SRC_URI += "file://patches/productdefine_common.patch;apply=no;subdir=src"
SRC_URI += "file://patches/third_party_libevdev.patch;apply=no;subdir=src"
SRC_URI += "file://patches/third_party_libusb.patch;apply=no;subdir=src"
SRC_URI += "file://patches/third_party_e2fsprogs-backports-to-3.1.patch;apply=no;subdir=src"
SRC_URI += "file://patches/third_party_selinux.patch;apply=no;subdir=src"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Patch for //base/miscservices/pasteboard git repository of OpenHarmony 3.1 codebase.
This replaces NAPI_CALL() calls with NAPI_CALL_BOOL() in functions
returning a boolean.
Signed-off-by: Thierry Escande <thierry.escande@huawei.com>
Upstream-Status: Inappropriate
diff --git a/base/miscservices/pasteboard/interfaces/kits/napi/src/napi_pastedata_record.cpp b/base/miscservices/pasteboard/interfaces/kits/napi/src/napi_pastedata_record.cpp
index 2658349..f94f446 100644
--- a/base/miscservices/pasteboard/interfaces/kits/napi/src/napi_pastedata_record.cpp
+++ b/base/miscservices/pasteboard/interfaces/kits/napi/src/napi_pastedata_record.cpp
@@ -37,7 +37,7 @@ PasteDataRecordNapi::~PasteDataRecordNapi()
bool PasteDataRecordNapi::NewInstanceByRecord(
napi_env env, napi_value &instance, const std::shared_ptr<MiscServices::PasteDataRecord> &record)
{
- NAPI_CALL(env, PasteDataRecordNapi::NewInstance(env, instance));
+ NAPI_CALL_BOOL(env, PasteDataRecordNapi::NewInstance(env, instance));
PasteDataRecordNapi *obj = nullptr;
napi_status status = napi_unwrap(env, instance, reinterpret_cast<void **>(&obj));
if ((status != napi_ok) || (obj == nullptr)) {
@@ -50,7 +50,7 @@ bool PasteDataRecordNapi::NewInstanceByRecord(
bool PasteDataRecordNapi::NewHtmlTextRecordInstance(napi_env env, const std::string &text, napi_value &instance)
{
- NAPI_CALL(env, PasteDataRecordNapi::NewInstance(env, instance));
+ NAPI_CALL_BOOL(env, PasteDataRecordNapi::NewInstance(env, instance));
PasteDataRecordNapi *obj = nullptr;
napi_status status = napi_unwrap(env, instance, reinterpret_cast<void **>(&obj));
if ((status != napi_ok) || (obj == nullptr)) {
@@ -63,7 +63,7 @@ bool PasteDataRecordNapi::NewHtmlTextRecordInstance(napi_env env, const std::str
bool PasteDataRecordNapi::NewPlainTextRecordInstance(napi_env env, const std::string &text, napi_value &instance)
{
- NAPI_CALL(env, PasteDataRecordNapi::NewInstance(env, instance));
+ NAPI_CALL_BOOL(env, PasteDataRecordNapi::NewInstance(env, instance));
PasteDataRecordNapi *obj = nullptr;
napi_status status = napi_unwrap(env, instance, reinterpret_cast<void **>(&obj));
if ((status != napi_ok) || (obj == nullptr)) {
@@ -76,7 +76,7 @@ bool PasteDataRecordNapi::NewPlainTextRecordInstance(napi_env env, const std::st
bool PasteDataRecordNapi::NewUriRecordInstance(napi_env env, const std::string &text, napi_value &instance)
{
- NAPI_CALL(env, PasteDataRecordNapi::NewInstance(env, instance));
+ NAPI_CALL_BOOL(env, PasteDataRecordNapi::NewInstance(env, instance));
PasteDataRecordNapi *obj = nullptr;
napi_status status = napi_unwrap(env, instance, reinterpret_cast<void **>(&obj));
if ((status != napi_ok) || (obj == nullptr)) {
@@ -94,7 +94,7 @@ bool PasteDataRecordNapi::NewWantRecordInstance(
return false;
}
- NAPI_CALL(env, PasteDataRecordNapi::NewInstance(env, instance));
+ NAPI_CALL_BOOL(env, PasteDataRecordNapi::NewInstance(env, instance));
PasteDataRecordNapi *obj = nullptr;
napi_status status = napi_unwrap(env, instance, reinterpret_cast<void **>(&obj));
if ((status != napi_ok) || (obj == nullptr)) {
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Backport of fixes included in OpenHarmony-v3.1.1 release
f1f1a3471fdf - Fix CodeCheck warning.
00663d8aab61 - static_cast size_t to int
97aa5de11e0d - Pass parameter p by reference.
6758af0c0da8 - Fix the crash problem caused by overflow in GetDacConfig.
Signed-off-by: Esben Haabendal <esben.haabendal@huawei.com>
Upstream-Status: Backport
diff --git a/third_party/e2fsprogs/contrib/android/dac_config.cpp b/third_party/e2fsprogs/contrib/android/dac_config.cpp
index 422e0d52280f..1c76dfd7e7d1 100644
--- a/third_party/e2fsprogs/contrib/android/dac_config.cpp
+++ b/third_party/e2fsprogs/contrib/android/dac_config.cpp
@@ -35,14 +35,14 @@ struct DacConfig {
string path;
DacConfig() : uid(0), gid(0), mode(0), capabilities(0), path("") {}
- DacConfig(unsigned int m, unsigned int u, unsigned int g, uint64_t c, string p) :
+ DacConfig(unsigned int m, unsigned int u, unsigned int g, uint64_t c, const string &p) :
uid(u),
gid(g),
mode(m),
capabilities(c),
path(p) {}
- void SetDefault(unsigned int m, unsigned int u, unsigned int g, uint64_t c, string p)
+ void SetDefault(unsigned int m, unsigned int u, unsigned int g, uint64_t c, const string &p)
{
this->uid = u;
this->gid = g;
@@ -198,33 +198,28 @@ extern "C" {
return 0;
}
- void GetDacConfig(const char* path, int dir, char* targetOutPath,
+ void GetDacConfig(const char* path, int dir, char*,
unsigned* uid, unsigned* gid, unsigned* mode,
uint64_t* capabilities)
{
- if (path && path[0] == '/') {
- path++;
- }
-
- (void)targetOutPath;
- string str = path;
- string str2;
+ string str = (path != nullptr && *path == '/') ? path + 1 : path;
DacConfig dacConfig(00755, 0, 0, 0, "");
if (dir == 0) {
dacConfig.SetDefault(00644, 0, 0, 0, "");
}
- if (g_configMap.count(str)) {
- dacConfig = g_configMap[str];
+ auto it = g_configMap.find(str);
+ if (it != g_configMap.end()) {
+ dacConfig = it->second;
} else if (dir == 0 && !str.empty()) {
- for (auto i = str.size() - 1; i >= 0; i--) {
+ for (int i = static_cast<int>(str.size()) - 1; i >= 0; i--) {
if (str[i] == '/') {
break;
} else {
- str2 = str.substr(0, i) + "*";
- if (g_configMap.count(str2)) {
- dacConfig = g_configMap[str2];
+ it = g_configMap.find(str.substr(0, i) + "*");
+ if (it != g_configMap.end()) {
+ dacConfig = it->second;
break;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment