Ok, basically resolve_deps() is broken. It gets called once with the $additional (--include=) package list. It calls 'PKGS=$PKGDETAILS GETDEPS $PKGS", in a loop while $PKGS is not empty. But pkgdetails only looks at the first package on the list at a time.
So after the first call to pkgdetails, only the first package in $PKGS was ever looked up, and all others are gone.
Which means only the first package listed ever gets its dependencies looked up.
It's worth seeing if debian's debootstrap has a fix for this. If not, I think the best fix is to change that loop so that we call pkgdetails GETDEPS for one package out of $PKGS at a time (making sure to weed out duplicates at every step of course, but this time by simply using 'without' at the end of each loop against a list of already-looked-up packages) instead of trying to overload $PKGS as it currently does.
Ok, basically resolve_deps() is broken. It gets called once with the $additional (--include=) package list. It calls 'PKGS=$PKGDETAILS GETDEPS $PKGS", in a loop while $PKGS is not empty. But pkgdetails only looks at the first package on the list at a time.
So after the first call to pkgdetails, only the first package in $PKGS was ever looked up, and all others are gone.
Which means only the first package listed ever gets its dependencies looked up.
It's worth seeing if debian's debootstrap has a fix for this. If not, I think the best fix is to change that loop so that we call pkgdetails GETDEPS for one package out of $PKGS at a time (making sure to weed out duplicates at every step of course, but this time by simply using 'without' at the end of each loop against a list of already-looked-up packages) instead of trying to overload $PKGS as it currently does.