fi
}
-# global var to store all final deps order
-BUILD_ORDER="libgmp libmpfr libmpc binutils glibc zlib gcc"
+ALT_START=0
-for i in $(find . -type f -name 'Pkgfile' -exec dirname {} \;); do
+# check for passed arguments
+if [ $# -ne 0 ]; then
+ # use package as starting point
+ ALT_START=1
+ START_PKG=$1
+ BUILD_ORDER=""
+else
+ # global var to store all final deps order
+ BUILD_ORDER="libgmp libmpfr libmpc binutils glibc zlib gcc"
+fi
+
+for i in $(find . -type f -name 'Pkgfile' -exec dirname {} \; | sort); do
PKG="$(basename $i)"
case $PKG in
# toolchain ports must be in order
getRecursiveDeps "$PKG"
done
-echo $BUILD_ORDER | tr ' ' '\n'
+if [ $ALT_START -eq 0 ]; then
+ echo $BUILD_ORDER | tr ' ' '\n'
+else
+ echo $BUILD_ORDER | sed "s|.* $START_PKG|$START_PKG|" | tr ' ' '\n'
+fi
echo
# End fo file