tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkglint before committing



On 2020-03-24 15:43, Frédéric Fauberteau wrote:
I don't commit very often and I forget something almost every time. Would it be possible to have a pre-commit hook script that asks if we have executed pkglint before committing (y/n)?

Fred
How about writing a simple checklist of your own?

I use the pkg-check script below followed by a short text checklist for the commit process that reminds me about things like bumping PKGREVISION, etc.

#!/bin/sh -e

pause()
{
    local junk

    printf "Press return to continue..."
    read junk
}

make=`pkgsrc-make`    # make or bmake
for mk_conf in `auto-pkgsrc-prefix`/etc/mk.conf /etc/mk.conf; do
    if [ -e $mk_conf ]; then
        break
    fi
done

if ! fgrep -q PKG_DEVELOPER $mk_conf; then
    printf "PKG_DEVELOPER not set in $mk_conf.  Stage-qa checks will not be performed.\n"
    printf "Continue? y/[n] "
    read continue
    if [ 0$continue != 0y ]; then
        exit
    fi
fi

printf "Remove distfile? y/[n] "
read distclean
if [ 0$distclean = 0y ]; then
    $make distclean
else
    $make clean
fi
pkglint -e || true
pause
$make deinstall
$make install
printf "Clean? y/[n] "
read clean
if [ 0$clean = 0y ]; then
    $make clean
fi




Home | Main Index | Thread Index | Old Index