Fixed some Github Actions errors. (#1886)

- Fix knownConditionTrueFalse cppcheck(2.7) error on MacOS
- Fixed package installing failure of appstream download on centos8
This commit is contained in:
Takeshi Nakatani 2022-02-13 14:23:35 +09:00 committed by GitHub
parent 94e8e23eef
commit d7e929e0a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -121,6 +121,17 @@ elif [ "${CONTAINER_FULLNAME}" = "centos:centos8" ]; then
PACKAGE_MANAGER_BIN="dnf"
PACKAGE_UPDATE_OPTIONS="update -y -qq"
# [NOTE] 2022-02-11
# We are receiving the following error on Github Actions:
# "Failed to download metadata for repo 'appstream':"
# We should proceed with the migration to CentOS9, but we will fix it temporarily.
#
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
"${PACKAGE_MANAGER_BIN}" update -y
"${PACKAGE_MANAGER_BIN}" --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos -y
"${PACKAGE_MANAGER_BIN}" distro-sync -y
# [NOTE]
# Installing ShellCheck on CentOS 8 is not easy.
# Give up to run ShellCheck on CentOS 8 as we don't have to run ShellChek on all operating systems.

View File

@ -161,12 +161,12 @@ static char* get_object_name(xmlDocPtr doc, xmlNodePtr node, const char* path)
const char* basepath= (path && '/' == path[0]) ? &path[1] : path;
xmlFree(fullpath);
if(!mybname || '\0' == mybname[0]){
if('\0' == mybname[0]){
return NULL;
}
// check subdir & file in subdir
if(dirpath && 0 < strlen(dirpath)){
if(0 < strlen(dirpath)){
// case of "/"
if(0 == strcmp(mybname, "/") && 0 == strcmp(dirpath, "/")){
return (char*)c_strErrorObjectName;