git clone git://git.nlnetlabs.nl/ldns/ || error_cleanup "git command failed"
cd ldns || error_cleanup "LDNS not exported correctly from git"
git checkout "$CHECKOUT" || error_cleanup "Could not checkout $CHECKOUT"
-git submodule update --init || error_cleanup "Could not checkout submodules"
+git submodule update --init || error_cleanup "Could not update submodules"
+(cd contrib/Net-LDNS; git checkout master) || error_cleanup "Could not checkout Net-LDNS contribution"
info "Running Libtoolize script (libtoolize)."
libtoolize -c --install || libtoolize -c || error_cleanup "Libtoolize failed."
# custom removes
find . -name .c-mode-rc.el -exec rm {} \;
find . -name .cvsignore -exec rm {} \;
+find . -name ".git*" -exec rm -fr {} \;
rm -rf lua
rm -rf masterdont
rm makedist.sh || error_cleanup "Failed to remove makedist.sh."