pkg_list_free(pkg, PKG_SHLIBS_PROVIDED);
if (pkg->rootfd != -1)
close(pkg->rootfd);
pkg->rootfd = -1;
pkg->type = type;
}