xbps-pkgdb: check that plist dict is there in version target.

--HG--
extra : convert_revision : 926363d195d0e4ce4fcd2e715823f43fd839561c
This commit is contained in:
Juan RP 2008-12-27 08:43:13 +01:00
parent 7f5a76ace3
commit 3b702f33aa

View File

@ -130,13 +130,18 @@ main(int argc, char **argv)
if (argc != 3)
usage();
pkgdict = xbps_find_pkg_in_dict(
prop_dictionary_internalize_from_file(dbfile), argv[2]);
dbdict = prop_dictionary_internalize_from_file(dbfile);
if (dbdict == NULL)
exit(1);
pkgdict = xbps_find_pkg_in_dict(dbdict, argv[2]);
if (pkgdict == NULL)
exit(1);
if (!prop_dictionary_get_cstring_nocopy(pkgdict, "version",
&version))
exit(1);
printf("%s\n", version);
} else if (strcasecmp(argv[1], "sanitize-plist") == 0) {