+++ /dev/null
-diff -Nur poldek-0.20/vfile/Makefile.am poldek-0.20.as_needed-fix/vfile/Makefile.am
---- poldek-0.20/vfile/Makefile.am 2005-05-15 17:16:13.000000000 +0200
-+++ poldek-0.20.as_needed-fix/vfile/Makefile.am 2006-08-02 01:46:42.000000000 +0200
-@@ -22,7 +22,7 @@
- vfffmod.c $(VFCURL_SRCS_) \
- vopen3.c vopen3.h vfile_intern.h
-
--libvfile_la_LIBADD = vfff/libvfff.la
-+libvfile_la_LIBADD = vfff/libvfff.la -lutil
-
- pkgincludedir = $(includedir)/vfile
- pkginclude_HEADERS = vfile.h p_open.h vopen3.h
+++ /dev/null
-diff -urN poldek-0.21-cvs20070703.00.org/misc.c poldek-0.21-cvs20070703.00/misc.c
---- poldek-0.21-cvs20070703.00.org/misc.c 2007-07-02 20:30:48.000000000 +0200
-+++ poldek-0.21-cvs20070703.00/misc.c 2007-11-22 18:09:26.899099602 +0100
-@@ -526,6 +526,9 @@
- {
- if (strstr(path, "./") == NULL)
- return NULL;
-+
-+ if (strncmp(path, ".", 1) == 0)
-+ return get_current_dir_name();
-
- #ifdef HAVE_CANONICALIZE_FILE_NAME /* have safe GNU ext? */
- return realpath(path, NULL);
+++ /dev/null
---- poldek/install-dist.c~ 2007-07-01 23:04:26.000000000 +0200
-+++ poldek/install-dist.c 2007-09-23 15:45:51.812485873 +0200
-@@ -232,6 +232,8 @@
-
- rc = 1;
-
-+ pkgs = pkgmark_get_packages(ts->pms, PKGMARK_MARK | PKGMARK_DEP);
-+
- ignorer = ts->getop(ts, POLDEK_OP_NODEPS);
- if (!packages_verify_dependecies(pkgs, ts->ctx->ps) && !ignorer)
- nerr++;
+++ /dev/null
-Index: install/install.c
-===================================================================
-RCS file: /cvsroot/poldek/poldek/install/install.c,v
-retrieving revision 1.10
-diff -u -r1.10 install.c
---- install/install.c 1 Jul 2007 21:04:26 -0000 1.10
-+++ install/install.c 4 Jul 2007 13:41:03 -0000
-@@ -327,6 +327,12 @@
- return nmarked;
- }
-
-+static void ts_reset(struct poldek_ts *ts)
-+{
-+ pkgmark_massset(ts->pms, 0, PKGMARK_MARK | PKGMARK_DEP);
-+ n_hash_clean(ts->ts_summary);
-+}
-+
- int in_do_poldek_ts_install(struct poldek_ts *ts)
- {
- int i, nmarked = 0, nerr = 0, n, is_particle;
-@@ -422,7 +428,7 @@
- if (!do_install(&ictx))
- nerr++;
-
-- pkgmark_massset(ts->pms, 0, PKGMARK_MARK | PKGMARK_DEP);
-+ ts_reset(ictx.ts);
- install_ctx_reset(&ictx);
- }
- }
-Index: log.c
-===================================================================
-RCS file: /cvsroot/poldek/poldek/log.c,v
-retrieving revision 1.32
-diff -u -r1.32 log.c
---- log.c 2 Jul 2007 17:08:38 -0000 1.32
-+++ log.c 4 Jul 2007 13:44:04 -0000
-@@ -173,7 +173,6 @@
- /* auto line break for errors and warnings */
- if (!last_endlined && !is_continuation && (pri & (LOGERR|LOGWARN))) {
- buf[buf_len++] = '\n';
-- n_assert(0);
- }
-
- last_endlined = is_endlined;
+++ /dev/null
-diff -urN poldek/cli/install.c poldek.new/cli/install.c
---- poldek/cli/install.c 2007-07-01 23:04:26.000000000 +0200
-+++ poldek.new/cli/install.c 2007-11-17 18:19:06.000000000 +0100
-@@ -174,6 +174,9 @@
- {"hold", OPT_INST_HOLD, "PACKAGE[,PACKAGE]...", 0,
- N_("Prevent packages listed from being upgraded if they are already installed."),
- OPT_GID },
-+
-+{"nohold", OPT_INST_NOHOLD, 0, 0,
-+ N_("Do not hold any packages. Disables --hold settings."), OPT_GID },
-
- {"ignore", OPT_INST_IGNORE, "PACKAGE[,PACKAGE]...", 0,
- N_("Make packages listed invisible."), OPT_GID },
-@@ -323,17 +326,21 @@
- poldek_configure(ts->ctx, POLDEK_CONF_ROOTDIR, arg);
- break;
-
--
- case OPT_INST_HOLD:
- poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_HOLD, 1);
- poldek_configure(ts->ctx, POLDEK_CONF_HOLD, arg);
- break;
--
-+
-+ case OPT_INST_NOHOLD:
-+ ts->setop(ts, POLDEK_OP_HOLD, 0);
-+ poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_HOLD, 0);
-+ break;
-+
- case OPT_INST_IGNORE:
- poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_IGNORE, 1);
- poldek_configure(ts->ctx, POLDEK_CONF_IGNORE, arg);
- break;
--
-+
- case OPT_INST_NOIGNORE:
- ts->setop(ts, POLDEK_OP_IGNORE, 0);
- poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_IGNORE, 0);
+++ /dev/null
-diff -urN poldek-0.21-cvs20070703.00/pm/rpm/rpminstall.c poldek-0.21-cvs20070703.00.new/pm/rpm/rpminstall.c
---- poldek-0.21-cvs20070703.00/pm/rpm/rpminstall.c 2007-07-01 23:04:27.000000000 +0200
-+++ poldek-0.21-cvs20070703.00.new/pm/rpm/rpminstall.c 2008-02-20 21:34:24.000000000 +0100
-@@ -434,7 +434,7 @@
- int can_ask = poldek_ts_is_interactive_on(ts);
-
- if (nsignerr) {
-- if (!can_ask || poldek__confirm(ts, 0,
-+ if (!can_ask || !poldek__confirm(ts, 0,
- _("There were signature verification errors. "
- "Proceed?")))
- goto l_err_end;
+++ /dev/null
-Index: conf.c
-===================================================================
-RCS file: /cvsroot/poldek/poldek/conf.c,v
-retrieving revision 1.84
-diff -u -r1.84 conf.c
---- conf.c 27 Jun 2007 21:47:43 -0000 1.84
-+++ conf.c 28 Jun 2007 15:47:04 -0000
-@@ -944,6 +944,9 @@
- addparam_flags |= ADD_PARAM_FOREIGN;
- }
-
-+ if (flags & POLDEK_LDCONF_NOVALIDATE)
-+ validate = 0;
-+
- if (flags & POLDEK_LDCONF_UPDATE)
- update = 1;
-
-Index: conf.h
-===================================================================
-RCS file: /cvsroot/poldek/poldek/conf.h,v
-retrieving revision 1.18
-diff -u -r1.18 conf.h
---- conf.h 27 Jun 2007 00:44:47 -0000 1.18
-+++ conf.h 28 Jun 2007 15:47:04 -0000
-@@ -6,10 +6,11 @@
- #include <trurl/narray.h>
- #include <trurl/nhash.h>
-
--#define POLDEK_LDCONF_FOREIGN (1 << 0) /* not a poldek file */
--#define POLDEK_LDCONF_UPDATE (1 << 1) /* resync with remote config */
--#define POLDEK_LDCONF_NOINCLUDE (1 << 2) /* ignore %include directives */
--#define POLDEK_LDCONF_GLOBALONLY (1 << 9) /* for early cachedir setup */
-+#define POLDEK_LDCONF_FOREIGN (1 << 0) /* not a poldek config file */
-+#define POLDEK_LDCONF_NOVALIDATE (1 << 1) /* do not validate config variables */
-+#define POLDEK_LDCONF_UPDATE (1 << 2) /* resync with remote config */
-+#define POLDEK_LDCONF_NOINCLUDE (1 << 3) /* ignore %include directives */
-+#define POLDEK_LDCONF_GLOBALONLY (1 << 4) /* for early cachedir setup */
-
- /* default localization is used if path is NULL */
- tn_hash *poldek_conf_load(const char *path, unsigned flags);
-Index: cli/main.c
-===================================================================
-RCS file: /cvsroot/poldek/poldek/cli/main.c,v
-retrieving revision 1.56
-diff -u -r1.56 main.c
---- cli/main.c 27 Jun 2007 00:44:47 -0000 1.56
-+++ cli/main.c 28 Jun 2007 15:47:05 -0000
-@@ -587,7 +587,8 @@
- } else if (noautosu == 0 && getuid() == 0) { /* check config's runas */
- tn_hash *cnf;
-
-- cnf = poldek_conf_load_default(POLDEK_LDCONF_NOINCLUDE | POLDEK_LDCONF_FOREIGN);
-+ cnf = poldek_conf_load_default(POLDEK_LDCONF_GLOBALONLY |
-+ POLDEK_LDCONF_NOVALIDATE);
- if (cnf) {
- tn_hash *global;
- const char *u;
-Index: tests/sh/04-conf
-===================================================================
-RCS file: /cvsroot/poldek/poldek/tests/sh/04-conf,v
-retrieving revision 1.2
-diff -u -r1.2 04-conf
---- tests/sh/04-conf 27 Jun 2007 21:47:42 -0000 1.2
-+++ tests/sh/04-conf 28 Jun 2007 15:47:05 -0000
-@@ -28,12 +28,43 @@
-
- is_verbose_mode && $poldek_l
-
-- n=$($poldek_l | grep -vE '^dbg:' | wc -l)
-+ n=$($poldek_l | grep 'test://' | wc -l)
- assertEquals "2 sources expected" "$n" "2"
-
- n=$($poldek_l | grep -E '^test[12] ' | wc -l)
- assertEquals "2 sources expected, but not those" "$n" "2"
- }
-+
-+testConfAsRoot()
-+{
-+ create_local_conf
-+ msgn "--conf"
-+ poldek_l="$POLDEK --conf $TMPDIR/poldek.conf -q -l"
-+
-+ is_verbose_mode && $poldek_l
-+
-+ n=$(fakeroot $poldek_l | grep 'test://' | wc -l)
-+ assertEquals "2 sources expected" "$n" "2"
-+
-+ n=$(fakeroot $poldek_l | grep -E '^test[12] ' | wc -l)
-+ assertEquals "2 sources expected, but not those" "$n" "2"
-+
-+ msgn "default conf"
-+ mkdir $TMPDIR/home || fail "mkdir"
-+ mv -f $TMPDIR/poldek.conf $TMPDIR/home/.poldekrc
-+ HOME=$TMPDIR/home
-+ export HOME
-+
-+ poldek_l="$POLDEK -q -l"
-+ is_verbose_mode && $poldek_l
-+
-+ n=$(fakeroot $poldek_l | grep 'test://' | wc -l)
-+ assertEquals "2 sources expected" "$n" "2"
-+
-+ n=$(fakeroot $poldek_l | grep -E '^test[12] ' | wc -l)
-+ assertEquals "2 sources expected, but not those" "$n" "2"
-+}
-+
-
- testConfInclude()
- {
+++ /dev/null
-diff -urN poldek/ask.c poldek.new/ask.c
---- poldek/ask.c 2007-07-08 18:48:11.000000000 +0200
-+++ poldek.new/ask.c 2007-11-18 18:55:32.000000000 +0100
-@@ -87,6 +87,38 @@
- return answer;
- }
-
-+static int term_sugs_confirm(void *foo, const struct poldek_ts *ts, int hint,
-+ const char *question)
-+{
-+ const char *yn = "[Y/n/c]";
-+ int a;
-+
-+ foo = foo;
-+ ts = ts;
-+
-+ if (!isatty(STDIN_FILENO))
-+ return hint;
-+
-+ if (hint == 0) /* no */
-+ yn = "[N/y/c]";
-+
-+ poldek_log(LOGINFO, "%s %s", question, yn);
-+
-+ a = poldek_term_ask(STDIN_FILENO, "YyNnCc\n", NULL);
-+ a = toupper(a);
-+ switch(a) {
-+ case 'Y': a = 1; break;
-+ case 'N': a = 0; break;
-+ case 'C': a = -1; break;
-+ case '\n': a = hint; break;
-+ default:
-+ n_assert(0);
-+ }
-+
-+ msg(-1, "_\n");
-+ return a;
-+}
-+
- static int term_choose_pkg(void *foo, const struct poldek_ts *ts,
- const char *capname, tn_array *pkgs, int hint)
- {
-@@ -152,6 +184,15 @@
- return ts->ctx->ts_confirm_fn(ts->ctx->data_ts_confirm_fn, ts);
- }
-
-+int poldek__sugs_confirm(const struct poldek_ts *ts, int hint, const char *message)
-+{
-+ if (ts->ctx->sugs_confirm_fn == NULL)
-+ return hint;
-+
-+ return ts->ctx->sugs_confirm_fn(ts->ctx->data_sugs_confirm_fn, ts, hint, message);
-+}
-+
-+
- int poldek__choose_equiv(const struct poldek_ts *ts,
- const char *capname, tn_array *pkgs, struct pkg *hint)
- {
-@@ -181,6 +222,9 @@
- ctx->data_ts_confirm_fn = NULL;
- ctx->ts_confirm_fn = term_ts_confirm;
-
-+ ctx->data_sugs_confirm_fn = NULL;
-+ ctx->sugs_confirm_fn = term_sugs_confirm;
-+
- ctx->data_choose_equiv_fn = NULL;
- ctx->choose_equiv_fn = term_choose_pkg;
- }
-diff -urN poldek/install/requirements.c poldek.new/install/requirements.c
---- poldek/install/requirements.c 2007-07-12 23:29:26.000000000 +0200
-+++ poldek.new/install/requirements.c 2007-11-18 18:42:27.000000000 +0100
-@@ -244,46 +244,94 @@
- }
-
- /* just append sugs to reqs if user wants to */
--static tn_array *process_suggets(struct pkg *pkg, struct poldek_ts *ts)
-+static tn_array *process_suggests(struct pkg *pkg, struct install_ctx *ictx)
- {
- char *confirmation, message[2048];
-- tn_array *reqs;
-+ tn_array *reqs, *sugs;
- tn_buf *nbuf;
-- int n;
-+ int i, j, n;
-
- reqs = pkg->reqs;
-
-- if (pkg->sugs == NULL || !in_is_user_choosable_equiv(ts))
-+ if (pkg->sugs == NULL || !in_is_user_choosable_equiv(ictx->ts))
- return reqs;
-
-- if (!ts->getop(ts, POLDEK_OP_SUGGESTS))
-+ if (!ictx->ts->getop(ictx->ts, POLDEK_OP_SUGGESTS))
- return reqs;
-
-- nbuf = capreq_arr_join(pkg->sugs, NULL, NULL);
--
--
-+ /* Array sugs will contain packages which are suggested and not installed */
-+ sugs = capreq_arr_new(n_array_size(pkg->sugs));
-+
-+ for (i = 0; i < n_array_size(pkg->sugs); i++)
-+ {
-+ struct capreq *suggest = n_array_nth(pkg->sugs, i);
-+
-+ /* Check if package is already installed */
-+ if (!pkgdb_match_req(ictx->ts->db, suggest, ictx->strict, ictx->uninst_set->dbpkgs))
-+ {
-+ n_array_push(sugs, suggest);
-+ }
-+ }
-+
-+ if (n_array_size(sugs) == 0)
-+ return reqs;
-+
-+ nbuf = capreq_arr_join(sugs, NULL, NULL);
- n = n_snprintf(message, sizeof(message), _("%s suggests installation of: %s"),
- pkg_id(pkg), n_buf_ptr(nbuf));
- n_buf_free(nbuf);
-
-- confirmation = ngettext("Try to install it?", "Try to install them?",
-- n_array_size(pkg->sugs));
-+ confirmation = ngettext("Try to install it?", "Try to install them?", n_array_size(sugs));
- n_snprintf(&message[n], sizeof(message) - n, "\n%s", confirmation);
-
-- if (poldek__confirm(ts, 0, message)) {
-- int i;
--
-- reqs = capreq_arr_new(n_array_size(pkg->reqs) + n_array_size(pkg->sugs));
-+ if (n_array_size(sugs) > 1)
-+ {
-+ int answer;
-+
-+ answer = poldek__sugs_confirm(ictx->ts, 0, message);
-+
-+ /* Install all suggested packages */
-+ if (answer == 1)
-+ {
-+ reqs = capreq_arr_new(n_array_size(pkg->reqs) + n_array_size(sugs));
-
-- for (i=0; i < n_array_size(pkg->reqs); i++)
-- n_array_push(reqs, n_array_nth(pkg->reqs, i));
-+ for (i=0; i < n_array_size(pkg->reqs); i++)
-+ n_array_push(reqs, n_array_nth(pkg->reqs, i));
-+ for (i=0; i < n_array_size(sugs); i++)
-+ n_array_push(reqs, n_array_nth(sugs, i));
-+
-+ n_array_ctl_set_freefn(reqs, NULL); /* "weak" refs */
-+
-+ return reqs;
-+ }
-+ /* Don't install */
-+ else if (answer == 0)
-+ return reqs;
-+ }
-+
-+ for (j = 0; j < n_array_size(sugs); j++)
-+ {
-+ n = n_snprintf(message, sizeof(message), _("%s suggests installation of: %s"),
-+ pkg_id(pkg), capreq_snprintf_s(n_array_nth(sugs, j)));
-
-- for (i=0; i < n_array_size(pkg->sugs); i++)
-- n_array_push(reqs, n_array_nth(pkg->sugs, i));
--
-- n_array_ctl_set_freefn(reqs, NULL); /* "weak" refs */
-+ n_snprintf(&message[n], sizeof(message) - n, "\n%s", _("Try to install it?"));
-+
-+ if (poldek__confirm(ictx->ts, 0, message))
-+ {
-+ tn_array *tmpreqs;
-+
-+ tmpreqs = capreq_arr_new(n_array_size(reqs) + 1);
-+
-+ for (i = 0; i < n_array_size(reqs); i++)
-+ n_array_push(tmpreqs, n_array_nth(reqs, i));
-+
-+ n_array_push(tmpreqs, n_array_nth(sugs, j));
-+
-+ reqs = tmpreqs;
-+
-+ n_array_ctl_set_freefn(reqs, NULL); /* "weak" refs */
-+ }
- }
--
- return reqs;
- }
-
-@@ -345,7 +393,7 @@
-
- reqs = pkg->reqs;
- if (process_as == PROCESS_AS_NEW)
-- reqs = process_suggets(pkg, ictx->ts);
-+ reqs = process_suggests(pkg, ictx);
-
- for (i=0; i < n_array_size(reqs); i++) {
- struct capreq *req = n_array_nth(reqs, i);
-diff -urN poldek/lib_init.c poldek.new/lib_init.c
---- poldek/lib_init.c 2007-07-09 20:31:14.000000000 +0200
-+++ poldek.new/lib_init.c 2007-11-17 22:42:56.000000000 +0100
-@@ -1226,6 +1226,15 @@
- ctx->data_ts_confirm_fn = vv;
- break;
-
-+ case POLDEK_CONF_SUGSCONFIRM_CB:
-+ if ((vv = va_arg(ap, void*)))
-+ ctx->sugs_confirm_fn = vv;
-+
-+ if ((vv = va_arg(ap, void*)))
-+ ctx->data_sugs_confirm_fn = vv;
-+
-+ break;
-+
- case POLDEK_CONF_CHOOSEEQUIV_CB:
- if ((vv = va_arg(ap, void*)))
- ctx->choose_equiv_fn = vv;
-diff -urN poldek/poldek.h poldek.new/poldek.h
---- poldek/poldek.h 2007-07-01 23:04:26.000000000 +0200
-+++ poldek.new/poldek.h 2007-11-17 21:33:31.000000000 +0100
-@@ -53,7 +53,8 @@
- #define POLDEK_CONF_GOODBYE_CB 22
- #define POLDEK_CONF_CONFIRM_CB 23
- #define POLDEK_CONF_TSCONFIRM_CB 24
--#define POLDEK_CONF_CHOOSEEQUIV_CB 25
-+#define POLDEK_CONF_SUGSCONFIRM_CB 25
-+#define POLDEK_CONF_CHOOSEEQUIV_CB 26
-
- int poldek_configure(struct poldek_ctx *ctx, int param, ...);
-
-diff -urN poldek/poldek_intern.h poldek.new/poldek_intern.h
---- poldek/poldek_intern.h 2007-07-08 18:59:15.000000000 +0200
-+++ poldek.new/poldek_intern.h 2007-11-17 22:47:39.000000000 +0100
-@@ -38,6 +38,10 @@
- void *data_ts_confirm_fn;
- int (*ts_confirm_fn)(void *data, const struct poldek_ts *ts); /* confirm transaction */
-
-+ void *data_sugs_confirm_fn;
-+ int (*sugs_confirm_fn)(void *data, const struct poldek_ts *ts, int hint,
-+ const char *message); /* confirm suggests */
-+
- void *data_choose_equiv_fn;
- int (*choose_equiv_fn)(void *data, const struct poldek_ts *ts,
- const char *cap, tn_array *pkgs, int hint);
-@@ -74,6 +78,10 @@
-
- int poldek__ts_confirm(const struct poldek_ts *ts);
-
-+int poldek__sugs_confirm(const struct poldek_ts *ts,
-+ int default_answer, const char *message);
-+
-+
- int poldek__choose_equiv(const struct poldek_ts *ts,
- const char *capname, tn_array *pkgs, struct pkg *hint);
-
-diff -urN poldek/poldek_ts.c poldek.new/poldek_ts.c
---- poldek/poldek_ts.c 2007-07-11 00:56:17.000000000 +0200
-+++ poldek.new/poldek_ts.c 2007-11-17 22:56:19.000000000 +0100
-@@ -54,6 +54,7 @@
-
- extern int poldek_term_confirm(int default_answer, const char *msg);
- extern int poldek_term_ts_confirm(const struct poldek_ts *ts);
-+extern int poldek_term_sugs_confirm(int default_answer, const char *msg);
- extern int poldek_term_choose_pkg(const char *capname, tn_array *pkgs,
- struct pkg *hint);
-
+++ /dev/null
-Index: capreq.c
-===================================================================
-RCS file: /cvsroot/poldek/poldek/capreq.c,v
-retrieving revision 1.44
-diff -u -r1.44 capreq.c
---- capreq.c 21 Jun 2007 16:47:45 -0000 1.44
-+++ capreq.c 29 Jun 2007 20:10:22 -0000
-@@ -59,7 +59,7 @@
- return strcmp(capreq_name(cr1), capreq_name(cr2));
- }
-
--__inline__
-+__inline__ static
- int capreq_cmp2name(struct capreq *cr1, const char *name)
- {
- return strcmp(capreq_name(cr1), name);
-@@ -427,9 +427,24 @@
- __inline__
- int capreq_arr_find(tn_array *capreqs, const char *name)
- {
-+ /* capreq_cmp2name is compilant with capreq_cmp_name_evr */
-+ if (!n_array_is_sorted(capreqs))
-+ n_array_sort(capreqs);
-+
- return n_array_bsearch_idx_ex(capreqs, name,
- (tn_fn_cmp)capreq_cmp2name);
- }
-+
-+__inline__
-+int capreq_arr_contains(tn_array *capreqs, const char *name)
-+{
-+ if (!n_array_is_sorted(capreqs))
-+ n_array_sort(capreqs); /* capreq_cmp2name */
-+
-+ return n_array_bsearch_idx_ex(capreqs, name,
-+ (tn_fn_cmp)capreq_cmp2name) > -1;
-+}
-+
-
- tn_buf *capreq_arr_join(tn_array *capreqs, tn_buf *nbuf, const char *sep)
- {
-Index: capreq.h
-===================================================================
-RCS file: /cvsroot/poldek/poldek/capreq.h,v
-retrieving revision 1.30
-diff -u -r1.30 capreq.h
---- capreq.h 21 Jun 2007 22:29:49 -0000 1.30
-+++ capreq.h 29 Jun 2007 20:10:22 -0000
-@@ -117,12 +117,12 @@
- int capreq_strcmp_name_evr(struct capreq *pr1, struct capreq *pr2);
-
- int capreq_cmp_name(struct capreq *cr1, struct capreq *cr2);
--int capreq_cmp2name(struct capreq *pr1, const char *name);
- int capreq_cmp_name_evr(struct capreq *cr1, struct capreq *cr2);
-
- #ifndef SWIG
- tn_array *capreq_arr_new(int size);
--int capreq_arr_find(tn_array *capreqs, const char *name);
-+int capreq_arr_find(tn_array *capreqs, const char *name); /* returns index */
-+int capreq_arr_contains(tn_array *capreqs, const char *name); /* returns bool */
- tn_buf *capreq_arr_join(tn_array *capreqs, tn_buf *nbuf, const char *sep);
-
- int capreq_arr_store_n(tn_array *arr);
-Index: libpoldek.sym
-===================================================================
-RCS file: /cvsroot/poldek/poldek/libpoldek.sym,v
-retrieving revision 1.28
-diff -u -r1.28 libpoldek.sym
---- libpoldek.sym 28 Jun 2007 22:28:21 -0000 1.28
-+++ libpoldek.sym 29 Jun 2007 20:10:22 -0000
-@@ -20,7 +20,6 @@
- capreq_arr_store
- capreq_arr_store_n
- capreq_clone
--capreq_cmp2name
- capreq_cmp_name
- capreq_cmp_name_evr
- capreq_epoch_
-Index: pkg.c
-===================================================================
-RCS file: /cvsroot/poldek/poldek/pkg.c,v
-retrieving revision 1.115
-diff -u -r1.115 pkg.c
---- pkg.c 21 Jun 2007 16:47:45 -0000 1.115
-+++ pkg.c 29 Jun 2007 20:10:23 -0000
-@@ -920,8 +920,7 @@
- struct capreq *cnfl = NULL;
-
- DBGF("%s %s%s", pkg_id(pkg), pkg_id(cpkg), isbastard ? " (bastard)" : "");
-- if (n_array_bsearch_ex(pkg->cnfls, cpkg->name,
-- (tn_fn_cmp)capreq_cmp2name) == NULL) {
-+ if (!capreq_arr_contains(pkg->cnfls, cpkg->name)) {
- cnfl = capreq_new(pkg->na, cpkg->name, cpkg->epoch, cpkg->ver,
- cpkg->rel, REL_EQ,
- (isbastard ? CAPREQ_BASTARD : 0));
-@@ -935,8 +934,7 @@
-
- int pkg_has_pkgcnfl(struct pkg *pkg, struct pkg *cpkg)
- {
-- return pkg->cnfls && (n_array_bsearch_ex(pkg->cnfls, cpkg->name,
-- (tn_fn_cmp)capreq_cmp2name));
-+ return pkg->cnfls && capreq_arr_contains(pkg->cnfls, cpkg->name);
- }
-
- struct pkguinf *pkg_xuinf(const struct pkg *pkg, tn_array *langs)
-Index: pkgdir/pkgdir_dirindex.c
-===================================================================
-RCS file: /cvsroot/poldek/poldek/pkgdir/pkgdir_dirindex.c,v
-retrieving revision 1.13
-diff -u -r1.13 pkgdir_dirindex.c
---- pkgdir/pkgdir_dirindex.c 24 Jun 2007 22:47:27 -0000 1.13
-+++ pkgdir/pkgdir_dirindex.c 29 Jun 2007 20:10:23 -0000
-@@ -505,7 +505,7 @@
- {
- const char **tl, **tl_save;
- char val[16 * 1024];
-- int vlen, n = 0, nadded = 0;
-+ int vlen, n = 0, nadded = 0, created_here = 0;
-
- n_assert(key[1] == PREFIX_PKGKEY_REQDIR);
- vlen = sizeof(val);
-@@ -513,15 +513,15 @@
- if (tl == NULL)
- return 0;
-
-- if (!pkg->reqs)
-+ if (!pkg->reqs) {
- pkg->reqs = capreq_arr_new(n);
--
-+ created_here = 1;
-+ }
-+
- while (*tl) {
- const char *dir = *tl;
-
-- if (*dir && !n_array_bsearch_ex(pkg->reqs, dir,
-- (tn_fn_cmp)capreq_cmp2name)) {
--
-+ if (*dir && (created_here || !capreq_arr_contains(pkg->reqs, dir))) {
- struct capreq *req = capreq_new(pkg->na, dir, 0, NULL, NULL, 0,
- CAPREQ_BASTARD);
- n_array_push(pkg->reqs, req);
-================================================================
-Index: trurlib/include/trurl/narray.h
-diff -u trurlib/include/trurl/narray.h:1.29 trurlib/include/trurl/narray.h:1.30
---- trurlib/include/trurl/narray.h:1.29 Tue Jun 19 23:52:49 2007
-+++ trurlib/include/trurl/narray.h Sat Jun 30 09:39:51 2007
-@@ -155,7 +155,9 @@
- /* internal macros, do not use them */
- #define TN_ARRAY_set_sorted(arr) ((arr)->flags |= TN_ARRAY_INTERNAL_ISSORTED)
- #define TN_ARRAY_clr_sorted(arr) ((arr)->flags &= ~TN_ARRAY_INTERNAL_ISSORTED)
--#define TN_ARRAY_is_sorted(arr) ((arr)->flags & TN_ARRAY_INTERNAL_ISSORTED)
-+
-+
-+#define n_array_is_sorted(arr) ((arr)->flags & TN_ARRAY_INTERNAL_ISSORTED)
-
- tn_array *n_array_grow_priv_(tn_array *arr, size_t req_size);
- #ifndef SWIG
-
-================================================================
-Index: trurlib/n_array_sorts.c
-diff -u trurlib/n_array_sorts.c:1.6 trurlib/n_array_sorts.c:1.7
---- trurlib/n_array_sorts.c:1.6 Tue Nov 16 20:01:40 2004
-+++ trurlib/n_array_sorts.c Sat Jun 30 09:39:51 2007
-@@ -121,7 +121,7 @@
-
- cmpf = autosort(arr, cmpf, &set_sorted);
-
-- if ((arr->flags & TN_ARRAY_AUTOSORTED) && TN_ARRAY_is_sorted(arr))
-+ if ((arr->flags & TN_ARRAY_AUTOSORTED) && n_array_is_sorted(arr))
- return arr;
-
- switch (alg) {
-
+++ /dev/null
---- vfile/vfff/http.c.orig 2007-07-16 22:05:47.000000000 +0200
-+++ vfile/vfff/http.c 2007-07-16 22:06:10.000000000 +0200
-@@ -123,16 +123,8 @@
-
- static char *make_req_line(char *buf, int size, const char *method, const char *uri)
- {
-- char *escaped = NULL;
--
-- if ((escaped = vfff_uri_escape(uri)))
-- uri = escaped;
--
- n_snprintf(buf, size, "%s %s HTTP/1.1\r\n", method, uri);
-
-- if (escaped)
-- free(escaped);
--
- return buf;
- }
-