fragment: refactor using pkg_list_t framework