2010-07-30 02:24:43 +00:00
|
|
|
#!/bin/sh
|
2017-02-20 19:20:23 +00:00
|
|
|
# Script helps download the build logs for the current tree.
|
|
|
|
# The downloaded logs will be saved in a logs/ within the
|
|
|
|
# tree.
|
|
|
|
|
|
|
|
BASEDIR="$(dirname "$(cd $(dirname $BASH_SOURCE[0]) && pwd)")"
|
|
|
|
pushd $BASEDIR > /dev/null
|
2010-07-30 02:24:43 +00:00
|
|
|
|
2011-08-27 17:27:59 +00:00
|
|
|
VER=$(fedpkg verrel)
|
2010-07-30 02:24:43 +00:00
|
|
|
ver=$(echo $VER | sed -e 's/-/ /g' | awk '{print $2}')
|
|
|
|
rev=$(echo $VER | sed -e 's/-/ /g' | awk '{print $3}')
|
|
|
|
|
2017-02-20 19:20:23 +00:00
|
|
|
# keep logs in one place. If logs directory does not exist, make it.
|
|
|
|
if [ -d "$BASEDIR/logs" ]; then
|
|
|
|
DIR="$BASEDIR/logs"
|
2010-07-30 02:24:43 +00:00
|
|
|
else
|
2017-02-20 19:20:23 +00:00
|
|
|
mkdir "$BASEDIR/logs"
|
|
|
|
DIR="$BASEDIR/logs"
|
2010-07-30 02:24:43 +00:00
|
|
|
fi
|
|
|
|
|
2017-02-20 19:20:23 +00:00
|
|
|
# Common architectures that have build logs.
|
|
|
|
ARCHS[0]=i686
|
|
|
|
ARCHS[1]=x86_64
|
|
|
|
ARCHS[2]=noarch
|
|
|
|
ARCHS[3]=armv7hl
|
2010-07-30 02:24:43 +00:00
|
|
|
|
2017-02-20 19:20:23 +00:00
|
|
|
for arch in ${ARCHS[@]}; do
|
|
|
|
URL=http://kojipkgs.fedoraproject.org/packages/kernel/$ver/$rev/data/logs/$arch/build.log
|
|
|
|
# Only download logs if exist
|
|
|
|
wget --spider -q $URL
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
wget -O $DIR/build-$VER-$arch.log $URL
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
popd > /dev/null
|