split out read_dpkg_* functions