Marcel Telka
2022-08-02 4d9e44befa21dc0b47340f21b6912dcde977fc45
tools/perl-integrate-module: support for modules with non-matching distribution

1 files modified
15 ■■■■ changed files
tools/perl-integrate-module 15 ●●●● patch | view | raw | blame | history
tools/perl-integrate-module
@@ -69,9 +69,15 @@
    exit 1
fi
if [[ "$DISTRIBUTION" != "${MODULE//::/-}" ]] then
    printf "WARNING: Module %s does not match distribution %s\n" "$MODULE" "$DISTRIBUTION"
    printf "WARNING: Continue with module %s instead of %s\n" "${DISTRIBUTION//-/::}" "$MODULE"
    MODULE="${DISTRIBUTION//-/::}"
    NEW_MODULE="${DISTRIBUTION//-/::}"
    NEW_METACPAN_MODULE=$($CURL "$METACPANAPI/module/$NEW_MODULE")
    NEW_DISTRIBUTION=$(printf "%s" "$NEW_METACPAN_MODULE" | /usr/bin/jq -r '.distribution')
    if [[ "$NEW_DISTRIBUTION" == "$DISTRIBUTION" ]] ; then
        printf "WARNING: Module %s does not match distribution %s\n" "$MODULE" "$DISTRIBUTION"
        printf "WARNING: Continue with module %s instead of %s\n" "$NEW_MODULE" "$MODULE"
        MODULE="$NEW_MODULE"
        METACPAN_MODULE="$NEW_METACPAN_MODULE"
    fi
fi
# Find the latest version if not provided by user
@@ -152,6 +158,9 @@
include ../../../make-rules/shared-macros.mk
COMPONENT_PERL_MODULE =        $MODULE
EOF
[[ "$DISTRIBUTION" != "${MODULE//::/-}" ]] && printf "COMPONENT_PERL_DISTRIBUTION =\t%s\n" "$DISTRIBUTION"
cat <<EOF
HUMAN_VERSION =            $VERSION
COMPONENT_REVISION =        $((PREV_REV + 1))
COMPONENT_SUMMARY =        $MODULE - TODO