New pkg metadata structure for 0.18. See the NEWS file for info.

This commit is contained in:
Juan RP
2012-11-16 16:55:35 +01:00
parent db4b542d40
commit 34bd49f85a
28 changed files with 672 additions and 534 deletions

View File

@@ -49,6 +49,7 @@ xbps_register_pkg(struct xbps_handle *xhp, prop_dictionary_t pkgrd, bool flush)
time_t t;
struct tm *tmp;
const char *pkgname, *version, *desc, *pkgver;
char *buf, *sha256;
int rv = 0;
bool autoinst = false;
@@ -156,6 +157,15 @@ xbps_register_pkg(struct xbps_handle *xhp, prop_dictionary_t pkgrd, bool flush)
goto out;
}
}
/*
* Create a hash for the pkg's metafile.
*/
buf = xbps_xasprintf("%s/.%s.plist", xhp->metadir, pkgname);
sha256 = xbps_file_hash(buf);
assert(sha256);
prop_dictionary_set_cstring(pkgd, "metafile-sha256", sha256);
free(sha256);
free(buf);
/*
* Remove unneeded objs from pkg dictionary.
*/