#!/usr/bin/env sh # musl-pbs-update (musl-based package build status source update) # retrieves http://wiki.musl-libc.org/wiki/Pkgsrc_results # and then converts it into a grep-friendly text file. # script created by Zvi Gilboa, copyright (and left) deferred # user should have write permission in the $HOME folder musl_pbs_src=$HOME/musl-pbs.src # temporary files, deleted once we are done musl_pbs_html=$HOME/musl-pbs.html.tmp musl_headless=$HOME/musl-HEADLESS.tmp # obtain the source html document from the musl Wiki wget --quiet --output-document=$musl_pbs_html http://wiki.musl-libc.org/wiki/Pkgsrc_results # locate the actual information (status table) within the html file pbs_table_begin=`grep -n 'sortable' $musl_pbs_html | cut -f1 -d':'` # chop off the head tail -n +$pbs_table_begin $musl_pbs_html > $musl_headless # locate the table's end () pbs_table_end=`grep -n '' $musl_headless | cut -f1 -d':'` # cut off the tail head -n +$pbs_table_end $musl_headless > $musl_pbs_html # green means yes sed -i -e 's/ bgcolor="green">.yesX-f--<#>n/a <#g' $musl_pbs_html # by default, red means no sed -i -e 's/ bgcolor="red">.no