pkgdb: added "repository-origin" obj to know its origin repository.
This commit is contained in:
parent
26c1e80933
commit
4070255529
7
NEWS
7
NEWS
@ -1,5 +1,12 @@
|
||||
xbps-0.37 (???):
|
||||
|
||||
* A new object is now recorded in the pkgdb to see the origin repository of
|
||||
which a package was installed from, i.e:
|
||||
|
||||
$ xbps-query --property=repository-origin pkg
|
||||
...
|
||||
$
|
||||
|
||||
* xbps-remove(8): the -n,--dry-run option does not acquire the pkgdb file lock
|
||||
anymore, so that any user can use this mode even without write permission to
|
||||
the target pkgdb.
|
||||
|
@ -39,7 +39,7 @@ xbps_register_pkg(struct xbps_handle *xhp, xbps_dictionary_t pkgrd)
|
||||
char outstr[64];
|
||||
time_t t;
|
||||
struct tm *tmp;
|
||||
const char *desc, *pkgver;
|
||||
const char *desc, *pkgver, *repo;
|
||||
char *pkgname = NULL, *buf, *sha256;
|
||||
int rv = 0;
|
||||
bool autoinst = false;
|
||||
@ -48,6 +48,7 @@ xbps_register_pkg(struct xbps_handle *xhp, xbps_dictionary_t pkgrd)
|
||||
|
||||
xbps_dictionary_get_cstring_nocopy(pkgrd, "pkgver", &pkgver);
|
||||
xbps_dictionary_get_cstring_nocopy(pkgrd, "short_desc", &desc);
|
||||
xbps_dictionary_get_cstring_nocopy(pkgrd, "repository", &repo);
|
||||
xbps_dictionary_get_bool(pkgrd, "automatic-install", &autoinst);
|
||||
provides = xbps_dictionary_get(pkgrd, "provides");
|
||||
rundeps = xbps_dictionary_get(pkgrd, "run_depends");
|
||||
@ -118,6 +119,12 @@ xbps_register_pkg(struct xbps_handle *xhp, xbps_dictionary_t pkgrd)
|
||||
rv = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
/* Save the repository origin which was used to install the pkg from */
|
||||
if (!xbps_dictionary_set_cstring(pkgd, "repository-origin", repo)) {
|
||||
xbps_dbg_printf(xhp, "%s: repository-origin set failed!\n", pkgver);
|
||||
rv = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a hash for the pkg's metafile.
|
||||
|
Loading…
Reference in New Issue
Block a user