Blame scripts/grab-logs.sh
|
Roland McGrath |
11487c5 |
#!/bin/sh
|
|
Miguel Flores Silverio |
52c10c8 |
# Script helps download the build logs for the current tree.
|
|
Miguel Flores Silverio |
52c10c8 |
# The downloaded logs will be saved in a logs/ within the
|
|
Miguel Flores Silverio |
52c10c8 |
# tree.
|
|
Miguel Flores Silverio |
52c10c8 |
|
|
Miguel Flores Silverio |
52c10c8 |
BASEDIR="$(dirname "$(cd $(dirname $BASH_SOURCE[0]) && pwd)")"
|
|
Miguel Flores Silverio |
52c10c8 |
pushd $BASEDIR > /dev/null
|
|
Roland McGrath |
11487c5 |
|
|
Dave Jones |
f29a760 |
VER=$(fedpkg verrel)
|
|
Roland McGrath |
11487c5 |
ver=$(echo $VER | sed -e 's/-/ /g' | awk '{print $2}')
|
|
Roland McGrath |
11487c5 |
rev=$(echo $VER | sed -e 's/-/ /g' | awk '{print $3}')
|
|
Roland McGrath |
11487c5 |
|
|
Miguel Flores Silverio |
52c10c8 |
# keep logs in one place. If logs directory does not exist, make it.
|
|
Miguel Flores Silverio |
52c10c8 |
if [ -d "$BASEDIR/logs" ]; then
|
|
Miguel Flores Silverio |
52c10c8 |
DIR="$BASEDIR/logs"
|
|
Roland McGrath |
11487c5 |
else
|
|
Miguel Flores Silverio |
52c10c8 |
mkdir "$BASEDIR/logs"
|
|
Miguel Flores Silverio |
52c10c8 |
DIR="$BASEDIR/logs"
|
|
Roland McGrath |
11487c5 |
fi
|
|
Roland McGrath |
11487c5 |
|
|
Miguel Flores Silverio |
52c10c8 |
# Common architectures that have build logs.
|
|
Miguel Flores Silverio |
52c10c8 |
ARCHS[0]=i686
|
|
Miguel Flores Silverio |
52c10c8 |
ARCHS[1]=x86_64
|
|
Miguel Flores Silverio |
52c10c8 |
ARCHS[2]=noarch
|
|
Miguel Flores Silverio |
52c10c8 |
ARCHS[3]=armv7hl
|
|
Roland McGrath |
11487c5 |
|
|
Miguel Flores Silverio |
52c10c8 |
for arch in ${ARCHS[@]}; do
|
|
Miguel Flores Silverio |
52c10c8 |
URL=http://kojipkgs.fedoraproject.org/packages/kernel/$ver/$rev/data/logs/$arch/build.log
|
|
Miguel Flores Silverio |
52c10c8 |
# Only download logs if exist
|
|
Miguel Flores Silverio |
52c10c8 |
wget --spider -q $URL
|
|
Miguel Flores Silverio |
52c10c8 |
if [ $? -eq 0 ]; then
|
|
Miguel Flores Silverio |
52c10c8 |
wget -O $DIR/build-$VER-$arch.log $URL
|
|
Miguel Flores Silverio |
52c10c8 |
fi
|
|
Miguel Flores Silverio |
52c10c8 |
done
|
|
Miguel Flores Silverio |
52c10c8 |
popd > /dev/null
|