#!/bin/bash
# better display of info about an installed package
# requires exact name of package as argument

# attempt to find where installed:
grep -hiA5 $1 /usr/lib/ipkg/status /mnt/cf/usr/lib/ipkg/status /mnt/card/usr/lib/ipkg/status \
        | sed '/^$/,$d' | tee /tmp/hold
echo
# Not often set!
#where=`grep '^Root:' /tmp/hold`
#where=${where##Root: }
#cat $where/usr/lib/ipkg/info/$1* 2>/dev/null
where=`ls {,/mnt/cf,/mnt/card}/usr/lib/ipkg/info/$1.list 2>/dev/null | sed 's/usr.*//'`
# It's called parametric substitution
cat {,/mnt/cf,/mnt/card}/usr/lib/ipkg/info/$1* 2>/dev/null | sed "s|^|$where|;s|//|/|"
