From d7e929e0a830069a0cfcc5f52cf53a28808854dc Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Sun, 13 Feb 2022 14:23:35 +0900 Subject: [PATCH] Fixed some Github Actions errors. (#1886) - Fix knownConditionTrueFalse cppcheck(2.7) error on MacOS - Fixed package installing failure of appstream download on centos8 --- .github/workflows/linux-ci-helper.sh | 11 +++++++++++ src/s3fs_xml.cpp | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-ci-helper.sh b/.github/workflows/linux-ci-helper.sh index 97ddb73..3267e50 100755 --- a/.github/workflows/linux-ci-helper.sh +++ b/.github/workflows/linux-ci-helper.sh @@ -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. diff --git a/src/s3fs_xml.cpp b/src/s3fs_xml.cpp index 6126a33..afee8a3 100644 --- a/src/s3fs_xml.cpp +++ b/src/s3fs_xml.cpp @@ -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;