[templates] beautify needed_libs template output