Skip to content
Snippets Groups Projects
Commit 29226efe authored by Krisjanis Rijnieks's avatar Krisjanis Rijnieks :lion_face:
Browse files

Include symbol description in manufacturer product ID lookup

parent 7ec2df36
No related branches found
No related tags found
No related merge requests found
......@@ -44,13 +44,21 @@ echo "This script looks for parts that are not in the KiCad fab library yet. In
# Read keywords from all KiCad fab library symbols
KEYWORD_LINES=$(cat ${LIBRARY_FILE} | grep --extended-regexp --only-matching -U 'property "ki_keywords" "([^"]*)"')
DESCRIPTION_LINES=$(cat ${LIBRARY_FILE} | grep --extended-regexp --only-matching -U 'property "ki_description" "([^"]*)"')
KEYWORDS=""
IFS=$'\n'
for LINE in ${KEYWORD_LINES}; do
WORDS=$(echo ${LINE} | sed -En 's/property "ki_keywords" "([^"]*)"/\1/p')
KEYWORDS="${KEYWORDS} ${WORDS}"
done
# Treat description as keywords
for LINE in ${DESCRIPTION_LINES}; do
WORDS=$(echo ${LINE} | sed -En 's/property "ki_description" "([^"]*)"/\1/p')
KEYWORDS="${KEYWORDS} ${WORDS}"
done
# Extract items matching source
# JQ is used here.
# RT*M: https://stedolan.github.io/jq/manual/
......@@ -60,7 +68,8 @@ ITEMS=$(curl -s ${INVENTORY_URL} | jq -r '.items[] | select(.source | .[] | cont
echo "Looking for matches in the library..."
for ITEM in ${ITEMS}; do
# TODO: Look for item in whitelist
# Look for item in whitelist
if [[ ${WHITELIST} == *"${ITEM}"* ]]; then
echo "${ITEM} found in whitelist"
continue
......
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