summaryrefslogtreecommitdiffstats
path: root/scripts/grab-logs.sh
diff options
context:
space:
mode:
authorJustin M. Forbes <jforbes@redhat.com>2017-02-20 13:20:23 -0600
committerJustin M. Forbes <jforbes@redhat.com>2017-02-20 13:20:23 -0600
commita98ed5ce60a3a27dd83f47a33d8993eaaef3685e (patch)
tree2390fe67f35cf364436421355cf15e7fab72e294 /scripts/grab-logs.sh
parent7a011b1bac9aea1fdb059ef767f1445c7062b79d (diff)
downloadkernel-a98ed5ce60a3a27dd83f47a33d8993eaaef3685e.tar.gz
kernel-a98ed5ce60a3a27dd83f47a33d8993eaaef3685e.tar.xz
kernel-a98ed5ce60a3a27dd83f47a33d8993eaaef3685e.zip
Linux 4.10 rebase for stabilization
Diffstat (limited to 'scripts/grab-logs.sh')
-rwxr-xr-xscripts/grab-logs.sh31
1 files changed, 25 insertions, 6 deletions
diff --git a/scripts/grab-logs.sh b/scripts/grab-logs.sh
index 5df573571..571b503bb 100755
--- a/scripts/grab-logs.sh
+++ b/scripts/grab-logs.sh
@@ -1,16 +1,35 @@
#!/bin/sh
+# 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
VER=$(fedpkg verrel)
ver=$(echo $VER | sed -e 's/-/ /g' | awk '{print $2}')
rev=$(echo $VER | sed -e 's/-/ /g' | awk '{print $3}')
-if [ -d logs ]; then
- DIR=logs/
+# keep logs in one place. If logs directory does not exist, make it.
+if [ -d "$BASEDIR/logs" ]; then
+ DIR="$BASEDIR/logs"
else
- DIR=./
+ mkdir "$BASEDIR/logs"
+ DIR="$BASEDIR/logs"
fi
-wget -O $DIR/build-$VER-i686.log http://kojipkgs.fedoraproject.org/packages/kernel/$ver/$rev/data/logs/i686/build.log
-wget -O $DIR/build-$VER-x86-64.log http://kojipkgs.fedoraproject.org/packages/kernel/$ver/$rev/data/logs/x86_64/build.log
-wget -O $DIR/build-$VER-noarch.log http://kojipkgs.fedoraproject.org/packages/kernel/$ver/$rev/data/logs/noarch/build.log
+# Common architectures that have build logs.
+ARCHS[0]=i686
+ARCHS[1]=x86_64
+ARCHS[2]=noarch
+ARCHS[3]=armv7hl
+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