+ # does package exist?
+ pkg=`basename $package | sed 's/.tar.bz2//'`
+ if [ -f $inst_root/$FL_DIR/${pkg}-[0-9]* ] ; then
+ echo "$pkg seems to be installed, candidates:"
+ for i in $inst_root/$FL_DIR/${pkg}-[0-9]*; do
+ echo "-> $i"
+ done
+ exit 1
+ fi
+
+ # package in database?
+ if [ "`grep "^$pkg\ -" $DBF`" = "" ] ; then
+ echo "sorry, package $package not found ..."
+ echo "(use 'hdw-get update' to update database)"
+ exit 1
+ fi
+
+ # check for runtime deps
+ if [ -z $no_deps ] ; then
+ deps="`grep "^$pkg\ -" $DBF | sed 's/.* -//'`"
+ udeps=""
+ tudeps=""
+ for dep in $deps; do
+ [ ! -f $inst_root/$FL_DIR/$dep-* ] && \
+ udeps="$dep $udeps"
+ done
+ while [ "$udeps" != "$tudeps" ] ; do
+ tudeps="$udeps"
+ for tdep in $tudeps; do
+ deps="`grep "^$tdep\ -" $DBF | sed 's/.* -//'`"
+ for dep in $deps; do
+ exists=0
+ [ -f $inst_root/$FL_DIR/$dep-* ] && \
+ break
+ for i in $udeps; do
+ [ "$i" = "$dep" ] && exists=1
+ done
+ [ "$exists" = "0" ] && \
+ udeps="$udeps $dep"
+ done
+ done
+ done
+ echo "$pkg depends on the following uninstalled packages:"
+ echo "$udeps"
+ echo
+ echo "continue? [y,n] (default 'n')"
+ if [ -z $auto_resolve_deps ] ; then
+ read answer
+ if [ "$answer" = "y" ] ; then
+ for i in $udeps; do
+ [ "$simulate" != "1" ] && \
+ $0 -no-dep install $inst_root $i
+ done
+ fi
+ fi
+ fi
+
+ if [ "$simulate" != "1" ] ; then
+