#!/bin/sh create_deps_graph () { for f in $DEP_DIR/*; do printf "${f#$DEP_DIR/}:" local deps="" [ -f "$f" ] && while read line; do for dep in $line; do case "$deps" in *"$dep"*);; *) deps="$deps $dep";; esac done done < $f printf "%s\n" "$deps" done } mirror () { local MIRROR_DIR=${SYSROOT}${1:-$MIRROR_DIR} mkdir -p $MIRROR_DIR create_deps_graph > $MIRROR_DIR/deps.graph local packages=$(list) cd $MIRROR_DIR fetch $packages cd - }