# # simple utility to fetch all found PRs into a subdirectory PRdata # relies on output of grep to determine when a PR is not found # # prereq: assumes wget and cleanLSBPR are in the PATH # # 1) uses the wget utility to fetch all PRs # # 2) cd PRdata && cleanLSBPR *.html type wget if [ $? -ne 0 ] then printf "wget not found, exiting...\n" exit 1 fi if [ ! -d PRdata ] then printf "creating directory PRdata\n" mkdir PRdata fi i=0 notfound=0 while : do i=`expr $i + 1` if [ $i -gt 99 ] then PRnum=0${i} else if [ $i -lt 10 ] then PRnum=000${i} else PRnum=00${i} fi fi wget --output-document=PRdata/PR${PRnum}.html http://www.opengroup.org:8000/lsb/publicpr/PRView?PR=${PRnum} grep "Sorry, the Report" PRdata/PR${PRnum}.html >/dev/null if [ $? -eq 0 ] then rm PRdata/PR${PRnum}.html echo "PR${PRnum} not found" notfound=`expr $notfound + 1` if [ $notfound -gt 2 ] then printf "Assuming end of PR data reached\n" break fi fi if [ $i -gt 2500 ] then printf "enough already....\n" break fi done cd PRdata && cleanLSBPR *.html