5 # Flags or not, if anyone else were to run this script, they'd want to change
6 # at least the first couple of these defaults and at least the header/prolog.
8 output
=$HOME/Projects
/website
/readmes.html
9 date=`date "+%F %H:%M"`
14 $script [-c location_of_sbopkg.conf] [-m MAINTAINER] [-o OUTPUT]
16 OUTPUT will be overwritten (if it exists) as $script generates an HTML
17 page composed of the READMEs of the SBo packages MAINTAINER maintains.
22 find $lib -name '*.info' \
23 -exec grep -il '^MAINTAINER="'"$maintainer"'"' {} + |
24 sed "s:$lib/::;s:/[^/]*$::" |
sort
27 while getopts :c
:hm
:o
: opt
; do
30 m
) maintainer
="$OPTARG" ;;
31 o
) output
="$OPTARG" ;;
36 shift `expr $OPTIND - 1`
43 # In order to allow the location of the sbopkg config file to be given as an
44 # argument, these assignments need to come after option processing. And, since
45 # lib and base_url depend on the conf file, they need to come after the final
46 # conf assignment and (attempted) eval of select lines. (If you did have a
47 # local repo and didn't use sbopkg, you'd need to do it differently.)
48 conf
=${conf:-/etc/sbopkg/sbopkg.conf}
50 eval `egrep '^REPO_(ROOT|NAME|BRANCH)=' $conf`
51 if [ -z "$REPO_ROOT" -o -z "$REPO_NAME" -o -z "$REPO_BRANCH" ]; then
52 echo "$script: $conf not valid." >&2
57 $script: $conf not readable.
61 lib
=$REPO_ROOT/$REPO_NAME/$REPO_BRANCH
62 base_url
=http
://slackbuilds.org
/repository
/$REPO_BRANCH
64 touch $output 2>/dev
/null
65 # if we can't create it, or if it previously existed but is unwriteable, stop
66 if [ $?
-ne 0 ] ||
[ ! -w $output ]; then
67 echo "$script: couldn't write to $output" >&2
72 if [ -z "$pkgs" ]; then
73 echo "$script: maintainer \"$maintainer\" not found." >&2
80 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
81 "http://www.w3.org/TR/html4/strict.dtd">
82 <link rel="stylesheet" type="text/css" href="current.css">
83 <title>$maintainer's SBo packages</title>
86 This page is composed of the README files of the packages I maintain.
87 (The contents are mostly copied from the program documentation rather
96 echo "<h1 id=\"`basename $f`\"><a href=\"$base_url/$f/\">$f</a></h1>"
98 cat $lib/$f/README |
sed 's/&/\&/g;s/</\</g;s/>/\>/g'
105 cat << EOF >> $output
108 <a href="index.html">Home</a>
110 Page created: 2010-04-28 23:30<br>