+
+ # package in database?
+ if [ -z $base ] ; then
+ if [ "`grep "^$pkg\ -" $DBF`" = "" ] ; then
+ echo "sorry, package $package not found ..."
+ echo "(use 'hdw-get update' to update database)"
+ exit 1
+ fi
+ fi
+
+ # check for runtime deps
+ if [ -z $no_dep ] ; then
+ deps="`grep "^$pkg\ -" $DBF | sed 's/.* -//'`"
+ udeps=""
+ tudeps=""
+ for dep in $deps; do
+ [ "$dep" != "$pkg" ] &&
+ [ ! -f $inst_root/$FL_DIR/$dep-[0-9]* ] && \
+ 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
+ [ "$dep" = "$pkg" ] && break
+ [ -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
+ if [ ".$udeps" != "." ] ; then
+ echo "$pkg uninstalled depends:"
+ echo "$udeps"
+ echo
+ echo "continue? [y,n] (default 'n')"
+ answer="n"
+ if [ "$auto_resolve_deps" != "1" ] ; 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
+ fi
+
+ if [ "$simulate" != "1" -a "$answer" = "y" ] ; then