#!/bin/sh
# url: http://pank.org/scripts/
# description: get windows live packages url
# comment: csh bash
# platform: all

if [ -z $1 ] ; then
    echo "`basename $0` {catalog-web.cab url}"
    echo "e.g. `basename $0` http://g.live.com/1rewlive3cat/zh-cht/catalog-web.cab"
    exit
fi

IFS='
'
wget -q $1
cabextract -q catalog-web.cab 2> /dev/null
for i in `egrep "<name|<source" catalog.xml | awk -F"[<>]" '{print $3}'`
do
    if [ ${#i} -le 80 ] ; then
        echo -n "$i "
    else
        echo $i
    fi
done