[arch-general] logging a PKGBUILD output

kludge drkludge at rat-patrol.org
Fri Aug 7 20:14:22 EDT 2009


Baho Utot wrote:
> On Fri, 2009-07-24 at 07:28 +1000, richard terry wrote:
>> I wondered if anyone could tell me how to log the output of a pkgbuild to a 
>> fille as it compiles so I an catch all the compilation  messages.
>>
>> Thanks.
>>
>> Richard
> 
> 
> try pkgbuild  <what ever>  2>&1 | tee build.log

FYI: that's exactly what 'makepkg -L' does:

        if [ "$LOGGING" -eq 1 ]; then
BUILDLOG="${startdir}/${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-build.log"
                if [ -f "$BUILDLOG" ]; then
                        local i=1
                        while true; do
                                if [ -f "$BUILDLOG.$i" ]; then
                                        i=$(($i +1))
                                else
                                        break
                                fi
                        done
                        mv "$BUILDLOG" "$BUILDLOG.$i"
                fi

                build 2>&1 | tee "$BUILDLOG"; ret=${PIPESTATUS[0]}
        else
                build 2>&1 || ret=$?
        fi





More information about the arch-general mailing list