2 # Convert the raw package-list to mediawiki table format
3 # usage: cat sysresccd-packages-list.txt | ./pkglist-to-wm-table.sh > pkglist-for-mediawiki.txt
4 # input: gentoo package-list, one package per line such as "sys-block/parted-1.7.1
5 # output: table formatted with the wikipedia syntax
6 # goal: prepare the package list for the website
8 ignore="dev-libs dev-util media-fonts media-libs sys-libs virtual x11-apps x11-libs x11-proto x11-misc perl-core dev-perl dev-cpp net-libs net-nds sys-devel virtual"
10 echo "{| class=\"wikitable\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\""
11 echo "! style=\"background:#4488FF;\" width=170 | Category"
12 echo "! style=\"background:#4488FF;\" width=270 | Package"
14 rm -f /tmp/pkglist.txt
15 echo $ignore | sed -e "s/ /\n/g" > /tmp/pkglist.txt
20 echo "$package" | grep -q -f /tmp/pkglist.txt
23 categorie=$(echo $package | cut -d/ -f1)
24 packagename=$(echo $package | cut -d/ -f2)
33 echo "|-align=\"center\" style=\"background:$coul;\""
35 echo "| $packagename "