mailing list of musl libc
 help / color / mirror / code / Atom feed
* tool: musl-pbs
@ 2013-04-13  0:38 Zvi Gilboa
  2013-04-13 14:52 ` Isaac Dunham
  0 siblings, 1 reply; 3+ messages in thread
From: Zvi Gilboa @ 2013-04-13  0:38 UTC (permalink / raw)
  To: musl


[-- Attachment #1.1: Type: text/plain, Size: 636 bytes --]

Greetings,

The attached scripts provide a quick way to view the current PkgSrc 
results for a select package (or several packages matching a pattern).

In addition to the comments found within the scripts, here is a brief 
summary:

*musl-pbs:
*--> the main script
--> usage:     musl-pbs   SEARCH_PATTERN
--> example: musl-pbs   databases/pg

*musl-pbs-update:
*--> obtains information from http://wiki.musl-libc.org/wiki/Pkgsrc_results
--> will be automatically executed upon the first run of *musl-pbs
*-->**creates *musl-pbs.src* (plain text) in the user's $HOME folder
--> dependencies: /wget/, /html2text/

Best regards,
Zvi

**

[-- Attachment #1.2: Type: text/html, Size: 1174 bytes --]

[-- Attachment #2: musl-pbs --]
[-- Type: text/plain, Size: 1051 bytes --]

#!/usr/bin/env sh
# musl-pbs (musl-based package build status)
#   $1: search pattern (package name)
#   source file: $HOME/musl-pbs.src
#   columns: Deps Builds Tests Package/patches
# script created by Zvi Gilboa, copyright (and left) deferred

# validation
if [ "$1"X = "X" ]; then
		echo
		echo "usage:   musl-pbs SEARCH_PATTERN"
		echo 
		echo "example: musl-pbs databases/pg"
		echo
		exit 2
fi

# our source file
musl_pbs_src=$HOME/musl-pbs.src

# the update script
musl_pbs_update='musl-pbs-update'

# see if the source file already exists
if [ ! -f $musl_pbs_src ]
    then
        # source file does not exist:
        # generate it using the update script
        possession="'s"
        echo
        echo "first-time run: retrieving musl-based package build status from the project$possession Wiki"
        sh $musl_pbs_update
fi

# print the header
HEADER=`head -n +1 $musl_pbs_src`
echo && echo $HEADER
# go fancy
echo $HEADER | sed -e 's/./=/g'

# and all lines matching the search pattern
grep $1 $musl_pbs_src
echo

# all done
exit 0

[-- Attachment #3: musl-pbs-update --]
[-- Type: text/plain, Size: 1551 bytes --]

#!/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 (</table>)
pbs_table_end=`grep -n '</table>' $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">.</>yes</g' $musl_pbs_html

# red with an X means fail (-f-)
sed -i -e 's/ bgcolor="red">X</>-f-</g' $musl_pbs_html

# red with a dash (-) means n/a
sed -i -e 's# bgcolor="red">-<#>n/a <#g' $musl_pbs_html

# by default, red means no
sed -i -e 's/ bgcolor="red">.</>no </g' $musl_pbs_html

# finally, convert the source html table into a grep-friendly text file
html2text -o $musl_pbs_src $musl_pbs_html

# remove the temporary files
rm $musl_headless
rm $musl_pbs_html

# all done
exit 0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-13 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-13  0:38 tool: musl-pbs Zvi Gilboa
2013-04-13 14:52 ` Isaac Dunham
2013-04-13 18:46   ` Zvi Gilboa

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).