#! /bin/sh ############################################################################# # recover broken installed.db from package download directory packdir=$(cygpath $(cat /etc/setup/last-cache)) echo INSTALLED.DB 2 (cd "$packdir"; find . -name "*.bz2") | sed -e "s,.*/,," -e "s,\(-[0-9]\), \1," -e "s,\([^ ]*\) \(.*\),\1\2 \1," | sort -nr | uniq -f 1 | sort -n | sed -e "s,\(.*\) \([^ ]*\),\2 \1 0," echo >&2 echo "Redirect output to /etc/setup/installed.db to overwrite (CAUTION!)" >&2