extract packages to external script