Use C99 for loop initializers.
That means that a C99 compiler is now mandatory.
This commit is contained in:
parent
9a9c816552
commit
4057e4961c
2
NEWS
2
NEWS
@ -1,5 +1,7 @@
|
||||
xbps-0.26 (???):
|
||||
|
||||
* A C99 compiler is now required due to the use of for loop initializers.
|
||||
|
||||
* Fixed #14 from github: "Removing recursively does not respect manual installation
|
||||
mode for dependencies". See https://github.com/xtraeme/xbps/issues/14
|
||||
for more information.
|
||||
|
@ -163,7 +163,6 @@ entry_is_conf_file(const char *file)
|
||||
{
|
||||
xbps_array_t a;
|
||||
const char *curfile;
|
||||
unsigned int i;
|
||||
|
||||
assert(file);
|
||||
|
||||
@ -171,7 +170,7 @@ entry_is_conf_file(const char *file)
|
||||
if (a == NULL || xbps_array_count(a) == 0)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < xbps_array_count(a); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(a); i++) {
|
||||
xbps_array_get_cstring_nocopy(a, i, &curfile);
|
||||
if (strcmp(file, curfile) == 0)
|
||||
return true;
|
||||
|
@ -144,7 +144,6 @@ generate_conf_file(void)
|
||||
{
|
||||
xbps_dictionary_t d, d2;
|
||||
struct defprops *dfp;
|
||||
size_t i;
|
||||
const char *outfile = "xbps-dgraph.conf";
|
||||
|
||||
d = xbps_dictionary_create();
|
||||
@ -165,7 +164,7 @@ generate_conf_file(void)
|
||||
xbps_dictionary_set(d, "node-sub", d2);
|
||||
xbps_object_release(d2);
|
||||
|
||||
for (i = 0; i < __arraycount(dfprops); i++) {
|
||||
for (unsigned int i = 0; i < __arraycount(dfprops); i++) {
|
||||
dfp = &dfprops[i];
|
||||
d2 = xbps_dictionary_get(d, dfp->sect);
|
||||
xbps_dictionary_set_cstring_nocopy(d2, dfp->prop, dfp->val);
|
||||
@ -187,14 +186,13 @@ write_conf_property_on_stream(FILE *f,
|
||||
xbps_array_t allkeys, allkeys2;
|
||||
xbps_dictionary_keysym_t dksym, dksym2;
|
||||
xbps_object_t keyobj, keyobj2;
|
||||
size_t i, x;
|
||||
const char *cf_val, *keyname, *keyname2;
|
||||
|
||||
/*
|
||||
* Iterate over the main dictionary.
|
||||
*/
|
||||
allkeys = xbps_dictionary_all_keys(confd);
|
||||
for (i = 0; i < xbps_array_count(allkeys); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(allkeys); i++) {
|
||||
dksym = xbps_array_get(allkeys, i);
|
||||
keyname = xbps_dictionary_keysym_cstring_nocopy(dksym);
|
||||
keyobj = xbps_dictionary_get_keysym(confd, dksym);
|
||||
@ -205,7 +203,7 @@ write_conf_property_on_stream(FILE *f,
|
||||
* Iterate over the dictionary sections [edge/graph/node].
|
||||
*/
|
||||
allkeys2 = xbps_dictionary_all_keys(keyobj);
|
||||
for (x = 0; x < xbps_array_count(allkeys2); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(allkeys2); x++) {
|
||||
dksym2 = xbps_array_get(allkeys2, x);
|
||||
keyname2 = xbps_dictionary_keysym_cstring_nocopy(dksym2);
|
||||
keyobj2 = xbps_dictionary_get_keysym(keyobj, dksym2);
|
||||
@ -244,11 +242,10 @@ parse_array_in_pkg_dictionary(FILE *f, xbps_dictionary_t plistd,
|
||||
{
|
||||
xbps_dictionary_keysym_t dksym;
|
||||
xbps_object_t keyobj, sub_keyobj;
|
||||
unsigned int i, x;
|
||||
const char *tmpkeyname, *cfprop, *optnodetmp;
|
||||
char *optnode, *keyname;
|
||||
|
||||
for (i = 0; i < xbps_array_count(allkeys); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(allkeys); i++) {
|
||||
dksym = xbps_array_get(allkeys, i);
|
||||
tmpkeyname = xbps_dictionary_keysym_cstring_nocopy(dksym);
|
||||
/* Ignore these objects */
|
||||
@ -268,7 +265,7 @@ parse_array_in_pkg_dictionary(FILE *f, xbps_dictionary_t plistd,
|
||||
|
||||
xbps_dictionary_get_cstring_nocopy(sub_confd, "opt-style", &cfprop);
|
||||
/* Check if object is optional and fill it in */
|
||||
for (x = 0; x < __arraycount(optional_objs); x++) {
|
||||
for (unsigned int x = 0; x < __arraycount(optional_objs); x++) {
|
||||
if (strcmp(keyname, optional_objs[x]) == 0) {
|
||||
optnode = xbps_xasprintf("[style=\"%s\"",
|
||||
cfprop);
|
||||
@ -286,7 +283,7 @@ parse_array_in_pkg_dictionary(FILE *f, xbps_dictionary_t plistd,
|
||||
fprintf(f, " %s %s];\n", keyname,
|
||||
optnodetmp);
|
||||
|
||||
for (x = 0; x < xbps_array_count(keyobj); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(keyobj); x++) {
|
||||
sub_keyobj = xbps_array_get(keyobj, x);
|
||||
if (xbps_object_type(sub_keyobj) == XBPS_TYPE_STRING) {
|
||||
/*
|
||||
|
@ -48,10 +48,9 @@ struct transaction {
|
||||
static void
|
||||
show_missing_deps(xbps_array_t a)
|
||||
{
|
||||
unsigned int i;
|
||||
const char *str;
|
||||
|
||||
for (i = 0; i < xbps_array_count(a); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(a); i++) {
|
||||
xbps_array_get_cstring_nocopy(a, i, &str);
|
||||
fprintf(stderr, "%s\n", str);
|
||||
}
|
||||
@ -60,10 +59,9 @@ show_missing_deps(xbps_array_t a)
|
||||
static void
|
||||
show_conflicts(xbps_array_t a)
|
||||
{
|
||||
unsigned int i;
|
||||
const char *str;
|
||||
|
||||
for (i = 0; i < xbps_array_count(a); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(a); i++) {
|
||||
xbps_array_get_cstring_nocopy(a, i, &str);
|
||||
fprintf(stderr, "%s\n", str);
|
||||
}
|
||||
|
@ -49,7 +49,6 @@ check_pkg_rundeps(struct xbps_handle *xhp, const char *pkgname, void *arg)
|
||||
{
|
||||
xbps_dictionary_t pkg_propsd = arg;
|
||||
xbps_array_t array;
|
||||
unsigned int i;
|
||||
const char *reqpkg;
|
||||
bool test_broken = false;
|
||||
|
||||
@ -57,7 +56,7 @@ check_pkg_rundeps(struct xbps_handle *xhp, const char *pkgname, void *arg)
|
||||
return 0;
|
||||
|
||||
array = xbps_dictionary_get(pkg_propsd, "run_depends");
|
||||
for (i = 0; i < xbps_array_count(array); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(array); i++) {
|
||||
xbps_array_get_cstring_nocopy(array, i, &reqpkg);
|
||||
if (xbps_pkg_is_installed(xhp, reqpkg) <= 0) {
|
||||
xbps_error_printf("%s: dependency not satisfied: %s\n",
|
||||
|
@ -77,7 +77,6 @@ check_pkg_symlinks(struct xbps_handle *xhp, const char *pkgname, void *arg)
|
||||
xbps_array_t array;
|
||||
xbps_object_t obj;
|
||||
xbps_dictionary_t filesd = arg;
|
||||
unsigned int i;
|
||||
const char *file, *tgt = NULL;
|
||||
char *path, *p, *buf, *buf2, *lnk, *dname, *tgt_path;
|
||||
int rv;
|
||||
@ -87,7 +86,7 @@ check_pkg_symlinks(struct xbps_handle *xhp, const char *pkgname, void *arg)
|
||||
if (array == NULL)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < xbps_array_count(array); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(array); i++) {
|
||||
obj = xbps_array_get(array, i);
|
||||
if (!xbps_dictionary_get_cstring_nocopy(obj, "target", &tgt)) {
|
||||
xbps_warn_printf("%s: `%s' symlink with "
|
||||
|
@ -46,7 +46,6 @@ pkgdb_format_021(struct xbps_handle *xhp, const char *plist_new)
|
||||
{
|
||||
xbps_array_t array, rdeps;
|
||||
xbps_dictionary_t pkgdb, pkgd;
|
||||
unsigned int i;
|
||||
char *pkgname, *plist;
|
||||
|
||||
plist = xbps_xasprintf("%s/pkgdb.plist", xhp->metadir);
|
||||
@ -71,7 +70,7 @@ pkgdb_format_021(struct xbps_handle *xhp, const char *plist_new)
|
||||
pkgdb = xbps_dictionary_create();
|
||||
assert(pkgdb);
|
||||
|
||||
for (i = 0; i < xbps_array_count(array); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(array); i++) {
|
||||
pkgd = xbps_array_get(array, i);
|
||||
xbps_dictionary_get_cstring(pkgd, "pkgname", &pkgname);
|
||||
rdeps = xbps_dictionary_get(pkgd, "run_depends");
|
||||
|
@ -128,13 +128,12 @@ list_orphans(struct xbps_handle *xhp)
|
||||
{
|
||||
xbps_array_t orphans;
|
||||
const char *pkgver;
|
||||
unsigned int i;
|
||||
|
||||
orphans = xbps_find_pkg_orphans(xhp, NULL);
|
||||
if (orphans == NULL)
|
||||
return EINVAL;
|
||||
|
||||
for (i = 0; i < xbps_array_count(orphans); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(orphans); i++) {
|
||||
xbps_dictionary_get_cstring_nocopy(xbps_array_get(orphans, i),
|
||||
"pkgver", &pkgver);
|
||||
printf("%s\n", pkgver);
|
||||
|
@ -54,7 +54,6 @@ match_files_by_pattern(xbps_dictionary_t pkg_filesd,
|
||||
xbps_array_t array;
|
||||
xbps_object_t obj;
|
||||
const char *keyname, *filestr, *typestr;
|
||||
unsigned int i;
|
||||
int x;
|
||||
|
||||
keyname = xbps_dictionary_keysym_cstring_nocopy(key);
|
||||
@ -71,7 +70,7 @@ match_files_by_pattern(xbps_dictionary_t pkg_filesd,
|
||||
return;
|
||||
|
||||
array = xbps_dictionary_get_keysym(pkg_filesd, key);
|
||||
for (i = 0; i < xbps_array_count(array); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(array); i++) {
|
||||
obj = xbps_array_get(array, i);
|
||||
filestr = NULL;
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "file", &filestr);
|
||||
@ -96,7 +95,6 @@ ownedby_pkgdb_cb(struct xbps_handle *xhp,
|
||||
xbps_dictionary_t pkgmetad;
|
||||
xbps_array_t files_keys;
|
||||
struct ffdata *ffd = arg;
|
||||
unsigned int i;
|
||||
const char *pkgver;
|
||||
|
||||
(void)obj_key;
|
||||
@ -110,7 +108,7 @@ ownedby_pkgdb_cb(struct xbps_handle *xhp,
|
||||
assert(pkgmetad);
|
||||
|
||||
files_keys = xbps_dictionary_all_keys(pkgmetad);
|
||||
for (i = 0; i < xbps_array_count(files_keys); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(files_keys); i++) {
|
||||
match_files_by_pattern(pkgmetad,
|
||||
xbps_array_get(files_keys, i), ffd, pkgver);
|
||||
}
|
||||
@ -127,13 +125,12 @@ ownedby(struct xbps_handle *xhp, int npatterns, char **patterns)
|
||||
{
|
||||
struct ffdata ffd;
|
||||
char *rfile;
|
||||
int i;
|
||||
|
||||
ffd.npatterns = npatterns;
|
||||
ffd.patterns = patterns;
|
||||
pthread_mutex_init(&ffd.mtx, NULL);
|
||||
|
||||
for (i = 0; i < npatterns; i++) {
|
||||
for (int i = 0; i < npatterns; i++) {
|
||||
rfile = realpath(patterns[i], NULL);
|
||||
if (rfile)
|
||||
patterns[i] = rfile;
|
||||
@ -150,12 +147,10 @@ repo_match_cb(struct xbps_handle *xhp _unused,
|
||||
{
|
||||
struct ffdata *ffd = arg;
|
||||
const char *filestr;
|
||||
unsigned int i;
|
||||
int x;
|
||||
|
||||
for (i = 0; i < xbps_array_count(obj); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(obj); i++) {
|
||||
xbps_array_get_cstring_nocopy(obj, i, &filestr);
|
||||
for (x = 0; x < ffd->npatterns; x++) {
|
||||
for (int x = 0; x < ffd->npatterns; x++) {
|
||||
if ((fnmatch(ffd->patterns[x], filestr, FNM_PERIOD)) == 0) {
|
||||
printf("%s: %s (%s)\n",
|
||||
key, filestr, ffd->repouri);
|
||||
@ -192,13 +187,13 @@ repo_ownedby(struct xbps_handle *xhp, int npatterns, char **patterns)
|
||||
{
|
||||
struct ffdata ffd;
|
||||
char *rfile;
|
||||
int i, rv;
|
||||
int rv;
|
||||
|
||||
pthread_mutex_init(&ffd.mtx, NULL);
|
||||
ffd.npatterns = npatterns;
|
||||
ffd.patterns = patterns;
|
||||
|
||||
for (i = 0; i < npatterns; i++) {
|
||||
for (int i = 0; i < npatterns; i++) {
|
||||
rfile = realpath(patterns[i], NULL);
|
||||
if (rfile)
|
||||
patterns[i] = rfile;
|
||||
|
@ -58,17 +58,17 @@ print_results(struct xbps_handle *xhp, struct search_data *sd)
|
||||
{
|
||||
const char *pkgver, *desc, *inststr;
|
||||
char tmp[256], *out;
|
||||
unsigned int i, j, tlen = 0, len = 0;
|
||||
unsigned int j, tlen = 0, len = 0;
|
||||
|
||||
/* Iterate over results array and find out largest pkgver string */
|
||||
for (i = 0; i < xbps_array_count(sd->results); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(sd->results); i++) {
|
||||
xbps_array_get_cstring_nocopy(sd->results, i, &pkgver);
|
||||
len = strlen(pkgver);
|
||||
if (tlen == 0 || len > tlen)
|
||||
tlen = len;
|
||||
i++;
|
||||
}
|
||||
for (i = 0; i < xbps_array_count(sd->results); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(sd->results); i++) {
|
||||
xbps_array_get_cstring_nocopy(sd->results, i, &pkgver);
|
||||
xbps_array_get_cstring_nocopy(sd->results, i+1, &desc);
|
||||
strncpy(tmp, pkgver, sizeof(tmp));
|
||||
@ -106,12 +106,11 @@ search_array_cb(struct xbps_handle *xhp _unused,
|
||||
{
|
||||
struct search_data *sd = arg;
|
||||
const char *pkgver, *desc;
|
||||
int x;
|
||||
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "short_desc", &desc);
|
||||
|
||||
for (x = 0; x < sd->npatterns; x++) {
|
||||
for (int x = 0; x < sd->npatterns; x++) {
|
||||
bool vpkgfound = false;
|
||||
|
||||
if (xbps_match_virtual_pkg_in_dict(obj, sd->patterns[x], false))
|
||||
|
@ -40,16 +40,14 @@ print_rdeps(struct xbps_handle *xhp, xbps_array_t rdeps,
|
||||
xbps_array_t currdeps;
|
||||
xbps_dictionary_t pkgd;
|
||||
const char *pkgdep;
|
||||
unsigned int i;
|
||||
int j;
|
||||
|
||||
if (!origin)
|
||||
(*indent)++;
|
||||
|
||||
for (i = 0; i < xbps_array_count(rdeps); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(rdeps); i++) {
|
||||
xbps_array_get_cstring_nocopy(rdeps, i, &pkgdep);
|
||||
if (!origin || !full)
|
||||
for (j = 0; j < *indent; j++)
|
||||
for (int j = 0; j < *indent; j++)
|
||||
putchar(' ');
|
||||
|
||||
printf("%s\n", pkgdep);
|
||||
@ -98,10 +96,9 @@ show_pkg_revdeps(struct xbps_handle *xhp, const char *pkg)
|
||||
{
|
||||
xbps_array_t reqby;
|
||||
const char *pkgdep;
|
||||
unsigned int i;
|
||||
|
||||
if ((reqby = xbps_pkgdb_get_pkg_revdeps(xhp, pkg)) != NULL) {
|
||||
for (i = 0; i < xbps_array_count(reqby); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(reqby); i++) {
|
||||
xbps_array_get_cstring_nocopy(reqby, i, &pkgdep);
|
||||
printf("%s\n", pkgdep);
|
||||
}
|
||||
@ -132,13 +129,12 @@ repo_show_pkg_revdeps(struct xbps_handle *xhp, const char *pkg)
|
||||
{
|
||||
xbps_array_t revdeps;
|
||||
const char *pkgver;
|
||||
unsigned int i;
|
||||
int rv;
|
||||
|
||||
revdeps = xbps_rpool_get_pkg_revdeps(xhp, pkg);
|
||||
rv = errno;
|
||||
|
||||
for (i = 0; i < xbps_array_count(revdeps); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(revdeps); i++) {
|
||||
xbps_array_get_cstring_nocopy(revdeps, i, &pkgver);
|
||||
printf("%s\n", pkgver);
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ print_value_obj(const char *keyname, xbps_object_t obj,
|
||||
xbps_array_t allkeys;
|
||||
xbps_object_t obj2, keysym;
|
||||
const char *ksymname, *value;
|
||||
unsigned int i;
|
||||
char size[8];
|
||||
|
||||
if (indent == NULL)
|
||||
@ -73,7 +72,7 @@ print_value_obj(const char *keyname, xbps_object_t obj,
|
||||
case XBPS_TYPE_ARRAY:
|
||||
if (!raw)
|
||||
printf("%s%s:\n", indent, keyname);
|
||||
for (i = 0; i < xbps_array_count(obj); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(obj); i++) {
|
||||
obj2 = xbps_array_get(obj, i);
|
||||
if (xbps_object_type(obj2) == XBPS_TYPE_STRING) {
|
||||
value = xbps_string_cstring_nocopy(obj2);
|
||||
@ -86,7 +85,7 @@ print_value_obj(const char *keyname, xbps_object_t obj,
|
||||
break;
|
||||
case XBPS_TYPE_DICTIONARY:
|
||||
allkeys = xbps_dictionary_all_keys(obj);
|
||||
for (i = 0; i < xbps_array_count(allkeys); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(allkeys); i++) {
|
||||
keysym = xbps_array_get(allkeys, i);
|
||||
ksymname = xbps_dictionary_keysym_cstring_nocopy(keysym);
|
||||
obj2 = xbps_dictionary_get_keysym(obj, keysym);
|
||||
@ -151,11 +150,10 @@ static void
|
||||
print_srcrevs(const char *keyname, xbps_string_t obj)
|
||||
{
|
||||
const char *str = xbps_string_cstring_nocopy(obj);
|
||||
unsigned int i;
|
||||
|
||||
/* parse string appending a \t after EOL */
|
||||
printf("%s:\n ", keyname);
|
||||
for (i = 0; i < strlen(str); i++) {
|
||||
for (unsigned int i = 0; i < strlen(str); i++) {
|
||||
if (str[i] == '\n')
|
||||
printf("\n ");
|
||||
else
|
||||
@ -170,10 +168,9 @@ show_pkg_info(xbps_dictionary_t dict)
|
||||
xbps_array_t all_keys;
|
||||
xbps_object_t obj, keysym;
|
||||
const char *keyname;
|
||||
unsigned int i;
|
||||
|
||||
all_keys = xbps_dictionary_all_keys(dict);
|
||||
for (i = 0; i < xbps_array_count(all_keys); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(all_keys); i++) {
|
||||
keysym = xbps_array_get(all_keys, i);
|
||||
keyname = xbps_dictionary_keysym_cstring_nocopy(keysym);
|
||||
obj = xbps_dictionary_get_keysym(dict, keysym);
|
||||
@ -201,13 +198,12 @@ show_pkg_files(xbps_dictionary_t filesd)
|
||||
xbps_object_t obj;
|
||||
xbps_dictionary_keysym_t ksym;
|
||||
const char *keyname, *file;
|
||||
unsigned int i, x;
|
||||
|
||||
if (xbps_object_type(filesd) != XBPS_TYPE_DICTIONARY)
|
||||
return EINVAL;
|
||||
|
||||
allkeys = xbps_dictionary_all_keys(filesd);
|
||||
for (i = 0; i < xbps_array_count(allkeys); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(allkeys); i++) {
|
||||
ksym = xbps_array_get(allkeys, i);
|
||||
keyname = xbps_dictionary_keysym_cstring_nocopy(ksym);
|
||||
if ((strcmp(keyname, "files") &&
|
||||
@ -219,7 +215,7 @@ show_pkg_files(xbps_dictionary_t filesd)
|
||||
if (array == NULL || xbps_array_count(array) == 0)
|
||||
continue;
|
||||
|
||||
for (x = 0; x < xbps_array_count(array); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(array); x++) {
|
||||
obj = xbps_array_get(array, x);
|
||||
if (xbps_object_type(obj) != XBPS_TYPE_DICTIONARY)
|
||||
continue;
|
||||
|
@ -186,7 +186,6 @@ remove_pkg(struct xbps_handle *xhp, const char *pkgname, int cols,
|
||||
{
|
||||
xbps_array_t reqby;
|
||||
const char *pkgver;
|
||||
unsigned int x;
|
||||
int rv;
|
||||
|
||||
rv = xbps_transaction_remove_pkg(xhp, pkgname, recursive);
|
||||
@ -196,7 +195,7 @@ remove_pkg(struct xbps_handle *xhp, const char *pkgname, int cols,
|
||||
printf("WARNING: %s IS REQUIRED BY %u PACKAGE%s:\n\n",
|
||||
pkgname, xbps_array_count(reqby),
|
||||
xbps_array_count(reqby) > 1 ? "S" : "");
|
||||
for (x = 0; x < xbps_array_count(reqby); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(reqby); x++) {
|
||||
xbps_array_get_cstring_nocopy(reqby, x, &pkgver);
|
||||
print_package_line(pkgver, cols, false);
|
||||
}
|
||||
@ -238,7 +237,7 @@ main(int argc, char **argv)
|
||||
};
|
||||
struct xbps_handle xh;
|
||||
const char *rootdir, *cachedir, *conffile;
|
||||
int i, c, flags, rv;
|
||||
int c, flags, rv;
|
||||
bool yes, drun, recursive, ignore_revdeps, clean_cache;
|
||||
bool orphans, reqby_force;
|
||||
int maxcols;
|
||||
@ -350,7 +349,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
for (i = optind; i < argc; i++) {
|
||||
for (int i = optind; i < argc; i++) {
|
||||
rv = remove_pkg(&xh, argv[i], maxcols, recursive);
|
||||
if (rv == 0)
|
||||
continue;
|
||||
|
@ -52,8 +52,7 @@ index_add(struct xbps_handle *xhp, int argc, char **argv, bool force)
|
||||
const char *oldpkgver, *arch, *oldarch;
|
||||
char *pkgver, *pkgname, *sha256, *repodir, *buf;
|
||||
char *tmprepodir;
|
||||
unsigned int x;
|
||||
int i, rv, ret = 0;
|
||||
int rv, ret = 0;
|
||||
bool flush = false, found = false;
|
||||
|
||||
idx = idxfiles = newpkgd = newpkgfilesd = curpkgd = NULL;
|
||||
@ -81,7 +80,7 @@ index_add(struct xbps_handle *xhp, int argc, char **argv, bool force)
|
||||
/*
|
||||
* Process all packages specified in argv.
|
||||
*/
|
||||
for (i = 0; i < argc; i++) {
|
||||
for (int i = 0; i < argc; i++) {
|
||||
/*
|
||||
* Read metadata props plist dictionary from binary package.
|
||||
*/
|
||||
@ -241,7 +240,7 @@ index_add(struct xbps_handle *xhp, int argc, char **argv, bool force)
|
||||
|
||||
/* add conf_files in pkg files array */
|
||||
if (pkg_cffiles != NULL) {
|
||||
for (x = 0; x < xbps_array_count(pkg_cffiles); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(pkg_cffiles); x++) {
|
||||
obj = xbps_array_get(pkg_cffiles, x);
|
||||
fileobj = xbps_dictionary_get(obj, "file");
|
||||
xbps_array_add(filespkgar, fileobj);
|
||||
@ -249,7 +248,7 @@ index_add(struct xbps_handle *xhp, int argc, char **argv, bool force)
|
||||
}
|
||||
/* add files array in pkg array */
|
||||
if (pkg_files != NULL) {
|
||||
for (x = 0; x < xbps_array_count(pkg_files); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(pkg_files); x++) {
|
||||
obj = xbps_array_get(pkg_files, x);
|
||||
fileobj = xbps_dictionary_get(obj, "file");
|
||||
xbps_array_add(filespkgar, fileobj);
|
||||
@ -257,7 +256,7 @@ index_add(struct xbps_handle *xhp, int argc, char **argv, bool force)
|
||||
}
|
||||
/* add links array in pkgd */
|
||||
if (pkg_links != NULL) {
|
||||
for (x = 0; x < xbps_array_count(pkg_links); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(pkg_links); x++) {
|
||||
obj = xbps_array_get(pkg_links, x);
|
||||
fileobj = xbps_dictionary_get(obj, "file");
|
||||
xbps_array_add(filespkgar, fileobj);
|
||||
|
@ -59,12 +59,11 @@ cleaner_thread(void *arg)
|
||||
struct thread_data *thd = arg;
|
||||
char *filen;
|
||||
const char *pkgver, *arch, *sha256;
|
||||
unsigned int i;
|
||||
|
||||
/* process pkgs from start until end */
|
||||
array = xbps_dictionary_all_keys(thd->idx);
|
||||
|
||||
for (i = thd->start; i < thd->end; i++) {
|
||||
for (unsigned int i = thd->start; i < thd->end; i++) {
|
||||
obj = xbps_array_get(array, i);
|
||||
pkgd = xbps_dictionary_get_keysym(thd->idx, obj);
|
||||
xbps_dictionary_get_cstring_nocopy(pkgd, "architecture", &arch);
|
||||
@ -104,12 +103,11 @@ cleaner_files_thread(void *arg)
|
||||
struct thread_data *thd = arg;
|
||||
const char *pkgver, *ipkgver;
|
||||
char *pkgname;
|
||||
unsigned int i;
|
||||
|
||||
/* process pkgs from start until end */
|
||||
array = xbps_dictionary_all_keys(thd->idxfiles);
|
||||
|
||||
for (i = thd->start; i < thd->end; i++) {
|
||||
for (unsigned int i = thd->start; i < thd->end; i++) {
|
||||
obj = xbps_array_get(array, i);
|
||||
pkgver = xbps_dictionary_keysym_cstring_nocopy(obj);
|
||||
pkgname = xbps_pkg_name(pkgver);
|
||||
@ -143,8 +141,8 @@ index_clean(struct xbps_handle *xhp, const char *repodir)
|
||||
xbps_dictionary_t idx, idxfiles;
|
||||
const char *keyname;
|
||||
char *pkgname;
|
||||
unsigned int x, pkgcount, slicecount;
|
||||
int i, maxthreads, rv = 0;
|
||||
unsigned int pkgcount, slicecount;
|
||||
int maxthreads, rv = 0;
|
||||
bool flush = false;
|
||||
|
||||
repo = xbps_repo_open(xhp, repodir);
|
||||
@ -175,7 +173,7 @@ index_clean(struct xbps_handle *xhp, const char *repodir)
|
||||
pkgcount = 0;
|
||||
|
||||
/* Setup threads to cleanup index and index-files */
|
||||
for (i = 0; i < maxthreads; i++) {
|
||||
for (int i = 0; i < maxthreads; i++) {
|
||||
thd[i].thread_num = i;
|
||||
thd[i].idx = idx;
|
||||
thd[i].result = xbps_array_create();
|
||||
@ -189,14 +187,14 @@ index_clean(struct xbps_handle *xhp, const char *repodir)
|
||||
pkgcount += slicecount;
|
||||
}
|
||||
/* wait for all threads */
|
||||
for (i = 0; i < maxthreads; i++)
|
||||
for (int i = 0; i < maxthreads; i++)
|
||||
pthread_join(thd[i].thread, NULL);
|
||||
|
||||
/* Setup threads to cleanup index-files */
|
||||
slicecount = xbps_dictionary_count(idxfiles) / maxthreads;
|
||||
pkgcount = 0;
|
||||
|
||||
for (i = 0; i < maxthreads; i++) {
|
||||
for (int i = 0; i < maxthreads; i++) {
|
||||
thd[i].thread_num = i;
|
||||
thd[i].idx = idx;
|
||||
thd[i].idxfiles = idxfiles;
|
||||
@ -211,11 +209,11 @@ index_clean(struct xbps_handle *xhp, const char *repodir)
|
||||
pkgcount += slicecount;
|
||||
}
|
||||
/* wait for all threads */
|
||||
for (i = 0; i < maxthreads; i++)
|
||||
for (int i = 0; i < maxthreads; i++)
|
||||
pthread_join(thd[i].thread, NULL);
|
||||
|
||||
for (i = 0; i < maxthreads; i++) {
|
||||
for (x = 0; x < xbps_array_count(thd[i].result); x++) {
|
||||
for (int i = 0; i < maxthreads; i++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(thd[i].result); x++) {
|
||||
xbps_array_get_cstring_nocopy(thd[i].result,
|
||||
x, &keyname);
|
||||
printf("index: removed entry %s\n", keyname);
|
||||
@ -225,7 +223,7 @@ index_clean(struct xbps_handle *xhp, const char *repodir)
|
||||
free(pkgname);
|
||||
flush = true;
|
||||
}
|
||||
for (x = 0; x < xbps_array_count(thd[i].result_files); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(thd[i].result_files); x++) {
|
||||
xbps_array_get_cstring_nocopy(thd[i].result_files,
|
||||
x, &keyname);
|
||||
printf("index-files: removed entry %s\n", keyname);
|
||||
|
@ -102,7 +102,7 @@ main(int argc, char **argv)
|
||||
struct xferstat xfer;
|
||||
const char *version, *rootdir = NULL, *confdir = NULL;
|
||||
char *pkgname, *hash;
|
||||
int flags = 0, i, c, rv = 0;
|
||||
int flags = 0, c, rv = 0;
|
||||
|
||||
while ((c = getopt(argc, argv, "C:dr:V")) != -1) {
|
||||
switch (c) {
|
||||
@ -247,7 +247,7 @@ main(int argc, char **argv)
|
||||
if (argc < 2)
|
||||
usage();
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
hash = xbps_file_hash(argv[i]);
|
||||
if (hash == NULL) {
|
||||
fprintf(stderr,
|
||||
@ -263,7 +263,7 @@ main(int argc, char **argv)
|
||||
if (argc != 2)
|
||||
usage();
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
rv = xbps_fetch_file(&xh, argv[i], "v");
|
||||
if (rv == -1) {
|
||||
printf("%s: %s\n", argv[1],
|
||||
|
9
configure
vendored
9
configure
vendored
@ -310,6 +310,15 @@ else
|
||||
BUILD_PIE_VALUE=no
|
||||
fi
|
||||
|
||||
#
|
||||
# A C99 compiler is required to build xbps.
|
||||
#
|
||||
check_compiler_flag "std=c99" "" CFLAGS
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERRROR: A compatible C99 compiler is required, exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# libfetch
|
||||
echo "CPPFLAGS += -I\$(TOPDIR)/lib/fetch" >>$CONFIG_MK
|
||||
echo "LDFLAGS += -lssl" >>$CONFIG_MK
|
||||
|
@ -94,9 +94,7 @@ config_inject_repos(struct xbps_handle *xh)
|
||||
static int
|
||||
cb_validate_virtual(cfg_t *cfg, cfg_opt_t *opt)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < cfg_size(cfg, "virtual-package"); i++) {
|
||||
for (unsigned int i = 0; i < cfg_size(cfg, "virtual-package"); i++) {
|
||||
cfg_t *sec = cfg_opt_getnsec(opt, i);
|
||||
if (cfg_getstr(sec, "targets") == 0) {
|
||||
cfg_error(cfg, "targets must be set for "
|
||||
|
@ -39,7 +39,6 @@ xbps_entry_is_a_conf_file(xbps_dictionary_t propsd,
|
||||
{
|
||||
xbps_array_t array;
|
||||
const char *cffile;
|
||||
unsigned int i;
|
||||
|
||||
assert(xbps_object_type(propsd) == XBPS_TYPE_DICTIONARY);
|
||||
assert(entry_pname != NULL);
|
||||
@ -48,7 +47,7 @@ xbps_entry_is_a_conf_file(xbps_dictionary_t propsd,
|
||||
if (xbps_array_count(array) == 0)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < xbps_array_count(array); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(array); i++) {
|
||||
xbps_array_get_cstring_nocopy(array, i, &cffile);
|
||||
if (strcmp(cffile, entry_pname) == 0)
|
||||
return true;
|
||||
|
@ -78,7 +78,6 @@ xbps_find_pkg_obsoletes(struct xbps_handle *xhp,
|
||||
xbps_array_t instfiles, newfiles, obsoletes;
|
||||
xbps_object_t obj, obj2;
|
||||
xbps_string_t oldstr, newstr;
|
||||
unsigned int i, x;
|
||||
const char *oldhash;
|
||||
char *file;
|
||||
int rv = 0;
|
||||
@ -101,7 +100,7 @@ xbps_find_pkg_obsoletes(struct xbps_handle *xhp,
|
||||
/*
|
||||
* Iterate over files list from installed package.
|
||||
*/
|
||||
for (i = 0; i < xbps_array_count(instfiles); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(instfiles); i++) {
|
||||
found = false;
|
||||
obj = xbps_array_get(instfiles, i);
|
||||
if (xbps_object_type(obj) != XBPS_TYPE_DICTIONARY) {
|
||||
@ -132,7 +131,7 @@ xbps_find_pkg_obsoletes(struct xbps_handle *xhp,
|
||||
/*
|
||||
* Check if current file is available in new pkg filelist.
|
||||
*/
|
||||
for (x = 0; x < xbps_array_count(newfiles); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(newfiles); x++) {
|
||||
obj2 = xbps_array_get(newfiles, x);
|
||||
newstr = xbps_dictionary_get(obj2, "file");
|
||||
assert(newstr);
|
||||
|
@ -68,7 +68,7 @@ xbps_find_pkg_orphans(struct xbps_handle *xhp, xbps_array_t orphans_user _unused
|
||||
xbps_object_iterator_t iter;
|
||||
const char *curpkgver, *deppkgver, *reqbydep;
|
||||
bool automatic = false;
|
||||
unsigned int i, x, j, cnt, reqbycnt;
|
||||
unsigned int cnt, reqbycnt;
|
||||
|
||||
if (xbps_pkgdb_init(xhp) != 0)
|
||||
return NULL;
|
||||
@ -78,7 +78,7 @@ xbps_find_pkg_orphans(struct xbps_handle *xhp, xbps_array_t orphans_user _unused
|
||||
/*
|
||||
* Add all packages specified by the client.
|
||||
*/
|
||||
for (i = 0; i < xbps_array_count(orphans_user); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(orphans_user); i++) {
|
||||
xbps_array_get_cstring_nocopy(orphans_user, i, &curpkgver);
|
||||
pkgd = xbps_pkgdb_get_pkg(xhp, curpkgver);
|
||||
if (pkgd == NULL)
|
||||
@ -116,17 +116,17 @@ xbps_find_pkg_orphans(struct xbps_handle *xhp, xbps_array_t orphans_user _unused
|
||||
xbps_object_iterator_release(iter);
|
||||
|
||||
find_orphans:
|
||||
for (i = 0; i < xbps_array_count(array); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(array); i++) {
|
||||
pkgd = xbps_array_get(array, i);
|
||||
rdeps = xbps_dictionary_get(pkgd, "run_depends");
|
||||
for (x = 0; x < xbps_array_count(rdeps); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(rdeps); x++) {
|
||||
cnt = 0;
|
||||
xbps_array_get_cstring_nocopy(rdeps, x, &deppkgver);
|
||||
reqby = xbps_pkgdb_get_pkg_revdeps(xhp, deppkgver);
|
||||
if (reqby == NULL)
|
||||
continue;
|
||||
reqbycnt = xbps_array_count(reqby);
|
||||
for (j = 0; j < reqbycnt; j++) {
|
||||
for (unsigned int j = 0; j < reqbycnt; j++) {
|
||||
xbps_array_get_cstring_nocopy(reqby, j, &reqbydep);
|
||||
if (xbps_find_pkg_in_array(array, reqbydep)) {
|
||||
cnt++;
|
||||
|
@ -57,14 +57,13 @@ find_pkg_symlink_target(xbps_dictionary_t d, const char *file)
|
||||
{
|
||||
xbps_array_t links;
|
||||
xbps_object_t obj;
|
||||
unsigned int i;
|
||||
const char *pkgfile, *tgt = NULL;
|
||||
char *rfile;
|
||||
|
||||
assert(d);
|
||||
|
||||
links = xbps_dictionary_get(d, "links");
|
||||
for (i = 0; i < xbps_array_count(links); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(links); i++) {
|
||||
rfile = strchr(file, '.') + 1;
|
||||
obj = xbps_array_get(links, i);
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "file", &pkgfile);
|
||||
@ -164,8 +163,9 @@ unpack_archive(struct xbps_handle *xhp,
|
||||
struct stat st;
|
||||
struct xbps_unpack_cb_data xucd;
|
||||
struct archive_entry *entry;
|
||||
size_t i, entry_idx = 0, instbufsiz = 0, rembufsiz = 0;
|
||||
size_t instbufsiz = 0, rembufsiz = 0;
|
||||
ssize_t entry_size;
|
||||
unsigned int entry_idx = 0;
|
||||
const char *file, *entry_pname, *transact, *tgtlnk;
|
||||
char *pkgname, *dname, *buf, *buf2, *p, *p2;
|
||||
int ar_rv, rv, entry_type, flags;
|
||||
@ -588,7 +588,7 @@ unpack_archive(struct xbps_handle *xhp,
|
||||
goto out;
|
||||
|
||||
obsoletes = xbps_find_pkg_obsoletes(xhp, old_filesd, filesd);
|
||||
for (i = 0; i < xbps_array_count(obsoletes); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(obsoletes); i++) {
|
||||
obj = xbps_array_get(obsoletes, i);
|
||||
file = xbps_string_cstring_nocopy(obj);
|
||||
if (remove(file) == -1) {
|
||||
|
@ -216,7 +216,6 @@ generate_full_revdeps_tree(struct xbps_handle *xhp)
|
||||
xbps_object_iterator_t iter;
|
||||
const char *pkgver, *pkgdep, *vpkgname;
|
||||
char *curpkgname;
|
||||
unsigned int i;
|
||||
bool alloc;
|
||||
|
||||
if (xhp->pkgdb_revdeps)
|
||||
@ -233,7 +232,7 @@ generate_full_revdeps_tree(struct xbps_handle *xhp)
|
||||
if (!xbps_array_count(rundeps))
|
||||
continue;
|
||||
|
||||
for (i = 0; i < xbps_array_count(rundeps); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(rundeps); i++) {
|
||||
alloc = false;
|
||||
xbps_array_get_cstring_nocopy(rundeps, i, &pkgdep);
|
||||
curpkgname = xbps_pkgpattern_name(pkgdep);
|
||||
|
12
lib/plist.c
12
lib/plist.c
@ -58,12 +58,11 @@ array_foreach_thread(void *arg)
|
||||
xbps_object_t obj, pkgd;
|
||||
struct thread_data *thd = arg;
|
||||
const char *key;
|
||||
unsigned int i;
|
||||
int rv;
|
||||
bool loop_done = false;
|
||||
|
||||
/* process pkgs from start until end */
|
||||
for (i = thd->start; i < thd->end; i++) {
|
||||
for (unsigned int i = thd->start; i < thd->end; i++) {
|
||||
if (thd->mtx)
|
||||
pthread_mutex_lock(thd->mtx);
|
||||
|
||||
@ -95,7 +94,7 @@ xbps_array_foreach_cb(struct xbps_handle *xhp,
|
||||
struct thread_data *thd;
|
||||
pthread_mutex_t mtx;
|
||||
unsigned int arraycount, slicecount, pkgcount;
|
||||
int rv = 0, maxthreads, i;
|
||||
int rv = 0, maxthreads;
|
||||
|
||||
assert(fn != NULL);
|
||||
|
||||
@ -114,7 +113,7 @@ xbps_array_foreach_cb(struct xbps_handle *xhp,
|
||||
pkgcount = 0;
|
||||
pthread_mutex_init(&mtx, NULL);
|
||||
|
||||
for (i = 0; i < maxthreads; i++) {
|
||||
for (int i = 0; i < maxthreads; i++) {
|
||||
thd[i].mtx = &mtx;
|
||||
thd[i].array = array;
|
||||
thd[i].dict = dict;
|
||||
@ -131,7 +130,7 @@ xbps_array_foreach_cb(struct xbps_handle *xhp,
|
||||
pkgcount += slicecount;
|
||||
}
|
||||
/* wait for all threads */
|
||||
for (i = 0; i < maxthreads; i++)
|
||||
for (int i = 0; i < maxthreads; i++)
|
||||
pthread_join(thd[i].thread, NULL);
|
||||
|
||||
pthread_mutex_destroy(&mtx);
|
||||
@ -178,7 +177,6 @@ array_replace_dict(xbps_array_t array,
|
||||
bool bypattern)
|
||||
{
|
||||
xbps_object_t obj;
|
||||
unsigned int i;
|
||||
const char *curpkgver;
|
||||
char *curpkgname;
|
||||
|
||||
@ -186,7 +184,7 @@ array_replace_dict(xbps_array_t array,
|
||||
assert(xbps_object_type(dict) == XBPS_TYPE_DICTIONARY);
|
||||
assert(str != NULL);
|
||||
|
||||
for (i = 0; i < xbps_array_count(array); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(array); i++) {
|
||||
obj = xbps_array_get(array, i);
|
||||
if (obj == NULL)
|
||||
continue;
|
||||
|
@ -238,7 +238,7 @@ vpkg_user_conf(struct xbps_handle *xhp,
|
||||
{
|
||||
const char *vpkgver, *pkg = NULL;
|
||||
char *vpkgname = NULL, *tmp;
|
||||
unsigned int i, j, cnt;
|
||||
unsigned int cnt;
|
||||
|
||||
if (xhp->cfg == NULL)
|
||||
return NULL;
|
||||
@ -254,9 +254,9 @@ vpkg_user_conf(struct xbps_handle *xhp,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < cnt; i++) {
|
||||
for (unsigned int i = 0; i < cnt; i++) {
|
||||
cfg_t *sec = cfg_getnsec(xhp->cfg, "virtual-package", i);
|
||||
for (j = 0; j < cfg_size(sec, "targets"); j++) {
|
||||
for (unsigned int j = 0; j < cfg_size(sec, "targets"); j++) {
|
||||
tmp = NULL;
|
||||
vpkgver = cfg_getnstr(sec, "targets", j);
|
||||
if (strchr(vpkgver, '_') == NULL) {
|
||||
|
@ -239,7 +239,6 @@ revdeps_match(struct xbps_repo *repo, xbps_dictionary_t tpkgd, const char *str)
|
||||
xbps_object_t obj;
|
||||
const char *pkgver, *tpkgver, *arch, *vpkg;
|
||||
char *buf;
|
||||
unsigned int i;
|
||||
|
||||
iter = xbps_dictionary_iterator(repo->idx);
|
||||
assert(iter);
|
||||
@ -278,7 +277,7 @@ revdeps_match(struct xbps_repo *repo, xbps_dictionary_t tpkgd, const char *str)
|
||||
* Try to match any virtual package.
|
||||
*/
|
||||
provides = xbps_dictionary_get(tpkgd, "provides");
|
||||
for (i = 0; i < xbps_array_count(provides); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(provides); i++) {
|
||||
xbps_array_get_cstring_nocopy(provides, i, &vpkg);
|
||||
if (strchr(vpkg, '_') == NULL)
|
||||
buf = xbps_xasprintf("%s_1", vpkg);
|
||||
@ -335,7 +334,6 @@ xbps_repo_get_pkg_revdeps(struct xbps_repo *repo, const char *pkg)
|
||||
xbps_dictionary_t pkgd;
|
||||
const char *vpkg;
|
||||
char *buf = NULL;
|
||||
unsigned int i;
|
||||
bool match = false;
|
||||
|
||||
if (((pkgd = xbps_rpool_get_pkg(repo->xhp, pkg)) == NULL) &&
|
||||
@ -347,7 +345,7 @@ xbps_repo_get_pkg_revdeps(struct xbps_repo *repo, const char *pkg)
|
||||
* If pkg is a virtual pkg let's match it instead of the real pkgver.
|
||||
*/
|
||||
if ((vdeps = xbps_dictionary_get(pkgd, "provides"))) {
|
||||
for (i = 0; i < xbps_array_count(vdeps); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(vdeps); i++) {
|
||||
char *vpkgn;
|
||||
|
||||
xbps_array_get_cstring_nocopy(vdeps, i, &vpkg);
|
||||
|
@ -160,7 +160,6 @@ find_repo_deps(struct xbps_handle *xhp,
|
||||
xbps_object_iterator_t iter;
|
||||
xbps_array_t curpkgrdeps;
|
||||
pkg_state_t state;
|
||||
unsigned int x;
|
||||
const char *reqpkg, *pkgver_q, *reason = NULL;
|
||||
char *pkgname, *reqpkgname;
|
||||
int rv = 0;
|
||||
@ -179,7 +178,7 @@ find_repo_deps(struct xbps_handle *xhp,
|
||||
reqpkg = xbps_string_cstring_nocopy(obj);
|
||||
if (xhp->flags & XBPS_FLAG_DEBUG) {
|
||||
xbps_dbg_printf(xhp, "");
|
||||
for (x = 0; x < *depth; x++)
|
||||
for (unsigned short x = 0; x < *depth; x++)
|
||||
xbps_dbg_printf_append(xhp, " ");
|
||||
xbps_dbg_printf_append(xhp, "%s: requires dependency '%s': ",
|
||||
curpkg != NULL ? curpkg : " ", reqpkg);
|
||||
@ -367,7 +366,7 @@ find_repo_deps(struct xbps_handle *xhp,
|
||||
|
||||
if (xhp->flags & XBPS_FLAG_DEBUG) {
|
||||
xbps_dbg_printf(xhp, "");
|
||||
for (x = 0; x < *depth; x++)
|
||||
for (unsigned short x = 0; x < *depth; x++)
|
||||
xbps_dbg_printf_append(xhp, " ");
|
||||
|
||||
xbps_dbg_printf_append(xhp,
|
||||
|
@ -52,7 +52,6 @@ xbps_rpool_init(struct xbps_handle *xhp)
|
||||
{
|
||||
struct rpool *rp;
|
||||
const char *repouri;
|
||||
unsigned int i;
|
||||
bool foundrepo = false;
|
||||
int rv = 0;
|
||||
|
||||
@ -63,7 +62,7 @@ xbps_rpool_init(struct xbps_handle *xhp)
|
||||
else if (xhp->cfg == NULL)
|
||||
return ENOTSUP;
|
||||
|
||||
for (i = 0; i < cfg_size(xhp->cfg, "repositories"); i++) {
|
||||
for (unsigned int i = 0; i < cfg_size(xhp->cfg, "repositories"); i++) {
|
||||
rp = malloc(sizeof(struct rpool));
|
||||
assert(rp);
|
||||
repouri = cfg_getnstr(xhp->cfg, "repositories", i);
|
||||
@ -114,12 +113,11 @@ int
|
||||
xbps_rpool_sync(struct xbps_handle *xhp, const char *uri)
|
||||
{
|
||||
const char *repouri;
|
||||
unsigned int i;
|
||||
|
||||
if (xhp->cfg == NULL)
|
||||
return ENOTSUP;
|
||||
|
||||
for (i = 0; i < cfg_size(xhp->cfg, "repositories"); i++) {
|
||||
for (unsigned int i = 0; i < cfg_size(xhp->cfg, "repositories"); i++) {
|
||||
repouri = cfg_getnstr(xhp->cfg, "repositories", i);
|
||||
/* If argument was set just process that repository */
|
||||
if (uri && strcmp(repouri, uri))
|
||||
|
@ -80,14 +80,13 @@ find_pkg_revdeps_cb(struct xbps_repo *repo, void *arg, bool *done _unused)
|
||||
struct rpool_fpkg *rpf = arg;
|
||||
xbps_array_t revdeps = NULL;
|
||||
const char *pkgver;
|
||||
unsigned int i;
|
||||
|
||||
revdeps = xbps_repo_get_pkg_revdeps(repo, rpf->pattern);
|
||||
if (xbps_array_count(revdeps)) {
|
||||
/* found */
|
||||
if (rpf->revdeps == NULL)
|
||||
rpf->revdeps = xbps_array_create();
|
||||
for (i = 0; i < xbps_array_count(revdeps); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(revdeps); i++) {
|
||||
xbps_array_get_cstring_nocopy(revdeps, i, &pkgver);
|
||||
xbps_array_add_cstring_nocopy(rpf->revdeps, pkgver);
|
||||
}
|
||||
|
@ -43,11 +43,10 @@ xbps_transaction_package_replace(struct xbps_handle *xhp)
|
||||
const char *pattern, *pkgver, *curpkgver;
|
||||
char *buf, *pkgname, *curpkgname;
|
||||
bool instd_auto, sr;
|
||||
unsigned int i;
|
||||
|
||||
unsorted = xbps_dictionary_get(xhp->transd, "unsorted_deps");
|
||||
|
||||
for (i = 0; i < xbps_array_count(unsorted); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(unsorted); i++) {
|
||||
obj = xbps_array_get(unsorted, i);
|
||||
replaces = xbps_dictionary_get(obj, "replaces");
|
||||
if (replaces == NULL || xbps_array_count(replaces) == 0)
|
||||
|
@ -48,12 +48,11 @@ check_virtual_pkgs(struct xbps_handle *xhp,
|
||||
xbps_array_t unsorted, provides, rundeps, mdeps;
|
||||
const char *pkgver, *revpkgver, *pkgpattern;
|
||||
char *pkgname, *pkgdepname, *vpkgname, *vpkgver, *str;
|
||||
unsigned int i, x;
|
||||
bool matched = false;
|
||||
|
||||
unsorted = xbps_dictionary_get(xhp->transd, "unsorted_deps");
|
||||
provides = xbps_dictionary_get(trans_pkgd, "provides");
|
||||
for (i = 0; i < xbps_array_count(provides); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(provides); i++) {
|
||||
char *tmp = NULL;
|
||||
|
||||
xbps_array_get_cstring(provides, i, &vpkgver);
|
||||
@ -64,7 +63,7 @@ check_virtual_pkgs(struct xbps_handle *xhp,
|
||||
vpkgname = xbps_pkg_name(vpkgver);
|
||||
assert(vpkgname);
|
||||
rundeps = xbps_dictionary_get(rev_pkgd, "run_depends");
|
||||
for (x = 0; x < xbps_array_count(rundeps); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(rundeps); x++) {
|
||||
xbps_array_get_cstring_nocopy(rundeps, x, &pkgpattern);
|
||||
if (((pkgname = xbps_pkgpattern_name(pkgpattern)) == NULL) &&
|
||||
((pkgname = xbps_pkg_name(pkgpattern)) == NULL))
|
||||
@ -117,11 +116,10 @@ xbps_transaction_revdeps(struct xbps_handle *xhp)
|
||||
xbps_object_t obj;
|
||||
const char *pkgver, *curdep, *revpkgver, *curpkgver, *tract;
|
||||
char *pkgname, *curdepname, *curpkgname, *str;
|
||||
unsigned int i, j, x;
|
||||
|
||||
unsorted = xbps_dictionary_get(xhp->transd, "unsorted_deps");
|
||||
|
||||
for (i = 0; i < xbps_array_count(unsorted); i++) {
|
||||
for (unsigned int i = 0; i < xbps_array_count(unsorted); i++) {
|
||||
obj = xbps_array_get(unsorted, i);
|
||||
/*
|
||||
* Only check packages in transaction being updated.
|
||||
@ -153,7 +151,7 @@ xbps_transaction_revdeps(struct xbps_handle *xhp)
|
||||
/*
|
||||
* Time to validate revdeps for current pkg.
|
||||
*/
|
||||
for (x = 0; x < xbps_array_count(pkgrdeps); x++) {
|
||||
for (unsigned int x = 0; x < xbps_array_count(pkgrdeps); x++) {
|
||||
bool found = false;
|
||||
|
||||
xbps_array_get_cstring_nocopy(pkgrdeps, x, &curpkgver);
|
||||
@ -173,7 +171,7 @@ xbps_transaction_revdeps(struct xbps_handle *xhp)
|
||||
curpkgname = xbps_pkg_name(pkgver);
|
||||
assert(curpkgname);
|
||||
|
||||
for (j = 0; j < xbps_array_count(rundeps); j++) {
|
||||
for (unsigned int j = 0; j < xbps_array_count(rundeps); j++) {
|
||||
xbps_array_get_cstring_nocopy(rundeps, j, &curdep);
|
||||
if (((curdepname = xbps_pkg_name(curdep)) == NULL) &&
|
||||
((curdepname = xbps_pkgpattern_name(curdep)) == NULL))
|
||||
|
@ -258,7 +258,7 @@ xbps_transaction_sort(struct xbps_handle *xhp)
|
||||
xbps_array_t provides, sorted, unsorted, rundeps;
|
||||
xbps_object_t obj;
|
||||
struct pkgdep *pd;
|
||||
unsigned int i, j, ndeps = 0, cnt = 0;
|
||||
unsigned int ndeps = 0, cnt = 0;
|
||||
const char *pkgname, *pkgver, *tract, *vpkgdep;
|
||||
int rv = 0;
|
||||
bool vpkg_found;
|
||||
@ -290,7 +290,7 @@ xbps_transaction_sort(struct xbps_handle *xhp)
|
||||
* Iterate over the unsorted package dictionaries and sort all
|
||||
* its package dependencies.
|
||||
*/
|
||||
for (i = 0; i < ndeps; i++) {
|
||||
for (unsigned int i = 0; i < ndeps; i++) {
|
||||
vpkg_found = false;
|
||||
obj = xbps_array_get(unsorted, i);
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
|
||||
@ -305,7 +305,7 @@ xbps_transaction_sort(struct xbps_handle *xhp)
|
||||
* if any of them was previously added. If true, don't
|
||||
* add it into the list again, just order its deps.
|
||||
*/
|
||||
for (j = 0; j < xbps_array_count(provides); j++) {
|
||||
for (unsigned int j = 0; j < xbps_array_count(provides); j++) {
|
||||
xbps_array_get_cstring_nocopy(provides,
|
||||
j, &vpkgdep);
|
||||
pd = pkgdep_find(vpkgdep);
|
||||
|
Loading…
x
Reference in New Issue
Block a user