Add more debug code for buildpkg