diff --git a/scripts/sbom_scraper.sh b/scripts/sbom_scraper.sh index efae217..21f5206 100755 --- a/scripts/sbom_scraper.sh +++ b/scripts/sbom_scraper.sh @@ -425,6 +425,8 @@ author = ET.SubElement(authors, 'author') ET.SubElement(author, 'name').text = '$AUTHOR_NAME' ET.SubElement(author, 'email').text = '$AUTHOR_EMAIL' +component = metadata.find('component', ns) + # Update component publisher and author publisher = component.find('publisher', ns) if not publisher: @@ -437,8 +439,6 @@ if not author: component.insert(0, author) author.text = '$COMPONENT_AUTHOR_NAME' -component = metadata.find('component', ns) - # Update component name and version component.find('name', ns).text = '$COMPONENT_NAME' component_version = '$COMPONENT_VERSION' @@ -472,7 +472,7 @@ ET.SubElement(supplier, 'url').text = '$SUPPLIER_URL' indent(root) et.write(sys.stdout, encoding='unicode', xml_declaration=True, default_namespace='') END -) +) < "$OUTPUT" > "$PATCHED_OUTPUT" fi # ----------------------------------------------------------------------------