Marcel Telka
2023-11-16 bfc6389b2262ff51a27aa50a4b1f5711e0d58e3f
tools/perl-integrate-module: handle history before publish

1 files modified
56 ■■■■ changed files
tools/perl-integrate-module 56 ●●●● patch | view | raw | blame | history
tools/perl-integrate-module
@@ -459,6 +459,34 @@
! $GMAKE env-check > /dev/null 2>&1 && printf "FATAL: 'gmake env-check' failed!\n" >&2 && exit 1
# Handle history
COMPONENT_FMRI=$($GMAKE print-value-COMPONENT_FMRI)
PERL_VERSIONS_OBSOLETING=$($GMAKE print-value-PERL_VERSIONS_OBSOLETING)
OV=
OV_PLURAL=
for o in $(echo $OBSOLETE $PERL_VERSIONS_OBSOLETING | LC_ALL=C sort -u) ; do
    PLV=${o//.}
    FMRI=$(pkg list -nvH "$COMPONENT_FMRI-$PLV" 2>/dev/null | egrep -v '(o|r)$' | sed -e 's|^.*\('"$COMPONENT_FMRI"'\)|\1|g' -e 's/:[^:]*$//g' -e 's/\(-[^-]*\)$/,5.11\1/g')
    [[ -n "$FMRI" ]] || continue
    FMRI_H=${FMRI%.*}
    FMRI_T=${FMRI##*.}
    if [[ "$FMRI_H" == "$FMRI" ]] ; then
        printf "WARNING: Wrong fmri format: %s\n" "$FMRI" >&2
        continue
    fi
    FMRI_T=$((FMRI_T + 1))
    printf "%s.%s noincorporate\n" "$FMRI_H" "$FMRI_T" >> history
    [[ -n "$OV" ]] && OV="$OV and " && OV_PLURAL="s"
    OV="$OV$o"
done
if [[ -f history ]] ; then
    LC_ALL=C sort -u history > history.new
    mv history.new history
    git add history
fi
# Cleanup before we try to publish to make sure there are no leftovers from
# previous steps
$GMAKE clobber > /dev/null 2>&1
@@ -524,34 +552,6 @@
if [[ "$common_results" == "yes" ]] ; then
    sed -i -e '/^USE_COMMON_TEST_MASTER/d' Makefile
    git add Makefile
fi
# Handle history
COMPONENT_FMRI=$($GMAKE print-value-COMPONENT_FMRI)
PERL_VERSIONS_OBSOLETING=$($GMAKE print-value-PERL_VERSIONS_OBSOLETING)
OV=
OV_PLURAL=
for o in $(echo $OBSOLETE $PERL_VERSIONS_OBSOLETING | LC_ALL=C sort -u) ; do
    PLV=${o//.}
    FMRI=$(pkg list -nvH "$COMPONENT_FMRI-$PLV" 2>/dev/null | egrep -v '(o|r)$' | sed -e 's|^.*\('"$COMPONENT_FMRI"'\)|\1|g' -e 's/:[^:]*$//g' -e 's/\(-[^-]*\)$/,5.11\1/g')
    [[ -n "$FMRI" ]] || continue
    FMRI_H=${FMRI%.*}
    FMRI_T=${FMRI##*.}
    if [[ "$FMRI_H" == "$FMRI" ]] ; then
        printf "WARNING: Wrong fmri format: %s\n" "$FMRI" >&2
        continue
    fi
    FMRI_T=$((FMRI_T + 1))
    printf "%s.%s noincorporate\n" "$FMRI_H" "$FMRI_T" >> history
    [[ -n "$OV" ]] && OV="$OV and " && OV_PLURAL="s"
    OV="$OV$o"
done
if [[ -f history ]] ; then
    LC_ALL=C sort -u history > history.new
    mv history.new history
    git add history
fi