Marcel Telka
2024-04-06 7a1e91471d4b540f48a912dfcca9f65211aa599c
tools/python-integrate-project
@@ -239,7 +239,7 @@
COMPONENT_SUMMARY =      $PROJECT - TODO
EOF
[[ -n "$HOMEPAGE" ]] && printf "COMPONENT_PROJECT_URL =\t\t%s\n" "$HOMEPAGE"
[[ -n "$DOWNLOAD_URL" ]] && printf 'COMPONENT_ARCHIVE_URL =\t\t\\\n\t%s\n' "$DOWNLOAD_URL"
[[ -n "$DOWNLOAD_URL" ]] && printf 'DOWNLOAD_URL =\t\t\\\n\t%s\n' "$DOWNLOAD_URL"
cat <<EOF
COMPONENT_ARCHIVE_HASH =   \\
   sha256:TODO
@@ -253,6 +253,25 @@
[[ -f "$CONF" ]] && cat "$CONF" | gsed -e '0,/^%include-3%/d' -e '/^%/,$d' | gsed -e '1s/^./\n&/'
printf "\n"
) > Makefile
# If the automatically constructed COMPONENT_ARCHIVE_URL points to the same
# location as DOWNLOAD_URL then we should use it
if [[ -n "$DOWNLOAD_URL" ]] ; then
   COMPONENT_ARCHIVE_URL=$($GMAKE print-value-COMPONENT_ARCHIVE_URL)
   [[ "$COMPONENT_ARCHIVE_URL" == "$DOWNLOAD_URL" ]] && DOWNLOAD_URL=
fi
# The default COMPONENT_ARCHIVE_URL usually redirects to DOWNLOAD_URL so check
# that too
if [[ -n "$DOWNLOAD_URL" ]] ; then
   [[ $($CURL --head --write-out "%{redirect_url}\n" --output /dev/null \
       "$COMPONENT_ARCHIVE_URL") == "$DOWNLOAD_URL" ]] && DOWNLOAD_URL=
fi
# Use either DOWNLOAD_URL or default COMPONENT_ARCHIVE_URL
if [[ -n "$DOWNLOAD_URL" ]] ; then
   sed -i -e $'s/^DOWNLOAD_URL =/COMPONENT_ARCHIVE_URL =/' Makefile
else
   sed -i -e $'/^DOWNLOAD_URL =/,+1d' Makefile
fi
# Remove COMPONENT_REVISION if not needed
COMPONENT_VERSION=$($GMAKE print-value-COMPONENT_VERSION)
@@ -368,8 +387,12 @@
   ((TOX_RET == 0)) && ! printf "%s" "$TOX_OUT" | grep -q 'assuming empty tox\.ini' && TEST_STYLE="tox" && break
   # Disable some pytest plugins that almost always collects tests to run
   # even there are no pytest tests available otherwise
   pytest -p no:black -p no:checkdocs -p no:cov -p no:mypy -p no:relaxed --setup-plan
   # even there are no pytest tests available otherwise.
   #
   # The system-statistics plugin is disabled because it often causes the
   # pytest to fail.
   # See also https://github.com/saltstack/pytest-system-statistics/issues/4
   pytest -p no:black -p no:checkdocs -p no:cov -p no:mypy -p no:relaxed -p no:system-statistics --setup-plan
   (($? != 5)) && TEST_STYLE="pytest" && break
   [[ -f setup.py ]] && python setup.py test --help && TEST_STYLE="setup.py" && break