xbps-rindex: added -f --force flag to forcefully register a pkg with -a --add.

This commit is contained in:
Juan RP
2013-05-02 10:46:30 +02:00
parent 30747b1c8b
commit 53217fd51b
5 changed files with 22 additions and 9 deletions

View File

@ -41,7 +41,7 @@
* and entry when it's necessary.
*/
int
index_add(struct xbps_handle *xhp, int argc, char **argv)
index_add(struct xbps_handle *xhp, int argc, char **argv, bool force)
{
prop_array_t filespkgar, pkg_files, pkg_links, pkg_cffiles;
prop_dictionary_t idx, idxfiles, newpkgd, newpkgfilesd, curpkgd;
@ -134,7 +134,8 @@ index_add(struct xbps_handle *xhp, int argc, char **argv)
free(pkgname);
return errno;
}
} else {
} else if (!force) {
/* Only check version if !force */
prop_dictionary_get_cstring_nocopy(curpkgd,
"pkgver", &oldpkgver);
prop_dictionary_get_cstring_nocopy(curpkgd,