Skip to content
Snippets Groups Projects

fix(CI): conan search command usage corrected

1 file
+ 14
10
Compare changes
  • Side-by-side
  • Inline
@@ -43,9 +43,12 @@ ExtractOptionsAndQueries() {
if [[ $option == ${packageName}* ]]; then
# Append "-o " before the matched variable
packageOptions+="-o ${option} "
packageQueries+="-q $(echo "$option" | grep -oP "${packageName}.*" | cut -d':' -f2-)"
packageQueries+="$(echo "$option" | grep -oP "${packageName}.*" | cut -d':' -f2-) AND "
fi
done
# Remove the trailing " AND "
packageQueries="${packageQueries% AND }"
}
# Function to build package other than protobuf with the given options in conanfile.txt
@@ -115,15 +118,6 @@ for each_requirement in "${listOfRequirements[@]}"; do
# queries command to check the package with the particular option as mentioned in conanfile.txt is available in local or not
packageQueries=""
# Extract options and queries for each package
ExtractOptionsAndQueries
# Check if the package is already available in the local
# conan search results failure if the package is not at all available
# and just informs that a particular package with the given option is not available, if the same package with another option is available.
# Therefore, it is important to parse the output and check if the package is available or not
searchResult=$(conan search $packageQueries $each_requirement 2>&1)
# If the requirement is protobuf, qt or boost, then we follow the different method,
# as we are using conancenter to install and need both shared and static binaries
if [[ "$packageName" == "protobuf" ]]; then
@@ -150,6 +144,16 @@ for each_requirement in "${listOfRequirements[@]}"; do
continue
fi
# Extract options and queries for each package
ExtractOptionsAndQueries
# Check if the package is already available in the local
# conan search results failure if the package is not at all available
# and just informs that a particular package with the given option is not available, if the same package with another option is available.
# Therefore, it is important to parse the output and check if the package is available or not
searchResult=$(conan search -q "$packageQueries" $each_requirement 2>&1)
# If requirement with the given option is already available, then just install them into deps folder.
if ! echo "$searchResult" | grep -q -e "no packages for reference" -e "ERROR:"; then
echo "Package $each_requirement $packageOptions is already available."
Loading