#!/bin/sh # This file is maintained using GNU Arch on # http://mdcc.cx/arch/{archives}/2008-ad1810-stuff # Copyright: © 2009 Joost van Baal # # This file 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, either version 3 of the License, or (at your option) # any later version. # # This file 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 GPL for more details. # # You should have received a copy of the GNU GPL along with this file, see # e.g. the file named COPYING. If not, see . # whohas2html - convert output as generated by whohas(1) to an HTML page # Example usage: # # $ { whohas package1 ; whohas package2 } | whohas2html "Title of webpage" \ # "

Header

Introductory paragraph

" > whohas.html # # NB: the wrapper update-whohashtml is likely more usable. # The first column is the name of the distribution, the second the name of the # package, the third the version number, then the date, repository name and a url # linking to more information about the package. # whohas -d # archlinux,debian,fink,freebsd,gentoo,macports,netbsd,openbsd,ubuntu,fedora,opensuse,slackware,sourcemage # archlinux,debian,fink,freebsd,gentoo,macports,netbsd,openbsd,ubuntu whocuts() { echo "$1" | cut -b $2-$3 } cat < $1 $2 EOT while read distribution package l do version=$( whocuts "$l" 1 21 ) size=$( whocuts "$l" 22 26 ) date=$( whocuts "$l" 27 37 ) repository=$( whocuts "$l" 38 49 ) url=$( whocuts "$l" 50 ) # echo "line after package: '$l'" # echo "distribution '$distribution' package '$package' version '$version' size '$size' date '$date' repository '$repository' url '$url'" # See http://www.w3.org/MarkUp/Guide/Advanced.html for example tables echo " " done # FIXME package should be an anchor/link cat <

Generated by $0 on `hostname --fqdn` at `date --rfc-3339=seconds`, using output from whohas.

EOT
distributionpackageversionsizedaterepositoryurl
$distribution$package$version$size$date$repository$url