Esempio n. 1
0
File: info.c Progetto: Minipig/dpkg
void do_showinfo(const char* const* argv) {
  const char *debar, *directory;
  struct pkginfo *pkg;
  struct pkg_format_node *fmt = pkg_format_parse(showformat);

  if (!fmt)
    ohshit(_("Error in format"));

  info_prepare(&argv,&debar,&directory,1);

  parsedb(CONTROLFILE, pdb_recordavailable | pdb_rejectstatus | pdb_ignorefiles,
          &pkg, NULL);
  pkg_format_show(fmt, pkg, &pkg->available);
}
Esempio n. 2
0
int
do_showinfo(const char *const *argv)
{
  const char *debar, *dir;
  char *controlfile;
  struct pkginfo *pkg;
  struct pkg_format_node *fmt = pkg_format_parse(showformat);

  if (!fmt)
    ohshit(_("Error in format"));

  info_prepare(&argv, &debar, &dir, 1);

  m_asprintf(&controlfile, "%s/%s", dir, CONTROLFILE);
  parsedb(controlfile, pdb_parse_binary | pdb_ignorefiles, &pkg);
  pkg_format_show(fmt, pkg, &pkg->available);
  pkg_format_free(fmt);
  free(controlfile);

  return 0;
}