1 if [ -e "$NIX_ATTRS_SH_FILE" ]; then .
"$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh
]; then . .attrs.sh
; fi
6 if ! [ -f "$cacheDB" ]; then
7 echo "Creating cache DB $cacheDB"
8 mtn
--db "$cacheDB" db init
11 echo "getting revision $selector";
14 for source in $dbs; do
15 if mtn pull
--db "$cacheDB" "$source" "${branch}"; then
16 revision
="$(mtn --db "$cacheDB" au toposort $(mtn --db "$cacheDB" au select "$selector") | tail -1)";
17 if [ -n "$revision" ]; then
18 if mtn
--db "$cacheDB" au get_revision
"$revision"; then
19 echo "found revision $revision"
22 echo "revision $revision does not exist";
25 echo "selector $selector does not match any revision";
28 echo "pulling branch $branch wasn't successful";
30 if test -n "$done"; then
35 echo "checking out the revision $revision";
37 if test -n "$done"; then
38 mtn checkout
--db "$cacheDB" -r "$revision" "$out" -b "${branch}"
40 echo "Needed revision still not found. Exiting";
44 echo "clearing _MTN in the output"