X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=scripts%2Fnfu%2Fget-w-b-db;h=eabbdc516ec0256734e30b7356629c779a512937;hb=2a10967af5974e4fa513d029fb995e122d90501a;hp=84c15e26d286f9b9bfc84491eaf62780bf7d7378;hpb=6a4cddfbe864e563e671fe5dabf5600c4783af5c;p=dak.git diff --git a/scripts/nfu/get-w-b-db b/scripts/nfu/get-w-b-db index 84c15e26..eabbdc51 100755 --- a/scripts/nfu/get-w-b-db +++ b/scripts/nfu/get-w-b-db @@ -1,22 +1,38 @@ #!/bin/bash +# Copyright (C) 2008 Joachim Breitner +# Copyright (C) 2011 Joerg Jaspert +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; version 2. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# exit on errors set -e +# make sure to only use defined variables +set -u +# ERR traps should be inherited from functions too. (And command +# substitutions and subshells and whatnot, but for us the functions is +# the important part here) +set -E -# list of architectures taken from -# http://buildd.debian.org/stats/ +# import the general variable set. +export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars +. $SCRIPTVARS # For debugging, you can override the path using # the WB_DB_DIR enviroment variable -if [ -z "$WB_DB_DIR" ] -then - WB_DB_DIR=/srv/ftp.debian.org/scripts/nfu -fi - -cd $WB_DB_DIR || { echo "Failed to cd to $WB_DB_DIR" ; exit 1 ;} +WB_DB_DIR=${WB_DB_DIR:-${scriptdir}/nfu} -for arch in alpha amd64 arm armel hppa i386 ia64 mips mipsel powerpc s390 sparc -do - rm -f $arch-all.txt - echo "Getting $arch-all.txt" - wget -q http://buildd.debian.org/stats/$arch-all.txt +for arch in $(dak admin s-a list-arch unstable); do + wget -q https://buildd.debian.org/stats/$arch-all.txt -O ${WB_DB_DIR}/${arch}-all.txt || echo "No w-b dump for ${arch}" done