poldek: poldek/misc.c, poldek/misc.h, poldek/pkgset.c - timethis pkgset setup
mis
mis at pld-linux.org
Thu Oct 29 16:07:46 CET 2009
Author: mis Date: Thu Oct 29 15:07:46 2009 GMT
Module: poldek Tag: HEAD
---- Log message:
- timethis pkgset setup
---- Files affected:
poldek/poldek:
misc.c (1.68 -> 1.69) , misc.h (1.39 -> 1.40) , pkgset.c (1.103 -> 1.104)
---- Diffs:
================================================================
Index: poldek/poldek/misc.c
diff -u poldek/poldek/misc.c:1.68 poldek/poldek/misc.c:1.69
--- poldek/poldek/misc.c:1.68 Sun Nov 23 16:01:47 2008
+++ poldek/poldek/misc.c Thu Oct 29 16:07:41 2009
@@ -660,22 +660,22 @@
/* first try */
if (n_array_bsearch(avlangs, lang)) {
- if (strcmp(lang, "C") == 0)
- *has_C = 1;
-
- n_array_push(r_langs, n_strdup(lang));
+ if (strcmp(lang, "C") == 0)
+ *has_C = 1;
+
+ n_array_push(r_langs, n_strdup(lang));
}
/* second try, without country code */
if ((cut = cut_country_code(lang))) {
- if (n_array_bsearch(avlangs, cut)) {
- if (strcmp(cut, "C") == 0)
- *has_C = 1;
-
- n_array_push(r_langs, cut);
- } else {
- free(cut);
- }
+ if (n_array_bsearch(avlangs, cut)) {
+ if (strcmp(cut, "C") == 0)
+ *has_C = 1;
+
+ n_array_push(r_langs, cut);
+ } else {
+ free(cut);
+ }
}
}
@@ -698,8 +698,8 @@
char *l, *q, *sep = "@.";
int len;
- /* try a complete match */
- lang_match_avlangs(avlangs, r_langs, *p, &has_C);
+ /* try a complete match */
+ lang_match_avlangs(avlangs, r_langs, *p, &has_C);
len = strlen(*p) + 1;
l = alloca(len + 1);
@@ -910,7 +910,7 @@
return tv;
}
-void timethis_end(void *tvp, const char *prefix)
+void timethis_end(int verbose_level, void *tvp, const char *prefix)
{
struct timeval tv, *tv0 = (struct timeval *)tvp;
@@ -923,6 +923,6 @@
tv.tv_usec = 1000000 + tv.tv_usec;
}
- msgn(2, "time [%s] %ld.%ld\n", prefix, tv.tv_sec, tv.tv_usec);
+ msgn(verbose_level, "time [%s] %ld.%ld\n", prefix, tv.tv_sec, tv.tv_usec);
free(tvp);
}
================================================================
Index: poldek/poldek/misc.h
diff -u poldek/poldek/misc.h:1.39 poldek/poldek/misc.h:1.40
--- poldek/poldek/misc.h:1.39 Sun May 25 11:17:41 2008
+++ poldek/poldek/misc.h Thu Oct 29 16:07:41 2009
@@ -59,6 +59,6 @@
const char *lc_messages_lang(void);
void *timethis_begin(void);
-void timethis_end(void *tvp, const char *prefix);
+void timethis_end(int verbose_level, void *tvp, const char *prefix);
#endif /* POLDEK_MISC_H */
================================================================
Index: poldek/poldek/pkgset.c
diff -u poldek/poldek/pkgset.c:1.103 poldek/poldek/pkgset.c:1.104
--- poldek/poldek/pkgset.c:1.103 Tue Mar 3 23:19:42 2009
+++ poldek/poldek/pkgset.c Thu Oct 29 16:07:41 2009
@@ -168,7 +168,6 @@
if (ps->flags & _PKGSET_INDEXES_INIT)
return 1;
- msg(2, "Indexing...\n");
add_self_cap(ps);
n_array_map(ps->pkgs, (tn_fn_map1)sort_pkg_caps);
MEMINF("after index[selfcap]");
@@ -184,8 +183,8 @@
for (i=0; i < n_array_size(ps->pkgs); i++) {
struct pkg *pkg = n_array_nth(ps->pkgs, i);
- if (i % 200 == 0)
- msg(3, " %d..\n", i);
+ if (i % 1000 == 0)
+ msg(3, " indexed %d..\n", i);
do_pkgset_add_package(ps, pkg, 0);
}
@@ -197,7 +196,7 @@
capreq_idx_stats("obs", &ps->obs_idx);
#endif
file_index_setup(ps->file_idx);
- msg(3, " ..%d done\n", i);
+ msg(3, " indexed %d. Done\n", i);
return 0;
}
@@ -228,7 +227,10 @@
int n;
int strict;
int v = poldek_VERBOSE;
+ void *t;
+ t = timethis_begin();
+ msgn(2, "Preparing package set...");
MEMINF("before setup");
ps->flags |= flags;
strict = ps->flags & PSET_VRFY_MERCY ? 0 : 1;
@@ -255,23 +257,28 @@
}
MEMINF("before index");
+ msgn(3, " a). indexing...");
pkgset_index(ps);
MEMINF("after index");
+ msgn(3, " b). detecting file conflicts...");
v = poldek_set_verbose(-1);
file_index_find_conflicts(ps->file_idx, strict);
poldek_set_verbose(v);
+ msgn(3, " c). dependencies...");
pkgset_verify_deps(ps, strict);
MEMINF("after verify deps");
-
+
pkgset_verify_conflicts(ps, strict);
MEMINF("MEM before order");
- if ((flags & PSET_NOORDER) == 0)
+ if ((flags & PSET_NOORDER) == 0) {
+ msgn(3, " d). ordering...");
pkgset_order(ps, flags & PSET_VERIFY_ORDER);
+ }
MEMINF("after setup[END]");
-
+ timethis_end(3, t, "setup");
return ps->nerrors == 0;
}
@@ -282,7 +289,7 @@
if (rt) {
if (n_array_bsearch(ps->pkgs, pkg))
return 0;
-
+
n_array_push(ps->pkgs, pkg_link(pkg));
}
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/poldek/poldek/misc.c?r1=1.68&r2=1.69&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/poldek/poldek/misc.h?r1=1.39&r2=1.40&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/poldek/poldek/pkgset.c?r1=1.103&r2=1.104&f=u
More information about the pld-cvs-commit
mailing list