+++ /dev/null
-diff -urN poldek-0.20.org/arg_packages.c poldek-0.20/arg_packages.c
---- poldek-0.20.org/arg_packages.c 2005-10-07 21:00:16.000000000 +0200
-+++ poldek-0.20/arg_packages.c 2006-07-26 20:25:54.027315250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <limits.h>
-@@ -42,6 +42,8 @@
- #include "pkgset.h"
- #include "pm/pm.h"
-
-+extern int poldek_conf_MULTILIB;
-+
- #define ARG_PACKAGES_SETUPDONE (1 << 0)
-
- /* @VIRTUAL [DEFAULT_MASK [EVR]] */
-@@ -227,36 +229,6 @@
- // n_hash_size(aps->resolved_caps);
- }
-
--#if 0 /* XXX: disabled, #5702 */
--/* tries to convert N-[E:]V-R to N#[E:]V-R */
--static char *mask2evrhashedmask(const char *mask)
--{
-- const char *name, *ver, *rel, *p;
-- char nmask[1024], e[32] = "", *tmp;
-- int32_t epoch = 0;
-- int n;
--
-- n_strdupap(mask, &tmp);
-- if (!poldek_util_parse_nevr(tmp, &name, &epoch, &ver, &rel))
-- return NULL;
--
-- p = ver; /* check if it is really version */
-- while (*p) {
-- if (isdigit(*p))
-- break;
-- p++;
-- }
--
-- if (*p == '\0') /* no digits => part of name propably */
-- return NULL;
--
-- if (epoch)
-- snprintf(e, sizeof(e), "%d:", epoch);
-- n = n_snprintf(nmask, sizeof(nmask), "%s#%s%s-%s", name, e, ver, rel);
-- return n_strdupl(nmask, n);
--}
--#endif
--
- tn_array *arg_packages_get_masks(struct arg_packages *aps, int hashed)
- {
- tn_array *masks;
-@@ -264,19 +236,11 @@
-
- masks = n_array_clone(aps->package_masks);
- for (i=0; i < n_array_size(aps->package_masks); i++) {
-- const char *mask;
--
-- mask = n_array_nth(aps->package_masks, i);
-- if (hashed && strchr(mask, '-') && strchr(mask, '*') == NULL) {
--#if 0 /* XXX: disabled so smart NEVR parsing, #5702 */
-- char *nmask;
-- if ((nmask = mask2evrhashedmask(mask)))
-- mask = nmask;
--#endif
-- }
-+ const char *mask = n_array_nth(aps->package_masks, i);
- n_array_push(masks, n_strdup(mask));
- }
--
-+
-+ hashed = 0; /* disabled for a while */
- for (i=0; i < n_array_size(aps->packages); i++) {
- struct pkg *pkg = n_array_nth(aps->packages, i);
- char mask[1024], e[32] = "";
-@@ -284,9 +248,13 @@
-
- if (pkg->epoch)
- snprintf(e, sizeof(e), "%d:", pkg->epoch);
--
-+
- n = n_snprintf(mask, sizeof(mask), "%s%s%s%s-%s", pkg->name,
-- hashed ? "#" : "-", e, pkg->ver, pkg->rel);
-+ hashed ? "#" : "-", e, pkg->ver, pkg->rel);
-+
-+ if (0 && poldek_conf_MULTILIB && pkg_arch(pkg))
-+ n += n_snprintf(&mask[n], sizeof(mask) - n, ".%s", pkg_arch(pkg));
-+
- n_array_push(masks, n_strdupl(mask, n));
- }
-
-@@ -532,7 +500,7 @@
- if (matches[j] == 0 && (flags & ARG_PACKAGES_RESOLV_MISSINGOK) == 0) {
- logn(LOGERR, _("%s: no such package"), mask);
- rc = 0;
-- }
-+ }
-
- if ((flags & ARG_PACKAGES_RESOLV_UNAMBIGUOUS) == 0 && matches_bycmp[j] > 1) {
- int pri = (flags & ARG_PACKAGES_RESOLV_EXACT) ? LOGERR : LOGWARN;
-@@ -675,7 +643,7 @@
- int arg_packages_resolve(struct arg_packages *aps, tn_array *avpkgs,
- struct pkgset *ps, unsigned flags)
- {
-- int i, j, nmasks, rc = 0;
-+ int i, j, nmasks, rc = 1;
-
- n_hash_clean(aps->resolved_caps);
- n_array_clean(aps->resolved_pkgs);
-@@ -697,12 +665,16 @@
- }
- }
-
-- rc = resolve_pkgs(aps->resolved_pkgs, aps, avpkgs, flags);
-- if (rc) /* continue with masks */
-- rc = resolve_masks(aps->resolved_pkgs, aps, avpkgs, ps, flags);
-+ if (!resolve_pkgs(aps->resolved_pkgs, aps, avpkgs, flags))
-+ rc = 0;
-+
-+ if (!resolve_masks(aps->resolved_pkgs, aps, avpkgs, ps, flags))
-+ rc = 0;
-
-- if (rc && ps && aps->pset_virtuals)
-- rc = resolve_pset_virtuals(aps, ps, flags);
-+ if (ps && aps->pset_virtuals) {
-+ if (!resolve_pset_virtuals(aps, ps, flags))
-+ rc = 0;
-+ }
-
- if (!rc) {
- n_array_clean(aps->resolved_pkgs);
-diff -urN poldek-0.20.org/arg_packages.h poldek-0.20/arg_packages.h
---- poldek-0.20.org/arg_packages.h 2005-05-25 19:53:19.000000000 +0200
-+++ poldek-0.20/arg_packages.h 2006-07-26 20:25:54.027315250 +0200
-@@ -1,4 +1,4 @@
--/* $Id$ */
-+/* $Id$ */
- #ifndef POLDEK_USRSET_H
- #define POLDEK_USRSET_H
-
-@@ -15,6 +15,7 @@
-
- void arg_packages_clean(struct arg_packages *aps);
- int arg_packages_size(struct arg_packages *aps);
-+
- tn_array *arg_packages_get_masks(struct arg_packages *aps, int hashed);
-
- int arg_packages_add_pkgmask(struct arg_packages *aps, const char *mask);
-diff -urN poldek-0.20.org/ask.c poldek-0.20/ask.c
---- poldek-0.20.org/ask.c 2003-04-14 18:28:09.000000000 +0200
-+++ poldek-0.20/ask.c 2006-07-26 20:25:54.027315250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -92,13 +92,18 @@
- *p++ = 'a' + i;
- i++;
- }
-+ *p++ = 'Q';
-
-- msg(-1, _("Which one do you want to install? [%c]"), 'a' + default_i);
-+ msg(-1, _("Which one do you want to install ('Q' to abort)? [%c]"),
-+ 'a' + default_i);
- a = poldek_term_ask(STDIN_FILENO, validchrs, NULL);
- msg(-1, "_\n");
-
- if (a == '\n')
- return default_i;
-+
-+ if (a == 'Q')
-+ return -1;
-
- a -= 'a';
- //printf("Selected %d\n", a);
-diff -urN poldek-0.20.org/cli/alias.c poldek-0.20/cli/alias.c
---- poldek-0.20.org/cli/alias.c 2005-05-24 21:54:22.000000000 +0200
-+++ poldek-0.20/cli/alias.c 2006-07-26 20:25:54.027315250 +0200
-@@ -7,13 +7,13 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
-+#include <errno.h>
- #include <limits.h>
- #include <stdint.h>
- #include <string.h>
--#include <errno.h>
- #include <unistd.h>
-
- #include <trurl/nassert.h>
-@@ -24,6 +24,7 @@
- #include "i18n.h"
- #include "log.h"
- #include "cli.h"
-+#include "cmd_chain.h"
- #include "conf.h"
-
-
-@@ -33,7 +34,7 @@
- COMMAND_NOARGS | COMMAND_NOOPTS,
- "alias", NULL, N_("Print defined command aliases"),
- NULL, NULL, NULL, alias,
-- NULL, NULL, NULL, NULL, 0, 0
-+ NULL, NULL, NULL, NULL, NULL, 0, 0
- };
-
- static int alias(struct cmdctx *cmdctx)
-@@ -53,6 +54,7 @@
- if (cmd->flags & COMMAND_IS_ALIAS) {
- n_cfree(&cmd->cmdline);
- n_cfree(&cmd->name);
-+ n_cfree(&cmd->aliasto);
- memset(cmd, 0, sizeof(*cmd));
- }
- }
-@@ -68,7 +70,10 @@
- alias->flags = COMMAND_IS_ALIAS | COMMAND__MALLOCED;
- alias->name = n_strdup(name);
- alias->cmdline = n_strdup(cmdline);
-+ alias->aliasto = NULL;
- alias->_free = free_alias;
-+ if (strchr(alias->cmdline, '%'))
-+ alias->flags |= COMMAND_PARAMETERIZED;
- return alias;
- }
-
-@@ -77,17 +82,18 @@
- int add_alias(struct poclidek_ctx *cctx,
- const char *aliasname, const char *cmdline)
- {
-- struct poclidek_cmd *cmd;
-- struct poclidek_cmd tmpcmd;
--
-+ struct poclidek_cmd *cmd, tmpcmd;
-+ int rc = 1;
-
- tmpcmd.name = (char*)aliasname;
-- if ((cmd = n_array_bsearch(cctx->commands, &tmpcmd)) == NULL) {
-- n_array_push(cctx->commands, command_new_alias(aliasname, cmdline));
-+ if ((cmd = n_array_bsearch(cctx->commands, &tmpcmd)) == NULL) {
-+ cmd = command_new_alias(aliasname, cmdline);
-+ n_array_push(cctx->commands, cmd);
-
- } else {
- if ((cmd->flags & COMMAND_IS_ALIAS) == 0) {
- logn(LOGWARN, _("%s: alias could not shadow a command"), aliasname);
-+ rc = 0;
-
- } else {
- if (poldek_verbose() > 1)
-@@ -102,15 +108,61 @@
- }
-
- n_array_sort(cctx->commands);
-- return 1;
-+ return rc;
-+}
-+
-+/* determine to what command alias is aliased */
-+static char *alias_to(struct poclidek_ctx *cctx, const char *cmdline)
-+{
-+ tn_array *ents;
-+ char *p, *cmd = NULL;
-+
-+ if (strchr(cmdline, '|') == NULL) {
-+ cmd = n_strdup(cmdline);
-+
-+ } else if ((ents = poclidek_prepare_cmdline(cctx, cmdline))) {
-+ struct cmd_chain_ent *ent = n_array_nth(ents, 0);
-+ while (ent->next_piped)
-+ ent = ent->next_piped;
-+
-+ cmd = n_strdup(ent->cmd->name);
-+ n_array_free(ents);
-+ }
-+
-+ if (cmd == NULL)
-+ return NULL;
-+
-+ if ((p = strchr(cmd, ' ')))
-+ *p = '\0';
-+
-+ return cmd;
- }
-
-+static void find_aliased_commands(struct poclidek_ctx *cctx)
-+{
-+ struct poclidek_cmd *cmd;
-+ int i;
-+
-+ for (i=0; i < n_array_size(cctx->commands); i++) {
-+ cmd = n_array_nth(cctx->commands, i);
-+
-+ if ((cmd->flags & COMMAND_IS_ALIAS) == 0)
-+ continue;
-+
-+ cmd->aliasto = alias_to(cctx, cmd->cmdline);
-+ if (cmd->aliasto == NULL)
-+ logn(LOGWARN, _("%s: could not determine aliased command"),
-+ cmd->name);
-+ else
-+ msgn(3, "%s => aliased %s", cmd->name, cmd->aliasto);
-+ }
-+}
-
- int poclidek_load_aliases(struct poclidek_ctx *cctx, const char *path)
- {
- tn_hash *aliases_htcnf, *ht;
- tn_array *keys;
-- int i;
-+ int i, n = 0;
-
- if (access(path, R_OK) != 0)
- return 0;
-@@ -126,16 +178,22 @@
- const char *name, *cmdline;
-
- name = n_array_nth(keys, i);
-+ if (*name == '_') /* config macro */
-+ continue;
-+
- if ((cmdline = poldek_conf_get(ht, name, NULL)))
-- add_alias(cctx, name, cmdline);
-+ if (add_alias(cctx, name, cmdline))
-+ n++;
- }
-
- n_array_free(keys);
- n_hash_free(aliases_htcnf);
-+
-+ if (n)
-+ find_aliased_commands(cctx);
-+
- return 1;
- }
-
-
-
--
--
-diff -urN poldek-0.20.org/cli/cd.c poldek-0.20/cli/cd.c
---- poldek-0.20.org/cli/cd.c 2005-06-12 23:11:08.000000000 +0200
-+++ poldek-0.20/cli/cd.c 2006-07-26 20:25:54.027315250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <sys/param.h> /* for PATH_MAX */
-@@ -30,14 +30,14 @@
- COMMAND_SELFARGS | COMMAND_EMPTYARGS | COMMAND_NOOPTS,
- "cd", N_("[PATH]"), N_("Change current package directory"),
- NULL, parse_opt, NULL, cd,
-- NULL, NULL, NULL, NULL, 0, 0
-+ NULL, NULL, NULL, NULL, NULL, 0, 0
- };
-
- struct poclidek_cmd command_pwd = {
- COMMAND_NOARGS | COMMAND_NOOPTS,
- "pwd", NULL, N_("Print name of current directory"),
- NULL, NULL, NULL, pwd,
-- NULL, NULL, NULL, NULL, 0, 0
-+ NULL, NULL, NULL, NULL, NULL, 0, 0
- };
-
-
-diff -urN poldek-0.20.org/cli/cli.c poldek-0.20/cli/cli.c
---- poldek-0.20.org/cli/cli.c 2005-10-12 01:20:12.000000000 +0200
-+++ poldek-0.20/cli/cli.c 2006-07-26 20:25:54.027315250 +0200
-@@ -1,5 +1,5 @@
- /*
-- Copyright (C) 2000 - 2004 Pawel A. Gajda <mis@pld.org.pl>
-+ Copyright (C) 2000 - 2005 Pawel A. Gajda <mis@k2.net.pl>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2 as
-@@ -11,23 +11,23 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
- # include "config.h"
- #endif
-
-+#include <signal.h>
-+#include <stdint.h>
- #include <stdio.h>
- #include <stdlib.h>
--#include <stdint.h>
- #include <string.h>
--#include <sys/param.h>
--#include <sys/types.h>
-+#include <sys/errno.h>
- #include <sys/file.h>
-+#include <sys/param.h>
- #include <sys/stat.h>
--#include <sys/errno.h>
--#include <signal.h>
-+#include <sys/types.h>
- #include <time.h>
- #include <argp.h>
-
-@@ -161,14 +161,22 @@
-
- if (cmd->flags & COMMAND_IS_ALIAS)
- return NULL;
--
-+
- n = n_snprintf(nam, sizeof(nam), "%s ", cmd->name);
- for (i=0; i < n_array_size(cctx->commands); i++) {
- struct poclidek_cmd *cm = n_array_nth(cctx->commands, i);
-+ int found = 0;
-+
- if ((cm->flags & COMMAND_IS_ALIAS) == 0)
- continue;
-+
-+ if (cm->aliasto && n_str_eq(cmd->name, cm->aliasto))
-+ found = 1;
-+
-+ else if (strncmp(nam, cm->cmdline, n) == 0)
-+ found = 1;
-
-- if (strncmp(nam, cm->cmdline, n) == 0) {
-+ if (found) {
- if (aliases == NULL)
- aliases = n_array_new(4, NULL, (tn_fn_cmp)command_cmp);
- n_array_push(aliases, cm);
-@@ -316,45 +324,50 @@
- return *fmt == '!';
- }
-
--int cmdctx_printf(struct cmdctx *cmdctx, const char *fmt, ...)
-+static
-+int do_cmdctx_printf(struct cmdctx *cmdctx, int color, const char *fmt,
-+ va_list args)
- {
-- va_list args;
-- int n = 0;
-+ int is_ctrl, n = 0;
-
-- if (cmdctx_isctrlmsg(fmt)) {
-+ if ((is_ctrl = cmdctx_isctrlmsg(fmt))) {
- if (cmdctx->rtflags & CMDCTX_NOCTRLMSGS)
- return 1;
- fmt++;
- }
-
-- va_start(args, fmt);
-- if (cmdctx->pipe_right)
-+ if (cmdctx->pipe_right == NULL || is_ctrl) {
-+ n = color ? poldek_term_vprintf_c(color, fmt, args) :
-+ vfprintf(stdout, fmt, args);
-+
-+ } else {
- n = cmd_pipe_vprintf(cmdctx->pipe_right, fmt, args);
-- else
-- n = vfprintf(stdout, fmt, args);
-+ }
-
-- va_end(args);
- return n;
-+}
-+
-+int cmdctx_printf(struct cmdctx *cmdctx, const char *fmt, ...)
-+{
-+ va_list args;
-+ int n;
-
-+ va_start(args, fmt);
-+ n = do_cmdctx_printf(cmdctx, 0, fmt, args);
-+ va_end(args);
-+
-+ return n;
- }
-
- int cmdctx_printf_c(struct cmdctx *cmdctx, int color, const char *fmt, ...)
- {
- va_list args;
-- int n = 0;
--
-- if (cmdctx_isctrlmsg(fmt)) {
-- if (cmdctx->rtflags & CMDCTX_NOCTRLMSGS)
-- return 1;
-- fmt++;
-- }
--
-+ int n;
-+
- va_start(args, fmt);
-- if (cmdctx->pipe_right)
-- n = cmd_pipe_vprintf(cmdctx->pipe_right, fmt, args);
-- else
-- n = poldek_term_vprintf_c(color, fmt, args);
--
-+ n = do_cmdctx_printf(cmdctx, color, fmt, args);
-+ va_end(args);
-+
- return n;
- }
-
-@@ -577,25 +590,22 @@
- return argv;
- }
-
--tn_array *poclidek_prepare_cmdline(struct poclidek_ctx *cctx, const char *line);
--
--
-+/* executes command chain (a pipeline) */
- static
- int poclidek_exec_cmd_ent(struct poclidek_ctx *cctx, struct poldek_ts *ts,
- struct cmd_chain_ent *ent, struct cmd_pipe *cmd_pipe)
- {
- struct cmdctx cmdctx;
- char **argv;
-- int rc = 0;
-+ int rc = 0, runit = 1;
-
- DBGF("ent %s, %d, %p\n", ent->cmd->name, n_array_size(ent->a_argv),
- ent->next_piped);
--
--
-
- memset(&cmdctx, 0, sizeof(cmdctx));
- cmdctx.cmd = ent->cmd;
- cmdctx.cctx = cctx;
-+
- if ((cmdctx.ts = ts) == NULL)
- cmdctx.ts = poldek_ts_new(cctx->ctx, 0);
-
-@@ -609,7 +619,7 @@
- cmdctx.pipe_right = ent->pipe_right;
- }
-
-- if (ent->prev_piped) {
-+ if (ent->prev_piped) { /* | cmd */
- struct cmd_pipe *pipe;
- tn_array *pipe_args = NULL;
-
-@@ -624,9 +634,15 @@
- else
- pipe_args = cmd_pipe_xargs(pipe, CMD_PIPE_CTX_ASCII);
-
-- if (pipe_args) {
-+ if (pipe_args == NULL) {
-+ runit = 0; /* do not execute command if pipe is empty */
-+ rc = 0;
-+ goto l_end;
-+
-+ } else {
- while (n_array_size(pipe_args))
- n_array_push(ent->a_argv, n_array_shift(pipe_args));
-+ n_array_free(pipe_args);
- }
- }
- }
-@@ -636,11 +652,12 @@
- a_argv_to_argv(ent->a_argv, argv);
-
- rc = do_exec_cmd_ent(&cmdctx, n_array_size(ent->a_argv), argv);
--
-+
-+ l_end:
- if (ts == NULL)
- poldek_ts_free(cmdctx.ts);
-
-- if (ent->next_piped)
-+ if (runit && ent->next_piped)
- return poclidek_exec_cmd_ent(cctx, ts, ent->next_piped, cmd_pipe);
-
- return rc;
-diff -urN poldek-0.20.org/cli/cmd_chain.c poldek-0.20/cli/cmd_chain.c
---- poldek-0.20.org/cli/cmd_chain.c 2005-10-21 17:59:28.000000000 +0200
-+++ poldek-0.20/cli/cmd_chain.c 2006-07-26 20:25:54.031315500 +0200
-@@ -1,32 +1,37 @@
--/*
-- Copyright (C) 2000 - 2004 Pawel A. Gajda (mis@k2.net.pl)
--
-+/*
-+ Copyright (C) 2000 - 2005 Pawel A. Gajda <mis@k2.net.pl>
-+
- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License published by
-- the Free Software Foundation (see file COPYING for details).
-+ it under the terms of the GNU General Public License, version 2 as
-+ published by the Free Software Foundation (see file COPYING for details).
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
- # include "config.h"
- #endif
-
-+#include <stdint.h>
- #include <stdio.h>
- #include <stdlib.h>
--#include <stdint.h>
- #include <string.h>
--#include <sys/types.h>
-+#include <sys/errno.h>
- #include <sys/file.h>
- #include <sys/stat.h>
--#include <sys/errno.h>
-+#include <sys/types.h>
-
- #include <trurl/trurl.h>
- #include <sigint/sigint.h>
-
- #include "i18n.h"
-+#include "poldek_util.h"
- #define ENABLE_TRACE 0
- #include "log.h"
- #include "cli.h"
-@@ -39,7 +44,8 @@
-
- static
- struct cmd_chain_ent *cmd_chain_ent_new(unsigned flags,
-- struct poclidek_cmd *cmd, tn_array *a_argv)
-+ struct poclidek_cmd *cmd,
-+ tn_array *a_argv)
- {
- struct cmd_chain_ent *ent;
- ent = n_malloc(sizeof(*ent));
-@@ -207,6 +213,58 @@
- return cmd;
- }
-
-+static const char *apply_params(const char *cmdline, tn_array *a_argv)
-+{
-+ tn_hash *vars;
-+ tn_array *new_a_argv = NULL;
-+ char newline[1024];
-+ int i;
-+
-+ n_assert(n_array_size(a_argv) > 0);
-+
-+ vars = n_hash_new(n_array_size(a_argv) < 16 ? 16:n_array_size(a_argv) * 2,
-+ NULL);
-+
-+ for (i=0; i < n_array_size(a_argv); i++) {
-+ char no[64];
-+ n_snprintf(no, sizeof(no), "%d", i);
-+
-+ n_hash_insert(vars, no, n_array_nth(a_argv, i));
-+ }
-+
-+ cmdline = poldek_util_expand_vars(newline, sizeof(newline),
-+ cmdline, '%', vars,
-+ POLDEK_UTIL_EXPANDVARS_RMUSED);
-+
-+ if (strchr(cmdline, '%')) {/* still unexpanded vars */
-+ cmdline = NULL;
-+ goto l_end;
-+ }
-+
-+ /* remove used args from a_argv */
-+ new_a_argv = n_array_clone(a_argv);
-+ n_assert(n_array_ctl_get_freefn(a_argv) == free);
-+
-+ i = 0;
-+ while (n_array_size(a_argv) > 0) {
-+ char no[64], *arg = n_array_shift(a_argv);
-+
-+ n_snprintf(no, sizeof(no), "%d", i++);
-+ if (n_hash_exists(vars, no))
-+ n_array_push(new_a_argv, arg);
-+ else
-+ free(arg);
-+ }
-+ n_assert(n_array_size(a_argv) == 0);
-+ while (n_array_size(new_a_argv) > 0)
-+ n_array_push(a_argv, n_array_shift(new_a_argv));
-+ n_array_free(new_a_argv);
-+
-+
-+ l_end:
-+ n_hash_free(vars);
-+ return cmdline;
-+}
-
- static
- tn_array *prepare_a_argv(struct poclidek_ctx *cctx, tn_array *cmd_chain,
-@@ -234,11 +292,26 @@
- ent = cmd_chain_ent_new(CMD_CHAIN_ENT_CMD, cmd, a_argv);
- n_array_push(cmd_chain, ent);
-
-- } else {
-+ } else { /* alias */
- const char *cmdline;
-
- n_assert(cmd->cmdline);
- cmdline = cmd->cmdline;
-+
-+ if (cmd->flags & COMMAND_PARAMETERIZED) {
-+ if (n_array_size(a_argv) == 0) {
-+ logn(LOGERR, _("%s: alias needs an arguments"), acmd);
-+ return NULL;
-+ }
-+
-+ if ((cmdline = apply_params(cmdline, a_argv)) == NULL) {
-+ logn(LOGERR,
-+ _("%s: apply arguments failed (not enough arguments?)"),
-+ acmd);
-+ return NULL;
-+ }
-+ }
-+ msgn(2, "%s => %s\n", acmd, cmdline);
-
- if (n_array_size(a_argv) > 1) { /* any arguments? -> pass them */
- char *line;
-@@ -247,7 +320,7 @@
- len = strlen(cmd->cmdline) + 1;
- /* from 1 -- skip alias */
- for (i=1; i < n_array_size(a_argv); i++)
-- /* + quotes + space */
-+ /* + quotes + space */
- len += strlen((char*)n_array_nth(a_argv, i)) + 2 + 1;
- len++;
-
-diff -urN poldek-0.20.org/cli/cmd.h poldek-0.20/cli/cmd.h
---- poldek-0.20.org/cli/cmd.h 2005-05-15 17:53:07.000000000 +0200
-+++ poldek-0.20/cli/cmd.h 2006-07-26 20:25:54.031315500 +0200
-@@ -1,4 +1,4 @@
--/* $Id$ */
-+/* $Id$ */
- #ifndef POCLIDEK_CMD_H
- #define POCLIDEK_CMD_H
-
-@@ -46,8 +46,9 @@
- #define COMMAND_HIDDEN (1 << 5) /* help doesn't displays it */
- #define COMMAND_SELFARGS (1 << 7) /* cmd parses its args itself */
-
--#define COMMAND_MODIFIESDB (1 << 8)
--#define COMMAND_IS_ALIAS (1 << 9)
-+#define COMMAND_MODIFIESDB (1 << 8)
-+#define COMMAND_IS_ALIAS (1 << 9)
-+#define COMMAND_PARAMETERIZED (1 << 10)
-
- #define COMMAND_PIPEABLE_LEFT (1 << 13)
- #define COMMAND_PIPEABLE_RIGTH (1 << 14)
-@@ -79,6 +80,7 @@
- char *extra_help;
-
- char *cmdline; /* alias content */
-+ char *aliasto; /* if alias, a cmd name is aliased to */
- int _seqno;
- void (*_free)(struct poclidek_cmd *);
- };
-diff -urN poldek-0.20.org/cli/cmd_pipe.c poldek-0.20/cli/cmd_pipe.c
---- poldek-0.20.org/cli/cmd_pipe.c 2005-04-27 20:28:32.000000000 +0200
-+++ poldek-0.20/cli/cmd_pipe.c 2006-07-26 20:25:54.031315500 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -181,6 +181,9 @@
- xargs_packages(p, args);
- }
-
-+ if (n_array_size(args) == 0)
-+ n_array_cfree(&args);
-+
- return args;
- }
-
-diff -urN poldek-0.20.org/cli/dbcache.c poldek-0.20/cli/dbcache.c
---- poldek-0.20.org/cli/dbcache.c 2005-09-17 17:36:21.000000000 +0200
-+++ poldek-0.20/cli/dbcache.c 2006-07-26 20:25:54.031315500 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -30,7 +30,6 @@
- #include <signal.h>
- #include <time.h>
- #include <argp.h>
--#include <time.h>
-
- #include <trurl/trurl.h>
- #include <sigint/sigint.h>
-diff -urN poldek-0.20.org/cli/dent.c poldek-0.20/cli/dent.c
---- poldek-0.20.org/cli/dent.c 2005-10-26 16:41:05.000000000 +0200
-+++ poldek-0.20/cli/dent.c 2006-07-26 20:25:54.031315500 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -140,6 +140,12 @@
- return strcmp(ent->name, name);
- }
-
-+static
-+int pkg_dent_cmp_ptr(struct pkg_dent *e1, struct pkg_dent *e2)
-+{
-+ return e1 != e2;
-+}
-+
-
- int pkg_dent_cmp_btime(struct pkg_dent *ent1, struct pkg_dent *ent2)
- {
-@@ -542,17 +548,15 @@
-
- if ((ents = poclidek_get_dent_ents(cctx, dir)) == NULL)
- return NULL;
--
-- pkgs = n_array_new(n_array_size(ents), (tn_fn_free)pkg_free,
-- (tn_fn_cmp)pkg_nvr_strcmp);
--
-+
-+ pkgs = pkgs_array_new_ex(n_array_size(ents), pkg_cmp_name_evr_rev);
-+
- for (i=0; i < n_array_size(ents); i++) {
- struct pkg *pkg;
-
- if ((pkg = pkg_dent_getpkg(n_array_nth(ents, i))))
- n_array_push(pkgs, pkg_link(pkg));
- }
-- n_array_ctl(pkgs, TN_ARRAY_AUTOSORTED);
- n_array_sort(pkgs);
- return pkgs;
- }
-@@ -641,6 +645,7 @@
- } /* else */
-
- if (fnmatch(mask, ent->name, 0) == 0) {
-+ DBGF("fnmatch %s %s\n", mask, ent->name);
- n_array_push(ments, pkg_dent_link(ent));
- matches[j]++;
- }
-@@ -666,7 +671,7 @@
-
-
- n_array_sort(ments);
-- n_array_uniq(ments);
-+ n_array_uniq_ex(ments, (tn_fn_cmp)pkg_dent_cmp_ptr);
- n_array_free(masks);
-
- //if (flags & ARG_PACKAGES_RESOLV_UNAMBIGUOUS)
-diff -urN poldek-0.20.org/cli/desc.c poldek-0.20/cli/desc.c
---- poldek-0.20.org/cli/desc.c 2005-10-18 20:01:34.000000000 +0200
-+++ poldek-0.20/cli/desc.c 2006-07-26 20:25:54.031315500 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <limits.h>
-@@ -99,7 +99,7 @@
- "desc", N_("PACKAGE..."), N_("Display packages info"),
- options, parse_opt,
- NULL, desc,
-- NULL, NULL, NULL, NULL, 0, 0
-+ NULL, NULL, NULL, NULL, NULL, 0, 0
- };
-
- static
-diff -urN poldek-0.20.org/cli/external.c poldek-0.20/cli/external.c
---- poldek-0.20.org/cli/external.c 2005-05-15 17:53:08.000000000 +0200
-+++ poldek-0.20/cli/external.c 2006-07-26 20:25:54.031315500 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <string.h>
-@@ -34,7 +34,7 @@
- COMMAND_SELFARGS | COMMAND_PIPEABLE | COMMAND_HIDDEN,
- "!", N_("COMMAND"), N_("Execute external command"),
- NULL, parse_opt, NULL, external,
-- NULL, NULL, NULL, NULL, 0, 0
-+ NULL, NULL, NULL, NULL, NULL, 0, 0
- };
-
-
-diff -urN poldek-0.20.org/cli/get.c poldek-0.20/cli/get.c
---- poldek-0.20.org/cli/get.c 2005-10-17 23:05:23.000000000 +0200
-+++ poldek-0.20/cli/get.c 2006-07-26 20:25:54.031315500 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <limits.h>
-@@ -37,20 +37,19 @@
- #define OPT_GET_DIR (1 << 1) /* cmd_state->flags */
-
- static struct argp_option options[] = {
-- { "dir", 'd', "DIR", 0, N_("Download to directory DIR instead to current one"), 1},
-+ { "dir", 'd', "DIR", 0,
-+ N_("Download to directory DIR instead to current one"), 1},
- { 0, 0, 0, 0, 0, 0 },
- };
-
--
- struct poclidek_cmd command_get = {
- 0,
- "get", N_("PACKAGE..."), N_("Download packages"),
- options, parse_opt,
-- NULL, get, NULL, NULL, NULL, 0, 5, 0
-+ NULL, get, NULL, NULL, NULL, NULL, 0, 5, 0
- };
-
-
--
- static
- error_t parse_opt(int key, char *arg, struct argp_state *state)
- {
-diff -urN poldek-0.20.org/cli/help.c poldek-0.20/cli/help.c
---- poldek-0.20.org/cli/help.c 2004-12-18 14:26:52.000000000 +0100
-+++ poldek-0.20/cli/help.c 2006-07-26 20:25:54.031315500 +0200
-@@ -1,5 +1,5 @@
- /*
-- Copyright (C) 2000 - 2002 Pawel A. Gajda <mis@k2.net.pl>
-+ Copyright (C) 2000 - 2005 Pawel A. Gajda <mis@k2.net.pl>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2 as
-@@ -11,11 +11,10 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <string.h>
--#include <time.h>
-
- #include <trurl/trurl.h>
-
-@@ -28,7 +27,7 @@
- COMMAND_NOOPTS | COMMAND_NOHELP | COMMAND_NOARGS,
- "help", NULL, N_("Display this help"),
- NULL, NULL, NULL, cmd_help,
-- NULL, NULL, NULL, NULL, 0, 0
-+ NULL, NULL, NULL, NULL, NULL, 0, 0
- };
-
- static
-diff -urN poldek-0.20.org/cli/install.c poldek-0.20/cli/install.c
---- poldek-0.20.org/cli/install.c 2005-10-17 23:13:14.000000000 +0200
-+++ poldek-0.20/cli/install.c 2006-07-26 20:25:54.031315500 +0200
-@@ -7,7 +7,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <limits.h>
-@@ -64,6 +64,7 @@
- #define OPT_PM (OPT_GID + 35)
- #define OPT_INST_NOFETCH (OPT_GID + 36)
- #define OPT_INST_PARSABLETS (OPT_GID + 37)
-+#define OPT_INST_MKDIR (OPT_GID + 38)
-
- static struct argp_option options[] = {
- {0, 'I', 0, 0, N_("Install, not upgrade packages"), OPT_GID },
-@@ -184,8 +185,11 @@
-
- {"parsable-tr-summary", OPT_INST_PARSABLETS, 0, 0,
- N_("Print installation summary in parseable form"), OPT_GID },
--
-- { 0, 0, 0, 0, 0, 0 },
-+
-+{"mkdir", OPT_INST_MKDIR, 0, OPTION_HIDDEN, /* legacy */
-+ "make %{_dbpath} directory if not exists", OPT_GID },
-+
-+{ 0, 0, 0, 0, 0, 0 },
- };
-
-
-@@ -194,7 +198,7 @@
- COMMAND_PIPEABLE_LEFT | COMMAND_PIPE_XARGS | COMMAND_PIPE_PACKAGES,
- "install", N_("PACKAGE..."), N_("Install packages"),
- options, parse_opt,
-- NULL, install, NULL, NULL, NULL, NULL, 0, 0
-+ NULL, install, NULL, NULL, NULL, NULL, NULL, 0, 0
- };
-
- static struct argp cmd_argp = {
-@@ -340,6 +344,9 @@
- ts->setop(ts, POLDEK_OP_PARSABLETS, 1);
- break;
-
-+ case OPT_INST_MKDIR:
-+ break; /* ignored, directory is created by default */
-+
- case 'I': /* silently ignore */
- break;
-
-diff -urN poldek-0.20.org/cli/ls.c poldek-0.20/cli/ls.c
---- poldek-0.20.org/cli/ls.c 2005-10-18 20:01:35.000000000 +0200
-+++ poldek-0.20/cli/ls.c 2006-07-26 20:25:54.035315750 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <string.h>
-@@ -19,6 +19,7 @@
-
- #include "sigint/sigint.h"
- #include "poldek_util.h"
-+#include "pkgcmp.h"
- #include "i18n.h"
- #include "pkgu.h"
- #include "cli.h"
-@@ -71,7 +72,7 @@
- COMMAND_PIPE_XARGS | COMMAND_PIPE_PACKAGES,
- "ls", N_("[PACKAGE...]"), N_("List packages"),
- options, parse_opt, NULL, ls,
-- NULL, NULL, NULL, NULL, 0, 0
-+ NULL, NULL, NULL, NULL, NULL, 0, 0
- };
-
-
-@@ -159,11 +160,9 @@
- char *evr, size_t size)
- {
- struct pkg *pkg = NULL;
-- char name[256];
- int n, found = 0;
-
-- snprintf(name, sizeof(name), "%s-", lpkg->name);
-- n = n_array_bsearch_idx_ex(pkgs, name, (tn_fn_cmp)pkg_nvr_strncmp);
-+ n = n_array_bsearch_idx_ex(pkgs, lpkg, (tn_fn_cmp)pkg_ncmp_name);
-
- if (n == -1)
- return 0;
-@@ -213,6 +212,9 @@
- return NULL;
- }
-
-+ n_assert(n_array_ctl_get_cmpfn(cmpto_pkgs) ==
-+ (tn_fn_cmp)pkg_cmp_name_evr_rev);
-+
- ls_ents2 = n_array_clone(ls_ents);
-
- for (i=0; i < n_array_size(ls_ents); i++) {
-@@ -243,6 +245,9 @@
- if (sigint_reached())
- break;
- }
-+
-+ if (cmpto_pkgs)
-+ n_array_free(cmpto_pkgs);
-
- return ls_ents2;
- }
-@@ -294,6 +299,10 @@
- n_array_sort_ex(ls_ents, cmpf);
-
- rc = do_ls(ls_ents, cmdctx, evrs);
-+
-+ if (cmpf)
-+ n_array_sort(ls_ents); /* sort them back, ls_ents could be reference
-+ to global packages array */
- }
-
-
-diff -urN poldek-0.20.org/cli/main.c poldek-0.20/cli/main.c
---- poldek-0.20.org/cli/main.c 2005-10-27 00:46:07.000000000 +0200
-+++ poldek-0.20/cli/main.c 2006-07-26 20:25:54.035315750 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -26,7 +26,6 @@
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
--#include <time.h>
-
- #include <trurl/trurl.h>
-
-@@ -116,8 +115,8 @@
- {"upconf", OPT_UPCONF, 0, 0, N_("Update remote configuration files (if any)"),
- OPT_GID },
-
--{"version", OPT_BANNER, 0, 0, N_("Display program version information and exit"),
-- OPT_GID },
-+{"version", OPT_BANNER, 0, OPTION_HIDDEN,
-+ N_("Display program version information and exit"), OPT_GID },
-
- {"log", OPT_LOG, "FILE", 0, N_("Log program messages to FILE"), OPT_GID },
- {"runas", OPT_RUNAS, "USER", 0, N_("Run program as user USER"), OPT_GID },
-diff -urN poldek-0.20.org/cli/op_makeidx.c poldek-0.20/cli/op_makeidx.c
---- poldek-0.20.org/cli/op_makeidx.c 2005-10-10 00:35:28.000000000 +0200
-+++ poldek-0.20/cli/op_makeidx.c 2006-07-26 20:25:54.035315750 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -74,9 +74,6 @@
- {"nocompress", OPT_NOCOMPR, NULL, 0,
- N_("Create uncompressed index"), OPT_GID },
-
--{"compress", OPT_COMPR, "type", OPTION_HIDDEN, /* not finished yet */
-- N_("Sets compression type (none, bz2, gz)"), OPT_GID },
--
- {"mo", OPT_MOPT, "OPTION[,OPTION]", OPTION_HIDDEN, /* not finished yet */
- N_("index type specific options"), OPT_GID },
- { 0, 0, 0, 0, 0, 0 },
-@@ -85,6 +82,20 @@
- { 0, 0, 0, 0, 0, 0 },
- };
-
-+struct mopt {
-+ char *name;
-+ unsigned flag;
-+};
-+
-+static struct mopt valid_mopts[] = {
-+ { "nodesc", PKGDIR_CREAT_NODESC },
-+ { "nodiff", PKGDIR_CREAT_NOPATCH },
-+ { "v018x", PKGDIR_CREAT_v018x }, /* pdir without pkg files timestamps */
-+ { "nocompress", 0 },
-+ { "compress", 0 }, /* compress=[gz,bz2,none] - a compression type, NFY */
-+ { NULL, 0 },
-+};
-+
- struct arg_s {
- unsigned cnflags;
- unsigned crflags;
-@@ -95,6 +106,9 @@
- };
- #define DO_MAKEIDX (1 << 0)
-
-+
-+static int parse_mopts(struct arg_s *arg_s, char *opstr);
-+
- static
- error_t parse_opt(int key, char *arg, struct argp_state *state);
-
-@@ -171,23 +185,30 @@
- break;
-
- case OPT_NODESC:
-- arg_s->crflags |= PKGDIR_CREAT_NODESC;
-+ parse_mopts(arg_s, "nodesc");
- /* XXX hack, no way to pass option between argps (?)*/
- poclidek_op_source_nodesc = 1;
- break;
-
- case OPT_NODIFF:
-- arg_s->crflags |= PKGDIR_CREAT_NOPATCH;
-+ parse_mopts(arg_s, "nodiff");
- break;
-
-- case OPT_COMPR:
-- n_hash_replace(arg_s->opts, "compress", n_strdup(arg));
-+ case OPT_COMPR: {
-+ char tmp[128];
-+ n_snprintf(tmp, sizeof(tmp), "compress=%s", arg);
-+ parse_mopts(arg_s, tmp);
- break;
-+ }
-
- case OPT_NOCOMPR:
-- n_hash_replace(arg_s->opts, "compress", n_strdup("none"));
-+ parse_mopts(arg_s, "nocompress");
- break;
--
-+
-+ case OPT_MOPT:
-+ parse_mopts(arg_s, arg);
-+ break;
-+
- default:
- return ARGP_ERR_UNKNOWN;
- }
-@@ -195,6 +216,73 @@
- return 0;
- }
-
-+
-+static int parse_mopt(struct arg_s *arg_s, const char *opstr)
-+{
-+ char *p, *tmp;
-+ int i, valid;
-+
-+ n_strdupap(opstr, &tmp);
-+
-+ if ((p = strchr(tmp, '='))) {
-+ *p = 0;
-+ p++;
-+ p = n_str_strip_ws(p);
-+ tmp = n_str_strip_ws(tmp);
-+ }
-+
-+ n_hash_replace(arg_s->opts, tmp, p ? n_strdup(p) : NULL);
-+
-+ i = 0;
-+ valid = 0;
-+ while (valid_mopts[i].name) {
-+ if (n_str_eq(tmp, valid_mopts[i].name)) {
-+ arg_s->crflags |= valid_mopts[i].flag;
-+ valid = 1;
-+ break;
-+ }
-+ i++;
-+ }
-+
-+ if (!valid) {
-+ logn(LOGERR, _("%s: unknown option"), tmp);
-+
-+ } else {
-+ if (n_str_eq(tmp, "nocompress"))
-+ n_hash_replace(arg_s->opts, "compress", n_strdup("none"));
-+ else
-+ n_hash_replace(arg_s->opts, tmp, p ? n_strdup(p) : NULL);
-+ }
-+
-+ return valid;
-+}
-+
-+
-+static int parse_mopts(struct arg_s *arg_s, char *opstr)
-+{
-+ opstr = n_str_strip_ws(opstr);
-+
-+ if (opstr == NULL || *opstr == '\0')
-+ return 1;
-+
-+ if (strchr(opstr, ',') == NULL) {
-+ parse_mopt(arg_s, opstr);
-+
-+ } else {
-+ const char **tl_save, **tl;
-+
-+ tl = tl_save = n_str_tokl(opstr, ",");
-+ while (*tl) {
-+ parse_mopt(arg_s, *tl);
-+ tl++;
-+ }
-+ n_str_tokl_free(tl_save);
-+ }
-+
-+ return 1;
-+}
-+
-+
- static tn_array *parse_types(const char *type)
- {
- tn_array *types = n_array_new(4, free, (tn_fn_cmp)strcmp);
-diff -urN poldek-0.20.org/cli/reload.c poldek-0.20/cli/reload.c
---- poldek-0.20.org/cli/reload.c 2005-10-12 01:20:12.000000000 +0200
-+++ poldek-0.20/cli/reload.c 2006-07-26 20:25:54.035315750 +0200
-@@ -11,11 +11,12 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <string.h>
- #include <sys/param.h>
-+#include <time.h>
-
- #include "sigint/sigint.h"
- #include "poldek_util.h"
-@@ -31,7 +32,7 @@
- COMMAND_NOARGS | COMMAND_NOOPTS,
- "reload", NULL, N_("Reload installed packages"),
- NULL, NULL, NULL, reload,
-- NULL, NULL, NULL, NULL, 0, 0
-+ NULL, NULL, NULL, NULL, NULL, 0, 0
- };
-
- static int reload(struct cmdctx *cmdctx)
-diff -urN poldek-0.20.org/cli/search.c poldek-0.20/cli/search.c
---- poldek-0.20.org/cli/search.c 2005-10-18 20:01:35.000000000 +0200
-+++ poldek-0.20/cli/search.c 2006-07-26 20:25:54.035315750 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <limits.h>
-@@ -121,7 +121,7 @@
- " <delimiter>perl-regexp<delimiter>[imsx]\n"
- " For example to find the packages containing foo.bar do:\n"
- " search --perlre /foo\\.bar/\n"
-- " See perlre(1) for more details.\n"), NULL, 0, 0
-+ " See perlre(1) for more details.\n"), NULL, NULL, 0, 0
- };
-
- static struct pattern *build_pattern(struct cmdctx *cmdctx, char *arg)
-diff -urN poldek-0.20.org/cli/shell.c poldek-0.20/cli/shell.c
---- poldek-0.20.org/cli/shell.c 2005-10-12 01:20:12.000000000 +0200
-+++ poldek-0.20/cli/shell.c 2006-07-26 20:25:54.035315750 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -28,10 +28,8 @@
- #include <sys/errno.h>
- #include <sys/param.h>
- #include <signal.h>
--#include <time.h>
- #include <argp.h>
- #include <fnmatch.h>
--#include <time.h>
- #include <unistd.h>
-
- #include <readline/readline.h>
-@@ -52,7 +50,7 @@
- COMMAND_NOARGS | COMMAND_NOOPTS,
- "quit", NULL, N_("Exit poldek"),
- NULL, NULL, NULL, cmd_quit,
-- NULL, NULL, NULL, NULL, 0, 0
-+ NULL, NULL, NULL, NULL, NULL, 0, 0
- };
-
- static volatile sig_atomic_t shDone = 0;
-@@ -78,13 +76,13 @@
- struct pkg *ipkg = NULL;
- tn_array *dents;
- char name[256];
-- int n;
-+ int n, name_len;
-
- dents = poclidek_get_dent_ents(cctx, POCLIDEK_INSTALLEDDIR);
- if (dents == NULL)
- return 1;
-
-- snprintf(name, sizeof(name), "%s-", pkg->name);
-+ name_len = snprintf(name, sizeof(name), "%s-", pkg->name);
- n = n_array_bsearch_idx_ex(dents, name, (tn_fn_cmp)pkg_dent_strncmp);
-
- if (n == -1)
-@@ -92,14 +90,15 @@
-
- while (n < n_array_size(dents)) {
- struct pkg_dent *ent = n_array_nth(dents, n++);
-+
- if (pkg_dent_isdir(ent))
- continue;
-+
-+ if (strncmp(name, ent->name, name_len) != 0)
-+ break;
-
- ipkg = ent->pkg_dent_pkg;
-- if (strcmp(pkg->name, ipkg->name) != 0)
-- break;
--
-- if (pkg_cmp_evr(pkg, ipkg) > 0)
-+ if (strcmp(pkg->name, ipkg->name) == 0 && pkg_cmp_evr(pkg, ipkg) > 0)
- return 1;
-
- }
-@@ -357,22 +356,34 @@
- snprintf(prompt, sizeof(prompt), "poldek:%s%s> ",
- currdir == NULL ? "/" : *currdir->name == '/' ? "" : "/",
- currdir == NULL ? "" : currdir->name);
-+
- if ((line = readline(prompt)) == NULL)
- break;
-
-+ /* add to history? */
-+ s = line;
-+ while (isspace(*s))
-+ s++;
-+
-+ if (*s)
-+ add_history(line);
-+
- s = n_str_strip_ws(line);
- if (*s) {
- int _verbose = poldek_verbose();
-- add_history(s);
-- //print_mem_info("BEFORE");
-+
- shInCmd = 1;
- DBGF("(%s)\n", s);
-+
-+ MEMINF("BEFORE %s\n", s);
- poclidek_execline(cctx, NULL, s);
-+ MEMINF("AFTER %s\n", s);
-+
- sigint_reset();
- shDone = 0;
- shInCmd = 0;
-+
- poldek_set_verbose(_verbose);
-- //print_mem_info("AFTER ");
- }
- free(line);
-
-diff -urN poldek-0.20.org/cli/uninstall.c poldek-0.20/cli/uninstall.c
---- poldek-0.20.org/cli/uninstall.c 2005-07-15 20:00:21.000000000 +0200
-+++ poldek-0.20/cli/uninstall.c 2006-07-26 20:25:54.047316500 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <limits.h>
-@@ -64,7 +64,7 @@
- COMMAND_PIPEABLE_LEFT | COMMAND_PIPE_XARGS | COMMAND_PIPE_PACKAGES,
- "uninstall", N_("PACKAGE..."), N_("Uninstall packages"),
- options, parse_opt,
-- NULL, uninstall, NULL, NULL, NULL, NULL, 0, 0
-+ NULL, uninstall, NULL, NULL, NULL, NULL, NULL, 0, 0
- };
-
- static struct argp cmd_argp = {
-@@ -171,6 +171,7 @@
-
- ts->setop(ts, POLDEK_OP_GREEDY, bool);
- }
-+ break;
-
- case 't':
- if (ts->getop(ts, POLDEK_OP_TEST))
-diff -urN poldek-0.20.org/conf/centos-source.conf poldek-0.20/conf/centos-source.conf
---- poldek-0.20.org/conf/centos-source.conf 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/conf/centos-source.conf 2006-07-26 20:25:54.051316750 +0200
-@@ -0,0 +1,41 @@
-+# $Id$
-+
-+# CentOS 4
-+_arch = i386
-+_prefix = http://mirror.centos.org/centos/4.2/apt/%{_arch}/
-+
-+[source]
-+name = co
-+type = apt
-+url = %{_prefix}/base/pkglist.os.bz2
-+prefix = %{_prefix}/RPMS.os
-+
-+[source]
-+name = co-updates
-+type = apt
-+url = %{_prefix}/base/pkglist.updates.bz2
-+prefix = %{_prefix}/RPMS.updates
-+
-+[source]
-+name = co-plus
-+type = apt
-+url = %{_prefix}/base/pkglist.centosplus.bz2
-+prefix = %{_prefix}/RPMS.centosplus
-+
-+# CentOS yum indexes
-+#_prefix = http://mirror.centos.org/centos/4.2
-+#[source]
-+#name = co
-+#type = yum
-+#url = %{_prefix}/os/%{_arch}/
-+#
-+#[source]
-+#name = co-updates
-+#type = yum
-+#url = %{_prefix}/updates/%{_arch}/
-+#
-+#[source]
-+#name = co-plus
-+#type = yum
-+#url = %{_prefix}/centosplus/%{_arch}/
-+#auto = no
-diff -urN poldek-0.20.org/conf/Makefile.am poldek-0.20/conf/Makefile.am
---- poldek-0.20.org/conf/Makefile.am 2005-10-28 18:15:27.000000000 +0200
-+++ poldek-0.20/conf/Makefile.am 2006-07-26 20:25:54.051316750 +0200
-@@ -1,13 +1,14 @@
--# $Id$
-+# $Id$
-
- # generated configs
- GENCONFIGS = fetch.conf source.conf poldek.conf
-
- CONFIGS = $(GENCONFIGS) aliases.conf \
-- pld-source.conf rh-source.conf fedora-source.conf
-+ pld-source.conf rh-source.conf \
-+ fedora-source.conf centos-source.conf
-
- EXTRA_DIST = $(CONFIGS) \
-- sample-source-remoteconf.conf \
-+ sample-source-remoteconf.conf \
- sample-cdrom-source.conf \
- poldek-pri-sample.conf
-
-diff -urN poldek-0.20.org/conf/mdk-source.conf poldek-0.20/conf/mdk-source.conf
---- poldek-0.20.org/conf/mdk-source.conf 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/conf/mdk-source.conf 2006-07-26 20:25:54.059317250 +0200
-@@ -0,0 +1,6 @@
-+# $Id$
-+
-+# Mandrake 8.2; package info is taken from (APT's?) pkglist.cooker.bz2 file
-+source1 = mdk,noautoup,type=hdrl \
-+ ftp://ftp.ps.pl/mirrors/mandrake/8.2/i586/Mandrake/base/pkglist.cooker.bz2
-+prefix1 = ftp://ftp.ps.pl/mirrors/mandrake/8.2/i586/Mandrake/RPMS/
-diff -urN poldek-0.20.org/conf.c poldek-0.20/conf.c
---- poldek-0.20.org/conf.c 2005-10-07 21:00:16.000000000 +0200
-+++ poldek-0.20/conf.c 2006-07-26 20:25:54.059317250 +0200
-@@ -1,5 +1,5 @@
- /*
-- Copyright (C) 2000 - 2005 Pawel A. Gajda <mis@k2.net.pl>
-+ Copyright (C) 2000 - 2006 Pawel A. Gajda <mis@k2.net.pl>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2 as
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <ctype.h>
-@@ -38,146 +38,29 @@
- #include "conf.h"
- #include "misc.h"
- #include "poldek_util.h"
-+#include "conf_intern.h"
-
- #define POLDEK_LDCONF_APTSOURCES (1 << 15)
-
--#define TYPE_STR (1 << 0)
--#define TYPE_BOOL (1 << 1)
--#define TYPE_INT (1 << 2)
--#define TYPE_LIST (1 << 3)
--#define TYPE_PATHLIST (1 << 4)
--
--#define TYPE_MULTI (1 << 5)
--#define TYPE_MULTI_EXCL (1 << 6)
--#define TYPE_ENUM (1 << 7)
--
--#define TYPE_F_ENV (1 << 10)
--#define TYPE_F_REQUIRED (1 << 11)
--#define TYPE_F_ALIAS (1 << 12)
--#define TYPE_F_OBSL (1 << 14)
--
- static const char *global_tag = "global";
- static const char *include_tag = "%include";
-
--struct tag {
-- char *name;
-- unsigned flags;
-- char *enums[8];
--};
--
--static struct tag unknown_tag = {
-- NULL, TYPE_STR | TYPE_F_ENV | TYPE_MULTI_EXCL, { 0 },
-+static struct poldek_conf_tag unknown_tag = {
-+ NULL, CONF_TYPE_STRING | CONF_TYPE_F_ENV | CONF_TYPE_F_MULTI_EXCL,
-+ NULL, 0, { 0 },
- };
-
--static struct tag global_tags[] = {
-- { "source", TYPE_STR | TYPE_MULTI | TYPE_F_ENV | TYPE_F_OBSL, {0} },
-- { "source?*", TYPE_STR | TYPE_F_ENV | TYPE_F_OBSL, { 0 } },
-- { "prefix?*", TYPE_STR | TYPE_F_ENV | TYPE_F_OBSL, { 0 } },
-- { "cachedir", TYPE_STR | TYPE_F_ENV, { 0 } },
--
-- { "ftp http_get", TYPE_STR | TYPE_F_OBSL, { 0 } }, /* obsolete */
-- { "ftp get", TYPE_STR | TYPE_F_OBSL, { 0 } }, /* obsolete */
-- { "http get", TYPE_STR | TYPE_F_OBSL, { 0 } }, /* obsolete */
-- { "https get", TYPE_STR | TYPE_F_OBSL, { 0 } }, /* obsolete */
-- { "rsync get", TYPE_STR | TYPE_F_OBSL, { 0 } }, /* obsolete */
-- { "cdrom get", TYPE_STR | TYPE_F_OBSL, { 0 } }, /* obsolete */
--
-- { "ignore req", TYPE_STR | TYPE_MULTI, { 0 } },
-- { "ignore pkg", TYPE_STR | TYPE_MULTI, { 0 } },
--
-- { "pm command", TYPE_STR | TYPE_F_ENV, { 0 } },
-- { "sudo command", TYPE_STR | TYPE_F_ENV, { 0 } },
-- { "rpmdef", TYPE_STR | TYPE_MULTI | TYPE_F_ENV, { 0 } },
-- { "rpm install opt", TYPE_STR , { 0 } },
-- { "rpm uninstall opt", TYPE_STR , { 0 } },
--
-- { "follow", TYPE_BOOL , { 0 } },
-- { "greedy", TYPE_BOOL , { 0 } },
-- { "aggressive greedy", TYPE_BOOL , { 0 } },
-- { "use sudo", TYPE_BOOL , { 0 } },
-- { "run as", TYPE_STR, { 0 } },
-- { "runas", TYPE_STR | TYPE_F_ALIAS, { 0 } },
-- { "mercy", TYPE_BOOL , { 0 } },
-- { "default fetcher", TYPE_STR | TYPE_MULTI , { 0 } },
-- { "proxy", TYPE_STR | TYPE_MULTI, { 0 } },
-- { "noproxy", TYPE_STR | TYPE_LIST | TYPE_MULTI, { 0 } },
-- { "no proxy", TYPE_STR | TYPE_LIST | TYPE_MULTI | TYPE_F_ALIAS, { 0 } },
-- { "hold", TYPE_STR | TYPE_LIST | TYPE_MULTI , { 0 } },
-- { "ignore", TYPE_STR | TYPE_LIST | TYPE_MULTI , { 0 } },
-- { "keep downloads", TYPE_BOOL , { 0 } },
-- { "confirm installation", TYPE_BOOL , { 0 } },
-- { "confirm installs", TYPE_BOOL | TYPE_F_ALIAS , { 0 } }, /* backward compat */
-- { "confirm removal", TYPE_BOOL , { 0 } },
-- { "choose equivalents manually", TYPE_BOOL , { 0 } },
-- { "particle install", TYPE_BOOL, { 0 } },
-- { "unique package names", TYPE_BOOL, { 0 } },
-- { "vfile ftp sysuser as anon passwd", TYPE_BOOL , { 0 } },
-- { "ftp sysuser as anon passwd", TYPE_BOOL | TYPE_F_ALIAS, { 0 } },
-- { "vfile external compress", TYPE_BOOL , { 0 } },
-- { "vfile retries", TYPE_INT, { 0 } },
-- { "auto zlib in rpm", TYPE_BOOL , { 0 } },
-- { "promoteepoch", TYPE_BOOL, { 0 } },
-- { "default index type", TYPE_STR, { 0 } },
-- { "autoupa", TYPE_BOOL, { 0 } },
-- { "load apt sources list", TYPE_BOOL, { 0 } },
-- { "exclude path", TYPE_STR | TYPE_PATHLIST | TYPE_MULTI , { 0 } },
-- { "allow duplicates", TYPE_BOOL , { 0 } },
-- { "multilib", TYPE_BOOL, { 0 } },
-- { "__dirname", TYPE_STR, { 0 } },
-- { NULL, 0, { 0 } },
--};
--
--static struct tag fetcher_tags[] = {
-- { "name", TYPE_STR, { 0 } },
-- { "proto", TYPE_STR | TYPE_F_REQUIRED, { 0 } },
-- { "cmd", TYPE_STR | TYPE_F_ENV | TYPE_F_REQUIRED, { 0 } },
-- { NULL, 0, { 0 } },
--};
--
--static struct tag alias_tags[] = {
-- { "name", TYPE_STR | TYPE_F_REQUIRED, { 0 } },
-- { "cmd", TYPE_STR | TYPE_F_REQUIRED, { 0 } },
-- { "ctx", TYPE_ENUM, { "none", "installed", "available", "upgradeable", NULL } },
-+/* XXX: aliases are not implemented yet
-+static struct poldek_conf_tag alias_tags[] = {
-+ { "name", CONF_TYPE_STRING | CONF_TYPE_F_REQUIRED, { 0 } },
-+ { "cmd", CONF_TYPE_STRING | CONF_TYPE_F_REQUIRED, { 0 } },
-+ { "ctx", CONF_TYPE_ENUM, { "none", "installed", "available", "upgradeable", NULL } },
- { NULL, 0, { 0 } },
- };
-+ { "pri", CONF_TYPE_STRING , { 0 } },
-+*/
-
--static struct tag source_tags[] = {
-- { "name", TYPE_STR, { 0 } },
-- { "url", TYPE_STR | TYPE_F_ENV | TYPE_F_REQUIRED, { 0 } },
-- { "path", TYPE_STR | TYPE_F_ENV | TYPE_F_ALIAS, { 0 } }, /* alias for url */
-- { "prefix", TYPE_STR | TYPE_F_ENV, { 0 } },
-- { "pri", TYPE_STR , { 0 } },
-- { "lang", TYPE_STR | TYPE_F_ENV, { 0 } },
-- { "dscr", TYPE_STR | TYPE_F_ENV | TYPE_F_ALIAS, { 0 } },
-- { "type", TYPE_STR , { 0 } },
-- { "original type", TYPE_STR , { 0 } },
-- { "noauto", TYPE_BOOL, { 0 } },
-- { "noautoup", TYPE_BOOL, { 0 } },
-- { "auto", TYPE_BOOL, { 0 } },
-- { "autoup", TYPE_BOOL, { 0 } },
-- { "douniq", TYPE_BOOL, { 0 } },
-- { "unique package names", TYPE_BOOL | TYPE_F_ALIAS, { 0 } },
-- { "signed", TYPE_BOOL, { 0 } },
-- { "hold", TYPE_STR | TYPE_LIST | TYPE_MULTI , { 0 } },
-- { "ignore", TYPE_STR | TYPE_LIST | TYPE_MULTI , { 0 } },
-- { "exclude path", TYPE_STR | TYPE_PATHLIST | TYPE_MULTI , { 0 } },
-- { "sources" , TYPE_STR | TYPE_LIST | TYPE_MULTI, { 0 }, },
-- { NULL, 0, { 0 } },
--};
--
--struct section {
-- char *name;
-- struct tag *tags;
-- int is_multi;
--};
--
--struct section sections[] = {
-- { "global", global_tags, 0 },
-- { "source", source_tags, 1 },
-- { "fetcher", fetcher_tags, 1 },
-- { "alias", alias_tags, 1 },
-- { NULL, NULL, 0 },
--};
-+struct poldek_conf_section *sections = poldek_conf_sections; /* just for short */
-
- #define COPT_MULTIPLE (1 << 0)
- struct copt {
-@@ -254,9 +137,15 @@
- sep = " \t,";
-
- p = v = n_str_tokl(vstr, sep);
-- if (v == NULL)
-+
-+ if (v == NULL) /* n_str_tokl error */
- return 0;
-
-+ if (*v == NULL) { /* empty option value */
-+ n_str_tokl_free(v);
-+ return 1;
-+ }
-+
- if (n_hash_exists(ht, name)) {
- opt = n_hash_get(ht, name);
-
-@@ -283,6 +172,7 @@
- }
- p++;
- }
-+
- n_str_tokl_free(v);
- return 1;
- }
-@@ -327,7 +217,7 @@
- }
-
- static
--const struct section *find_section(const char *name)
-+const struct poldek_conf_section *find_section(const char *name)
- {
- int i = 0;
-
-@@ -343,11 +233,11 @@
-
- static
- int find_tag(const char *sectname, const char *key,
-- const struct section **sectp)
-+ const struct poldek_conf_section **sectp)
- {
- int i = 0;
-- struct tag *tags = NULL;
-- const struct section *sect;
-+ struct poldek_conf_tag *tags = NULL;
-+ const struct poldek_conf_section *sect;
-
- *sectp = NULL;
- if ((sect = find_section(sectname)) == NULL)
-@@ -450,17 +340,17 @@
- }
-
-
--static int verify_section(const struct section *sect, tn_hash *ht)
-+static int verify_section(const struct poldek_conf_section *sect, tn_hash *ht)
- {
- int i = 0, nerr = 0;
-- struct tag *tags;
-+ struct poldek_conf_tag *tags;
- struct copt *fl;
-
- fl = n_hash_get(ht, "__file__line");
- tags = sect->tags;
-
- while (tags[i].name) {
-- if ((tags[i].flags & TYPE_F_REQUIRED) && !n_hash_exists(ht, tags[i].name)) {
-+ if ((tags[i].flags & CONF_TYPE_F_REQUIRED) && !n_hash_exists(ht, tags[i].name)) {
- const char *missing_tag = tags[i].name;
-
- if (n_str_eq(sect->name, "source") &&
-@@ -586,13 +476,43 @@
- #define ADD_PARAM_OVERWRITE (1 << 1)
- #define ADD_PARAM_FOREIGN (1 << 2)
-
-+static int verify_param_presence(tn_hash *ht_sect, const char *section,
-+ const char *name,
-+ const struct poldek_conf_tag *tag,
-+ unsigned flags,
-+ const char *filemark)
-+
-+{
-+ int gotit = 0, overwrite = (flags & ADD_PARAM_OVERWRITE), rc = 1;
-+
-+ if (n_hash_exists(ht_sect, name)) {
-+ struct copt *opt = n_hash_get(ht_sect, name);
-+ gotit = (opt->val != NULL);
-+ }
-+
-+ if (!gotit)
-+ return rc;
-+
-+ if (overwrite || (tag->flags & CONF_TYPE_F_MULTI_EXCL)) {
-+ if (!overwrite || poldek_VERBOSE > 1)
-+ logn(LOGWARN, _("%s %s::%s redefined"), filemark, section, name);
-+ n_hash_remove(ht_sect, name);
-+
-+ } else if ((tag->flags & CONF_TYPE_F_MULTI) == 0) {
-+ logn(LOGWARN, _("%s: multiple '%s' not allowed"), filemark, name);
-+ rc = 0;
-+ }
-+
-+ return rc;
-+}
-+
- static int add_param(tn_hash *ht_sect, const char *section,
- char *name, char *value, unsigned flags,
- const char *path, int nline)
- {
- char *val, expanded_val[PATH_MAX], filemark[512];
-- const struct section *sect;
-- const struct tag *tag;
-+ const struct poldek_conf_section *sect;
-+ const struct poldek_conf_tag *tag;
- struct copt *opt;
- int tagindex, validate, overwrite;
-
-@@ -635,14 +555,15 @@
-
- msgn_i(3, 2, "%s::%s = %s", section, name, value);
-
-- if (tag->flags & TYPE_F_ALIAS) {
-+ if (tag->flags & CONF_TYPE_F_ALIAS) {
- int n = tagindex;
- char *p = NULL;
- while (n > 0) {
- n--;
-- if ((sect->tags[n].flags & TYPE_F_ALIAS) == 0) {
-+ if ((sect->tags[n].flags & CONF_TYPE_F_ALIAS) == 0) {
- msg(5, "alias %s -> %s\n", name, sect->tags[n].name);
- p = name = sect->tags[n].name;
-+ tag = §->tags[n];
- break;
- }
- }
-@@ -652,10 +573,13 @@
- }
-
- }
-+
-+ if (!verify_param_presence(ht_sect, section, name, tag, flags, filemark))
-+ return 0;
-
-- if (tag->flags & (TYPE_LIST | TYPE_PATHLIST))
-+ if (tag->flags & CONF_TYPE_F_LIST)
- return getvlist(ht_sect, name, value,
-- (tag->flags & TYPE_PATHLIST) ? " \t,:" : " \t,",
-+ (tag->flags & CONF_TYPE_F_PATH) ? " \t,:" : " \t,",
- path, nline);
-
- val = getv(value, path, nline);
-@@ -669,7 +593,7 @@
- return 0;
- }
-
-- if ((tag->flags & TYPE_ENUM)) {
-+ if ((tag->flags & CONF_TYPE_ENUM)) {
- int n = 0, valid = 0;
- while (tag->enums[n]) {
- if (strcmp(tag->enums[n++], val) == 0) {
-@@ -693,21 +617,22 @@
- n_hash_insert(ht_sect, opt->name, opt);
- }
-
-- if (tag->flags & TYPE_F_ENV)
-- val = (char*)expand_env_vars(expanded_val, sizeof(expanded_val), val);
-+ if (tag->flags & CONF_TYPE_F_ENV)
-+ val = (char*)poldek_util_expand_env_vars(expanded_val,
-+ sizeof(expanded_val), val);
-
- if (opt->val == NULL) {
- opt->val = n_strdup(val);
- DBGF("ADD %p %s -> %s\n", ht_sect, name, val);
-
-- } else if (overwrite || (tag->flags & TYPE_MULTI_EXCL)) {
-- if (!overwrite || poldek_VERBOSE > 1)
-- logn(LOGWARN, _("%s %s::%s redefined"), filemark, section, name);
-+ } else if (overwrite || (tag->flags & CONF_TYPE_F_MULTI_EXCL)) {
-+ n_assert(0); /* verify_param_presence() should catch this */
- free(opt->val);
- opt->val = n_strdup(val);
-
-- } else if ((tag->flags & TYPE_MULTI) == 0) {
-- logn(LOGWARN, _("%s: multiple '%s' not allowed"), filemark, name);
-+ } else if ((tag->flags & CONF_TYPE_F_MULTI) == 0) {
-+ n_assert(0); /* verify_param_presence() should catch this */
-+ //logn(LOGWARN, _("%s: multiple '%s' not allowed"), filemark, name);
- return 0;
-
- } else if (opt->vals != NULL) {
-@@ -824,14 +749,16 @@
- p = (char*)do_expand_value(expval, sizeof(expval), p, ht, ht_global);
-
- if (strchr(p, '$'))
-- p = (char*)expand_env_vars(expenv_val, sizeof(expenv_val), p);
-+ p = (char*)poldek_util_expand_env_vars(expenv_val, sizeof(expenv_val),
-+ p);
-
- n_snprintf(path, size, "%s", p);
- return path;
- }
-
- static
--tn_hash *open_section_ht(tn_hash *htconf, const struct section *sect,
-+tn_hash *open_section_ht(tn_hash *htconf,
-+ const struct poldek_conf_section *sect,
- const char *sectnam, const char *path, int nline)
- {
- tn_array *arr_sect;
-@@ -883,8 +810,8 @@
-
- void *poldek_conf_add_section(tn_hash *htconf, const char *name)
- {
-- const struct section *sect = NULL;
-- tn_hash *ht_sect = NULL;
-+ const struct poldek_conf_section *sect = NULL;
-+ tn_hash *ht_sect = NULL;
-
- if ((sect = find_section(name)) == NULL) {
- logn(LOGERR, _("'%s': invalid section name"), name);
-@@ -1086,7 +1013,7 @@
- continue;
-
- if (*p == '[') { /* section */
-- const struct section *sect = NULL;
-+ const struct poldek_conf_section *sect = NULL;
-
- p++;
- name = p;
-@@ -1392,7 +1319,7 @@
- return default_v;
-
- if (sscanf(vs, "%d", &v) != 1) {
-- logn(LOGERR, _("invalid value ('%s') of option '%s'"), vs, name);
-+ logn(LOGERR, _("invalid value ('%s') of integer option '%s'"), vs, name);
- v = default_v;
- }
-
-@@ -1409,6 +1336,22 @@
- return default_v;
-
- if ((bool = poldek_util_parse_bool(v)) < 0) {
-+ logn(LOGERR, _("invalid value ('%s') of boolean option '%s'"), v, name);
-+ bool = default_v;
-+ }
-+
-+ return bool;
-+}
-+
-+int poldek_conf_get_bool3(const tn_hash *htconf, const char *name, int default_v)
-+{
-+ const char *v;
-+ int bool;
-+
-+ if ((v = poldek_conf_get(htconf, name, NULL)) == NULL)
-+ return default_v;
-+
-+ if ((bool = poldek_util_parse_bool3(v)) < 0) {
- logn(LOGERR, _("invalid value ('%s') of option '%s'"), v, name);
- bool = default_v;
- }
-@@ -1438,7 +1381,7 @@
-
- static void load_apt_sources_list(tn_hash *htconf, const char *path)
- {
-- const struct section *sect = NULL;
-+ const struct poldek_conf_section *sect = NULL;
- const char **tl, **tl_save, *sectnam;
- char buf[1024];
- FILE *stream;
-@@ -1527,89 +1470,3 @@
- fclose(stream);
- }
-
--#define XML 0
--#if XML
--static const char *strtype(unsigned flags)
--{
-- if (flags & TYPE_PATHLIST)
-- return "str-list";
--
-- if (flags & TYPE_STR)
-- return "str";
--
-- if (flags & TYPE_BOOL)
-- return "bool";
--
-- if (flags & TYPE_INT)
-- return "int";
--
--
-- if (flags & TYPE_ENUM)
-- return "enum";
--
-- n_assert(0);
-- return NULL;
--}
--
--
--static void dump_section(struct section *sect)
--{
-- struct tag tag;
-- int i = 0;
--
-- printf("<section name=\"%s\">\n", sect->name);
--
-- while (1) {
-- tag = sect->tags[i++];
-- if (tag.name == NULL)
-- break;
--
-- if (tag.flags & TYPE_F_OBSL)
-- continue;
--
-- printf(" <option name=\"%s\" type=\"%s%s\"", tag.name,
-- strtype(tag.flags),
-- (tag.flags & TYPE_LIST) ? "-list" : "");
-- printf(" default=\"\"");
-- if (tag.flags & TYPE_MULTI_EXCL)
-- printf(" redefinable=\"yes\"");
--
-- if (tag.flags & TYPE_MULTI)
-- printf(" multiple=\"yes\"");
--
-- if (tag.flags & TYPE_F_ENV)
-- printf(" env=\"yes\"");
--
-- if (tag.flags & TYPE_F_ALIAS)
-- printf(" alias=\"yes\"");
--
-- if (tag.flags & TYPE_F_REQUIRED)
-- printf(" required=\"yes\"");
--
-- printf(">\n");
--
-- if (tag.flags & TYPE_ENUM) {
-- int n = 0;
-- printf(" <values>\n");
-- while (tag.enums[n])
-- printf(" <enum>%s</enum>\n", tag.enums[n++]);
-- printf(" </values>\n");
-- }
-- printf(" <descripion>\n");
-- printf(" </descripion>\n");
--
-- printf(" </option>\n\n");
-- }
-- printf("</section> <!-- end of \"%s\" -->\n", sect->name);
--}
--
--static
--void dump_sections(const char *name)
--{
-- int i = 0;
-- while (sections[i].name) {
-- dump_section(§ions[i]);
-- i++;
-- }
--}
--#endif /* xml */
-diff -urN poldek-0.20.org/conf.h poldek-0.20/conf.h
---- poldek-0.20.org/conf.h 2005-05-05 20:54:31.000000000 +0200
-+++ poldek-0.20/conf.h 2006-07-26 20:25:54.059317250 +0200
-@@ -1,4 +1,4 @@
--/* $Id$ */
-+/* $Id$ */
- /* ini-like config parsing module */
- #ifndef POLDEK_CONF_H
- #define POLDEK_CONF_H
-@@ -13,6 +13,14 @@
-
- tn_hash *poldek_conf_load(const char *path, unsigned flags);
- tn_hash *poldek_conf_loadefault(unsigned flags);
-+
-+
-+/*
-+ Adds to htconf parameters discovered from lines. If htconf is NULL
-+ then it is created. Caution: parameters from lines overwrite
-+ previously discovered ones, i.e. if lines = [ 'foo = a', 'foo = b' ]
-+ then 'foo' value will be 'b'
-+*/
- tn_hash *poldek_conf_addlines(tn_hash *htconf, const char *sectnam,
- tn_array *lines);
-
-@@ -21,6 +29,7 @@
-
- const char *poldek_conf_get(const tn_hash *htconf, const char *name, int *is_multi);
- int poldek_conf_get_bool(const tn_hash *htconf, const char *name, int default_v);
-+int poldek_conf_get_bool3(const tn_hash *htconf, const char *name, int default_v);
- int poldek_conf_get_int(const tn_hash *htconf, const char *name, int default_v);
- tn_array *poldek_conf_get_multi(const tn_hash *htconf, const char *name);
-
-diff -urN poldek-0.20.org/configure.in poldek-0.20/configure.in
---- poldek-0.20.org/configure.in 2005-10-28 17:32:26.000000000 +0200
-+++ poldek-0.20/configure.in 2006-07-26 20:25:54.067317750 +0200
-@@ -1,5 +1,5 @@
- dnl Process this file with autoconf to produce a configure script.
--dnl $Id$
-+dnl $Id$
-
- AC_INIT(poldek,0.20)
- AC_CONFIG_SRCDIR([capreq.c])
-@@ -293,9 +293,16 @@
- LIBS="$LIBS -lbz2 -lrpmio"
- fi
-
--AC_CHECK_FUNCS(rpmGetRpmlibProvides,,
-- [AC_MSG_WARN("[poldek will not work fine with rpmlib\(...\) capabilities"])],
-- [$CONF_IN_LDFLAGS])
-+AC_CHECK_FUNCS(rpmdsRpmlib,,
-+ [ AC_CHECK_FUNCS(rpmGetRpmlibProvides,,
-+ [AC_MSG_WARN(["poldek will not work fine with rpmlib\(...\) capabilities"])],
-+ [$CONF_IN_LDFLAGS])], [$CONF_IN_LDFLAGS])
-+
-+AC_CHECK_FUNCS(rpmdsUname)
-+AC_CHECK_FUNCS(rpmdsSysinfo)
-+AC_CHECK_FUNCS(rpmdsGetconf)
-+AC_CHECK_FUNCS(rpmdsCpuinfo)
-+
-
-
- dnl metadata & xml2
-@@ -473,6 +480,7 @@
- sigint/Makefile
- vfile/Makefile
- vfile/vfff/Makefile
-+ vfile/tests/Makefile
- python/Makefile
- conf/Makefile
- doc/Makefile
-diff -urN poldek-0.20.org/conf_intern.h poldek-0.20/conf_intern.h
---- poldek-0.20.org/conf_intern.h 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/conf_intern.h 2006-07-26 20:25:54.067317750 +0200
-@@ -0,0 +1,41 @@
-+/* $Id$ */
-+/* ini-like config parsing module */
-+
-+
-+#ifndef POLDEK_CONF_INTERN_H
-+#define POLDEK_CONF_INTERN_H
-+
-+#define CONF_TYPE_STRING (1 << 0)
-+#define CONF_TYPE_BOOLEAN (1 << 1)
-+#define CONF_TYPE_BOOLEAN3 (1 << 2) /* yes, no, auto */
-+#define CONF_TYPE_INTEGER (1 << 3)
-+#define CONF_TYPE_ENUM (1 << 4)
-+
-+#define CONF_TYPE_F_LIST (1 << 5) /* values list */
-+#define CONF_TYPE_F_PATH (1 << 6) /* path -"- */
-+#define CONF_TYPE_F_MULTI (1 << 7) /* may occurr multiple times */
-+#define CONF_TYPE_F_MULTI_EXCL (1 << 8) /* may occurr multiple times, last occurrence
-+ is taken into account */
-+
-+#define CONF_TYPE_F_ENV (1 << 10) /* environment variables are expanded */
-+#define CONF_TYPE_F_REQUIRED (1 << 11) /* */
-+#define CONF_TYPE_F_ALIAS (1 << 12) /* an alias */
-+#define CONF_TYPE_F_OBSL (1 << 14) /* obsoleted */
-+
-+struct poldek_conf_tag {
-+ char *name;
-+ unsigned flags;
-+ char *defaultv;
-+ int _op_no; /* internal option number */
-+ char *enums[8];
-+};
-+
-+struct poldek_conf_section {
-+ char *name;
-+ struct poldek_conf_tag *tags;
-+ int is_multi;
-+};
-+
-+extern struct poldek_conf_section poldek_conf_sections[];
-+
-+#endif
-diff -urN poldek-0.20.org/doc/conf-xml2c.xsl poldek-0.20/doc/conf-xml2c.xsl
---- poldek-0.20.org/doc/conf-xml2c.xsl 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/doc/conf-xml2c.xsl 2006-07-26 20:25:54.067317750 +0200
-@@ -0,0 +1,59 @@
-+<xsl:stylesheet version="1.0"
-+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-+
-+<!-- poldek.conf.xml -> conf_sections.c -->
-+<!-- $Id$ -->
-+
-+<xsl:output method="text" indent="no" />
-+<xsl:template match="/">
-+/* This file is generated from poldek.conf.xml. Do not edit */
-+#include <stdlib.h>
-+#include "conf_intern.h"
-+#include "poldek_ts.h"
-+ <xsl:for-each select="config/confsection">
-+static struct poldek_conf_tag <xsl:value-of select="@name"/>_tags[] = {
-+ <xsl:for-each select="optiongroup">
-+ <xsl:for-each select="option">
-+ { "<xsl:value-of select="@name"/>",
-+ CONF_TYPE_<xsl:value-of select="translate(@type,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
-+ <xsl:if test="@multiple='yes'"> | CONF_TYPE_F_MULTI</xsl:if>
-+ <xsl:if test="@required='yes'"> | CONF_TYPE_F_REQUIRED</xsl:if>
-+ <xsl:if test="@env='yes'"> | CONF_TYPE_F_ENV</xsl:if>
-+ <xsl:if test="@list='yes'"> | CONF_TYPE_F_LIST</xsl:if>
-+ <xsl:if test="@path='yes'"> | CONF_TYPE_F_PATH</xsl:if>
-+ <xsl:if test="@obsoleted='yes'"> | CONF_TYPE_F_OBSL</xsl:if>,
-+ <xsl:choose>
-+ <xsl:when test="string-length(@default) > 0">"<xsl:value-of select="@default"/>"</xsl:when>
-+ <xsl:otherwise>NULL</xsl:otherwise>
-+ </xsl:choose>,
-+ <xsl:choose>
-+ <xsl:when test="string-length(@op) > 0">POLDEK_OP_<xsl:value-of select="@op"/></xsl:when>
-+ <xsl:otherwise>0</xsl:otherwise>
-+ </xsl:choose>, { 0 } },
-+ <xsl:for-each select="alias">
-+ { "<xsl:value-of select="@name"/>", CONF_TYPE_F_ALIAS<xsl:if test="@obsoleted='yes'"> | CONF_TYPE_F_OBSL</xsl:if>, NULL, 0, { 0 } },
-+ </xsl:for-each>
-+
-+ </xsl:for-each>
-+ </xsl:for-each>
-+ { NULL, 0, NULL, 0, { 0 } }
-+};
-+
-+ </xsl:for-each>
-+
-+
-+struct poldek_conf_section poldek_conf_sections[] = {
-+ <xsl:for-each select="config/confsection">
-+ { "<xsl:value-of select="@name"/>", <xsl:value-of select="@name"/>_tags,
-+ <xsl:choose>
-+ <xsl:when test="@multiple='yes'">1</xsl:when>
-+ <xsl:otherwise>0</xsl:otherwise>
-+ </xsl:choose>,
-+ },
-+ </xsl:for-each>
-+ { NULL, 0, 0 }
-+};
-+
-+</xsl:template>
-+</xsl:stylesheet>
-+
-diff -urN poldek-0.20.org/doc/conf-xml2.sh poldek-0.20/doc/conf-xml2.sh
---- poldek-0.20.org/doc/conf-xml2.sh 2005-05-23 21:05:05.000000000 +0200
-+++ poldek-0.20/doc/conf-xml2.sh 2006-07-26 20:25:54.075318250 +0200
-@@ -22,6 +22,10 @@
- }
-
-
-+to_c() {
-+ xsltproc $DN/conf-xml2c.xsl $FILE
-+}
-+
- to_conf() {
- tmp=$FILE.tmp
- # - replace [screen] to '=remove' (removed at end)
-@@ -55,6 +59,9 @@
- elif [ "$TO" = "docb" ]; then
- to_docb
-
-+elif [ "$TO" = "c" ]; then
-+ to_c
-+
- elif [ "$TO" = "conf" ]; then
- NAME=$3
- [ -n "$NAME" ] || exit 1
-diff -urN poldek-0.20.org/doc/conf-xml2testconf.xsl poldek-0.20/doc/conf-xml2testconf.xsl
---- poldek-0.20.org/doc/conf-xml2testconf.xsl 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/doc/conf-xml2testconf.xsl 2006-07-26 20:25:54.075318250 +0200
-@@ -0,0 +1,59 @@
-+<xsl:stylesheet version="1.0"
-+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-+<!-- poldek.conf.xml -> tests/poldek_test_conf.conf -->
-+<!-- $Id$ -->
-+
-+<xsl:output method="text" indent="no" />
-+<xsl:template match="/">
-+ <xsl:for-each select="config/confsection">
-+[<xsl:value-of select="@name"/>]
-+ <xsl:for-each select="optiongroup">
-+ <xsl:for-each select="option[@type='boolean' or @type='boolean3']">
-+ <xsl:choose>
-+ <xsl:when test="@default='yes'">
-+<xsl:value-of select="@name"/> = no
-+ </xsl:when>
-+ <xsl:when test="@default='no'">
-+<xsl:value-of select="@name"/> = yes
-+ </xsl:when>
-+ <xsl:when test="@default='auto'">
-+<xsl:value-of select="@name"/> = auto
-+ </xsl:when>
-+ <xsl:otherwise>
-+<xsl:value-of select="@name"/> = yes
-+ </xsl:otherwise>
-+ </xsl:choose>
-+ </xsl:for-each>
-+
-+ <xsl:for-each select="option[@type='string']">
-+ <xsl:if test="not(contains(@name, '*'))">
-+ <xsl:choose>
-+ <xsl:when test="string-length(@default) > 0">
-+ <xsl:value-of select="@name"/> = <xsl:value-of select="@default"/>
-+ </xsl:when>
-+ <xsl:otherwise>
-+ <xsl:value-of select="@name"/> = <xsl:value-of select="translate(@name,' ','_')"/>
-+ </xsl:otherwise>
-+ </xsl:choose>
-+ #
-+ </xsl:if>
-+ </xsl:for-each>
-+
-+ <xsl:for-each select="option[@type='integer']">
-+ <xsl:choose>
-+ <xsl:when test="string-length(@default) > 0">
-+ <xsl:value-of select="@name"/> = <xsl:value-of select="@default"/>
-+ </xsl:when>
-+ <xsl:otherwise>
-+ <xsl:value-of select="@name"/> = 100;
-+ </xsl:otherwise>
-+ </xsl:choose>
-+ #
-+ </xsl:for-each>
-+
-+
-+ </xsl:for-each>
-+ </xsl:for-each>
-+</xsl:template>
-+</xsl:stylesheet>
-+
-diff -urN poldek-0.20.org/doc/homepage/download-body.html poldek-0.20/doc/homepage/download-body.html
---- poldek-0.20.org/doc/homepage/download-body.html 2005-10-28 17:32:27.000000000 +0200
-+++ poldek-0.20/doc/homepage/download-body.html 2006-07-26 20:25:54.075318250 +0200
-@@ -7,22 +7,27 @@
- <li> <a href="download/poldek-POLDEK_VERSION.tar.bz2">poldek-POLDEK_VERSION.tar.bz2</a></li>
- <li> <a href="download/poldek-POLDEK_VERSION-1.src.rpm">poldek-POLDEK_VERSION-1.src.rpm</a> </li>
- </ul>
--<p>An older versions are available <a href="download/">here</a>.
-- Development snapshots are available <a href="download/snapshots/">here</a></p>
-+<p>
-+An older versions are available <a href="download/">here</a>.
-+Development snapshots are available <a href="download/snapshots/">here</a>
-+</p>
-
- <h1> Binary packages </h1>
-
--<h2> PLD Linux </h2>
-+<h2> <a href="http://pld-linux.org/">PLD Linux</a> </h2>
- <ul>
- <li> PLD 1.0 (Ra)
- <a href="download/pld/ra/poldek-POLDEK_VERSION-1.i386.rpm">poldek-POLDEK_VERSION-1.i386.rpm</a>
- </li>
- </ul>
-
--<p> Packages for other architectures as for developement PLD branches are available on PLD
-+<p>
-+Packages for other architectures as for developement PLD branches are available on PLD
- <a href="http://ftp.pld-linux.org">FTP site</a>.
-+</p>
-+
-+<h2> <a href="http://fedora.redhat.com/">Fedora Core</a> </h2>
-
--<h2> Fedora Core </h2>
- <ul>
- <li> Fedora Core 4
- <a href="download/fedora/c4/poldek-POLDEK_VERSION-1.i386.rpm">poldek-POLDEK_VERSION-1.i386.rpm</a>
-@@ -36,15 +41,28 @@
- <p> An older versions of packages for previous Fedora Core releases can be found <a href="download/fedora/">here</a>.
- </p>
-
--<h2> RedHat </h2>
-+<h2> <a href="http://www.redhat.com/">RedHat</a> </h2>
- <ul>
- <li> RedHat 9 (rpm 4.2)
- <a href="download/rh/9.0/poldek-0.20-1.i386.rpm">poldek-0.20-1.i386.rpm</a>
- </li>
- </ul>
-
--<p> An older versions of packages for several RedHat versions can be found <a href="download/rh/">here</a>.
--</li>
--</ul>
-+<p>
-+An older versions of packages for several RedHat versions can be found <a href="download/rh/">here</a>.
-+</p>
-
-+<h2> <a href="http://www.centos.org/">CentOS</a> </h2>
-+<p>
-+CentOS aims to be 100% binary compatible with
-+<a href="http://www.redhat.com/en_us/USA/rhel">Red Hat Enterprise Linux</a>.
-+</p>
-+<p>
-+Packages maintained by Arkadiusz Patyk <<em>areq att pld-linux org</em>>,
-+available <a href="http://rescuecd.pld-linux.org/poldek/CentOS/">here</a>.
-+</p>
-
-+<h2> Other </h2>
-+<p> Send <a href="mailto: mis @ pld.org.pl">me</a> a links to packages
-+ for your system
-+</p>
-diff -urN poldek-0.20.org/doc/homepage/Makefile.am poldek-0.20/doc/homepage/Makefile.am
---- poldek-0.20.org/doc/homepage/Makefile.am 2005-10-28 18:38:17.000000000 +0200
-+++ poldek-0.20/doc/homepage/Makefile.am 2006-07-26 20:25:54.079318500 +0200
-@@ -1,4 +1,4 @@
--# $Id$
-+# $Id$
-
- WWW_PAGES = page-template.html \
- devel-body.html download-body.html index-body.html related-body.html \
-@@ -11,8 +11,11 @@
-
- EXTRA_DIST = $(WWW_PAGES) $(WWWBINS)
-
-+site-only:
-+ ./genhomepage --clean --destdir site
-+ ./genhomepage --destdir site || exit 1
-
--site: $(WWW_PAGES)
-+site: $(WWW_PAGES) ../manual.xml ../NEWS.xml ../NEWSto
- $(MAKE) -C .. manual-web
- $(MAKE) -C ../.. NEWS
- $(MAKE) -C .. NEWS.html
-@@ -22,7 +25,7 @@
- cp ../NEWS.html ../manual.css style.css logo90.png site
- rm -rf site/manual && cp -a ../manual-web site/manual
-
--credits-body.html: ../NEWS.xml
-+credits-body.html: ../NEWS.xml ../NEWSto
- $(MAKE) -C .. CREDITS-body.html NEWS.html
- cp ../CREDITS-body.html credits-body.html
-
-diff -urN poldek-0.20.org/doc/homepage/style.css poldek-0.20/doc/homepage/style.css
---- poldek-0.20.org/doc/homepage/style.css 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/doc/homepage/style.css 2006-07-26 20:25:54.087319000 +0200
-@@ -0,0 +1,147 @@
-+html {
-+ background: white;
-+ margin: 0;
-+ padding: 1em 1em;
-+}
-+
-+body {
-+ background: white;
-+ color: black;
-+ margin: 0;
-+ padding: 0;
-+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
-+ font-size: small;
-+ line-height: 1.5;
-+}
-+
-+a {
-+ font-weight: bold;
-+}
-+
-+a img {
-+ border: none;
-+}
-+
-+a, a:link, a:visited {
-+ text-decoration: none;
-+ color: #577c9b;
-+}
-+
-+a:hover {
-+ text-decoration: underline;
-+}
-+
-+a.current {
-+ text-decoration: none;
-+ color: #555555;
-+}
-+
-+acronym, abbr {
-+ cursor: help;
-+}
-+
-+h1 {
-+ font-size: 1.3em;
-+ color: #577c9b;
-+}
-+
-+h2, h3, h4 {
-+ font-size: 1.1em;
-+ color: #577c9b;
-+}
-+
-+.term {
-+ color: #577c9b;
-+ font-weight: bold;
-+}
-+
-+#head {
-+ border: 0;
-+ padding: 0;
-+ margin: 0;
-+ //border: 1px solid #ccc;
-+}
-+
-+#head h1 {
-+ margin-left: 10px;
-+ display: inline;
-+ font-size: 16px;
-+ color: #555555;
-+}
-+
-+#head img {
-+ vertical-align: middle;
-+}
-+
-+#nav {
-+ #position: absolute;
-+ #left: 0;
-+ float: left;
-+
-+ margin: 0;
-+ padding: 5px;
-+ background-color: #EEEEEE;
-+ border: 1px dashed #ccc;
-+ margin-top: 5px;
-+ text-align: left;
-+ width: 150px;
-+}
-+
-+#nav ul {
-+ list-style: none;
-+ padding: 0;
-+ margin: 0;
-+}
-+
-+#nav li {
-+ padding: 0;
-+ margin: 0;
-+}
-+
-+#content {
-+ padding: 0 1em;
-+ margin: 0;
-+ margin-top: 5px;
-+ margin-left: 165px;
-+ //border: 1px solid #ccc;
-+}
-+
-+/* from manual.css */
-+.option, .filename { font-weight: bold; font-size: 12px; }
-+#.application { }
-+
-+.prompt { font-family: courier, monospace; }
-+
-+.screen {
-+ background-color: #EEEEEE;
-+ font-family: courier, monospace;
-+ font-size: 13px;
-+ padding: 2px;
-+ padding-left: 5px;
-+ padding-top: 0;
-+ border: 1pt solid #DDDDDD;
-+ /* background: #fff8eb; */
-+ white-space: pre;
-+ /* begin css 3 or browser specific rules - do not remove!
-+ see: http://forums.techguy.org/archive/index.php/t-249849.html */
-+ white-space: pre-wrap;
-+ word-wrap: break-word;
-+ white-space: -moz-pre-wrap;
-+ white-space: -pre-wrap;
-+ white-space: -o-pre-wrap;
-+ moz-border-radius: 10px;
-+ /* end css 3 or browser specific rules */
-+}
-+
-+.replaceable {
-+ font-weight: normal;
-+ font-family: courier, monospace;
-+ font-style: normal;
-+}
-+
-+ul.plain {
-+ list-style: none;
-+}
-+
-+
-+
-diff -urN poldek-0.20.org/doc/homepage/support-body.html poldek-0.20/doc/homepage/support-body.html
---- poldek-0.20.org/doc/homepage/support-body.html 2005-10-24 13:24:54.000000000 +0200
-+++ poldek-0.20/doc/homepage/support-body.html 2006-07-26 20:25:54.087319000 +0200
-@@ -1,3 +1,12 @@
-+<!--
-+
-+<h1> Documentation & co.</h1>
-+<ul>
-+<li> poldek <a href="http://team.pld.org.pl/~mis/poldek/manual/">manual</a>
-+</ul>
-+
-+-->
-+
- <h1>Mailing list</h1>
-
- <p>Program mailing list <code>poldek@pld-linux.org</code>.
-@@ -5,14 +14,18 @@
- <a href="http://lists.pld-linux.org/mailman/listinfo/poldek">web interface</a>,
- or by sending a message to <a href="mailto:poldek-subscribe@pld-linux.org">poldek-subscribe@pld-linux.org</a>.
- </p>
-+
- <p> List archives:
- <a href="http://lists.pld-linux.org/mailman/pipermail/poldek/">http://lists.pld-linux.org/mailman/pipermail/poldek/</a>.
-+</p>
-
- <p>
- List traffic is rather low, most poldek issues are discussed on PLD <a href="http://pld-linux.org/MailingLists">mailing lists</a>.
--
-+</p>
-
- <h1>Issue Tracker</h1>
-+<p>
- Project bugs and other issues database is placed in PLD
--<a href="http://bugs.pld-linux.org/index.php?project=111" title="Bug Tracking System">BTS</a>. Use it to report a bug or request a feature.
-+<a href="http://bugs.pld-linux.org/index.php?project=111" title="Bug Tracking System">BTS</a>. Please use it to report a bug or request a feature, although you may <a href="mailto: mis @ pld.org.pl">mail</a> author directly as well.
-+</p>
-
-diff -urN poldek-0.20.org/doc/Makefile.am poldek-0.20/doc/Makefile.am
---- poldek-0.20.org/doc/Makefile.am 2005-10-28 18:50:15.000000000 +0200
-+++ poldek-0.20/doc/Makefile.am 2006-07-26 20:25:54.087319000 +0200
-@@ -1,4 +1,4 @@
--# $Id$
-+# $Id$
-
- # NOTE
- # $(GEN) files are automatically generated, don't modify them. See
-@@ -53,7 +53,7 @@
- CREDITS: CREDITS.docb.tmp
- xmlto -m NEWS.xsl txt CREDITS.docb.tmp && mv CREDITS.docb.txt $@
-
--CREDITS-body.html:
-+CREDITS-body.html: NEWS.xml NEWSto
- ./NEWSto CREDITS.html_body > $@
-
- NEWS.docb.tmp: NEWS.xml NEWSdocb.xsl NEWSto
-diff -urN poldek-0.20.org/doc/manual-web.xsl poldek-0.20/doc/manual-web.xsl
---- poldek-0.20.org/doc/manual-web.xsl 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/doc/manual-web.xsl 2006-07-26 20:25:54.095319500 +0200
-@@ -0,0 +1,11 @@
-+<?xml version='1.0'?>
-+<!-- add home link, applied as -m argument of xmlto -->
-+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-+ version='1.0'>
-+<xsl:template name="user.header.navigation">
-+ <div align="right">
-+ [<a href="../">poldek home</a>]
-+ </div>
-+</xsl:template>
-+
-+</xsl:stylesheet>
-diff -urN poldek-0.20.org/doc/manual.xml poldek-0.20/doc/manual.xml
---- poldek-0.20.org/doc/manual.xml 2005-10-28 17:32:27.000000000 +0200
-+++ poldek-0.20/doc/manual.xml 2006-07-26 20:25:54.095319500 +0200
-@@ -66,8 +66,8 @@
- </author>
- </authorgroup>
-
--<date>$Date$</date>
--<releaseinfo>$Id$</releaseinfo>
-+<date>$Date$</date>
-+<releaseinfo>$Id$</releaseinfo>
-
- <keywordset>
- <keyword>package management</keyword>
-@@ -85,7 +85,7 @@
- <sect1 id="overview"> <title id="overview.title">Overview</title>
- <para>
- &poldek; is a full-featured frontend to RPM package manager. Its core features
--are similar to every modern package updater like &apt-get;. Features include
-+are similar to every modern package updater like &apt-get;. The features include
- package installation, upgrading and removal with automatic dependency handling,
- querying/ search the package database and more.
- </para>
-@@ -95,11 +95,12 @@
- <varlistentry><term>Easy to use</term>
- <listitem>
- <para>
-- Basic command line options and switches are similar in use to &rpm;
-- so &poldek; is easy to learn for users familiar with it. Apart from
-- rpm-like command line switches, &poldek; provides higher level command
-+ &poldek; is easy to learn for users familiar with &rpm; because the
-+ basic command line options and switches are similar in use.
-+
-+ Apart from rpm-like command line switches, &poldek; provides higher level command
- set ("install", "upgrade", "ls", etc) quite intuitive for those who knows &apt-get;.
-- Shell-like interface with auto-completion and history is also provided.
-+ A very handy shell-like interface with auto-completion and history is also provided.
- </para>
- </listitem>
- </varlistentry>
-@@ -108,12 +109,11 @@
- <listitem>
- <para>
- &poldek; has been designed with efficiency and scalability in mind.
-- Native package repository index format is optimized for storage size
-- and loading speed. Package dependencies, conflicts and setting
-- in order are handled without using <application>rpmlib</application>,
-- so the program is significantly faster and needs less memory than
-- rpmlib-based tools. On typical machine &poldek; can handle 20K packages
-- without noticable speed degradation.
-+ The native package repository index format is optimized for storage size
-+ and loading speed. Dependency processing (dependencies, conflicts, package
-+ ordering) is significantly faster and needs less memory than rpmlib-based
-+ tools. &poldek; can handle 20K packages without noticable
-+ speed degradation on typical machine.
- </para>
- </listitem>
- </varlistentry>
-@@ -121,9 +121,11 @@
- <varlistentry><term>Incremental repository updates</term>
- <listitem>
- <para>
-- &poldek;'s repositories are updateable by downloading a changes
-- of remote repository only, what drastically reduces amout of data
-- need to be retrieved when remote repository was changed a bit.
-+ &poldek;'s native repositories are able to update incrementally.
-+ During the update only the incremental files are transferred
-+ instead of the complete index. Such files are certainly much smaller,
-+ what drastically reduces amout of data need to be retrieved
-+ when remote repository was changed a bit.
- </para>
- </listitem>
- </varlistentry>
-@@ -582,12 +584,13 @@
- <sect1 id="pkgmanaging"> <title>Managing packages</title>
- <para>
- &poldek; operates in two basic modes - the first one is more generic
--and compliant with &rpm; (&poldek; command) and second <emphasis>interactive</emphasis>
--mode with simplified and more intuitive command set. </para>
-+and compliant with &rpm; (&poldek; command) and the second,
-+called <emphasis>interactive</emphasis> mode with simplified and
-+intuitive command set. </para>
-
- <para>
--Interactive mode is available from both command line (&ipoldek; command) and shell
--like interface with auto-completion and history. To enter shell interface
-+Interactive mode commands is available from both command line (&ipoldek; command)
-+and shell like interface with auto-completion and history. To enter shell interface
- execute &ipoldek; without any "command" options like "install", "erase", etc.
- See also an <link linkend="screen.shell-start">example</link>.
- </para>
-@@ -664,7 +667,7 @@
- <para>
- To install packages in &rpm; sense, i.e. do not upgrade even if older version is already installed:
- <screen>
--&poldek-prompt; [OPTION..] --install (&rpm; mode)
-+&poldek-prompt; [OPTION..] --install (command line mode)
- &ipoldek-prompt; [OPTION..] install -IN (interactive mode)
- </screen>
-
-@@ -686,9 +689,9 @@
- </para>
-
- <para>
--To install package or upgrade it if older version is already installed:
-+To install or upgrade package if older version is already installed:
- <screen>
--&poldek-prompt; [OPTION..] --upgrade (&rpm; mode)
-+&poldek-prompt; [OPTION..] --upgrade (command line mode)
- &ipoldek-prompt; [OPTION..] install (interactive mode)
- </screen>
- This is most used installation type. Example:
-@@ -732,7 +735,7 @@
- <para>
- To upgrade packages, i.e. install only if older version is already installed:
- <screen>
--&poldek-prompt; [OPTION..] --upgrade --fresh (&rpm; mode)
-+&poldek-prompt; [OPTION..] --upgrade --fresh (command line mode)
- &ipoldek-prompt; [OPTION..] upgrade (interactive mode)
- </screen>
- </para>
-@@ -763,8 +766,9 @@
- <screen>
- &poldek-prompt; --install-dist=DIR [PACKAGE...]
- </screen>
--All unmet dependencies will be satisfied by marking additionall packages. In this type of installation
--packages are installed one by one what, because of reduction of memory consumption and utilization of CPU, permits to install the system on older machines.
-+All unmet dependencies will be satisfied by marking additionall packages.
-+Packages are installed one by one what reduces memory consumption and CPU
-+utilization of CPU and permits to install the system on older machines.
- </para>
- <para>
- As example, command which installs system under <filename>/mnt/dest</filename> might looks like:
-@@ -789,7 +793,7 @@
- <para>
- To remove installed packages:
- <screen>
--&poldek-prompt; [OPTION..] --erase (&rpm; mode)
-+&poldek-prompt; [OPTION..] --erase (command line mode)
- &ipoldek-prompt; [OPTION..] uninstall [ERASE_OPTION...] (interactive mode)
- </screen>
- </para>
-@@ -803,6 +807,7 @@
- </screen>
- </para>
-
-+
- <!--
- <para>
- See also package removal command line options <link linkend="ref.cmdl.package_deinstallation">reference</link>.
-@@ -900,19 +905,26 @@
-
- <sect2 id="security.sudo"> <title>Using sudo</title>
- <para>
--Setting on <option>use sudo</option> configuration opinion causes
-+<option>use sudo</option> configuration opinion causes
- execution of &rpm; binary through sudo for read-write operations.
--The rest is of the operations may work without super user privileges.
-+The rest works without super user privileges.
-+
- </para><para>
- Of course it is necessary to configure <application>sudo</application>
- to allow the user to run <command>rpm</command> binary.
- </para>
-+
-+<para>
-+<option>use sudo</option> is set to "auto" by default, means that
-+<command>rpm</command> is executed through <command>sudo</command>
-+when poldek is run by an ordinary user.
-+</para>
- </sect2>
-
- <sect2 id="security.runas"> <title>Automatic switching to an ordinary user</title>
- <para>
- There is more automated way of using sudo. Configured by <option>runas</option>
--option &poldek; will automatically switch to an ordinary user if detects beeing
-+option &poldek; will automatically switch to an ordinary user if detects being
- executed by root. To setup this scenario, set <option>runas</option> option:
- <screen>
- runas = poldek
-@@ -967,7 +979,7 @@
-
- <varlistentry><term>Package conflicts</term>
- <listitem><para>
-- Report prints all package pairs beeing in conflict or beeing obsoleted one another.
-+ Report prints all package pairs being in conflict or being obsoleted one another.
- It lets to verify if all conflicts are needed, what are redundant, and so on. Report is
- called <emphasis>conflicts</emphasis>. Output example (Obsoletes
- are printed with asterisk '*'):
-@@ -986,7 +998,7 @@
-
- <varlistentry><term>File conflicts</term>
- <listitem><para>
-- Report prints all package pairs beeing in conflict on file level and pairs
-+ Report prints all package pairs being in conflict on file level and pairs
- which share the same file. It lets to verify if all file conflicts are wanted.
- Report is called <emphasis>file-conflicts</emphasis>:
- <screen>
-diff -urN poldek-0.20.org/doc/manual.xsl poldek-0.20/doc/manual.xsl
---- poldek-0.20.org/doc/manual.xsl 2005-10-28 17:32:27.000000000 +0200
-+++ poldek-0.20/doc/manual.xsl 2006-07-26 20:25:54.095319500 +0200
-@@ -10,7 +10,7 @@
- <xsl:param name="html.stylesheet.type">text/css</xsl:param>
- <xsl:param name="html.stylesheet" select="'manual.css'"></xsl:param>
-
--
-+<xsl:param name="css.decoration" select="0"/>
- <xsl:param name="draft.mode" select="'no'"></xsl:param>
-
- </xsl:stylesheet>
-diff -urN poldek-0.20.org/doc/mkindex.pl poldek-0.20/doc/mkindex.pl
---- poldek-0.20.org/doc/mkindex.pl 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/doc/mkindex.pl 2006-07-26 20:25:54.095319500 +0200
-@@ -0,0 +1,92 @@
-+#!/usr/bin/perl -w
-+use strict;
-+require XML::Simple;
-+use Data::Dumper;
-+use vars qw($file $xs $ref $xml $current_id);
-+
-+my %out = ();
-+foreach my $file (@ARGV) {
-+ #print STDERR "FILE $file\n";
-+ $xs = new XML::Simple();
-+
-+ open(F, "<$file") || die;
-+ my @lines = <F>;
-+ close(F);
-+ if ($lines[0] !~ /\<\?xml\s/) {
-+ unshift @lines, "<xml>";
-+ push @lines, "</xml>";
-+ }
-+ $ref = $xs->XMLin(join('', @lines), keeproot => 1, keyattr => [], forcecontent => 1);
-+ #print Dumper($ref);
-+ traverse(undef, $ref, \%out);
-+}
-+
-+foreach my $term (keys %out) {
-+ my %h = map { $_ => 1 } @{$out{$term}};
-+ my $id = join(' ', keys %h);
-+ print qq{<indexterm zone="$id"><primary>$term</primary></indexterm>\n};
-+}
-+
-+sub traverse {
-+ my $key = shift || 'undef';
-+ my $xml = shift;
-+ my $outhref = shift || die;
-+
-+ #print STDERR "traverse $key, $xml\n" if $key eq 'filename';
-+ if (ref $xml eq 'HASH') {
-+ $current_id = '' if exists $xml->{sect1} ||
-+ exists $xml->{sect2} || exists $xml->{sect3};
-+
-+ my $previous = $current_id;
-+ $current_id = $xml->{id} if $xml->{id} && exists $xml->{title};
-+ $previous ||= '(empty)';
-+ my $current_id_str = $current_id || '(empty)';
-+ #print STDERR "ID $previous -> $current_id_str\n"
-+ # if $previous ne $current_id_str;
-+ }
-+
-+ if (ref $xml eq 'ARRAY') {
-+ foreach my $elem (@{$xml}) {
-+ next if !ref $elem && $key eq 'filename'; # index <file>s with ids only
-+ next if !$key eq 'filename' && exists $elem->{id};
-+ traverse($key, $elem, $outhref);
-+ }
-+
-+ } elsif (ref $xml eq 'HASH') {
-+ foreach (keys %$xml) {
-+ my $akey = $_;
-+ if ($_ eq 'content') {
-+ #index all <option>s
-+ $akey = $key if $key eq 'option';
-+ # and <file>s with ids
-+ if ($key eq 'filename' && exists $xml->{id}) {
-+ $akey = $key;
-+ #print STDERR " DO $akey $xml->{id} $xml->{content}\n";
-+ }
-+ }
-+ traverse($akey, $xml->{$_}, $outhref);
-+ }
-+ }
-+
-+ return if ref $xml;
-+ return if $key ne 'option' && $key ne 'filename';
-+
-+ my $content = $xml;
-+ $content =~ s/^([^\=]+)/$1/ if $content =~ /=/;
-+ $content =~ s/^\s+//;
-+ $content =~ s/\s+$//;
-+ $content .= " file" if $key eq 'filename';
-+ $outhref->{$content} ||= [];
-+
-+ push @{$outhref->{$content}}, $current_id;
-+ #print STDERR " do $content $current_id\n";
-+
-+ return;
-+ if ($content =~ /\-\-/) {
-+ my ($opt) = ($content =~ /\-\-([\w\-]+)/);
-+ if ($opt) {
-+ $outhref->{$opt} ||= [];
-+ push @{$outhref->{$opt}}, $current_id;
-+ }
-+ }
-+}
-diff -urN poldek-0.20.org/doc/NEWSdocb.xsl poldek-0.20/doc/NEWSdocb.xsl
---- poldek-0.20.org/doc/NEWSdocb.xsl 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/doc/NEWSdocb.xsl 2006-07-26 20:25:54.103320000 +0200
-@@ -0,0 +1,99 @@
-+<!-- convert NEWS.xml to docbook document -->
-+<xsl:stylesheet version="1.0"
-+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-+
-+<xsl:output method="xml"
-+ doctype-public="-//OASIS//DTD DocBook XML V4.1.2//EN"
-+ doctype-system="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
-+ encoding="ISO-8859-1"
-+ indent="yes"/>
-+<xsl:strip-space elements="*"/>
-+
-+<xsl:template match="/">
-+<article lang="en">
-+<articleinfo>
-+<title>poldek NEWS</title>
-+<releaseinfo><xsl:value-of select="news/cvsid"/></releaseinfo>
-+</articleinfo>
-+
-+<xsl:apply-templates select="news"/>
-+</article>
-+</xsl:template>
-+
-+<xsl:template match="news">
-+<xsl:for-each select="release[string-length(@date) > 0]">
-+ <xsl:text>
-+ </xsl:text>
-+
-+ <xsl:variable name="id_version">
-+ <xsl:value-of select="translate(@version, '.', '_')"/>
-+ </xsl:variable>
-+ <sect1 id="v{$id_version}"><title><xsl:value-of select="@version"/> (<xsl:value-of select="@focus"/>; <xsl:value-of select="@date"/>)</title>
-+ <xsl:if test="para">
-+ <para><xsl:value-of select="para"/></para>
-+ </xsl:if>
-+
-+
-+ <xsl:choose>
-+ <xsl:when test='section'>
-+ <xsl:for-each select="section">
-+ <sect2><title><xsl:value-of select="title"/></title>
-+ <itemizedlist>
-+ <xsl:apply-templates select="entry"/>
-+ </itemizedlist>
-+ </sect2>
-+ </xsl:for-each>
-+ </xsl:when>
-+ <xsl:otherwise>
-+ <itemizedlist>
-+ <xsl:apply-templates select="entry"/>
-+ </itemizedlist>
-+ </xsl:otherwise>
-+ </xsl:choose>
-+</sect1>
-+</xsl:for-each>
-+</xsl:template>
-+
-+<xsl:template match="entry">
-+ <xsl:text>
-+ </xsl:text>
-+ <listitem>
-+ <xsl:if test="count(para) = 1">
-+ <para>
-+ <xsl:value-of select="para"/>
-+ <xsl:if test="author">
-+ (<xsl:apply-templates select="author"/>)
-+ </xsl:if>
-+ </para>
-+ </xsl:if>
-+ <xsl:if test="count(para) > 1">
-+ <xsl:for-each select="para">
-+ <xsl:choose>
-+ <xsl:when test='@nowrap'>
-+ <screen>
-+ <xsl:value-of select="."/>
-+ </screen>
-+ </xsl:when>
-+ <xsl:otherwise>
-+ <para>
-+ <xsl:value-of select="."/>
-+ </para>
-+ </xsl:otherwise>
-+ </xsl:choose>
-+ </xsl:for-each>
-+ </xsl:if>
-+ </listitem>
-+</xsl:template>
-+
-+
-+<xsl:template match="author">
-+ <emphasis><xsl:if test="@part">with help of </xsl:if><xsl:value-of select="."/></emphasis> <<emphasis><xsl:value-of select="@email"/></emphasis>><xsl:if test="not(position()=last())">, </xsl:if>
-+</xsl:template>
-+
-+<xsl:template match="para">
-+</xsl:template>
-+
-+
-+</xsl:stylesheet>
-+
-+
-diff -urN poldek-0.20.org/doc/NEWSto poldek-0.20/doc/NEWSto
---- poldek-0.20.org/doc/NEWSto 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/doc/NEWSto 2006-07-26 20:25:54.103320000 +0200
-@@ -0,0 +1,140 @@
-+#!/usr/bin/perl -w
-+# $Id$
-+use strict;
-+require XML::Simple;
-+#use Data::Dumper;
-+use vars qw($xs $xml $PREABLE %op);
-+
-+%op = ('NEWS.docb' => \&to_NEWS_docb,
-+ 'CREDITS.docb' => \&to_CREDITS_docb,
-+ 'CREDITS.html_body' => \&to_CREDITS_html_body);
-+
-+$PREABLE = q{
-+<para>
-+This project has been alive for several years. Many people have provided
-+feedback that have improved poldek, especially
-+<ulink url="http://pld-linux.org">PLD Linux</ulink> Team people. Thanks!</para>
-+<para> Here follows a list of people that have
-+contributed (in alphabetical order). <emphasis>Please</emphasis> let
-+<a href="mailto: mis @ pld.org.pl">me</a>
-+know if somebody is missing.
-+</para>
-+};
-+
-+die "Usage: $0 {" . join('|', sort keys %op) . "}\n"
-+ if @ARGV == 0 || !exists $op{$ARGV[0]};
-+
-+$xs = new XML::Simple();
-+$xml = $xs->XMLin('NEWS.xml', keeproot => 1,
-+ keyattr => [], forcecontent => 1) || die "XML::Simple error";
-+
-+&{$op{$ARGV[0]}}($xml);
-+
-+sub to_NEWS_docb {
-+ system("xsltproc NEWSdocb.xsl NEWS.xml") == 0 ||
-+ die "xsltproc failed: $?";
-+}
-+
-+sub to_CREDITS_html_body {
-+ my $ref = shift;
-+ my $credits = get_credits($ref);
-+ my $preable = $PREABLE;
-+ $preable =~ s/(\W)para>/${1}p>/g;
-+ $preable =~ s/(\W)emphasis>/${1}em>/g;
-+ $preable =~ s/(\W)ulink([\s>])/$1a$2/g;
-+ $preable =~ s/url=/href=/g;
-+ print qq{<h1>Credits</h1>$preable};
-+ print q{<ul class="plain">};
-+
-+ foreach (@$credits) {
-+ #print STDERR "$_->{name}\n";
-+ print qq{<li>$_->{name} <<em>$_->{email}</em>></li>\n};
-+ }
-+ print q{</ul>};
-+}
-+
-+sub to_CREDITS_docb {
-+ my $ref = shift;
-+ my $credits = get_credits($ref);
-+
-+ print q{<?xml version="1.0" encoding="ISO-8859-1"?>
-+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
-+<article lang="en"><articleinfo><title>Credits</title></articleinfo>
-+<sect1 id="credits"><title></title>};
-+
-+ print $PREABLE;
-+
-+ print q{
-+<itemizedlist id="creditslist">
-+ };
-+
-+ foreach (@$credits) {
-+ print qq{
-+ <listitem id="$_->{id}"><para>
-+ $_->{name} <<emphasis>$_->{email}</emphasis>>
-+ </para></listitem>
-+ };
-+ }
-+ print q{
-+</itemizedlist>
-+</sect1>
-+</article>
-+ };
-+}
-+
-+sub get_credits {
-+ my $ref = shift;
-+
-+ my %credits = ();
-+
-+ foreach my $rel (@{$ref->{news}->{release}}) {
-+ $rel->{entry} = [ $rel->{entry} ] if ref $rel->{entry} eq 'HASH';
-+ process_entry($rel->{entry}, \%credits);
-+
-+ if ($rel->{section}) {
-+ $rel->{section} = [ $rel->{section} ] if ref $rel->{section} eq 'HASH';
-+ foreach my $s (@{$rel->{section}}) {
-+ die if !$s->{entry};
-+ $s->{entry} = [ $s->{entry} ] if ref $s->{entry} eq 'HASH';
-+ process_entry($s->{entry}, \%credits);
-+ }
-+ }
-+ }
-+ my @credits = ();
-+ foreach my $au (sort { $credits{$a}->{orderby} cmp $credits{$b}->{orderby} } keys %credits) {
-+ push @credits, $credits{$au};
-+ }
-+ return \@credits;
-+}
-+
-+sub process_entry {
-+ my $aref = shift;
-+ my $credits = shift;
-+
-+ foreach my $e (@{$aref}) {
-+ next if !$e->{author};
-+ $e->{author} = [ $e->{author} ] if ref $e->{author} eq 'HASH';
-+
-+ foreach my $au (@{$e->{author}}) {
-+ next if $au->{part};
-+ next if exists $credits->{$au->{id}};
-+ my $name = $au->{content};
-+ $name =~ s/^\s+//;
-+ $name =~ s/\s+$//;
-+ $name =~ s/\s+/ /;
-+
-+ my $orderby = $name;
-+ if ($name =~ /\s/) {
-+ my ($n, $ln) = ($name =~ /(\S+)\s(\S+)/);
-+ $orderby = $ln if $ln;
-+ }
-+
-+ $credits->{$au->{id}} = {
-+ id => $au->{id},
-+ name => $name,
-+ orderby => $orderby,
-+ email => $au->{email},
-+ };
-+ }
-+ }
-+}
-diff -urN poldek-0.20.org/doc/NEWS.xml poldek-0.20/doc/NEWS.xml
---- poldek-0.20.org/doc/NEWS.xml 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/doc/NEWS.xml 2006-07-26 20:25:54.103320000 +0200
-@@ -0,0 +1,1133 @@
-+<?xml version="1.0"?>
-+<news>
-+<cvsid>$Id$</cvsid>
-+
-+<release version="0.20.1" date="" focus="bugfix release">
-+ <entry><para>
-+ let a user to choose equivalents selected by --caplookup option
-+ </para></entry>
-+
-+ <entry><para>
-+ choosing equivalents prompt are interrupt-able now.
-+ </para></entry>
-+
-+ <entry><para>
-+ added 0.18.x's --mkdir to be bacward compatible
-+ </para></entry>
-+
-+ <entry><para>
-+ fixed path validation ("/foo../" is not a relative path)
-+ </para></entry>
-+
-+ <entry><para>
-+ vfcompr: temporary *vfcompr.md5 files moved from source to destination
-+ (a cache) directory
-+ </para></entry>
-+
-+ <entry><para>
-+ orphaned package are upgraded if its successor drags more new packages
-+ than orphaned one
-+ </para></entry>
-+
-+ <entry><para>
-+ "use sudo" default value is explicit set to "auto" (new 3var boolean-like
-+ type is added).
-+ </para></entry>
-+
-+ <entry><para>
-+ configuration for CentOS has been added.
-+ <author id="areq" email="areq att areq eu org">Arkadiusz Patyk</author>
-+ </para></entry>
-+</release>
-+
-+<release version="0.20" date="2005/10/28" focus="major enhancements release">
-+<para>
-+This release introduces new series of poldek.
-+Significant changes and differences from 0.18.x series
-+</para>
-+
-+<section><title>Package repositories</title>
-+ <entry>
-+ <para>
-+ repositories code has been redesigned and totally rewritten in the
-+ modular, plugin-like way, so is is quite easy to add support for
-+ new formats.
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ new 'pndir' is the default format now. It is based on tndb (cdb like) DBM
-+ library. To save bandwidth package descriptions (Description, Summary, etc)
-+ are stored in 2 separate files: first named packages.ndir.dscr with common
-+ (BuildHost, Distribution, etc) and "C" descriptions and second with all
-+ non-C descriptions).
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>'hdrl' aka 'apt' format are update-able</para>
-+ </entry>
-+
-+ <entry>
-+ <para>support for Yum and Metadata XML repositories</para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ repository indexes could be created in many formats at once
-+ using --mt switch, ex:
-+ </para>
-+ <para nowrap="yes">
-+ $ poldek -s /foo/bar --mkdix --mt=pdir,pndir
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ indexes may be created from any index format, i.e conversion to
-+ to another format is supported, ex:
-+ </para>
-+ <para nowrap="yes">
-+ $ poldek --st apt -s /foo/bar --mkidx=/ala/ma --mt=pdir
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ (re)creation of native poldek's indexes (pdir, pndir) is much faster now
-+ package headers are not loaded at all if package's file modification
-+ time is the same as saved one in existing index.
-+ </para>
-+ </entry>
-+ </section>
-+
-+ <section><title>Installation related</title>
-+ <entry>
-+ <para>
-+ uninstallation code has been rewritten and improved. Packages are removed
-+ with its reverse dependencies and in the right order, according to
-+ {pre,post}un requirements
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ poldek can perform 'to repository' installation, i.e packages
-+ are copied from source to destination repository with full
-+ dependency checking, ex:
-+ </para>
-+ <para nowrap="yes">
-+ $ poldek -n ... --dt pdir --destination /foo/bar/RPMS --upgrade-dist -v
-+ $ poldek -n ... --dn name --upgrade-dist -v
-+ </para>
-+ </entry>
-+ </section>
-+ <section><title>Interactive mode</title>
-+ <entry>
-+ <para>
-+ interactive mode commands are available directly from command line
-+ </para>
-+ <para nowrap="yes">
-+ $ poldek --cmd ls foo
-+ $ ipoldek ls foo
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ command aliases are defined in external configuration file
-+ </para>
-+ <author id="mmazur" email="mmazur a kernel pl">Mariusz Mazur</author>
-+ </entry>
-+
-+ <entry>
-+ <para>commands may be piped, ex:</para>
-+ <para nowrap="yes">
-+ poldek> rsearch /poldek/ | ls -l
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>external commands are supported: </para>
-+ <para nowrap="yes">
-+ poldek> rsearch /pol/ | !grep ^pol
-+ </para>
-+ </entry>
-+ </section>
-+
-+ <section><title>Configuration</title>
-+ <entry>
-+ <para>
-+ multi word option names may be written with spaces or underscore separator, i.e:
-+ both forms "this is = foo" and "this_is = foo" are valid.
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ default location of configuration file has been changed to "${_sysconfdir}/poldek/poldek.conf", old /etc location is still supported.
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ configuration file format has been changed to ini-like one. Sources and
-+ external file getters should be configured in its own sections "source" and
-+ "fetcher", see sample configs. Old configuration format is still supported.
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ environment variables in config files are expanded, for example:
-+ </para>
-+ <para nowrap="yes">
-+ cachedir = $HOME/.cache
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ support for simple macros has been added to make configuration easier to write
-+ and read, for example:
-+ </para>
-+ <para nowrap="yes">
-+ _arch = i686
-+ _prefix = ftp://ftp.pld.org.pl/dists
-+
-+ [source]
-+ type = pdir
-+ name = pld-ra
-+ path = %{_prefix}/ra/PLD/%{_arch}/PLD/RPMS/
-+
-+ [source]
-+ type = pdir
-+ name = pld-ra-updates
-+ path = %{_prefix}/ra/updates/general/%{_arch}/
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ %include directive has been added, it can include both local and remote files:
-+ </para>
-+ <para nowrap="yes">
-+ %include source.conf
-+ %include ftp://ftp.pld.org.pl/dists/ra/source.conf
-+ </para>
-+ <para>
-+ Remote files once downloaded are stored in cache directory. To resynchronize them
-+ with it's remote copy use --upconf option.
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ support for APT sources configuration has been added - new
-+ "load apt sources list" configuration option.
-+ </para>
-+ </entry>
-+</section>
-+ <section><title>General</title>
-+ <entry>
-+ <para>
-+ some command line switches has been changed, but all obsoleted switches are still
-+ supported *except* "-f" (not important IMO).
-+ Changes:
-+ </para>
-+ <para nowrap="yes">
-+ 0.18.x 0.20
-+ ------------------------------------
-+ -f, --fast => --skip-installed
-+ --mkidxz => --mkidx (compression is on by default)
-+ --sidx, --sdir, --shdrl => (use --st=TYPE -s instead)
-+ --unique-pkg-names => --uniq
-+ --shcmd => (use --cmd or run ipoldek)
-+ </para>
-+ </entry>
-+ <entry>
-+ <para>
-+ configuration options may be set from command line by -O switch, for
-+ example:
-+ </para>
-+ <para nowrap="yes">
-+ $ poldek -Ovfile_external_compress=yes
-+ </para>
-+ </entry>
-+
-+ <entry>
-+ <para>
-+ PLD-FreeBSD port (ftp://beliar.pld-freebsd.org/dists/1.0/ready/i386/RPMS/)
-+ </para>
-+ <author id="trojan" email="tomek att uninet com pl">Tomasz Trojanowski</author>
-+ </entry>
-+
-+ <entry>
-+ <para>manual have been rewritten and enhanced</para>
-+ </entry>
-+</section>
-+</release>
-+
-+
-+<!-- ============================ 0.18.x ============================ -->
-+
-+<release version="0.18.9.1" date="2005/10/17" focus="bugfix release">
-+ <entry>
-+ <para>fixed writing diff list file (packages.diff.toc)</para>
-+ </entry>
-+ <entry>
-+ <para>update to rpm 4.4 (dropped legacy PreReq support)</para>
-+ <author id="qboosh" email="qboosh att pld-linux org">Jakub Bogusz</author>
-+ </entry>
-+ <entry>
-+ <para>renamed trurlib's nstream members to avoid conflicts with stdio macros</para>
-+ <author id="olivier.thauvin" email="olivier.thauvin att aerov jussieu fr">Olivier Thauvin</author>
-+ </entry>
-+ <entry>
-+ <para>fixed package version selection on greedy upgrade</para>
-+ </entry>
-+</release>
-+
-+
-+<release version="0.18.9" date="2005/07/03" focus="bugfix release">
-+ <entry>
-+ <para>handle package file 'mtime' tag ('t' tag) to be compatible with devel branch.</para>
-+ </entry>
-+ <entry>
-+ <para>fixes related to glibc 2.3.5</para>
-+ <author id="qboosh" email="qboosh att pld-linux org">Jakub Bogusz</author>
-+ <author id="arekm" email="arekm att pld-linux org">Arkadiusz Miskiewicz</author>
-+ <ul>
-+ <li>fixed cookie seek functions</li>
-+ <li>setvbuf() with small buffer to avoid reverse gzseeks on small forward fseeks</li>
-+ <li>do fread() instead of small forward fseeks</li>
-+ </ul>
-+ </entry>
-+ <entry>
-+ <para>fixed compilation with gcc 4.x (PLD's poldek-gcc4.patch)</para>
-+ </entry>
-+ <entry>
-+ <para>dependency resolving issues</para>
-+ <author id="mrk" email="mrk att sed pl">Mariusz Krynski</author>
-+ <ul>
-+ <li>packages marked for removal are not treated as candidates to upgrade</li>
-+ <li>user can choose among equivalents during conflict resolving.</li>
-+ </ul>
-+ </entry>
-+ <entry>
-+ <para>new --pmcmd to set rpm binary in place of default /bin/rpm</para>
-+ <author id="baggins" email="baggins att sith mimuw edu pl">Jan Rekorajski</author>
-+ </entry>
-+</release>
-+<release version="0.18.8" date="2004/12/30" focus="bugfix release">
-+ <entry>
-+ <para>fixed checking file-based dependencies of packages being removed</para>
-+ </entry>
-+ <entry>
-+ <para>fixed another dependency processing bug (hard to explain)</para>
-+ </entry>
-+ <entry>
-+ <para>'ls' output fixes to be parsable by external scripts</para>
-+ <author id="patrys" email="patrys att pld-dc org">Patryk Zawadzki</author>
-+ </entry>
-+ <entry>
-+ <para>removed usage of superfluous n_free()</para>
-+ <author id="twittner" email="twittner att o2 pl">Tomasz Wittner</author>
-+ </entry>
-+ <entry>
-+ <para>vfile's progress bar: fixed displaying total transfer and rate</para>
-+ <author id="lukasz.masko" email="lukasz.masko att ipipan waw pl">Lukasz Masko</author>
-+ </entry>
-+ <entry>
-+ <para>support for RPM 4.4 </para>
-+ </entry>
-+ <entry>
-+ <para>fixed build under Owl (rpm 4.0.2 without libelf)</para>
-+ </entry>
-+ <entry>
-+ <para>workaround for "group not found" bug </para>
-+ </entry>
-+ <entry>
-+ <para>pl and de translation fixes (PLD Team)</para>
-+ </entry>
-+</release>
-+<release version="0.18.7" date="2004/09/24" focus="major bugfix release">
-+ <entry>
-+ <para>another stupid SIGSEGV killed (happened occasionally while dependency processing)</para>
-+ </entry>
-+ <entry>
-+ <para>vfile's progress bar improvements</para>
-+ <author id="patrys" email="p zawadzki att vegaballs com">Patryk Zawadzki</author>
-+ </entry>
-+ <entry>
-+ <para>fix: disabled package Epoch's autopromotion while checking if it matches requirement</para>
-+ </entry>
-+ <entry>
-+ <para>with rpm >= 4.1 packages with same provide are obsoleted, not just name</para>
-+ </entry>
-+ <entry>
-+ <para>fixed processing dependencies of orphaned packages </para>
-+ </entry>
-+ <entry>
-+ <para>SIGSEGV killed while reading packages with dir/file names longer than 127 bytes</para>
-+ </entry>
-+ <entry>
-+ <para>fixed package ordering bug</para>
-+ </entry>
-+ <entry>
-+ <para>with --caplookup packages may be installed by specifying
-+its capabilities, i.e: "poldek --caplookup -uv foo" will install
-+package provides "foo" (if any). </para>
-+ </entry>
-+</release>
-+<release version="0.18.6" date="2004/06/28" focus="major bugfix release">
-+ <entry>
-+ <para>fixed broken dist installation</para>
-+ </entry>
-+ <entry>
-+ <para>fixed serious bug with dependency processing of obsoleted packages</para>
-+ </entry>
-+ <entry>
-+ <para>fixed --rpmdef '_dbpath DIR' (do not read rpm's configs many times) </para>
-+ </entry>
-+ <entry>
-+ <para>fix: --nofollow with --install-dist works as expected (#920)</para>
-+ </entry>
-+ <entry>
-+ <para>vfile: fixed progress bar displaying on std sized terminal (79 cols)</para>
-+ </entry>
-+</release>
-+<release version="0.18.5" date="2004/05/23" focus="bugfix release">
-+ <entry>
-+ <para>fixed dowloading packages from apt-like sources </para>
-+ </entry>
-+</release>
-+<release version="0.18.4" date="2004/05/10" focus="bugfix and minor improvements release">
-+ <entry>
-+ <para>package filenames in "non-standard" form (N-V.R.ARCH.rpm) are supported</para>
-+ </entry>
-+ <entry>
-+ <para>killed SIGSEGVs on 64bit architecture</para>
-+ <author id="qboosh" email="qboosh att pld-linux org">Jakub Bogusz</author>
-+ </entry>
-+ <entry>
-+ <para>fixed Epoch comparison bug while checking uninstalled capabilities</para>
-+ </entry>
-+ <entry>
-+ <para>vfile: progress bar shows remaining time and transfer rate</para>
-+ <author id="patrys" email="p zawadzki att vegaballs com">Patryk Zawadzki</author>
-+ </entry>
-+ <entry>
-+ <para>fixed setting cache directory bug</para>
-+ <author id="a.piesk" email="a.piesk att gmx net">Andreas Piesk</author>
-+ </entry>
-+ <entry>
-+ <para>fixed serious bug of checking unversioned dependencies </para>
-+ </entry>
-+ <entry>
-+ <para>--ignore{arch,os} rpm options are honored</para>
-+ </entry>
-+ <entry>
-+ <para>rpm options could be passed as --rpm=OPTION too,
-+i.e. --rpm=ignorearch is equivalent of -- --rpm-ignorearch</para>
-+ </entry>
-+ <entry>
-+ <para>new cmdline options --rpm-{force,nodeps} which are passed
-+as --force and --nodeps to /bin/rpm only.</para>
-+ </entry>
-+ <entry>
-+ <para>more aggressive package upgrades - orphaned packages are
-+upgraded instead of processing its dependencies. This behavior is
-+enabled by "greedy" option. To disable put "aggressive_greedy = no" to
-+config. </para>
-+ </entry>
-+ <entry>
-+ <para>"greedy" upgrade mode is enabled by default</para>
-+ </entry>
-+ <entry>
-+ <para>conflicts with already installed packages are treated as
-+resolved if at least one of multiple-installed package satisfies
-+conflict. Of course RPM doesn't support such cases, so additionally
-+--rpm-nodepsis needed (use with care). This behavior is enabled by
-+default, put "allow_duplicates=no" to config to disable
-+it.</para>
-+ </entry>
-+ <entry>
-+ <para>displaying package size summary of installed package
-+set</para>
-+ </entry>
-+ <entry>
-+ <para>--unique-pkg-names (-Q) behavior is more intuitive now -
-+highest version of package are taken instead of one from highest
-+prioritizedsource </para>
-+ </entry>
-+</release>
-+<release version="0.18.3" date="2004/01/10" focus="bugfix and improvements release">
-+ <entry>
-+ <para>internal HTTP client does not prevent proxy caching</para>
-+ <author id="arekm" email="arekm att pld-linux org">Arkadiusz Miskiewicz</author>
-+ </entry>
-+ <entry>
-+ <para>fixed bug on getting package capabilities having EVR with
-+empty Epoch like "foo = :1.0-1"</para>
-+ </entry>
-+ <entry>
-+ <para>do not die if rpmdb iterator returns NULL (possibly broken rpm database)</para>
-+ <author id="arekm" email="arekm att pld-linux org">Arkadiusz Miskiewicz</author>
-+ </entry>
-+ <entry>
-+ <para>vfile_external_compress=yes in config allows gzipped
-+indexes to be used on systems with broken zlib linked in rpmio
-+library(rpm 4.2 from RedHat 9, Fedora) </para>
-+ </entry>
-+ <entry>
-+ <para>kill unaligned traps on Alpha, time_t is not 32bit long (Jakub Bogusz <qboosh att pld-linux org>)</para>
-+ <author id="qboosh" email="qboosh att pld-linux org">Jakub Bogusz</author>
-+ </entry>
-+ <entry>
-+ <para>new "promoteepoch" config and cmdline option switches Epoch
-+to comparision compatible with rpm prior to 4.2.1</para>
-+ <author part="yes" id="qboosh" email="qboosh att pld-linux org">Jakub Bogusz</author>
-+ </entry>
-+ <entry>
-+ <para>support for RPM 4.2/4.3</para>
-+ </entry>
-+ <entry>
-+ <para>dependency processing fixes</para>
-+ </entry>
-+ <entry>
-+ <para>RPM 4.1 related fixes </para>
-+ </entry>
-+</release>
-+<release version="0.18.1" date="2002/11/27" focus="major bugfix release">
-+ <entry>
-+ <para>ability of creation empty indexes</para>
-+ </entry>
-+ <entry>
-+ <para>killed SIGSEV on '$ poldek -s /' (#443)</para>
-+ </entry>
-+ <entry>
-+ <para>fixed presentation of dependency tree during
-+unistallations; information about what package marks an others was
-+completely broken </para>
-+ </entry>
-+ <entry>
-+ <para>killed SIGSEV during dependencies processing</para>
-+ </entry>
-+ <entry>
-+ <para>fixed vfile's progress bar </para>
-+ </entry>
-+ <entry>
-+ <para>fixed 'hold' and 'ignore' package patterns matching</para>
-+ </entry>
-+ <entry>
-+ <para>fixed bug of interactive mode; after interrupted
-+installation selected packages are properly unmarked
-+now. </para>
-+ </entry>
-+</release>
-+<release version="0.18" date="2002/11/07" focus="bugfix/minor enhancements release">
-+ <entry>
-+ <para>support for RPM 4.1</para>
-+ <author part="yes" id="wiget" email="wiget att pld-linux org">Artur Frysiak</author>
-+ </entry>
-+ <entry>
-+ <para>few dependency processing improvements</para>
-+ <ul>
-+ <li>greedy upgrades are performed instead of marking different versions of the same package</li>
-+ <li>with --greedy packages are selected by Obsoletes tag too</li>
-+ </ul>
-+ </entry>
-+ <entry>
-+ <para>'hold' and 'ignore' package masks are matched with source name, package epoch,
-+version and release, i.e. masks apache-1.3.2* or ra:apache-1* are valid ones now. </para>
-+ </entry>
-+ <entry>
-+ <para>new: with --unique-pkg-names (-Q) packages with the same name
-+ are removed from available package set</para>
-+ </entry>
-+ <entry>
-+ <para>sources are prioritized in order they are passed in cmdline,
-+i.e. with $ poldek -s /foo/bar -n pld, source 'foo/bar' obtains
-+highest priority than 'pld', no matter what priority 'pld' has in
-+config file. </para>
-+ </entry>
-+ <entry>
-+ <para>fixed available package list management in interactive mode </para>
-+ </entry>
-+ <entry>
-+ <para>AM/AC stuff cleanup and adaptation to their new versions
-+ (automake 1.7 and autoconf 2.54)</para>
-+ <author id="wiget" email="wiget att pld-linux org">Artur Frysiak</author>
-+ </entry>
-+ <entry>
-+ <para>Polish translation of manual page</para>
-+ <author id="gotar" email="gotar att pld-linux org">Tomasz Pala</author>
-+ </entry>
-+ <entry>
-+ <para>fix: progress bar isn't refreshed so frequently (#367)</para>
-+ </entry>
-+</release>
-+<release version="0.17.9" date="2002/09/20" focus="bugfix/minor enhancements release">
-+ <entry>
-+ <para>Obsoletes tag is used during upgrades (if --greedy is set)</para>
-+ </entry>
-+
-+ <entry>
-+ <para>fixed dependency EVR matching</para>
-+ </entry>
-+
-+ <entry>
-+ <para>source priorities (new 'pri' source option) -- if the
-+ same package is availablein more than one source than program takes
-+ package from source with highest priority.If priorities aren't set
-+ sources are prioritized in order they are appear in config
-+ file.</para>
-+ </entry>
-+
-+ <entry>
-+ <para>bugfix: -s URL works fine </para>
-+ </entry>
-+
-+ <entry>
-+ <para> added poldek's logo </para>
-+ <author id="mimooh" email="mimooh att sgsp edu pl">Karol Krenski</author>
-+ </entry>
-+
-+</release>
-+<release version="0.17.8" date="2002/08/18" focus="major bugfix release">
-+ <entry>
-+ <para>package installation is verified with rpm database if rpm reports failure</para>
-+ </entry>
-+ <entry>
-+ <para>fixed obsoletes matching</para>
-+ <author id="qboosh" email="qboosh att pld-linux org">Jakub Bogusz</author>
-+ </entry>
-+ <entry>
-+ <para>improved and fixed file based conflicts detection</para>
-+ </entry>
-+ <entry>
-+ <para>fixed size units display</para>
-+ <author id="gotar" email="gotar att poczta.onet.pl">Tomasz Pala</author>
-+ </entry>
-+</release>
-+<release version="0.17.7" date="2002/06/14" focus="bugfix release">
-+ <entry>
-+ <para>improved package conflicts resolving</para>
-+ </entry>
-+ <entry>
-+ <para>split: SIGSEV killed </para>
-+ </entry>
-+ <entry>
-+ <para>fixed package removal </para>
-+ </entry>
-+ <entry>
-+ <para>shell: search: fixed default options processing</para>
-+ </entry>
-+ <entry>
-+ <para>another "desynchronized index" bug is fixed</para>
-+ </entry>
-+ <entry>
-+ <para>fixed Epoch matching </para>
-+ </entry>
-+ <entry>
-+ <para>vhttp: program doesn't die on doubled HTTP headers </para>
-+ </entry>
-+</release>
-+<release version="0.17.6" date="2002/06/03" focus="minor bugfix release">
-+ <entry>
-+ <para>new "--ignore" option makes packages invisible to the poldek </para>
-+ </entry>
-+ <entry>
-+ <para>"hdrl" sources can be refreshed with --upa </para>
-+ </entry>
-+ <entry>
-+ <para>fixed package removal: don't follow dependencies if only one of
-+multiple-installed packages is intended to uninstall </para>
-+ </entry>
-+ <entry>
-+ <para>shell: search: pattern is treated as shell wildcard (matched by fnmatch(3))
-+by default; previous behavior (Perl regular expression matching) is available
-+with --perlre or "rsearch" alias. </para>
-+ </entry>
-+ <entry>
-+ <para>fixed package auto-selection among equivalents: dependencies aren't verified strictly
-+during package scoring. </para>
-+ </entry>
-+ <entry>
-+ <para>fixed bug of equivalent package selection (<Enter> was select first,
-+notdefault package).</para>
-+ </entry>
-+ <entry>
-+ <para>shell: with 'upgrade' and 'greedy-upgrade' commands only upgradeable
-+packages are auto-completed. </para>
-+ </entry>
-+</release>
-+<release version="0.17.5" date="2002/05/15" focus="minor bugfix release">
-+ <entry>
-+ <para>about 75% less memory is used by incremental update of packages.dir </para>
-+ </entry>
-+ <entry>
-+ <para>improved package auto-selection among equivalents: package which marks
-+ less packages to install is preferred</para>
-+ </entry>
-+ <entry>
-+ <para>vftp: fixed logging in when server doesn't ask for password</para>
-+ <author id="venglin" email="venglin att freebsd.lublin.pl">Przemyslaw Frasunek</author>
-+ </entry>
-+ <entry>
-+ <para>bugfix: root directory (--rootdir) is always passed to rpm as absolute path </para>
-+ </entry>
-+ <entry>
-+ <para>shell: desc: file mode is displayed in human readable form</para>
-+ </entry>
-+ <entry>
-+ <para>fixed vfjuggle: packages.dir.md* are copied to hdd too</para>
-+ </entry>
-+ <entry>
-+ <para>few SIGSEVs killed on "search" command when APT's pkglist file is used as package index
-+</para>
-+ <author part="yes" id="niemeyer" email="niemeyer att conectiva com">Gustavo Niemeyer</author>
-+ </entry>
-+</release>
-+<release version="0.17.4" date="2002/05/06" focus="bugfix/minor enhancements release">
-+ <entry>
-+ <para>new (major) modes: --downgrade downgrade given packages;
-+ --reinstall major mode reinstalls given packages;
-+ --erase removes packages with its reverse dependent ones</para>
-+ </entry>
-+ <entry>
-+ <para>shell: fixed C-c handling (connecting phase can be interrupted)</para>
-+ </entry>
-+ <entry>
-+ <para>improved splitting</para>
-+ <ul>
-+ <li>packages are auto-rearranged on chunk's boundaries </li>
-+ <li>masks with priority less than 0 are always applied at first</li>
-+ </ul>
-+ </entry>
-+ <entry>
-+ <para>killed SIGSEV on long URL's basenames</para>
-+ </entry>
-+ <entry>
-+ <para>source prefix is handled properly with --mkidx*</para>
-+ </entry>
-+</release>
-+<release version="0.17.3" date="2002/04/23" focus="major enhancements release">
-+ <entry>
-+ <para> supported "hdlist" files (simple raw RPM package headers list) as
-+sources. These files are used by APT-RPM as they are widely supported
-+by RPM based distributions. However this format isn't optimal, now
-+poldek is useable with almost every RPM based distro without poldek's
-+native indexes support.
-+See poldekrc.sample-{rh,mdk} for examples of RedHat and Mandrake
-+configuration.
-+</para>
-+ </entry>
-+ <entry>
-+ <para>new "type=[pidx|dir|hdrl]" source option lets define source type inconfiguration file. Needed to distinguish "hdlist" ('hdrl' type) from"native" index format. Cmdline options: --source for 'pidx', --sdir for'dir' and --shdrl for 'hdrl'.</para>
-+ </entry>
-+ <entry>
-+ <para>support for GPG/PGP signatures verification (new "gpg" and "pgp" source options). Verification works well with rpm >= 4.0.4 or patched PLD's rpm 4.0.2 package (release 62). </para>
-+ </entry>
-+ <entry>
-+ <para>simple HTTP client (with partly HTTP/1.1 support), it is used for HTTP downloads; cURL backend is not compiled by default. </para>
-+ </entry>
-+ <entry>
-+ <para>added IPv6 support to internal FTP client</para>
-+ </entry>
-+ <entry>
-+ <para>new "--clean" and "--clean-whole" options for cache directorycleanup</para>
-+ </entry>
-+ <entry>
-+ <para>URLs with user and password (ftp://user:passwd at host:port/path/ syntax) are supported</para>
-+ <author id="a.piesk" email="a.piesk att gmx.net">Andreas Piesk</author>
-+ </entry>
-+ <entry>
-+ <para>new "ftp_sysuser_as_anon_passwd" option causes sending login at
-+ hostname as anonymous FTP password </para>
-+ </entry>
-+ <entry>
-+ <para>new "noautoup" source option tells poldek to do not update source by default. </para>
-+ </entry>
-+ <entry>
-+ <para>shell: added long listig format of file list (poldek> desc -ll)</para>
-+ </entry>
-+ <entry>
-+ <para>misc fixes to compile on SuSE</para>
-+ </entry>
-+ <entry>
-+ <para>fixed rpm 3.x support</para>
-+ <author part="yes" id="rl" email="rl att hellgate.ch">Roger Luethi</author>
-+ </entry>
-+ <entry>
-+ <para>fixed and improved handling of bool configuration options, added on/off and enable/disable
-+ to the list of valid choices</para>
-+ <author id="a.piesk" email="a.piesk att gmx.net">Andreas Piesk</author>
-+ </entry>
-+ <entry>
-+ <para>fixed detection of file based conflicts between available packages. </para>
-+ </entry>
-+ <entry>
-+ <para>packages with capabilities with the same name and different
-+ versions are handled properly</para>
-+ </entry>
-+ <entry>
-+ <para>misc fixes to compile and work with glibc2.1</para>
-+ <author part="yes" id="a.piesk" email="a.piesk att gmx.net">Andreas Piesk</author>
-+ </entry>
-+ <entry>
-+ <para>installation of multiple instances of package is allowed (by poldek -i)</para>
-+ </entry>
-+ <entry>
-+ <para>fixes and improvements of dependency resolution</para>
-+ <ul>
-+ <li>fixed greedy mode</li>
-+ <li>fixed handling package conflicts added by poldek</li>
-+ <li>faster dependency checking</li>
-+ </ul>
-+ </entry>
-+ <entry>
-+ <para>German translation</para>
-+ <author id="a.piesk" email="a.piesk att gmx.net">Andreas Piesk</author>
-+ </entry>
-+ <entry>
-+ <para>various bugs are fixed</para>
-+ <ul>
-+ <li>double '/' in paths handling</li>
-+ <li>huge mem leak on --update </li>
-+ <li>ambiguous p_open() flags (Michal Moskal <malekith att pld-linux org>)</li>
-+ <li>removed [v]snprintf() (wrong) usage; trurlib's n_[v]snprintf() are used instead</li>
-+ <li>automake/autoconf fixes (Artur Frysiak <wiget att pld-linux org>)</li>
-+ </ul>
-+ </entry>
-+</release>
-+<release version="0.17.2" date="2002/03/26" focus="bugfix release">
-+ <entry>
-+ <para>"ported" to RedHat 7.2 (with rpm 4.0.4)</para>
-+ </entry>
-+ <entry>
-+ <para>install-dist: --force forces installation of broken package sets</para>
-+ </entry>
-+ <entry>
-+ <para>corrected package installation progress bar</para>
-+ <author id="malekith" email="malekith att pld-linux org">Michal Moskal</author>
-+ </entry>
-+ <entry>
-+ <para>install-dist: log INST-{OK,ERR} for PLD Installer</para>
-+ <author id="malekith" email="malekith att pld-linux org">Michal Moskal</author>
-+ </entry>
-+ <entry>
-+ <para>--dump* works properly</para>
-+ </entry>
-+ <entry>
-+ <para>vftp: fixed error handling</para>
-+ </entry>
-+</release>
-+<release version="0.17.1" date="2002/03/26" focus="bugfix release">
-+ <entry>
-+ <para>ftp: fixed multiline responses handling</para>
-+ </entry>
-+</release>
-+<release version="0.17" date="2002/02/21" focus="major enhancements release">
-+ <entry>
-+ <para>added support for package.dir's "patches" (new option --update-whole updates
-+ whole index; --update looking for patches first)</para>
-+ </entry>
-+ <entry>
-+ <para>packages are divided into groups before install and each group is installed
-+ separately; this ensures that broken dependencies in one of group doesn't affect
-+ the rest. </para>
-+ </entry>
-+ <entry>
-+ <para>improved dependency processing</para>
-+ <ul>
-+ <li>package may be marked for install as a consequence of conflict</li>
-+ <li>dependency loops detected during install time are noticed in human readable form</li>
-+ <li>improved "greedy" selection - if foo-VER is upgraded, then "greedy" marks will mark
-+ foo-{devel,static,etc} in version VER too.</li>
-+ </ul>
-+ </entry>
-+ <entry>
-+ <para>added simple ftp client; it is used for FTP downloads by default</para>
-+ </entry>
-+ <entry>
-+ <para>shell</para>
-+ <ul>
-+ <li>db package list is cached what speeds up program start</li>
-+ <li>ls: long listings are passed to $PAGER program (default is "less")</li>
-+ <li>ls: new switches -n (list package names only), -G (list group)
-+ and -O (show package summaries)</li>
-+ </ul>
-+ </entry>
-+ <entry>
-+ <para>added log file support (--log option)</para>
-+ </entry>
-+ <entry>
-+ <para>sources may be configured as name and URL pair and later selected by that name
-+ (new --sn|-n option); with --sl|-l program lists all configured sources. </para>
-+ </entry>
-+ <entry>
-+ <para>packages.dir's integrity is verified before each loadingwhat prevents program
-+ SIGSEVs on load broken indexes</para>
-+ </entry>
-+ <entry>
-+ <para>changed default cache directory to $HOME/.poldek-cache</para>
-+ </entry>
-+ <entry>
-+ <para>package MD5 sums are verified before install</para>
-+ </entry>
-+ <entry>
-+ <para>with --ask program confirms each installation (confirm_install config option)
-+ and allows the user to choose among equivalent packages
-+ (choose_equivalents_manually config option)</para>
-+ </entry>
-+ <entry>
-+ <para>few (nice) improvements and (not so nice ;-) bugs fixed</para>
-+ </entry>
-+</release>
-+<release version="0.16" date="2002/01/29" focus="bugfix release">
-+ <entry>
-+ <para>fixed removable media support in non-install-dist modes</para>
-+ </entry>
-+ <entry>
-+ <para>shell: uninstall: fix: don't remove pkg from install list if removal fails</para>
-+ </entry>
-+</release>
-+<release version="0.15.9" date="2002/01/11" focus="major enhancements release">
-+ <entry>
-+ <para>shell</para>
-+ <ul>
-+ <li>desc: added package file size display</li>
-+ <li>search: added Group search</li>
-+ <li>install: unhidden --mercy</li>
-+ <li>uninstall: fix: don't remove pkg from install list if --test is used</li>
-+ <li>added -h opt. to all commands</li>
-+ </ul>
-+ </entry>
-+ <entry>
-+ <para>removed GCC's nested functions usage -- seems that it causes SIGSEVs on some machines</para>
-+ <author id="areq" email="areq att pld-linux org">Arkadiusz Patyk</author>
-+ </entry>
-+ <entry>
-+ <para>fix: don't include trailing whitespaces in config values</para>
-+ </entry>
-+</release>
-+<release version="0.15.8" date="2001/10/29" focus="bugfix release">
-+ <entry>
-+ <para>curl: disabled timeouts, cURL's timeout it's a time to transfer file </para>
-+ </entry>
-+ <entry>
-+ <para>curl: amount and total sizes are displayed in progress bar</para>
-+ </entry>
-+ <entry>
-+ <para>fix: enabled --hold </para>
-+ </entry>
-+ <entry>
-+ <para>fix: SIGSEV killed when pkg description requested while pkg index
-+doesn't contain package descriptions at all</para>
-+ </entry>
-+ <entry>
-+ <para>shell: fixed installed package list management</para>
-+ </entry>
-+ <entry>
-+ <para>curl: fixed progress bar if total file size is unknown</para>
-+ <author id="malekith" email="malekith att pld-linux org">Michal Moskal</author>
-+ </entry>
-+ <entry>
-+ <para>"mercy" mode bugfix</para>
-+ </entry>
-+</release>
-+<release version="0.15.7" date="2001/10/10" focus="major enhancements release">
-+ <entry>
-+ <para>downloaded packages are removed after successful installation by default
-+(keep_downloads=yes in config can change to previous behavior)</para>
-+ </entry>
-+ <entry>
-+ <para>changed semantics of --test: -t causes poldek's checks only,
-+ -tt turns on tests performed by rpm too.</para>
-+ </entry>
-+ <entry>
-+ <para>"mercy" dependency checking mode may be enabled in config</para>
-+ </entry>
-+ <entry>
-+ <para>added workarounds and traps for (probably) curl's bugs</para>
-+ </entry>
-+ <entry>
-+ <para>"update" option can be used with other commands simultaneously</para>
-+ </entry>
-+ <entry>
-+ <para>shell mode is now the default</para>
-+ </entry>
-+ <entry>
-+ <para>shell: added greedy option to install cmd</para>
-+ </entry>
-+</release>
-+<release version="0.15.6" date="2001/08/12" focus="bugfix/major enhancements release">
-+ <entry>
-+ <para>package priorities could be used during installation too
-+ (/etc/poldek-pkgsplit.conf or /etc/poldek-pri.conf is used by default)</para>
-+ </entry>
-+ <entry>
-+ <para>added global config /etc/poldek.conf usage </para>
-+ </entry>
-+ <entry>
-+ <para>fixed prereq loop detection</para>
-+ </entry>
-+ <entry>
-+ <para>added '@' to list of valid characters in package filename</para>
-+ <author id="klakier" email="klakier att pld-linux org">Rafal Kleger-Rudomin</author>
-+ </entry>
-+ <entry>
-+ <para>vfjuggle: sed is used instead of awk</para>
-+ <author id="klakier" email="klakier att pld-linux org">Rafal Kleger-Rudomin</author>
-+ </entry>
-+ <entry>
-+ <para>shell: ls: fixed packages sorting </para>
-+ </entry>
-+ <entry>
-+ <para>minor bugfixes </para>
-+ </entry>
-+</release>
-+<release version="0.15.5" date="2001/07/20" focus="bugfix release">
-+ <entry>
-+ <para>another bugfix of dependency processing</para>
-+ </entry>
-+ <entry>
-+ <para>shell: new ls options: -t, -T, -r</para>
-+ </entry>
-+ <entry>
-+ <para>added --shcmd option which allows to execute poldek's shell command
-+without entering shell mode </para>
-+ </entry>
-+ <entry>
-+ <para>detect if stdout is connected to a terminal and display progress bars accordingly.</para>
-+ </entry>
-+ <entry>
-+ <para>install-dist: retry to fetch packages if connection is down</para>
-+ </entry>
-+</release>
-+<release version="0.15.4" date="2001/07/17" focus="bugfix release">
-+ <entry>
-+ <para>conflicts detection bugfix </para>
-+ </entry>
-+</release>
-+<release version="0.15.3" date="2001/07/16" focus="bugfix release">
-+ <entry>
-+ <para>another bugfix of dependency processing</para>
-+ </entry>
-+ <entry>
-+ <para>splitted verify option to verify, verify-conflicts and verify-fileconflicts</para>
-+ </entry>
-+ <entry>
-+ <para>more user friendly output on package set verification</para>
-+ </entry>
-+</release>
-+<release version="0.15.2" date="2001/07/13" focus="bugfix/major enhancements release">
-+ <entry>
-+ <para>added "hold" and "greedy" commands </para>
-+ </entry>
-+ <entry>
-+ <para>added FIRST_FREE_SPACE param to split option</para>
-+ </entry>
-+ <entry>
-+ <para>fixed bug of dependency processing</para>
-+ </entry>
-+ <entry>
-+ <para>minor bugfixes </para>
-+ </entry>
-+</release>
-+<release version="0.15.1" date="2001/06/28" focus="major bugfix release">
-+ <entry>
-+ <para>spliting: changed packages.chunk* format: full package filenames are printed
-+ and removed comments. </para>
-+ </entry>
-+ <entry>
-+ <para>bugfixes </para>
-+ </entry>
-+</release>
-+<release version="0.15" date="2001/06/26" focus="bugfix/major enhancements release">
-+ <entry>
-+ <para>updated vfcurl progress bar handling (according to curl 7.8)</para>
-+ </entry>
-+ <entry>
-+ <para>better index format version handling (minor.major ver schema), current
-+ version is 1.0, older versions not supported...</para>
-+ </entry>
-+ <entry>
-+ <para>package's integer fields are stored in binary form, groups are stored as separate, global tag</para>
-+ </entry>
-+ <entry>
-+ <para>remote indexes are verified after download</para>
-+ </entry>
-+ <entry>
-+ <para>added checking of package architecture and OS</para>
-+ </entry>
-+ <entry>
-+ <para>added support for removable media (vfjuggle script is added)</para>
-+ </entry>
-+ <entry>
-+ <para>added package file size to index (for spliting)</para>
-+ </entry>
-+ <entry>
-+ <para>added "nofollow" option to cmdline and "follow" one to config </para>
-+ </entry>
-+ <entry>
-+ <para>renamed "freshen" to "fresh" and changed its semantics, now rpm's
-+"--freshen" <=> "--nofollow --fresh"</para>
-+ </entry>
-+ <entry>
-+ <para>changed default index name to "packages.dir"</para>
-+ </entry>
-+ <entry>
-+ <para>added mkpackagedir script</para>
-+ </entry>
-+ <entry>
-+ <para>added spliting (--split* options)</para>
-+ </entry>
-+ <entry>
-+ <para>package-set file syntax: changed "maybe" mark to '~' ('!' still work, but obsoleted)</para>
-+ </entry>
-+ <entry>
-+ <para>shell</para>
-+ <ul>
-+ <li>added aliases for commands ("ll", "llu", "freshen", "what-requires", etc)</li>
-+ <li>better completition context switching</li>
-+ <li>extended "desc" and "search" commands -- almost allpackage fields could be specified</li>
-+ <li>colorized output</li>
-+ </ul>
-+ </entry>
-+ <entry>
-+ <para>many bugfixes</para>
-+ <author id="klakier" email="klakier att pld-linux org">Rafal Kleger-Rudomin</author>
-+ <author id="malekith" email="malekith att pld-linux org">Michal Moskal</author>
-+ </entry>
-+</release>
-+<release version="0.14" date="2001/06/12" focus="bugfix/major enhancements release">
-+ <entry>
-+ <para>support for multiple sources</para>
-+ </entry>
-+ <entry>
-+ <para>Packages SHA1 digest is computed and checked (Packages.md is created) </para>
-+ </entry>
-+ <entry>
-+ <para>capabilities/requirement are stored in binary form (v0.4 of Packages format)</para>
-+ </entry>
-+ <entry>
-+ <para>default name (Packages[.gz]) is used if only dir is given as source (i.e. it's last character is '/') </para>
-+ </entry>
-+ <entry>
-+ <para>shell: both installed and available packages list is maintained properly during installs/unistalls without reloading rpm database </para>
-+ </entry>
-+ <entry>
-+ <para>shell: added "search" command</para>
-+ </entry>
-+ <entry>
-+ <para>removed unused support for rpmidx (aka tocfile)</para>
-+ </entry>
-+ <entry>
-+ <para>cleanup and bugfixes </para>
-+ </entry>
-+</release>
-+</news>
-diff -urN poldek-0.20.org/doc/NEWS.xsl poldek-0.20/doc/NEWS.xsl
---- poldek-0.20.org/doc/NEWS.xsl 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/doc/NEWS.xsl 2006-07-26 20:25:54.103320000 +0200
-@@ -0,0 +1,16 @@
-+<?xml version='1.0'?>
-+<!-- NEWS customizations, applied as -m argument of xmlto -->
-+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-+ version='1.0'>
-+<xsl:param name="use.id.as.filename" select="'1'"></xsl:param>
-+<xsl:param name="chunk.first.sections" select="'1'"></xsl:param>
-+<xsl:param name="section.autolabel" select="'0'"></xsl:param>
-+<xsl:param name="generate.index" select="0"></xsl:param>
-+
-+<xsl:param name="html.stylesheet.type">text/css</xsl:param>
-+<xsl:param name="html.stylesheet" select="'manual.css'"></xsl:param>
-+
-+<xsl:param name="draft.mode" select="'no'"></xsl:param>
-+
-+<xsl:param name="generate.toc"/>
-+</xsl:stylesheet>
-diff -urN poldek-0.20.org/doc/poldek.1.xml poldek-0.20/doc/poldek.1.xml
---- poldek-0.20.org/doc/poldek.1.xml 2005-07-06 09:31:50.000000000 +0200
-+++ poldek-0.20/doc/poldek.1.xml 2006-07-26 20:25:54.111320500 +0200
-@@ -42,8 +42,8 @@
- </para>
-
- <para>
--This manual page contains only option reference, the full documentation for poldek
--is available as a Texinfo manual. Do <command>info poldek</command> to get it.
-+This manual page contains only command line option reference, the full documentation
-+for poldek is available as a Texinfo manual. Do <command>info poldek</command> to get it.
- </para>
- </refsect1>
-
-@@ -61,6 +61,15 @@
- &ref-miscellaneous_options;
- </refsect1>
-
-+<refsect1><title>AUTHOR</title>
-+<para>
-+Pawel A. Gajda <mis at pld.org.pl>
-+</para>
-+<para>
-+See CREDITS file for a list of contributors.
-+</para>
-+</refsect1>
-+
- <refsect1><title>See also</title>
- <para>
- <citerefentry>
-diff -urN poldek-0.20.org/doc/poldek.conf.xml poldek-0.20/doc/poldek.conf.xml
---- poldek-0.20.org/doc/poldek.conf.xml 2005-10-28 18:11:14.000000000 +0200
-+++ poldek-0.20/doc/poldek.conf.xml 2006-07-26 20:25:54.111320500 +0200
-@@ -1,4 +1,23 @@
- <?xml version='1.0'?>
-+
-+<!--
-+option syntax
-+<option name="NAME" type="{string,boolean,boolean3,integer}"
-+ default="DEFAULT VALUE"
-+ list="yes" # if an option is a list of values
-+ path="yes" # if path list (':' separator) in conjunction with list,
-+ multiple="yes" # if an option may be set multiple times
-+ env="yes" # if an option value may contain environment variables
-+ obsoleted="yes" # if an option is obsoleted
-+ hidden="yes" # not to show it to the user. XXX need to be implemented
-+ # in *conf-xml2*.xsls, currently just length of the
-+ # description is tested.
-+>
-+<description> OPTION DESCRIPTION </description>
-+<alias name="ALIAS NAME" obsoleted="{yes,no}" /> an option alias
-+</option>
-+-->
-+
- <config name="poldek.conf">
-
- <section id="synopsis" target="manual">
-@@ -133,6 +152,18 @@
-
- <confsection name="global" id="section.global" config="poldek.conf">
- <optiongroup id="ogroup.general">
-+ <!-- legacy options -->
-+ <option name="source" type="string" multiple="yes" env="yes" obsoleted="yes" />
-+ <option name="source?*" type="string" env="yes" obsoleted="yes" />
-+ <option name="prefix?*" type="string" env="yes" obsoleted="yes" />
-+ <option name="ftp http get" type="string" obsoleted="yes" />
-+ <option name="ftp get" type="string" obsoleted="yes" />
-+ <option name="http get" type="string" obsoleted="yes" />
-+ <option name="https get" type="string" obsoleted="yes" />
-+ <option name="rsync get" type="string" obsoleted="yes" />
-+ <option name="cdrom get" type="string" obsoleted="yes" />
-+
-+
- <option name="default index type" type="string" default="pndir">
- <description>
- This parameter allows to configure the default repository index type.
-@@ -141,7 +172,7 @@
-
- <option name="cachedir" type="string" default="$HOME/.poldek-cache" env="yes">
- <description>
-- Cache directory for downloaded files. NOTE: that parent directory of cachedir
-+ Cache directory for downloaded files. NOTE that parent directory of cachedir
- must exists.
- </description>
- </option>
-@@ -153,10 +184,10 @@
- <alias name="run as" />
- </option>
-
-- <option name="use sudo" type="boolean" default="no">
-+ <option name="use sudo" type="boolean3" default="auto" op="USESUDO">
- <description>
-- Permits using root privileges for installation only. Automatically turned
-- on when poldek executed as ordinary user.
-+ Permits using root privileges for installation only. If set to "auto" then
-+ automatically turned on when poldek executed as ordinary user.
- </description>
- </option>
-
-@@ -182,21 +213,13 @@
- </description>
- </option>
-
-- <option name="rpm" type="string" default="" env="yes" hide="yes">
-- <description></description>
-- </option>
--
-- <option name="sudo" type="string" default="" env="yes" hide="yes">
-- <description></description>
-- </option>
--
-- <option name="autoupa" type="boolean" default="yes" hide="yes">
-+ <option name="autoupa" type="boolean" default="yes">
- <description>
- Automatically download whole index if incremental update fails.
- </description>
- </option>
-
-- <option name="exclude path" type="path-list" default="" multiple="yes" hide="yes">
-+ <option name="exclude path" type="string" list="yes" path="yes" multiple="yes">
- <description>
- Do not save given paths into created indexes. This option may significantly
- reduce index size. Example (notice missing starting '/'):
-@@ -206,13 +229,14 @@
- </description>
- </option>
-
-- <option name="pm command" type="string" default="/bin/rpm" multiple="no" hide="no">
-+ <option name="pm command" type="string" default="/bin/rpm" multiple="no">
- <description>
- Full path name to a PM (rpm for now) binary.
- </description>
-+ <alias name="rpm command" obsoleted="yes" />
- </option>
-
-- <option name="sudo command" type="string" default="/usr/bin/sudo" multiple="no" hide="no">
-+ <option name="sudo command" type="string" default="/usr/bin/sudo" multiple="no">
- <description>
- Full path name to sudo binary.
- </description>
-@@ -226,7 +250,7 @@
- Send ${USER}@${HOSTNAME} as anonymous FTP password (by default
- [literal]'poldek@znienacka.net'[/literal] is sent)
- </description>
-- <alias name="ftp sysuser as anon passwd" /> <!-- legacy -->
-+ <alias name="ftp sysuser as anon passwd" obsoleted="yes" /> <!-- legacy -->
- </option>
-
- <option name="default fetcher" type="string" default="http,ftp: internal" multiple="yes">
-@@ -266,7 +290,7 @@
- </description>
- </option>
-
-- <option name="noproxy" type="string" default="" multiple="yes">
-+ <option name="noproxy" type="string" list="yes" default="" multiple="yes">
- <description>
- Comma separated list of hosts or domains which will not be accessed via proxy.
- Option overrides no_proxy environment variable.
-@@ -275,6 +299,7 @@
- noproxy = localhost, .pl, ftp.foo.bar.org
- [/screen]
- </description>
-+ <alias name="no proxy" />
- </option>
-
- <option name="vfile retries" type="integer" default="128">
-@@ -287,20 +312,20 @@
- </optiongroup>
-
- <optiongroup id="ogroup.installation"><title>Installation options</title>
-- <option name="particle install" type="boolean" default="yes">
-+ <option name="particle install" type="boolean" default="yes" op="PARTICLE">
- <description>
- Install packages in small groups instead of doing all-or-nothing
- installations.
- </description>
- </option>
-
-- <option name="keep downloads" type="boolean" default="no">
-+ <option name="keep downloads" type="boolean" default="no" op="KEEP_DOWNLOADS">
- <description>
- Do not remove downloaded packages after its successful installation.
- </description>
- </option>
-
-- <option name="unique package names" type="boolean" default="no">
-+ <option name="unique package names" type="boolean" default="no" op="UNIQN">
- <description>
- Controls visibility of multiple package instances with different EVR.
- If on, only one, highest version will be visible.
-@@ -308,42 +333,43 @@
- </option>
-
-
-- <option name="promoteepoch" type="boolean" default="no">
-+ <option name="promoteepoch" type="boolean" default="no" op="PROMOTEPOCH">
- <description>
- Epoch autopromotion during dependency comparision. RPM specific.
- Set it up if you are using system with rpm prior to 4.2.1 version.
- </description>
- </option>
-
-- <option name="confirm installation" type="boolean" default="no">
-+ <option name="confirm installation" type="boolean" default="no" op="CONFIRM_INST">
- <description>
- Confirm packages installation.
- </description>
-- <alias name="confirm installs" legacy="yes"/>
-+ <alias name="confirm installs" obsoleted="yes"/>
- </option>
-
-- <option name="confirm removal" type="boolean" default="yes">
-+ <option name="confirm removal" type="boolean" default="yes" op="CONFIRM_UNINST">
- <description>
- Confirm packages removal.
- </description>
- </option>
-
-- <option name="choose equivalents manually" type="boolean" default="no">
-+ <option name="choose equivalents manually" type="boolean" default="no" op="EQPKG_ASKUSER">
- <description>
- Let the user select package among equivalents.
- </description>
- </option>
-
-- <option name="hold" type="string-list" default="" multiple="yes">
-+ <option name="hold" type="string" list="yes" default="" multiple="yes">
- <description>
- Prevent package listed from being upgraded if they are already installed.
- [screen]
- hold = kernel* dev
- [/screen]
- </description>
-+ <alias name="a hold alias for testing purposes" obsoleted="yes" />
- </option>
-
-- <option name="ignore" type="string-list" default="" multiple="yes">
-+ <option name="ignore" type="string" list="yes" default="" multiple="yes">
- <description>
- Ignore package list - packages fits given mask will be invisible.
- [screen]
-@@ -352,7 +378,7 @@
- </description>
- </option>
-
-- <option name="allow duplicates" type="boolean" default="yes">
-+ <option name="allow duplicates" type="boolean" default="yes" op="ALLOWDUPS">
- <description>
- Conflicts with already installed packages are treated as resolved
- if at least one of multiple-installed package satisfies conflict.
-@@ -385,21 +411,22 @@
- Subtle dependency processing options, they should not be changed
- unless you know what you are doing
- </description>
-+ <option name="multilib" type="boolean3" default="auto" hidden="yes" op="MULTILIB"/>
-
-- <option name="follow" type="boolean" default="yes">
-+ <option name="follow" type="boolean" default="yes" op="FOLLOW">
- <description>
- Automatically install packages required by installed ones.
- </description>
- </option>
-
-- <option name="greedy" type="boolean" default="yes">
-+ <option name="greedy" type="boolean" default="yes" op="GREEDY">
- <description>
- Greedy upgrades, i.e. upgrade packages which dependencies are broken
- by being uninstalled ones.
- </description>
- </option>
-
-- <option name="aggressive greedy" type="boolean" default="yes">
-+ <option name="aggressive greedy" type="boolean" default="yes" op="AGGREEDY">
- <description>
- Be yet more greedy; if successor of orphaned package found, and this
- successor drags no packages then upgrade the package instead of process
-@@ -407,7 +434,7 @@
- </description>
- </option>
-
-- <option name="mercy" type="boolean" default="no">
-+ <option name="mercy" type="boolean" default="no" op="VRFYMERCY">
- <description>
- Be tolerant for unmatched versioned dependencies which rpm tolerates, e.g.
- package A requires capability foo >= 1.0 while package B provides "foo"
-@@ -415,17 +442,21 @@
- </description>
- </option>
-
-- <option name="obsoletes" type="boolean" default="yes">
-+ <option name="obsoletes" type="boolean" default="yes" op="OBSOLETES">
- <description>
- Taking into account package Obsoletes.
- </description>
- </option>
-
-- <option name="conflicts" type="boolean" default="yes">
-+ <option name="conflicts" type="boolean" default="yes" op="CONFLICTS">
- <description>
- Taking into account package Conflicts.
- </description>
- </option>
-+
-+ <!-- internal tag -->
-+ <!-- <option name="__dirname" type="string" hidden="yes" /> -->
-+
- </optiongroup>
- </confsection> <!-- end of "global" -->
-
-@@ -439,7 +470,7 @@
- </description>
- </section>
-
--<confsection name="source" id="section.source" config="source.conf">
-+<confsection name="source" id="section.source" config="source.conf" multiple="yes">
- <description>
- This section contains poldek's repository configuration.
- Every repository is configured in its own [ source ] section.
-@@ -453,7 +484,7 @@
- </description>
- </option>
-
-- <option name="type" type="string" value="pndir">
-+ <option name="type" type="string" required="yes" value="pndir">
- <description>
- Type of repository index. Permitted values are 'pndir', 'pdir', 'apt', 'yum'
- and 'dir' as listed by [option]--stl[/option] switch.
-@@ -468,7 +499,7 @@
- </description>
- </option>
-
-- <option name="path" type="string" env="yes" value="/some/url/or/dir">
-+ <option name="path" type="string" env="yes" required="yes" value="/some/url/or/dir">
- <description>
- Unique name of the repository. May be either path or URL.
- </description>
-@@ -487,6 +518,7 @@
- Controls visibility of multiple package instances with different EVR.
- If on, only one, highest version will be visible.
- </description>
-+ <alias name="unique package names" />
- </option>
-
- <option name="pri" type="integer" default="0">
-@@ -515,6 +547,9 @@
- </description>
- </option>
-
-+ <option name="noauto" type="boolean" default="no" obsoleted="yes" />
-+ <option name="noautoup" type="boolean" default="no" obsoleted="yes"/>
-+
- <option name="signed" type="boolean" default="no">
- <description>
- Packages PGP/GPG signatures (if any) will be verified before their
-@@ -522,7 +557,7 @@
- </description>
- </option>
-
-- <option name="hold" type="string-list" default="" multiple="yes">
-+ <option name="hold" type="string" list="yes" default="" multiple="yes">
- <description>
- Have the same meaning as [ global ] parameter. Example:
- [screen]
-@@ -531,7 +566,7 @@
- </description>
- </option>
-
-- <option name="ignore" type="string-list" default="" multiple="yes">
-+ <option name="ignore" type="string" list="yes" default="" multiple="yes">
- <description>
- Have the same meaning as [ global ] parameter. Example:
- [screen]
-@@ -540,7 +575,7 @@
- </description>
- </option>
-
-- <option name="exclude path" type="path-list" default="" multiple="yes">
-+ <option name="exclude path" type="string" list="yes" path="yes" default="" multiple="yes">
- <description>
- Parameter have the same meaning as [ global ] parameter.
- [screen]
-@@ -557,6 +592,13 @@
- lang = pl_PL:lt_LT
- [/screen]
- </description>
-+ <alias name="dscr" obsoleted="yes" />
-+ </option>
-+
-+ <option name="sources" type="string" list="yes" value="foo foo-updates">
-+ <description>
-+ Make sense for 'group' source type only. A list of names of sources.
-+ </description>
- </option>
- <footer target="config">
-
-@@ -596,7 +638,7 @@
- </description>
- </section>
-
--<confsection name="fetcher" id="section.fetcher" config="fetch.conf">
-+<confsection name="fetcher" id="section.fetcher" config="fetch.conf" multiple="yes">
- <description>
- This section contains external downloaders configuration.
- Each section describes one fetcher.
-@@ -610,7 +652,7 @@
- </description>
- </option>
-
-- <option name="proto" type="string-list" value="foo,bar">
-+ <option name="proto" type="string" value="foo,bar" required="yes">
- <description>
- Protocol or protocols supported by fetcher. Name of the protocol can be
- completely arbitrary, i.e. if you can handle protocol "foo" by writing
-@@ -618,7 +660,7 @@
- </description>
- </option>
-
-- <option name="cmd" type="string" env="yes" value="foogetter.sh -N %D %Pn">
-+ <option name="cmd" type="string" env="yes" required="yes" value="foogetter.sh -N %D %Pn">
- <description>
- Parameter specifies an external command and its invoking syntax.
- The syntax of "cmd" is:
-diff -urN poldek-0.20.org/gensym.sh poldek-0.20/gensym.sh
---- poldek-0.20.org/gensym.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/gensym.sh 2006-07-26 20:25:54.115320750 +0200
-@@ -0,0 +1,43 @@
-+#!/bin/sh
-+
-+libNAME=libpoldek
-+if [ -n "$1" ]; then libNAME="lib$1"; fi
-+
-+LIB=.libs/${libNAME}_allsyms.a
-+if [ ! -f $LIB ]; then echo "$LIB: no such file"; exit 1; fi
-+
-+INCLUDES=$(grep ^libHEADERS Makefile.am | perl -ne 's|^libHEADERS\s*=\s*||; print')
-+
-+HH="/tmp/hh";
-+> /tmp/hh
-+for i in $INCLUDES; do
-+ gcc -E $i 2>/dev/null >>$HH;
-+done
-+
-+
-+symlist=$(nm --defined-only $LIB | pcregrep '^\w+\s+[tT]' | awk '{print $3}' | sort -u)
-+
-+#out=$(basename $LIB .so)
-+#out="$out.sym"
-+out="${libNAME}.sym"
-+> $out
-+for s in $symlist; do
-+ if pcregrep -s "\b$s\(" $HH; then
-+ echo "+ $s"
-+ echo $s >> $out
-+ fi
-+done
-+
-+# libpoldek hack - add constans
-+if [ "$libNAME" = "libpoldek" ]; then
-+ nm --defined-only $LIB | pcregrep '^\w+\s+[RB]' | awk '{print $3}' | grep -v poldek_conf_| grep poldek_ | sort -u >> $out
-+
-+# provide rpmlog to cover rpmlib's one -- haaack
-+ nm --defined-only $LIB | pcregrep '\brpmlog\b' | awk '{print $3}' >> $out
-+
-+fi
-+
-+
-+if [ "$libNAME" = "libpoclidek" ]; then
-+ nm --defined-only $LIB | pcregrep '^\w+\s+[D]' | awk '{print $3}' | grep poclidek_ | sort -u >> $out
-+fi
-diff -urN poldek-0.20.org/getlib.sh poldek-0.20/getlib.sh
---- poldek-0.20.org/getlib.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/getlib.sh 2006-07-26 20:25:54.119321000 +0200
-@@ -0,0 +1,50 @@
-+#!/bin/sh
-+# $Id$
-+
-+do_configure()
-+{
-+ nn="$1"
-+ [ -d $nn ] || exit 1
-+ [ -f $nn/configure ] || (cd $nn && ./autogen.sh --no-configure)
-+}
-+
-+PATH="/bin/:/usr/bin:/sbin:/usr/sbin"
-+if [ ! -f capreq.h ]; then
-+ cd `dirname $0`;
-+ if [ ! -f capreq.h ]; then
-+ echo "$0: `pwd`: not a poldek directory"
-+ exit 1
-+ fi
-+fi
-+
-+name=$1
-+mode=$2
-+
-+[ -n "$name" ] || exit 1
-+
-+# no ../$name => we are propably in distribution tree
-+if [ ! -d ../$name -a -d $name ]; then
-+ do_configure $name;
-+ exit;
-+fi
-+
-+if [ "$mode" = "link" ]; then
-+ if [ -h $name ]; then do_configure $name; exit 0; fi
-+ if [ -d $name ]; then rm -rf $name; fi
-+fi
-+
-+if [ "$mode" = "copy" ]; then
-+ if [ -h $name ]; then rm -f $name; fi
-+ if [ -d $name ]; then do_configure $name; exit 0; fi
-+fi
-+
-+if [ ! -d $name ]; then
-+ if [ -n "$mode" -a $mode == "link" ]; then
-+ ln ../$name -sf
-+ else
-+ cp -a ../$name .
-+ fi
-+fi
-+
-+do_configure $name
-+
-diff -urN poldek-0.20.org/install/conflicts.c poldek-0.20/install/conflicts.c
---- poldek-0.20.org/install/conflicts.c 2005-07-09 19:51:18.000000000 +0200
-+++ poldek-0.20/install/conflicts.c 2006-07-26 20:25:54.119321000 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include "ictx.h"
-@@ -96,10 +96,13 @@
- if (found) {
- struct pkg *real_tomark = tomark;
- if (tomark_candidates) {
-- int n;
-- n = ictx->ts->askpkg_fn(capreq_snprintf_s(req), tomark_candidates, tomark);
-- real_tomark = tomark_candidates[n];
-+ real_tomark = in_choose_equiv(ictx->ts, req, tomark_candidates,
-+ tomark);
- n_cfree(&tomark_candidates);
-+ if (real_tomark == NULL) { /* user aborts */
-+ ictx->nerr_fatal++;
-+ found = 0;
-+ }
- }
- tomark = real_tomark;
-
-diff -urN poldek-0.20.org/install/icaps.c poldek-0.20/install/icaps.c
---- poldek-0.20.org/install/icaps.c 2005-07-09 19:51:18.000000000 +0200
-+++ poldek-0.20/install/icaps.c 2006-07-26 20:25:54.123321250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include "ictx.h"
-@@ -25,13 +25,34 @@
-
- capreq_new_name_a(capname, cap);
- dbpkgs = pkgdb_get_provides_dbpkgs(ts->db, cap, NULL, 0);
-+
- if (dbpkgs == NULL) {
-- struct pkg *pkg;
-+ struct pkg *pkg = NULL;
-+
- if (ts->getop(ts, POLDEK_OP_FRESHEN))
- return 0;
-
- n_array_sort_ex(pkgs, (tn_fn_cmp)pkg_cmp_name_evr_rev);
-- pkg = n_array_nth(pkgs, 0);
-+
-+ if (ts->getop(ts, POLDEK_OP_EQPKG_ASKUSER) && ts->askpkg_fn &&
-+ n_array_size(pkgs) > 1) {
-+
-+ struct pkg **candidates = alloca(sizeof(struct pkg *) *
-+ (n_array_size(pkgs) + 1));
-+ for (i=0; i < n_array_size(pkgs); i++)
-+ candidates[i] = n_array_nth(pkgs, i);
-+ candidates[i] = NULL;
-+
-+ pkg = in_choose_equiv(ts, cap, candidates, NULL);
-+ if (pkg == NULL) { /* user aborts */
-+ found = -1;
-+ goto l_end;
-+ }
-+ }
-+
-+ if (pkg == NULL)
-+ pkg = n_array_nth(pkgs, 0);
-+
- pkg_hand_mark(ts->pms, pkg);
- return 1;
- }
-@@ -65,7 +86,7 @@
-
- else if (cmprc < 0 && poldek_ts_issetf(ts, POLDEK_TS_DOWNGRADE))
- mark = 1;
--
-+
- if (mark) {
- found = 1;
- msgn(1, _("%s: marked as %s's provider"), pkg_id(pkg),
-@@ -82,10 +103,10 @@
-
- } else {
- n_assert(0);
--
- }
- }
- }
-+
- l_end:
- if (dbpkgs)
- n_array_free(dbpkgs);
-@@ -93,20 +114,26 @@
- return found;
- }
-
-+/* handles --caplookup */
- int in_prepare_icaps(struct poldek_ts *ts)
- {
- tn_array *keys;
- tn_hash *icaps;
-- int i;
--
-+ int i, rc = 1;
-+
- icaps = arg_packages_get_resolved_caps(ts->aps);
- keys = n_hash_keys_cp(icaps);
- for (i=0; i < n_array_size(keys); i++) {
- const char *cap = n_array_nth(keys, i);
- tn_array *pkgs = n_hash_get(icaps, cap);
-- prepare_icap(ts, cap, pkgs);
-+
-+ if (prepare_icap(ts, cap, pkgs) == -1) {
-+ rc = -1;
-+ break;
-+ }
- }
-+
- n_array_free(keys);
- n_hash_free(icaps);
-- return 1;
-+ return rc;
- }
-diff -urN poldek-0.20.org/install/ictx.h poldek-0.20/install/ictx.h
---- poldek-0.20.org/install/ictx.h 2005-10-18 20:02:16.000000000 +0200
-+++ poldek-0.20/install/ictx.h 2006-07-26 20:25:54.131321750 +0200
-@@ -138,4 +138,7 @@
- int in_process_package(int indent, struct install_ctx *ictx,
- struct pkg *pkg, int process_as);
-
-+
-+struct pkg *in_choose_equiv(struct poldek_ts *ts, struct capreq *cap,
-+ struct pkg **candidates, struct pkg *defaultpkg);
- #endif
-diff -urN poldek-0.20.org/install/install.c poldek-0.20/install/install.c
---- poldek-0.20.org/install/install.c 2005-10-20 19:39:12.000000000 +0200
-+++ poldek-0.20/install/install.c 2006-07-26 20:25:54.131321750 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <vfile/vfile.h>
-@@ -352,7 +352,9 @@
- struct install_ctx ictx;
- n_assert(ts->type == POLDEK_TS_INSTALL);
-
-- in_prepare_icaps(ts);
-+ if (in_prepare_icaps(ts) < 0) /* user aborts, no error */
-+ return 1;
-+
- if (unmark_name_dups(ts->pms, ts->ctx->ps->pkgs) == 0) {
- msgn(1, _("Nothing to do"));
- return 1;
-diff -urN poldek-0.20.org/install/misc.c poldek-0.20/install/misc.c
---- poldek-0.20.org/install/misc.c 2005-10-20 19:57:51.000000000 +0200
-+++ poldek-0.20/install/misc.c 2006-07-26 20:25:54.139322250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include "ictx.h"
-@@ -439,7 +439,7 @@
-
- l_end:
-
-- if (candidates && nsuspkgs) {
-+ if (candidates && nsuspkgs > 1) {
- n_assert(suspkgs);
- *candidates = suspkgs;
-
-@@ -460,3 +460,16 @@
- ictx->uninst_set->dbpkgs);
- }
-
-+struct pkg *in_choose_equiv(struct poldek_ts *ts, struct capreq *cap,
-+ struct pkg **candidates, struct pkg *defaultpkg)
-+{
-+ int n;
-+
-+ if (defaultpkg == NULL)
-+ defaultpkg = candidates[0];
-+
-+ n = ts->askpkg_fn(capreq_snprintf_s(cap), candidates, defaultpkg);
-+ if (n == -1)
-+ return NULL;
-+ return candidates[n];
-+}
-diff -urN poldek-0.20.org/install/requirements.c poldek-0.20/install/requirements.c
---- poldek-0.20.org/install/requirements.c 2005-10-20 20:19:16.000000000 +0200
-+++ poldek-0.20/install/requirements.c 2006-07-26 20:25:54.139322250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include "ictx.h"
-@@ -165,12 +165,15 @@
-
- struct pkg *real_tomark = tomark;
- if (tomark_candidates) {
-- int n;
-- n = ictx->ts->askpkg_fn(capreq_snprintf_s(req),
-- tomark_candidates, tomark);
-- real_tomark = tomark_candidates[n];
-+ real_tomark = in_choose_equiv(ictx->ts, req, tomark_candidates,
-+ tomark);
- free(tomark_candidates);
- tomark_candidates = NULL;
-+
-+ if (real_tomark == NULL) { /* user abort */
-+ ictx->nerr_fatal++;
-+ return 0;
-+ }
- }
-
- if (in_is_marked_for_removal_by_req(ictx, real_tomark, req)) {
-@@ -265,7 +268,10 @@
- memset(&successor, 0, sizeof(successor));
- if (process_as == PROCESS_AS_ORPHAN &&
- ictx->ts->getop(ictx->ts, POLDEK_OP_AGGREEDY)) {
-- if (in_pkg_drags(ictx, pkg) == 0) {
-+ int pkg_ndragged;
-+
-+ pkg_ndragged = in_pkg_drags(ictx, pkg);
-+ if (pkg_ndragged == 0 || 1) { /* XXX: see note in pkgset-install.c */
- struct pkg *p;
- int is_marked = 0, ndragged = 0, by_obsoletes = 0;
-
-@@ -277,9 +283,9 @@
- successor.realpkg = p;
- successor.by_obsoletes = by_obsoletes;
-
-- /* do not follow successor if package drags something and
-- is not marked */
-- if (p && (ndragged = in_pkg_drags(ictx, p)) > 0 && is_marked == 0) {
-+ /* do not follow successor if it drags more than its predecessor
-+ and successor itself is not marked */
-+ if (p && (ndragged = in_pkg_drags(ictx, p)) > pkg_ndragged && is_marked == 0) {
- DBGF("OMIT select_successor %s -> %s (%d)\n",
- pkg_id(pkg), pkg_id(p), ndragged);
- p = NULL;
-diff -urN poldek-0.20.org/INSTALL poldek-0.20/INSTALL
---- poldek-0.20.org/INSTALL 2002-05-13 22:24:43.000000000 +0200
-+++ poldek-0.20/INSTALL 2006-07-26 20:25:54.139322250 +0200
-@@ -1,12 +1,14 @@
- Build requirements: $ grep ^BuildReq poldek.spec
-+To build without libxml2, use --without-xml-metadata option as follows:
-
--Build
-+$ ./configure [--without-xml-metadata] && make
-
--$ ./configure && make
-
--or better
-+or better build rpm package:
-
--$ rpm -tb poldek-<VERSION>.tar.gz --define 'distro <distro>'
--Possible distro values: pld, rh or mdk.
-+$ rpmbuild -tb poldek-${version}.tar.gz --define 'distro <distro>' \
-+ [--without xml_metadata]
-+
-+Possible distro values: pld, rh, fedora and centos
-
-
-diff -urN poldek-0.20.org/lib_init.c poldek-0.20/lib_init.c
---- poldek-0.20.org/lib_init.c 2005-10-27 00:49:40.000000000 +0200
-+++ poldek-0.20/lib_init.c 2006-07-26 20:25:54.147322750 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -41,8 +41,9 @@
- #include "poldek_intern.h"
- #include "poldek_term.h"
- #include "pm/pm.h"
-+#include "conf_intern.h"
-
--extern void (*poldek_log_say_goodbye)(const char *msg); /* log.c */
-+extern int (*poldek_log_say_goodbye)(const char *msg); /* log.c */
-
- static int poldeklib_init_called = 0;
-
-@@ -60,8 +61,8 @@
-
- static const char *poldek_logprefix = "poldek";
-
--static void say_goodbye(const char *msg);
--void (*poldek_say_goodbye)(const char *msg) = say_goodbye;
-+static int say_goodbye(const char *msg);
-+int (*poldek_say_goodbye)(const char *msg) = say_goodbye;
-
- static
- void (*poldek_assert_hook)(const char *expr, const char *file, int line) = NULL;
-@@ -72,8 +73,6 @@
- static
- void (*poldek_die_hook)(const char *msg) = NULL;
-
--
--
- static void register_vf_handlers_compat(const tn_hash *htcnf);
- static void register_vf_handlers(const tn_array *fetchers);
-
-@@ -93,39 +92,22 @@
- extern
- int poldek_load_sources__internal(struct poldek_ctx *ctx, int load_dbdepdirs);
-
--
--static struct {
-- int config;
-- const char *name;
-+struct default_op_map_ent {
-+ int config; /* configuration var? */
-+ char *name;
- int op;
-+ int _defaultv;
- int defaultv;
--} default_op_map[] = {
-- { 1, "use_sudo", POLDEK_OP_USESUDO, 0 },
-- { 1, "confirm_installation", POLDEK_OP_CONFIRM_INST, 0 },
-- { 1, "confirm_removal", POLDEK_OP_CONFIRM_UNINST, 1 },
-- { 1, "keep_downloads", POLDEK_OP_KEEP_DOWNLOADS, 0 },
-- { 1, "choose_equivalents_manually", POLDEK_OP_EQPKG_ASKUSER, 0 },
-- { 1, "particle_install", POLDEK_OP_PARTICLE, 1 },
-- { 1, "follow", POLDEK_OP_FOLLOW, 1 },
-- { 1, "obsoletes", POLDEK_OP_OBSOLETES, 1 },
-- { 1, "conflicts", POLDEK_OP_CONFLICTS, 1 },
-- { 1, "mercy", POLDEK_OP_VRFYMERCY, 1 },
-- { 1, "greedy", POLDEK_OP_GREEDY, 1 },
-- { 1, "allow_duplicates", POLDEK_OP_ALLOWDUPS, 1 },
-- { 1, "unique_package_names", POLDEK_OP_UNIQN, 0 },
-- { 1, "promoteepoch", POLDEK_OP_PROMOTEPOCH, 0 },
-- { 1, "multilib", POLDEK_OP_MULTILIB, 0 },
-- { 0, "(!no)hold", POLDEK_OP_HOLD, 1 },
-- { 0, "(!no)ingore", POLDEK_OP_IGNORE, 1 },
-- { 0, NULL, 0, 0 }
-+ int optype;
- };
-
-+static tn_array *default_op_map = NULL; /* see build_default_op_map() */
-+
- int poldek__is_setup_done(struct poldek_ctx *ctx)
- {
- return (ctx->_iflags & SETUP_DONE) == SETUP_DONE;
- }
-
--
- static inline void check_if_setup_done(struct poldek_ctx *ctx)
- {
- if ((ctx->_iflags & SETUP_DONE) == SETUP_DONE)
-@@ -684,34 +666,142 @@
- p_st_destroy(&pst);
- }
-
-+int default_op_map_ent_cmp(struct default_op_map_ent *e1,
-+ struct default_op_map_ent *e2)
-+{
-+ return strcmp(e1->name, e2->name);
-+}
-+
-+static tn_array *build_default_op_map(void)
-+{
-+ struct poldek_conf_tag *tags = NULL;
-+ tn_array *op_map;
-+ int i = 0;
-+ struct default_op_map_ent *ent;
-+ struct default_op_map_ent addon[] = {
-+ { 0, "(!no)hold", POLDEK_OP_HOLD, 1, 1, CONF_TYPE_BOOLEAN },
-+ { 0, "(!no)ingore", POLDEK_OP_IGNORE, 1, 1, CONF_TYPE_BOOLEAN },
-+ { 0, NULL, 0, 0, 0, 0 }
-+ };
-+
-+ op_map = n_array_new(32, free, (tn_fn_cmp)default_op_map_ent_cmp);
-+
-+ while (poldek_conf_sections[i].name) {
-+ if (n_str_eq(poldek_conf_sections[i].name, "global")) {
-+ tags = poldek_conf_sections[i].tags;
-+ break;
-+ }
-+ i++;
-+ }
-+ n_assert(tags);
-+
-+ i = 0;
-+ while (tags[i].name) {
-+ if (tags[i]._op_no == 0) {
-+ i++;
-+ continue;
-+ }
-+
-+ ent = n_malloc(sizeof(*ent));
-+ n_assert(tags[i].flags & (CONF_TYPE_BOOLEAN | CONF_TYPE_BOOLEAN3));
-+ ent->config = 1;
-+ ent->name = tags[i].name;
-+ ent->op = tags[i]._op_no;
-+
-+ if (tags[i].flags & CONF_TYPE_BOOLEAN) {
-+ ent->_defaultv = poldek_util_parse_bool(tags[i].defaultv);
-+ ent->defaultv = ent->_defaultv;
-+ n_assert(ent->defaultv == 0 || ent->defaultv == 1);
-+ ent->optype = CONF_TYPE_BOOLEAN;
-+
-+ } else if (tags[i].flags & CONF_TYPE_BOOLEAN3) {
-+ ent->_defaultv = poldek_util_parse_bool3(tags[i].defaultv);
-+ n_assert(ent->_defaultv == 0 || ent->_defaultv == 1 ||
-+ ent->_defaultv == 2);
-+
-+ ent->defaultv = ent->_defaultv;
-+ ent->optype = CONF_TYPE_BOOLEAN3;
-+
-+ } else {
-+ n_assert(0);
-+ }
-+
-+ n_array_push(op_map, ent);
-+ i++;
-+ }
-+
-+ i = 0;
-+ while (addon[i].name) {
-+ ent = n_malloc(sizeof(*ent));
-+ ent->config = 0;
-+ ent->name = addon[i].name;
-+ ent->op = addon[i].op;
-+ ent->_defaultv = ent->defaultv = addon[i].defaultv;
-+ ent->optype = addon[i].optype;
-+ n_array_push(op_map, ent);
-+ i++;
-+ }
-+#if ENABLE_TRACE
-+ for (i=0; i<n_array_size(op_map); i++) {
-+ struct default_op_map_ent *ent = n_array_nth(op_map, i);
-+ DBGF("%s %d\n", ent->name, ent->_defaultv);
-+ }
-+#endif
-+ n_array_sort(op_map);
-+ return op_map;
-+}
-+
- static
- void poldek__ts_apply_config(struct poldek_ctx *ctx, struct poldek_ts *ts)
- {
- tn_hash *htcnf = NULL;
- int i;
-+
-+ n_assert(default_op_map);
-
- if (ctx->htconf == NULL)
- return;
-
- htcnf = poldek_conf_get_section_ht(ctx->htconf, "global");
-- i = 0;
-+
- DBGF("ts %p, tsctx %p\n", ts, ctx->ts);
-- while (default_op_map[i].name && default_op_map[i].config) {
-- const char *name = default_op_map[i].name;
-- int op = default_op_map[i].op;
-+ DBGF("default_op_map size = %d\n", n_array_size(default_op_map));
-+
-+ for (i=0; i < n_array_size(default_op_map); i++) {
-+ struct default_op_map_ent *ent = n_array_nth(default_op_map, i);
-+
-+ DBGF("op[%d] %s (config %d)\n", i, ent->name, ent->config);
-+
-+ if (ent->config == 0) /* omit non-config options */
-+ continue;
-
-- if (poldek_ts_op_touched(ts, op)) { /* modified by cmdl opts */
-- DBGF(" - ldconfig %s(%d) = %d\n", name, op, ts->getop(ts, op));
-+
-+ n_assert(ent->defaultv >= 0);
-+
-+ if (poldek_ts_op_touched(ts, ent->op)) { /* modified by cmdl opts */
-+ DBGF(" %d. - ldconfig %s(%d) = %d\n", i, ent->name, ent->op,
-+ ts->getop(ts, ent->op));
-
- } else {
-- int v = poldek_conf_get_bool(htcnf, name,
-- default_op_map[i].defaultv);
-+ int v;
-+ if (ent->optype == CONF_TYPE_BOOLEAN)
-+ v = poldek_conf_get_bool(htcnf, ent->name, ent->defaultv);
-+
-+ else if (ent->optype == CONF_TYPE_BOOLEAN3)
-+ v = poldek_conf_get_bool3(htcnf, ent->name, ent->defaultv);
-+ else
-+ n_assert(0);
-
-- DBGF(" + ldconfig %s(%d) = %d\n", name, op, v);
-- poldek_ts_xsetop(ts, op, v, 0);
-+ if (ent->optype == CONF_TYPE_BOOLEAN3 && v == 2) { /* auto */
-+ if (ent->defaultv != 0 && ent->defaultv != 1)
-+ continue;
-+ v = ent->defaultv;
-+ }
-+
-+ n_assert(v == 0 || v == 1);
-+ DBGF(" %d. + ldconfig %s(%d) = %d\n", i, ent->name, ent->op, v);
-+ poldek_ts_xsetop(ts, ent->op, v, 0);
- }
--
-- i++;
- }
-
- if (ts->getop(ts, POLDEK_OP_CONFIRM_INST) && poldek_VERBOSE < 1)
-@@ -726,15 +816,17 @@
-
- void poldek__ts_dump_settings(struct poldek_ctx *ctx, struct poldek_ts *ts)
- {
-- int i = 0;
--
-+ int i;
-+
-+ n_assert(default_op_map);
- DBGF_F("ts %p, tsctx %p\n", ts, ctx->ts);
-- while (default_op_map[i].op) {
-- const char *name = default_op_map[i].name;
-- int op = default_op_map[i++].op;
-
-- DBGF_F("%% %s=%s (ctx=%s)\n", name, ts->getop(ts, op) ? "y" : "n",
-- ctx->ts->getop(ctx->ts, op) ? "y" : "n");
-+ for (i=0; i<n_array_size(default_op_map); i++) {
-+ struct default_op_map_ent *ent = n_array_nth(default_op_map, i);
-+
-+ DBGF_F("%% %s=%s (ctx=%s)\n", ent->name,
-+ ts->getop(ts, ent->op) ? "y" : "n",
-+ ctx->ts->getop(ctx->ts, ent->op) ? "y" : "n");
- }
- }
-
-@@ -744,29 +836,29 @@
- struct poldek_ts *ts)
- {
- int i = 0;
--
-+
-+ n_assert(default_op_map);
- DBGF("ts %p, tsctx %p\n", ts, ctx->ts);
-- while (default_op_map[i].op) {
-- const char *name = default_op_map[i].name;
-- int op = default_op_map[i++].op;
--
-- name = name; /* compiler warn */
-- if (poldek_ts_op_touched(ts, op)) { /* modified by cmdl opts */
-- DBGF(" - skip touched %s(%d) = %d, ctxv %d\n", name, op,
-- ts->getop(ts, op), ctx->ts->getop(ctx->ts, op));
-+
-+ for (i=0; i<n_array_size(default_op_map); i++) {
-+ struct default_op_map_ent *ent = n_array_nth(default_op_map, i);
-+
-+ if (poldek_ts_op_touched(ts, ent->op)) { /* modified by cmdl opts */
-+ DBGF(" - skip touched %s(%d) = %d, ctxv %d\n", ent->name, ent->op,
-+ ts->getop(ts, ent->op), ctx->ts->getop(ctx->ts, ent->op));
- continue;
- }
-
-- if (poldek_ts_op_touched(ctx->ts, op)) {
-- DBGF(" + apply %s(%d) = %d (was %d)\n", name, op,
-- ctx->ts->getop(ctx->ts, op), ts->getop(ts, op));
-+ if (poldek_ts_op_touched(ctx->ts, ent->op)) {
-+ DBGF(" + apply %s(%d) = %d (was %d)\n", ent->name, ent->op,
-+ ctx->ts->getop(ctx->ts, ent->op), ts->getop(ts, ent->op));
-
-- ts->setop(ts, op, ctx->ts->getop(ctx->ts, op));
-+ ts->setop(ts, ent->op, ctx->ts->getop(ctx->ts, ent->op));
-
- } else {
-- DBGF(" - NOT apply %s(%d) = %d (touched=%d)\n", name,
-- op, ctx->ts->getop(ctx->ts, op),
-- poldek_ts_op_touched(ctx->ts, op));
-+ DBGF(" - NOT apply %s(%d) = %d (touched=%d)\n", ent->name,
-+ ent->op, ctx->ts->getop(ctx->ts, ent->op),
-+ poldek_ts_op_touched(ctx->ts, ent->op));
- }
-
- }
-@@ -880,16 +972,17 @@
- return 1;
- }
-
--static void say_goodbye(const char *msg)
-+static int say_goodbye(const char *msg)
- {
- printf("%s", msg);
-+ return 1; /* let the caller die() itself */
- }
-
- static void n_malloc_fault(void)
- {
-- poldek_say_goodbye("Something wrong, something not quite right...\n"
-- "Memory exhausted\n");
-- exit(EXIT_FAILURE);
-+ if (poldek_say_goodbye("Something wrong, something not quite right...\n"
-+ "Memory exhausted\n"))
-+ exit(EXIT_FAILURE);
- }
-
-
-@@ -900,8 +993,8 @@
- "Assertion '%s' failed, %s:%d\n"
- "Please report this bug to %s.\n\n",
- expr, file, line, poldek_BUG_MAILADDR);
-- poldek_say_goodbye(msg);
-- abort();
-+ if (poldek_say_goodbye(msg))
-+ abort();
- }
-
- static void n_die_hook(const char *msg)
-@@ -909,11 +1002,12 @@
- char buf[1024];
- n_snprintf(buf, sizeof(buf),
- "Something wrong, something not quite right.\ndie: %s\n", msg);
-- poldek_say_goodbye(buf);
-- abort();
-+
-+ if (poldek_say_goodbye(buf))
-+ abort();
- }
-
--static void self_init(void)
-+static void verify_setuid(void)
- {
- uid_t uid;
-
-@@ -1084,6 +1178,12 @@
-
- void poldeklib_destroy(void)
- {
-+ if (poldeklib_init_called == 0)
-+ return;
-+
-+ n_array_free(default_op_map);
-+ default_op_map = NULL;
-+
- }
-
- int poldeklib_init(void)
-@@ -1097,7 +1197,10 @@
- pmmodule_init();
- poldek_set_verbose(0);
- poldek_log_init(NULL, stdout, poldek_logprefix);
-- self_init();
-+ verify_setuid();
-+
-+ default_op_map = build_default_op_map();
-+ n_assert(default_op_map);
-
- bindtextdomain(PACKAGE, NULL);
- textdomain(PACKAGE);
-@@ -1163,24 +1266,42 @@
-
- ctx->ts = poldek_ts_new(NULL, 0);
- ts = ctx->ts;
--
-- i = 0;
-- while (default_op_map[i].op) {
-- poldek_ts_xsetop(ts, default_op_map[i].op,
-- default_op_map[i].defaultv, 0);
-- i++;
-- }
-
-- if (getuid() != 0)
-- poldek_ts_setop(ts, POLDEK_OP_USESUDO, 1);
--
-+ /* set default option values without "touching" them in ts */
-+ for (i=0; i < n_array_size(default_op_map); i++) {
-+ struct default_op_map_ent *ent = n_array_nth(default_op_map, i);
-+ int v = ent->_defaultv;
-+
-+ if (v == 2) { /* "auto" */
-+ switch (ent->op) {
-+ case POLDEK_OP_USESUDO:
-+ v = 0;
-+ if (getuid() != 0)
-+ v = 1;
-+ break;
-+
-+ case POLDEK_OP_MULTILIB: /* do not touch, will
-+ be determined later */
-+ break;
-+
-+ default:
-+ n_assert(0);
-+ }
-+ DBGF("auto %s = %d\n", ent->name, v);
-+ ent->defaultv = v;
-+ }
-+
-+ if (v != 2)
-+ poldek_ts_xsetop(ts, ent->op, v, 0);
-+ }
-+ DBGF("default_op_map size = %d\n", n_array_size(default_op_map));
- return 1;
- }
-
- struct poldek_ctx *poldek_new(unsigned flags)
- {
- struct poldek_ctx *ctx;
--
-+
- if (!poldeklib_init_called) {
- logn(LOGERR | LOGDIE, "poldeklib_init() call is a must...");
- return 0;
-@@ -1260,6 +1381,54 @@
- return 1;
- }
-
-+static void __setup_multilib(struct poldek_ctx *ctx)
-+{
-+ struct default_op_map_ent *ent, tmp;
-+ char scolor[64];
-+ int color, multilib = 2;
-+
-+
-+ if (!pm_conf_get(ctx->pmctx, "%{_transaction_color}", scolor, sizeof(scolor)))
-+ return;
-+
-+ if (sscanf(scolor, "%u", &color) != 1)
-+ return;
-+
-+ if (ctx->htconf) {
-+ tn_hash *htcnf = poldek_conf_get_section_ht(ctx->htconf, "global");
-+ multilib = poldek_conf_get_bool3(htcnf, "multilib", 2);
-+ }
-+
-+ if (color && multilib == 0) {
-+ logn(LOGWARN, _("RPM works in multilib mode, while poldek not"));
-+ return;
-+
-+ } else if (!color && multilib == 1) {
-+ logn(LOGWARN, _("poldek works in multilib mode, while rpm not"));
-+ return;
-+ }
-+
-+ if (multilib == 2) { /* auto */
-+ ctx->_rpm_tscolor = color;
-+
-+ tmp.name = "multilib";
-+ ent = n_array_bsearch(default_op_map, &tmp);
-+ n_assert(ent);
-+
-+ ent->defaultv = 0;
-+ if (color)
-+ ent->defaultv = 1;
-+
-+ if (color)
-+ msgn(2, "Enabling multilib mode, rpm's transaction color = %d",
-+ color);
-+
-+ DBGF("multilib(auto) = %d\n", ent->defaultv);
-+ poldek_ts_xsetop(ctx->ts, ent->op, ent->defaultv, 0);
-+ }
-+}
-+
-+
-
- /* */
- static int setup_pm(struct poldek_ctx *ctx)
-@@ -1271,7 +1440,8 @@
- if (strcmp(pm, "rpm") == 0) {
- ctx->pmctx = pm_new(pm);
- pm_configure(ctx->pmctx, "macros", ctx->ts->rpmacros);
--
-+ __setup_multilib(ctx);
-+
- } else if (strcmp(pm, "pset") == 0) {
- n_array_sort_ex(ctx->dest_sources, (tn_fn_cmp)source_cmp_no);
- if (n_array_size(ctx->dest_sources) == 0) {
-diff -urN poldek-0.20.org/libpoldek.sym poldek-0.20/libpoldek.sym
---- poldek-0.20.org/libpoldek.sym 2005-10-21 01:01:10.000000000 +0200
-+++ poldek-0.20/libpoldek.sym 2006-07-26 20:25:54.147322750 +0200
-@@ -272,6 +272,8 @@
- poldek_ts_setop
- poldek_ts_type
- poldek_ts_vconfigure
-+poldek_util_expand_vars
-+poldek_util_expand_env_vars
- poldek_util_get_gmt_offs
- poldek_util_is_rwxdir
- poldek_util_lc_lang
-diff -urN poldek-0.20.org/log.c poldek-0.20/log.c
---- poldek-0.20.org/log.c 2005-10-27 00:46:07.000000000 +0200
-+++ poldek-0.20/log.c 2006-07-26 20:25:54.155323250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <stdarg.h>
-@@ -32,19 +32,18 @@
-
- int poldek_VERBOSE = 0;
-
--static void say_goodbye(const char *msg);
--void (*poldek_log_say_goodbye)(const char *msg) = say_goodbye;
-+static int say_goodbye(const char *msg);
-+int (*poldek_log_say_goodbye)(const char *msg) = say_goodbye;
-
- static char l_prefix[64];
--static FILE *l_stream, *l_fstream = NULL;
-+static FILE *l_stream = NULL, *l_filestream = NULL;
-
- static void vlog_tty(int pri, const char *fmt, va_list args);
-
--static void say_goodbye(const char *msg)
-+static int say_goodbye(const char *msg)
- {
-- msg = msg;
-- /* do nothing, msg is logged before die */
-- return;
-+ msg = msg; /* do nothing, msg is logged before die */
-+ return 1;
- }
-
- int poldek_verbose(void)
-@@ -83,11 +82,11 @@
- {
- static int last_endlined = 1;
- char buf[1024], tmp_fmt[1024];
-- int n = 0, flags, is_cont = 0, is_endlined = 0;
-+ int n = 0, flags, is_continuation = 0, is_endlined = 0;
-
- if (*fmt == '_') {
- fmt++;
-- is_cont = 1;
-+ is_continuation = 1;
-
- } else if (*fmt == '\n') {
- buf[n++] = '\n';
-@@ -112,18 +111,18 @@
- }
- }
-
-- if (last_endlined == 0 && !is_cont && (pri & (LOGERR|LOGWARN)))
-+ if (last_endlined == 0 && !is_continuation && (pri & (LOGERR|LOGWARN)))
- buf[n++] = '\n';
- last_endlined = is_endlined;
-
-- if (indent > 0) {
-+ if (indent > 0 && indent < 256) { /* have buf[1024] */
- memset(&buf[n], ' ', indent);
- n += indent;
- }
-
- buf[n] = '\0';
-
-- /* revert LOG[TTY|FLAGS] */
-+ /* revert LOG[TTY|FILE] */
- flags = LOGTTY | LOGFILE;
- if (pri & LOGTTY)
- flags &= ~LOGFILE;
-@@ -140,12 +139,12 @@
- fflush(l_stream);
- }
-
-- if ((flags & LOGFILE) && l_fstream) {
-+ if ((flags & LOGFILE) && l_filestream) { /* logging to file */
- if (*fmt == '\0') {
-- fprintf(l_fstream, "%s", buf);
-+ fprintf(l_filestream, "%s", buf);
-
- } else {
-- if (!is_cont) {
-+ if (!is_continuation) {
- char timbuf[64];
- time_t t;
-
-@@ -153,24 +152,24 @@
- strftime(timbuf, sizeof(timbuf), "%Y/%m/%d %H:%M:%S ",
- localtime(&t));
-
-- fprintf(l_fstream, "%s", timbuf);
-+ fprintf(l_filestream, "%s", timbuf);
- }
- if (pri & LOGERR)
-- fprintf(l_fstream, "%s", _("error: "));
-+ fprintf(l_filestream, "%s", _("error: "));
- else if (pri & LOGWARN)
-- fprintf(l_fstream, "%s", _("warn: "));
-+ fprintf(l_filestream, "%s", _("warn: "));
-
-- fprintf(l_fstream, "%s", buf);
-- vfprintf(l_fstream, fmt, args);
-- fflush(l_fstream);
-+ fprintf(l_filestream, "%s", buf);
-+ vfprintf(l_filestream, fmt, args);
-+ fflush(l_filestream);
- }
- }
-
- if (pri & LOGDIE) {
- char msg[1024];
- n_snprintf(msg, sizeof(msg), fmt, args);
-- say_goodbye(msg);
-- abort();
-+ if (poldek_log_say_goodbye(msg))
-+ abort();
- }
- }
-
-@@ -222,19 +221,20 @@
- if (l_stream != NULL && is_not_stdstream)
- fclose(l_stream);
-
-- if (l_fstream)
-- fclose(l_fstream);
-+ if (l_filestream)
-+ fclose(l_filestream);
-
- l_stream = tty;
-+
- if (pathname)
-- l_fstream = fopen(pathname, "a");
-+ l_filestream = fopen(pathname, "a");
-
- l_prefix[0] = '\0';
- if (prefix)
- snprintf(l_prefix, sizeof(l_prefix), "%s:", prefix);
-
- if (pathname)
-- return l_fstream != NULL;
-+ return l_filestream != NULL;
- return 1;
- }
-
-@@ -246,9 +246,9 @@
-
- l_stream = NULL;
-
-- if (l_fstream) {
-- fclose(l_fstream);
-- l_fstream = NULL;
-+ if (l_filestream) {
-+ fclose(l_filestream);
-+ l_filestream = NULL;
- }
- }
-
-@@ -261,12 +261,12 @@
-
- FILE *poldek_log_file_stream(void)
- {
-- return l_fstream;
-+ return l_filestream;
- }
-
- int poldek_log_enabled_filelog(void)
- {
-- return l_fstream != NULL;
-+ return l_filestream != NULL;
- }
-
- static
-@@ -294,27 +294,3 @@
- fflush(l_stream);
- }
-
--#if 0
--static char *text_wrap(char *dest, int size, const char *text, int tolen)
--{
-- char *p, *q;
-- int n = 0;
--
--
-- p = dest;
-- while (*p) {
-- n++;
-- if (isspace(*p))
-- q = p;
--
-- if (len > tolen) {
-- if (isspace(*p))
-- dest = '\n';
-- else
-- dest
--
--
--
--}
--#endif
--
-diff -urN poldek-0.20.org/Makefile.am poldek-0.20/Makefile.am
---- poldek-0.20.org/Makefile.am 2005-10-28 18:06:59.000000000 +0200
-+++ poldek-0.20/Makefile.am 2006-07-26 20:25:54.155323250 +0200
-@@ -1,4 +1,4 @@
--# $Id$
-+# $Id$
-
- AUTOMAKE_OPTIONS =
- ACLOCAL_AMFLAGS = -I m4
-@@ -16,7 +16,7 @@
-
- POD2MAN = @POD2MAN@
-
--libVERINFO = 0:0:0
-+libVERINFO = 1:0:1
- lib_LTLIBRARIES = libpoldek.la
- noinst_LTLIBRARIES = libpoldek_allsym.la
-
-@@ -43,7 +43,7 @@
- pkgset-install.c \
- dbdep.c dbdep.h \
- arg_packages.c arg_packages.h \
-- conf.c conf.h \
-+ conf.c conf.h conf_intern.h conf_sections.c \
- dbpkgset.c dbpkgset.h \
- split.c split.h \
- pkgroup.c pkgroup.h \
-@@ -110,6 +110,9 @@
- $(MAKE) -C doc NEWS
- cp doc/NEWS .
-
-+conf_sections.c: doc/poldek.conf.xml doc/*.xsl
-+ doc/conf-xml2.sh c doc/poldek.conf.xml > $@
-+
- vfjuggle:
-
- dist-hook:
-diff -urN poldek-0.20.org/make.sh poldek-0.20/make.sh
---- poldek-0.20.org/make.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/make.sh 2006-07-26 20:25:54.155323250 +0200
-@@ -0,0 +1,4 @@
-+#!/bin/sh
-+
-+cd $(dirname $0) || exit 1
-+make CFLAGS="-fno-builtin-log -O0 -g -Wall -W -pipe -std=gnu99" $@
-diff -urN poldek-0.20.org/misc.c poldek-0.20/misc.c
---- poldek-0.20.org/misc.c 2005-07-21 20:06:41.000000000 +0200
-+++ poldek-0.20/misc.c 2006-07-26 20:25:54.163323750 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -578,20 +578,29 @@
- return val;
- }
-
--
--const char *expand_env_vars(char *dest, int size, const char *str)
-+const char *poldek_util_expand_vars(char *dest, int size, const char *src,
-+ char varmark, tn_hash *varh, unsigned flags)
- {
- const char **tl, **tl_save;
-+ tn_array *usedvars = NULL;
-+ char smark[16];
- int n = 0;
-
-+ if (varmark == '\0')
-+ varmark = '$';
-+
-+ n_snprintf(smark, sizeof(smark), "%c", varmark);
-
-- tl = tl_save = n_str_tokl(str, "$");
-- if (*str != '$' && tl[1] == NULL) {
-+ tl = tl_save = n_str_tokl(src, smark);
-+ if (*src != varmark && tl[1] == NULL) {
- n_str_tokl_free(tl);
-- return str;
-+ return src;
- }
-+
-+ if (flags & POLDEK_UTIL_EXPANDVARS_RMUSED)
-+ usedvars = n_array_new(16, free, (tn_fn_cmp)strcmp);
-
-- if (*str != '$') {
-+ if (*src != varmark) {
- n = n_snprintf(dest, size, *tl);
- tl++;
- }
-@@ -621,13 +630,24 @@
- vv++;
-
- if (v_len + 1 > (int)sizeof(val))
-- return str;
-+ return src;
-
- n_snprintf(val, v_len + 1, v);
-- DBGF("env %s\n", val);
-+ DBGF("var %c{%s}\n", varmark, val);
-+
-+ var = NULL;
-+ if (varh && varmark != '$') {
-+ var = n_hash_get(varh, val);
-+ if (usedvars)
-+ n_array_push(usedvars, n_strdup(val));
-
-- if ((var = get_env(buf, sizeof(buf), val)) == NULL) {
-- n += n_snprintf(&dest[n], size - n, "$%s", p);
-+ } else if (varmark == '$') {
-+ var = get_env(buf, sizeof(buf), val);
-+
-+ }
-+
-+ if (var == NULL) {
-+ n += n_snprintf(&dest[n], size - n, "%c%s", varmark, p);
-
- } else {
- n += n_snprintf(&dest[n], size - n, "%s", var);
-@@ -636,9 +656,26 @@
- }
-
- n_str_tokl_free(tl_save);
-+
-+ if (usedvars) { /* RMUSED is requested */
-+ int i;
-+
-+ n_array_sort(usedvars);
-+ n_array_uniq(usedvars);
-+ for (i=0; i < n_array_size(usedvars); i++)
-+ n_hash_remove(varh, n_array_nth(usedvars, i));
-+ }
-+
- return dest;
- }
-
-+
-+
-+const char *poldek_util_expand_env_vars(char *dest, int size, const char *str)
-+{
-+ return poldek_util_expand_vars(dest, size, str, '$', NULL, 0);
-+}
-+
- const char *abs_path(char *buf, int size, const char *path)
- {
-
-@@ -818,6 +855,18 @@
- return -1;
- }
-
-+int poldek_util_parse_bool3(const char *v)
-+{
-+ int rv = -1;
-+
-+ if ((rv = poldek_util_parse_bool(v)) == -1) {
-+ if (strcasecmp(v, "auto") == 0 || strcasecmp(v, "a"))
-+ rv = 2;
-+ }
-+
-+ return rv;
-+}
-+
-
- char *strtime_(time_t t)
- {
-diff -urN poldek-0.20.org/misc.h poldek-0.20/misc.h
---- poldek-0.20.org/misc.h 2005-05-18 21:43:08.000000000 +0200
-+++ poldek-0.20/misc.h 2006-07-26 20:25:54.163323750 +0200
-@@ -1,4 +1,4 @@
--/* $Id$ */
-+/* $Id$ */
- #ifndef POLDEK_MISC_H
- #define POLDEK_MISC_H
-
-@@ -33,7 +33,6 @@
- char *setup_cachedir(const char *path);
- const char *tmpdir(void);
-
--const char *expand_env_vars(char *dest, int size, const char *str);
-
- void die(void);
-
-diff -urN poldek-0.20.org/mkpackagedir poldek-0.20/mkpackagedir
---- poldek-0.20.org/mkpackagedir 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/mkpackagedir 2006-07-26 20:25:54.167324000 +0200
-@@ -0,0 +1,41 @@
-+#!/bin/sh
-+# $Id$
-+
-+PATH="/bin:/usr/bin:/usr/sbin:/sbin"
-+NAME=packages.dir.gz
-+
-+usage()
-+{
-+ echo "usage: `basename $0` [--nodiff] DIR..."
-+}
-+
-+if [ "$#" = 0 ]; then
-+ usage
-+ exit 1
-+fi
-+
-+nodiff=""
-+while [ $# -gt 0 ]; do
-+ if [ "$1" == "--nodiff" ]; then
-+ nodiff="--nodiff"
-+ shift
-+ continue
-+ fi
-+
-+ if [ ! -d "$1" ]; then
-+ echo "$1: no such directory"
-+ exit 1
-+ fi
-+
-+ poldek --noconf -s "$1" --mkidxz
-+
-+ if [ $? -ne 0 ]; then
-+ exit 1
-+ fi
-+
-+ if [ ! -f "$1/$NAME" ]; then
-+ exit 1
-+ fi
-+
-+ shift
-+done
-diff -urN poldek-0.20.org/pkg.c poldek-0.20/pkg.c
---- poldek-0.20.org/pkg.c 2005-10-13 20:24:49.000000000 +0200
-+++ poldek-0.20/pkg.c 2006-07-26 20:25:54.175324500 +0200
-@@ -1,5 +1,5 @@
- /*
-- Copyright (C) 2000 - 2004 Pawel A. Gajda <mis@k2.net.pl>
-+ Copyright (C) 2000 - 2006 Pawel A. Gajda (mis@k2.net.pl)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2 as
-@@ -15,7 +15,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -215,7 +215,6 @@
-
- len += len + 1; /* for id (nvr) */
-
--
- if (poldek_conf_MULTILIB && arch) {
- arch_len = strlen(arch);
- len += arch_len + 1;
-@@ -356,7 +355,7 @@
- {
- #if ENABLE_TRACE
- if (strcmp(pkg->name, "poldek") == 0) {
-- DBGF_F("%p %s (pdir %s, na->refcnt=%d), refcnt=%d (%p)\n",
-+ DBGF("%p %s (pdir %s, na->refcnt=%d), refcnt=%d (%p)\n",
- pkg, pkg_snprintf_s(pkg),
- pkg->pkgdir ? pkgdir_idstr(pkg->pkgdir) : "<none>",
- pkg->na ? pkg->na->_refcnt : -1,
-@@ -694,8 +693,8 @@
- int n;
-
- DBGF("\npkg_caps_match_req %s %s\n", pkg_snprintf_s(pkg),
-- capreq_snprintf_s(req));
--
-+ capreq_snprintf_s(req));
-+
- if (pkg->caps == NULL || n_array_size(pkg->caps) == 0)
- return 0; /* not match */
-
-@@ -703,40 +702,25 @@
- return 0;
-
- } else {
-- struct capreq *cap;
- int i;
-+ for (i = n; i < n_array_size(pkg->caps); i++) {
-+ struct capreq *cap = n_array_nth(pkg->caps, i);
-
-- cap = n_array_nth(pkg->caps, n);
-- if (cap_xmatch_req(cap, req, flags)) {
-- DBGF("chk%d (%s-%s-%s) -> match (flags=%d)\n", n, capreq_name(cap),
-- capreq_ver(cap), capreq_rel(cap), flags);
-- return 1;
-- }
-- n++;
--
-- for (i = n; i<n_array_size(pkg->caps); i++) {
-- struct capreq *cap;
--
-- cap = n_array_nth(pkg->caps, n);
-- if (strcmp(capreq_name(cap), capreq_name(req)) != 0) {
-- DBGF("chk%d %s-%s-%s -> NOT match IRET\n", i,
-- capreq_name(cap), capreq_ver(cap),
-- capreq_rel(cap));
-+ /* names not equal -> return with false;
-+ eq test omitting for first cap */
-+ if (i > n && n_str_ne(capreq_name(cap), capreq_name(req))) {
-+ DBGF(" cap[%d] %s -> NOT match, IRET\n", i,
-+ capreq_snprintf_s(cap));
- return 0;
- }
--
--
-+
- if (cap_xmatch_req(cap, req, flags)) {
-- DBGMSG("chk %s-%s-%s -> match\n", capreq_name(cap),
-- capreq_ver(cap), capreq_rel(cap));
-+ DBGF(" cap[%d] %s -> match\n", i, capreq_snprintf_s(cap));
- return 1;
-- } else {
-- DBGMSG("chk%d %s-%s-%s -> NOT match\n", i,
-- capreq_name(cap), capreq_ver(cap),
-- capreq_rel(cap));
- }
-+
-+ DBGF(" cap[%d] %s -> NOT match\n", i, capreq_snprintf_s(cap));
- }
-- DBGMSG("NONE\n");
- }
-
- return 0;
-diff -urN poldek-0.20.org/pkgdir/metadata/load.c poldek-0.20/pkgdir/metadata/load.c
---- poldek-0.20.org/pkgdir/metadata/load.c 2005-10-18 20:01:35.000000000 +0200
-+++ poldek-0.20/pkgdir/metadata/load.c 2006-07-26 20:25:54.183325000 +0200
-@@ -1,4 +1,4 @@
--/* $Id$ */
-+/* $Id$ */
-
- #include <stdio.h>
- #include <stdint.h>
-@@ -134,7 +134,8 @@
- }
-
- //<rpm:entry name="glibc-devel" flags="LT" epoch="0" ver="2.2.3", rel="foo" pri="1" />
--static tn_array *load_caps(tn_alloc *na, tn_array *arr, xmlNode *node, unsigned cr_flags)
-+static tn_array *load_caps(tn_alloc *na, tn_array *arr, xmlNode *node,
-+ unsigned cr_flags)
- {
- if (arr == NULL)
- arr = capreq_arr_new(0);
-@@ -192,7 +193,8 @@
- return arr;
- }
-
--static struct pkg *load_package(tn_alloc *na, struct pkgroup_idx *pkgroups, xmlNode *node)
-+static struct pkg *load_package(tn_alloc *na, struct pkgroup_idx *pkgroups,
-+ xmlNode *node)
- {
- struct pkg pkg, *rpkg = NULL;
- char *arch;
-@@ -269,7 +271,8 @@
-
- else if (x_node_eq(n, "file")) {
- char *path = xmlNodeGetContent(n);
-- struct capreq *cr = capreq_new(na, path, 0, NULL, NULL, 0, 0);
-+ struct capreq *cr = capreq_new(na, path, 0, NULL,
-+ NULL, 0, 0);
- if (pkg.caps == NULL)
- pkg.caps = capreq_arr_new(0);
- n_array_push(pkg.caps, cr);
-diff -urN poldek-0.20.org/pkgdir/pdir/pdir_pkg_store.c poldek-0.20/pkgdir/pdir/pdir_pkg_store.c
---- poldek-0.20.org/pkgdir/pdir/pdir_pkg_store.c 2005-10-13 20:24:50.000000000 +0200
-+++ poldek-0.20/pkgdir/pdir/pdir_pkg_store.c 2006-07-26 20:25:54.183325000 +0200
-@@ -7,7 +7,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -132,7 +132,7 @@
- if (pkg->fn)
- n_buf_printf(nbuf, "n: %s\n", pkg->fn);
-
-- if (pkg->fmtime)
-+ if (pkg->fmtime && (flags & PKGSTORE_NOTIMESTAMP) == 0)
- n_buf_printf(nbuf, "t: %u\n", pkg->fmtime);
-
- n_buf_printf(nbuf, "F:\n");
-diff -urN poldek-0.20.org/pkgdir/pndir/pndir.c poldek-0.20/pkgdir/pndir/pndir.c
---- poldek-0.20.org/pkgdir/pndir/pndir.c 2005-10-21 17:38:28.000000000 +0200
-+++ poldek-0.20/pkgdir/pndir/pndir.c 2006-07-26 20:25:54.191325500 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -198,13 +198,14 @@
-
-
- static
--int open_dscr(struct pndir *idx, time_t ts, const char *lang)
-+struct tndb *do_open_dscr(struct pndir *idx, int vfmode, struct vfile **vf,
-+ time_t ts, const char *lang)
- {
- char buf[128], tmpath[PATH_MAX], tss[32];
- const char *suffix;
- char *idxpath;
- const char *dbid, *langid;
--
-+
- pndir_db_dscr_idstr(lang, &dbid, &langid);
-
- idxpath = idx->idxpath;
-@@ -244,24 +245,48 @@
-
- DBGF("mk %s, %s\n", idxpath, suffix);
- pndir_mkidx_pathname(tmpath, sizeof(tmpath), idxpath, suffix);
--
-+
-+ msgn(3, _("Opening %s..."), vf_url_slim_s(tmpath, 0));
-+ return do_dbopen(tmpath, vfmode, vf, idx->srcnam);
-+}
-+
-+
-+static
-+int open_dscr(struct pndir *idx, int vfmode, time_t ts, const char *lang)
-+{
-+ struct tndb *db = NULL;
-+ struct vfile *vf = NULL;
-+
- if (idx->db_dscr_h == NULL)
- idx->db_dscr_h = pndir_db_dscr_h_new();
-
-- if (!pndir_db_dscr_h_get(idx->db_dscr_h, lang)) {
-- struct tndb *db;
-+ if (pndir_db_dscr_h_get(idx->db_dscr_h, lang))
-+ return 1;
-+
-+ if ((db = do_open_dscr(idx, vfmode, &vf, ts, lang)) == NULL)
-+ return 0;
-+
-+ if (tndb_verify(db)) {
-+ pndir_db_dscr_h_insert(idx->db_dscr_h, lang, db);
-
-- msgn(3, _("Opening %s..."), vf_url_slim_s(tmpath, 0));
-- if ((db = do_dbopen(tmpath, idx->_vf->vf_mode, NULL, idx->srcnam))) {
-- if (tndb_verify(db))
-- pndir_db_dscr_h_insert(idx->db_dscr_h, lang, db);
-- else {
-- tndb_close(db);
-- logn(LOGERR, "%s: broken file", vf_url_slim_s(tmpath, 0));
-- }
-+ } else {
-+ logn(LOGERR, "%s: broken file", vf_url_slim_s(tndb_path(db), 0));
-+
-+ if (vf->vf_flags & VF_FRMCACHE) { /* not fully downloaded? */
-+ n_assert(vfmode & VFM_CACHE);
-+ vfmode &= ~VFM_CACHE;
-+ vfmode |= VFM_NODEL;
-+
-+ tndb_close(db);
-+ vfile_close(vf);
-+
-+ return open_dscr(idx, vfmode, ts, lang);
- }
-+ tndb_close(db);
- }
--
-+
-+ if (vf)
-+ vfile_close(vf);
- return pndir_db_dscr_h_get(idx->db_dscr_h, lang) != NULL;
- }
-
-@@ -291,8 +316,8 @@
- }
-
- static
--int pndir_open_verify(struct pndir *idx, const char *path, int vfmode, unsigned flags,
-- const char *srcnam)
-+int pndir_open_verify(struct pndir *idx, const char *path, int vfmode,
-+ unsigned flags, const char *srcnam)
- {
- int rc;
-
-@@ -514,12 +539,12 @@
- n_assert(loadC);
-
- if (loadC)
-- if (!open_dscr(&idx, pkgdir->orig_ts, "C"))
-+ if (!open_dscr(&idx, vfmode, pkgdir->orig_ts, "C"))
- nerr++;
-
- if (nerr == 0 && loadi18n) {
- n_assert(loadC);
-- if (!open_dscr(&idx, pkgdir->orig_ts, "i18n"))
-+ if (!open_dscr(&idx, vfmode, pkgdir->orig_ts, "i18n"))
- nerr++;
- }
- }
-diff -urN poldek-0.20.org/pkgdir/source.c poldek-0.20/pkgdir/source.c
---- poldek-0.20.org/pkgdir/source.c 2005-10-27 00:59:33.000000000 +0200
-+++ poldek-0.20/pkgdir/source.c 2006-07-26 20:25:54.199326000 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <string.h>
-@@ -1034,6 +1034,10 @@
- rc = 0;
- if (pkgdir_load(pkgdir, NULL, ldflags)) {
- n_assert((pkgdir->_ldflags & PKGDIR_LD_DOIGNORE) == 0);
-+
-+ if (kw && n_hash_exists(kw, "v018x"))
-+ cr_flags |= PKGDIR_CREAT_v018x;
-+
- rc = pkgdir_save_as(pkgdir, type, idxpath, cr_flags);
- }
-
-diff -urN poldek-0.20.org/pkgdir/source.h poldek-0.20/pkgdir/source.h
---- poldek-0.20.org/pkgdir/source.h 2005-05-05 20:54:32.000000000 +0200
-+++ poldek-0.20/pkgdir/source.h 2006-07-26 20:25:54.199326000 +0200
-@@ -1,4 +1,4 @@
--/* $Id$ */
-+/* $Id$ */
- #ifndef POLDEK_SOURCE_H
- #define POLDEK_SOURCE_H
-
-@@ -96,10 +96,7 @@
-
- int sources_clean(tn_array *sources, unsigned flags);
-
--#define PKGSOURCE_MKIDX_NODIFF (1 << 0)
--#define PKGSOURCE_MKIDX_COMPRESSED_GZ (1 << 1)
--#define PKGSOURCE_MKIDX_COMPRESSED_BZ2 (1 << 2)
--
-+/* flags = PKGDIR_CREAT_* */
- int source_make_idx(struct source *src, const char *stype,
- const char *dtype, const char *idxpath,
- unsigned flags, tn_hash *kw);
-diff -urN poldek-0.20.org/pkgfl.c poldek-0.20/pkgfl.c
---- poldek-0.20.org/pkgfl.c 2005-10-12 21:28:02.000000000 +0200
-+++ poldek-0.20/pkgfl.c 2006-07-26 20:25:54.207326500 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <stdlib.h>
-@@ -636,5 +636,65 @@
- return path;
- }
-
-+/* returns list of directories not belong to filelist itself */
-+int pkgfl_owned_and_required_dirs(tn_tuple *fl, tn_array **owned,
-+ tn_array **required)
-+{
-+ const char *dn = NULL;
-+ int i, dnlen, r;
-+ tn_array *od = NULL, *rd = NULL;
-+
-+ if (owned)
-+ od = n_array_new(n_tuple_size(fl), NULL, (tn_fn_cmp)strcmp);
-+
-+ if (required)
-+ rd = n_array_new(n_tuple_size(fl), NULL, (tn_fn_cmp)strcmp);
-+
-+ for (i=0; i < n_tuple_size(fl); i++) {
-+ struct pkgfl_ent *flent = n_tuple_nth(fl, i);
-+
-+ if (dn && strncmp(dn, flent->dirname, dnlen) == 0) {
-+ if (od)
-+ n_array_push(od, flent->dirname);
-+ continue;
-+ }
-+
-+ dn = flent->dirname;
-+ if (*dn == '/' && *(dn + 1) == '\0') {
-+ dn = "";
-+ dnlen = 0;
-+ continue;
-+ }
-+
-+ dnlen = strlen(dn);
-+ if (rd)
-+ n_array_push(rd, dn);
-+ }
-+
-+ r = 0;
-+ if (od) {
-+ *owned = od;
-+ for (i = 0; i < n_array_size(od); i++)
-+ printf("O %s\n", n_array_nth(od, i));
-+ r += i;
-+ }
-+
-+ if (rd) {
-+ *required = rd;
-+ for (i = 0; i < n_array_size(rd); i++)
-+ printf("R %s\n", n_array_nth(rd, i));
-+ r += i;
-+ }
-+ return r;
-+}
-+
-+tn_array *pkgfl_required_directories(tn_tuple *fl)
-+{
-+ tn_array *required = NULL;
-+
-+ pkgfl_owned_and_required_dirs(fl, NULL, &required);
-+
-+ return required;
-+}
-
-
-diff -urN poldek-0.20.org/pkgset.c poldek-0.20/pkgset.c
---- poldek-0.20.org/pkgset.c 2005-06-17 00:15:19.000000000 +0200
-+++ poldek-0.20/pkgset.c 2006-07-26 20:25:54.211326750 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <limits.h>
-@@ -136,9 +136,13 @@
- int pkgset_pmprovides(const struct pkgset *ps, const struct capreq *req)
- {
- struct capreq *cap;
--
-+
- if (ps->rpmcaps == NULL)
-- return 1; /* no caps -> assume yes */
-+ return 0; /* no caps -> assume NO */
-+
-+ /* internal caps have names like name(feature) */
-+ if (!capreq_is_rpmlib(req) && strstr(capreq_name(req), "(") == NULL)
-+ return 0;
-
- cap = n_array_bsearch_ex(ps->rpmcaps, req,
- (tn_fn_cmp)capreq_cmp_name);
-diff -urN poldek-0.20.org/pkgset-install.c poldek-0.20/pkgset-install.c
---- poldek-0.20.org/pkgset-install.c 2005-10-24 17:30:40.000000000 +0200
-+++ poldek-0.20/pkgset-install.c 2006-07-26 20:25:54.211326750 +0200
-@@ -11,7 +11,13 @@
- */
-
- /*
-- $Id$
-+ $Id$
-+*/
-+
-+/*
-+ Dependency resolver module.
-+ This file is going to be obsoleted soon, the same code splitted and
-+ partially redesigned was moved to install/ subdir
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -1174,7 +1180,9 @@
- memset(&successor, 0, sizeof(successor));
- if (process_as == PROCESS_AS_ORPHAN &&
- upg->ts->getop(upg->ts, POLDEK_OP_AGGREEDY)) {
-- if (pkg_drags(pkg, ps, upg) == 0) {
-+ int ndrags = pkg_drags(pkg, ps, upg);
-+ DBGF("%s, ndrags %d\n", pkg_id(pkg), ndrags);
-+ if (ndrags == 0 || 1) { /* XXX cond temporary disabled - needs test */
- struct pkg *p;
- int is_marked = 0, ndragged = 0, by_obsoletes = 0;
-
-@@ -1186,9 +1194,10 @@
- successor.realpkg = p;
- successor.by_obsoletes = by_obsoletes;
-
-- /* do not follow successor if package drags something and
-- is not marked */
-- if (p && (ndragged = pkg_drags(p, ps, upg)) > 0 && is_marked == 0) {
-+ /* do not follow successor if it drags more packages than orphaned one
-+ * and successor is not marked */
-+
-+ if (p && (ndragged = pkg_drags(p, ps, upg)) > ndrags && is_marked == 0) {
- DBGF("OMIT select_successor %s -> %s (%d)\n",
- pkg_id(pkg), pkg_id(p), ndragged);
- p = NULL;
-@@ -1240,7 +1249,8 @@
-
- DBGF("req %s\n", capreq_snprintf_s(req));
-
-- if (upg->ts->getop(upg->ts, POLDEK_OP_EQPKG_ASKUSER) && upg->ts->askpkg_fn)
-+ if (upg->ts->getop(upg->ts, POLDEK_OP_EQPKG_ASKUSER) &&
-+ upg->ts->askpkg_fn)
- tomark_candidates_ptr = &tomark_candidates;
-
- if (find_req(pkg, req, &tomark, tomark_candidates_ptr, ps, upg)) {
-@@ -1298,6 +1308,14 @@
- int n;
- n = upg->ts->askpkg_fn(capreq_snprintf_s(req),
- tomark_candidates, tomark);
-+
-+ if (n == -1) { /* user abort */
-+ free(tomark_candidates);
-+ tomark_candidates = NULL;
-+ upg->nerr_fatal++;
-+ return 0;
-+ }
-+
- real_tomark = tomark_candidates[n];
- free(tomark_candidates);
- tomark_candidates = NULL;
-@@ -1434,12 +1452,15 @@
-
- if (pkg->reqs)
- process_pkg_reqs(indent, pkg, ps, upg, process_as);
--
-+
- if (process_as == PROCESS_AS_NEW) {
- process_pkg_conflicts(indent, pkg, ps, upg);
- //process_pkg_obsl(pkg, ps, upg, indent);
- }
-
-+ if (upg->nerr_fatal || sigint_reached())
-+ return 0;
-+
- DBGF("END PROCESSING [%d] %s as %s\n", indent, pkg_id(pkg),
- process_as == PROCESS_AS_NEW ? "NEW" : "ORPHAN");
-
-@@ -1529,7 +1550,14 @@
- struct pkg *real_tomark = tomark;
- if (tomark_candidates) {
- int n;
-- n = upg->ts->askpkg_fn(capreq_snprintf_s(req), tomark_candidates, tomark);
-+ n = upg->ts->askpkg_fn(capreq_snprintf_s(req), tomark_candidates,
-+ tomark);
-+ if (n == -1) {
-+ n_cfree(&tomark_candidates);
-+ upg->nerr_fatal++;
-+ goto l_end;
-+ }
-+
- real_tomark = tomark_candidates[n];
- n_cfree(&tomark_candidates);
- }
-@@ -1805,6 +1833,9 @@
-
- db = upg->ts->db;
-
-+ if (upg->nerr_fatal || sigint_reached())
-+ return 0;
-+
- if (!upg->ts->getop(upg->ts, POLDEK_OP_CONFLICTS))
- return 1;
-
-@@ -1847,7 +1878,9 @@
- if (n)
- pkg_set_unmetdeps(upg->unmetpms, pkg);
- }
--
-+
-+ if (upg->nerr_fatal || sigint_reached())
-+ return 0;
-
- if (pkg->cnfls != NULL)
- for (i = 0; i < n_array_size(pkg->cnfls); i++) {
-@@ -2314,103 +2347,8 @@
- return nmarked;
- }
-
--static
--int prepare_icap(struct poldek_ts *ts, const char *capname, tn_array *pkgs)
--{
-- int i, found = 0;
-- tn_array *dbpkgs;
-- struct capreq *cap;
--
-- capreq_new_name_a(capname, cap);
-- dbpkgs = pkgdb_get_provides_dbpkgs(ts->db, cap, NULL, 0);
-- if (dbpkgs == NULL) {
-- struct pkg *pkg;
-- if (ts->getop(ts, POLDEK_OP_FRESHEN))
-- return 0;
--
-- n_array_sort_ex(pkgs, (tn_fn_cmp)pkg_cmp_name_evr_rev);
-- pkg = n_array_nth(pkgs, 0);
-- pkg_hand_mark(ts->pms, pkg);
-- return 1;
-- }
--
-- n_array_sort_ex(pkgs, (tn_fn_cmp)pkg_cmp_name_evr_rev);
-- for (i=0; i < n_array_size(dbpkgs); i++) {
-- struct pkg *dbpkg = n_array_nth(dbpkgs, i);
-- int n = n_array_bsearch_idx_ex(pkgs, dbpkg,
-- (tn_fn_cmp)pkg_cmp_name);
--
-- DBGF("%s: %s\n", capname, pkg_id(dbpkg));
--
-- if (n < 0)
-- continue;
--
-- for (; n < n_array_size(pkgs); n++) {
-- struct pkg *pkg = n_array_nth(pkgs, n);
-- int cmprc, mark = 0;
--
-- DBGF("%s: %s cmp %s\n", capname, pkg_id(pkg),
-- pkg_id(dbpkg));
-- if (pkg_cmp_name(pkg, dbpkg) != 0)
-- break;
--
-- cmprc = pkg_cmp_name_evr(pkg, dbpkg);
-- if (cmprc > 0)
-- mark = 1;
--
-- else if (cmprc == 0 && poldek_ts_issetf(ts, POLDEK_TS_REINSTALL))
-- mark = 1;
--
-- else if (cmprc < 0 && poldek_ts_issetf(ts, POLDEK_TS_DOWNGRADE))
-- mark = 1;
--
-- if (mark) {
-- found = 1;
-- msgn(1, _("%s: marked as %s's provider"), pkg_id(pkg),
-- capname);
--
-- pkg_hand_mark(ts->pms, pkg);
-- goto l_end;
--
-- } else if (cmprc <= 0) {
-- char *eqs = cmprc == 0 ? "equal" : "newer";
-- msgn(1, _("%s: %s version of %s is installed (%s), skipped"),
-- capname, eqs, pkg_id(dbpkg),
-- pkg_id(pkg));
--
-- } else {
-- n_assert(0);
--
-- }
-- }
-- }
--l_end:
-- if (dbpkgs)
-- n_array_free(dbpkgs);
--
-- return found;
--}
--
--static
--int prepare_icaps(struct poldek_ts *ts)
--{
-- tn_array *keys;
-- tn_hash *icaps;
-- int i;
--
-- icaps = arg_packages_get_resolved_caps(ts->aps);
-- keys = n_hash_keys_cp(icaps);
-- for (i=0; i < n_array_size(keys); i++) {
-- const char *cap = n_array_nth(keys, i);
-- tn_array *pkgs = n_hash_get(icaps, cap);
-- prepare_icap(ts, cap, pkgs);
-- }
-- n_array_free(keys);
-- n_hash_free(icaps);
-- return 1;
--}
--
--
-+/* use install/ in_prepare_icaps() */
-+extern int in_prepare_icaps(struct poldek_ts *ts);
-
- int do_poldek_ts_install(struct poldek_ts *ts, struct poldek_iinf *iinf)
- {
-@@ -2421,7 +2359,9 @@
-
- n_assert(ts->type == POLDEK_TS_INSTALL);
-
-- prepare_icaps(ts);
-+ if (in_prepare_icaps(ts) == -1) /* user abort */
-+ return 1;
-+
- if (unmark_name_dups(ts->pms, ps->pkgs) == 0) {
- msgn(1, _("Nothing to do"));
- return 1;
-diff -urN poldek-0.20.org/pkgset-req.c poldek-0.20/pkgset-req.c
---- poldek-0.20.org/pkgset-req.c 2005-10-20 19:27:27.000000000 +0200
-+++ poldek-0.20/pkgset-req.c 2006-07-26 20:25:54.219327250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <limits.h>
-@@ -332,32 +332,25 @@
- n_assert(0);
- */
-
-- if (capreq_is_rpmlib(req)) {
-- if (matched) {
-- int i;
-+ if (capreq_is_rpmlib(req) && matched) {
-+ int i;
-
-- for (i=0; i<*npkgs; i++) {
-- if (strcmp((*suspkgs)[i]->name, "rpm") != 0) {
-- logn(LOGERR, _("%s: provides rpmlib cap \"%s\""),
-- pkg_snprintf_s((*suspkgs)[i]), reqname);
-- matched = 0;
-- }
-+ for (i=0; i<*npkgs; i++) {
-+ if (strcmp((*suspkgs)[i]->name, "rpm") != 0) {
-+ logn(LOGERR, _("%s: provides rpmlib cap \"%s\""),
-+ pkg_snprintf_s((*suspkgs)[i]), reqname);
-+ matched = 0;
- }
- }
-+
-+ *suspkgs = NULL;
-+ *npkgs = 0;
-+ }
-
-- if (pkgset_pmprovides(ps, req)) {
-- matched = 1;
-- capreq_set_satisfied(req);
-- msg(4, " req %-35s --> PM_CAP\n", capreq_snprintf_s(req));
-- }
--#if 0
--DUPA
-- if (!matched && (ps->flags & (PSMODE_VERIFY | PSMODE_MKIDX))) {
-- matched = 1;
-- logn(LOGWARN, "%s: not found (poldek needs to be linked with newer"
-- " rpmlib)\n", capreq_snprintf_s(req));
-- }
--#endif
-+ if (!matched && pkgset_pmprovides(ps, req)) {
-+ matched = 1;
-+ capreq_set_satisfied(req);
-+ msg(4, " req %-35s --> PM_CAP\n", capreq_snprintf_s(req));
-
- *suspkgs = NULL;
- *npkgs = 0;
-@@ -407,7 +400,7 @@
- return nmatch;
- }
-
--
-+/* find packages satisfies req and (optionally) best fitted to pkg */
- int psreq_find_match_packages(struct pkgset *ps,
- const struct pkg *pkg, struct capreq *req,
- struct pkg ***packages, int *npackages,
-@@ -431,7 +424,7 @@
-
- found = 0;
-
-- if (poldek_conf_MULTILIB) {
-+ if (poldek_conf_MULTILIB && pkg) {
- struct pkg **tmp = alloca(sizeof(*tmp) * nsuspkgs);
- int i, j = 0;
-
-diff -urN poldek-0.20.org/pkgu.c poldek-0.20/pkgu.c
---- poldek-0.20.org/pkgu.c 2005-10-18 20:01:34.000000000 +0200
-+++ poldek-0.20/pkgu.c 2006-07-26 20:25:54.219327250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <ctype.h>
-@@ -337,7 +337,7 @@
- }
-
- pkgu->vendor = cp_tag(pkgu->_na, h, RPMTAG_VENDOR);
-- pkgu->license = cp_tag(pkgu->_na, h, RPMTAG_COPYRIGHT);
-+ pkgu->license = cp_tag(pkgu->_na, h, PM_RPMTAG_LICENSE);
- pkgu->url = cp_tag(pkgu->_na, h, RPMTAG_URL);
- pkgu->distro = cp_tag(pkgu->_na, h, RPMTAG_DISTRIBUTION);
- pkgu->buildhost = cp_tag(pkgu->_na, h, RPMTAG_BUILDHOST);
-@@ -370,7 +370,7 @@
- headerAddEntry(hdr, RPMTAG_VENDOR, RPM_STRING_TYPE, pkgu->vendor, 1);
-
- if (pkgu->license)
-- headerAddEntry(hdr, RPMTAG_COPYRIGHT, RPM_STRING_TYPE, pkgu->license, 1);
-+ headerAddEntry(hdr, PM_RPMTAG_LICENSE, RPM_STRING_TYPE, pkgu->license, 1);
-
- if (pkgu->url)
- headerAddEntry(hdr, RPMTAG_URL, RPM_STRING_TYPE, pkgu->url, 1);
-diff -urN poldek-0.20.org/pm/mod.h poldek-0.20/pm/mod.h
---- poldek-0.20.org/pm/mod.h 2005-10-24 11:37:32.000000000 +0200
-+++ poldek-0.20/pm/mod.h 2006-07-26 20:25:54.227327750 +0200
-@@ -22,6 +22,7 @@
- void *(*init)(void);
- void (*destroy)(void *modh);
- int (*configure)(void *modh, const char *key, void *val);
-+ int (*conf_get)(void *modh, const char *key, char *value, int vsize);
-
- tn_array *(*pm_caps)(void *modh);
- char *(*dbpath)(void *modh, char *path, size_t size);
-diff -urN poldek-0.20.org/pm/pkgdb.c poldek-0.20/pm/pkgdb.c
---- poldek-0.20.org/pm/pkgdb.c 2005-10-24 17:25:58.000000000 +0200
-+++ poldek-0.20/pm/pkgdb.c 2006-07-26 20:25:54.235328250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <stdlib.h>
-@@ -440,6 +440,9 @@
- tn_array *unistdbpkgs, unsigned ldflags)
- {
- tn_array *dbpkgs = NULL;
-+
-+ n_assert(db);
-+ n_assert(cap);
- pkgdb_search(db, &dbpkgs, PMTAG_CAP, capreq_name(cap),
- unistdbpkgs, ldflags);
- return dbpkgs;
-diff -urN poldek-0.20.org/pm/pm.c poldek-0.20/pm/pm.c
---- poldek-0.20.org/pm/pm.c 2005-05-15 17:48:46.000000000 +0200
-+++ poldek-0.20/pm/pm.c 2006-07-26 20:25:54.235328250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <sys/param.h> /* for PATH_MAX */
-@@ -161,4 +161,13 @@
- return 0;
- }
-
-+int pm_conf_get(struct pm_ctx *ctx, const char *key, char *val, int vsize)
-+{
-+ if (ctx->mod->conf_get)
-+ return ctx->mod->conf_get(ctx->modh, key, val, vsize);
-+
-+ return 0;
-+}
-+
-+
-
-diff -urN poldek-0.20.org/pm/pm.h poldek-0.20/pm/pm.h
---- poldek-0.20.org/pm/pm.h 2005-10-24 17:12:32.000000000 +0200
-+++ poldek-0.20/pm/pm.h 2006-07-26 20:25:54.235328250 +0200
-@@ -21,6 +21,8 @@
- void pm_free(struct pm_ctx *ctx);
-
- int pm_configure(struct pm_ctx *ctx, const char *key, void *val);
-+int pm_conf_get(struct pm_ctx *ctx, const char *key, char *value, int vsize);
-+
- const char *pm_get_name(struct pm_ctx *ctx);
-
-
-diff -urN poldek-0.20.org/pm/pset/mod.c poldek-0.20/pm/pset/mod.c
---- poldek-0.20.org/pm/pset/mod.c 2005-10-24 11:49:07.000000000 +0200
-+++ poldek-0.20/pm/pset/mod.c 2006-07-26 20:25:54.243328750 +0200
-@@ -6,7 +6,7 @@
- 0, "pset",
- pm_pset_init, pm_pset_destroy,
- pm_pset_configure,
--
-+ NULL,
- NULL,
-
- // pm_pset_dbpath,
-diff -urN poldek-0.20.org/pm/rpm/misc.c poldek-0.20/pm/rpm/misc.c
---- poldek-0.20.org/pm/rpm/misc.c 2005-05-13 20:15:53.000000000 +0200
-+++ poldek-0.20/pm/rpm/misc.c 2006-07-26 20:25:54.247329000 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -23,6 +23,9 @@
- #include <string.h>
-
- #include <rpm/rpmlib.h>
-+#if HAVE_RPMDSRPMLIB
-+# include <rpm/rpmds.h>
-+#endif
-
- #include <trurl/nassert.h>
- #include <trurl/nstr.h>
-@@ -33,23 +36,88 @@
- #include "log.h"
- #include "pm/pm.h"
-
--tn_array *pm_rpm_rpmlib_caps(void)
-+#if HAVE_RPMDSRPMLIB /* rpmdsRpmlib() => rpm >= 4.4.3 */
-+
-+static int extract_rpmds(tn_array *caps, rpmds ds)
-+{
-+ ds = rpmdsInit(ds);
-+ while (rpmdsNext(ds) >= 0) {
-+ const char *name, *evr;
-+ char tmp[256], *tmpptr;
-+ struct capreq *cr;
-+ uint32_t flags, crflags;
-+
-+ name = rpmdsN(ds);
-+ evr = rpmdsEVR(ds);
-+ flags = rpmdsFlags(ds);
-+
-+ if ((flags & RPMSENSE_EQUAL)) {
-+ n_strncpy(tmp, evr, 128);
-+ tmpptr = tmp;
-+ crflags = REL_EQ;
-+
-+ } else { /* cap without version */
-+ tmpptr = NULL;
-+ crflags = 0;
-+ }
-+
-+ cr = capreq_new_evr(name, tmpptr, crflags, 0);
-+ if (cr) {
-+ msgn(3, " - %s", capreq_snprintf_s(cr));
-+ n_array_push(caps, cr);
-+ }
-+ }
-+ ds = rpmdsFree(ds);
-+ return n_array_size(caps);
-+}
-+
-+typedef int (*rpmcap_fn)(rpmds *ds, void *);
-+
-+static int get_rpmlib_caps(tn_array *caps)
-+{
-+ rpmds ds = NULL;
-+ int i;
-+ rpmcap_fn functions[] = {
-+ rpmdsRpmlib,
-+#ifdef HAVE_RPMDSCPUINFO
-+ (rpmcap_fn)rpmdsCpuinfo,
-+#endif
-+#ifdef HAVE_RPMDSGETCONF
-+ (rpmcap_fn)rpmdsGetconf,
-+#endif
-+#ifdef HAVE_RPMDSSYSINFO
-+ (rpmcap_fn)rpmdsSysinfo,
-+#endif
-+#ifdef HAVE_RPMDSUNAME
-+ (rpmcap_fn)rpmdsUname,
-+#endif
-+ NULL,
-+ };
-+
-+ i = 0;
-+ msgn(3, "Loading internal capabilities");
-+ while (functions[i]) {
-+ functions[i++](&ds, NULL);
-+ }
-+
-+ return extract_rpmds(caps, ds);
-+}
-+
-+#endif /* HAVE_RPMDSRPMLIB */
-+
-+#if HAVE_RPMGETRPMLIBPROVIDES /* rpmGetRpmlibProvides() => rpm < 4.4.3 */
-+static int get_rpmlib_caps_rpm_lt_4_4_3(tn_array *caps)
- {
- char **names = NULL, **versions = NULL, *evr;
- int *flags = NULL, n = 0, i;
-- tn_array *caps;
--
--#if HAVE_RPMGETRPMLIBPROVIDES
-+
-+ n_assert(caps);
- n = rpmGetRpmlibProvides((const char ***)&names, &flags, (const char ***)&versions);
--#endif
--
- if (n <= 0)
-- return NULL;
-+ return 0;
-
-- caps = capreq_arr_new(0);
--
- evr = alloca(128);
--
-+
- for (i=0; i<n; i++) {
- struct capreq *cr;
-
-@@ -62,19 +130,39 @@
- n_array_push(caps, cr);
- }
-
-- if (names)
-- free(names);
--
-- if (flags)
-- free(flags);
-+ n_cfree(&names);
-+ n_cfree(&flags);
-+ n_cfree(&versions);
-+ return 1;
-+}
-+#endif
-
-- if (versions)
-- free(versions);
-+tn_array *pm_rpm_rpmlib_caps(void)
-+{
-+ tn_array *caps;
-+ int rc = 0;
-+
-+ caps = capreq_arr_new(0);
-+
-+#if HAVE_RPMDSRPMLIB /* rpm >= 4.4.3 */
-+ rc = get_rpmlib_caps(caps);
-+#else
-+# if HAVE_RPMGETRPMLIBPROVIDES
-+ rc = get_rpmlib_caps_rpm_lt_4_4_3(caps);
-+# endif
-+#endif
-
-- n_array_sort(caps);
-+ if (rc) {
-+ n_array_sort(caps);
-+
-+ } else {
-+ n_array_free(caps);
-+ caps = NULL;
-+ }
- return caps;
- }
-
-+
- const char *pm_rpm_get_arch(void *pm_rpm)
- {
- pm_rpm = pm_rpm;
-diff -urN poldek-0.20.org/pm/rpm/mod.c poldek-0.20/pm/rpm/mod.c
---- poldek-0.20.org/pm/rpm/mod.c 2004-10-10 17:31:22.000000000 +0200
-+++ poldek-0.20/pm/rpm/mod.c 2006-07-26 20:25:54.255329500 +0200
-@@ -6,8 +6,9 @@
- 0, "rpm",
- (void *(*)(void))pm_rpm_init, pm_rpm_destroy,
- pm_rpm_configure,
-- pm_rpm_rpmlib_caps,
--
-+ pm_rpm_conf_get,
-+
-+ pm_rpm_rpmlib_caps, /* XXX: TODO replace with pm_rpm_conf_get() */
- pm_rpm_dbpath,
- pm_rpm_dbmtime,
- pm_rpm_dbdepdirs,
-diff -urN poldek-0.20.org/pm/rpm/pm_rpm.h poldek-0.20/pm/rpm/pm_rpm.h
---- poldek-0.20.org/pm/rpm/pm_rpm.h 2005-10-24 11:39:29.000000000 +0200
-+++ poldek-0.20/pm/rpm/pm_rpm.h 2006-07-26 20:25:54.255329500 +0200
-@@ -10,6 +10,14 @@
- # include <rpm/rpmts.h>
- #endif
-
-+/* RPMTAG_COPYRIGHT disappears in 4.4.3 but don't know from
-+ when RPMTAG_LICENSE starts */
-+#ifdef RPMTAG_COPYRIGHT
-+# define PM_RPMTAG_LICENSE RPMTAG_COPYRIGHT
-+#else
-+# define PM_RPMTAG_LICENSE RPMTAG_LICENSE
-+#endif
-+
- #include <trurl/trurl.h>
- #include "poldek.h"
- #include "pm/pm.h"
-@@ -25,6 +33,8 @@
- void *pm_rpm_init(void);
- void pm_rpm_destroy(void *pm_rpm);
- int pm_rpm_configure(void *modh, const char *key, void *val);
-+int pm_rpm_conf_get(void *pm_rpm, const char *key, char *value, int vsize);
-+
- tn_array *pm_rpm_rpmlib_caps(void *pm_rpm);
- const char *pm_rpm_get_arch(void *pm_rpm);
-
-diff -urN poldek-0.20.org/pm/rpm/rpm.c poldek-0.20/pm/rpm/rpm.c
---- poldek-0.20.org/pm/rpm/rpm.c 2005-10-08 02:05:46.000000000 +0200
-+++ poldek-0.20/pm/rpm/rpm.c 2006-07-26 20:25:54.263330000 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -146,6 +146,26 @@
- return 1;
- }
-
-+int pm_rpm_conf_get(void *pm_rpm, const char *key, char *value, int vsize)
-+{
-+ int n = 0;
-+
-+ pm_rpm = pm_rpm;
-+
-+ if (*key == '%') {
-+ char *v = rpmExpand(key, NULL);
-+
-+ if (v == NULL)
-+ return 0;
-+
-+ if (strlen(v)) /* rpmExpand returns empty strings */
-+ n = n_snprintf(value, vsize, "%s", v);
-+
-+ free(v);
-+ }
-+
-+ return n;
-+}
-
-
- static int db_exists(void *pm_rpm, const char *rootdir, const char *dbpath)
-diff -urN poldek-0.20.org/po/POTFILES.in poldek-0.20/po/POTFILES.in
---- poldek-0.20.org/po/POTFILES.in 2005-10-23 15:45:26.000000000 +0200
-+++ poldek-0.20/po/POTFILES.in 2006-07-26 20:25:54.263330000 +0200
-@@ -118,11 +118,9 @@
- vfile/p_open.c
- vfile/sample.c
- vfile/test_progress.c
--vfile/test_vfile.c
- vfile/test_vopen3.c
- vfile/testcookie.c
- vfile/ttest.c
--vfile/vfcurl.c
- vfile/vfetch.c
- vfile/vfff/base64.c
- vfile/vfff/ftp.c
-diff -urN poldek-0.20.org/poldek_intern.h poldek-0.20/poldek_intern.h
---- poldek-0.20.org/poldek_intern.h 2005-10-21 01:01:10.000000000 +0200
-+++ poldek-0.20/poldek_intern.h 2006-07-26 20:25:54.263330000 +0200
-@@ -27,7 +27,7 @@
- unsigned ps_setup_flags;
- struct pkgset *ps;
- struct pm_ctx *pmctx;
--
-+ int _rpm_tscolor; /* rpm transaction color */
- // tn_array *inst_pkgs; /* array of installed packages */
- // time_t ts_instpkgs; /* inst_pkgs timestamp */
-
-diff -urN poldek-0.20.org/poldek_ts.c poldek-0.20/poldek_ts.c
---- poldek-0.20.org/poldek_ts.c 2005-10-26 16:41:05.000000000 +0200
-+++ poldek-0.20/poldek_ts.c 2006-07-26 20:25:54.271330500 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <stdarg.h>
-@@ -1036,6 +1036,7 @@
-
- if (rc && !ts->getop(ts, POLDEK_OP_RPMTEST))
- pkgdb_tx_commit(ts->db);
-+
- pkgdb_free(ts->db);
- ts->db = NULL;
- return rc;
-diff -urN poldek-0.20.org/poldek_ts.h poldek-0.20/poldek_ts.h
---- poldek-0.20.org/poldek_ts.h 2005-07-10 14:38:13.000000000 +0200
-+++ poldek-0.20/poldek_ts.h 2006-07-26 20:25:54.271330500 +0200
-@@ -1,4 +1,4 @@
--/* $Id$ */
-+/* $Id$ */
- #ifndef POLDEK_LIB_TX_H
- #define POLDEK_LIB_TX_H
-
-@@ -126,8 +126,9 @@
- int (*getop_v)(const struct poldek_ts *, int op, ...);
- void (*setop)(struct poldek_ts *, int op, int onoff);
-
-- int uninstall_greedy_deep;
--
-+ int uninstall_greedy_deep; /* greediness of uninstall, is set
-+ by ts->setop(POLDEK_OP_GREEDY, v)
-+ */
- };
- #endif
- struct poldek_ts *poldek_ts_new(struct poldek_ctx *ctx, unsigned flags);
-diff -urN poldek-0.20.org/poldek_util.h poldek-0.20/poldek_util.h
---- poldek-0.20.org/poldek_util.h 2004-10-09 16:41:42.000000000 +0200
-+++ poldek-0.20/poldek_util.h 2006-07-26 20:25:54.279331000 +0200
-@@ -1,9 +1,27 @@
- #ifndef POLDEK_UTIL_H
-
-+#include <trurl/nhash.h>
-+
- const char *poldek_util_lc_lang(const char *category);
- int poldek_util_get_gmt_offs(void);
- int poldek_util_is_rwxdir(const char *path);
-
- const char *poldek_util_ngettext_n_packages_fmt(int n);
-+
- int poldek_util_parse_bool(const char *v);
-+
-+/* returns 0 - false, 1 - true, 2 - auto */
-+int poldek_util_parse_bool3(const char *v);
-+
-+
-+/* remove used variables from varh */
-+#define POLDEK_UTIL_EXPANDVARS_RMUSED (1 << 0)
-+
-+/* expands "foo %{foo} bar */
-+const char *poldek_util_expand_vars(char *dest, int size, const char *src,
-+ char varmark, tn_hash *varh,
-+ unsigned flags);
-+
-+const char *poldek_util_expand_env_vars(char *dest, int size, const char *str);
-+
- #endif
-diff -urN poldek-0.20.org/python/local_stdint.c poldek-0.20/python/local_stdint.c
---- poldek-0.20.org/python/local_stdint.c 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/python/local_stdint.c 2006-07-26 20:25:54.279331000 +0200
-@@ -0,0 +1,2 @@
-+#define __extension__ /* prevent swig warning */
-+#include <stdint.h>
-diff -urN poldek-0.20.org/python/qrowser/mainWindow.ui poldek-0.20/python/qrowser/mainWindow.ui
---- poldek-0.20.org/python/qrowser/mainWindow.ui 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/python/qrowser/mainWindow.ui 2006-07-26 20:25:54.335334500 +0200
-@@ -0,0 +1,556 @@
-+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-+<class>mainWindow</class>
-+<widget class="QMainWindow">
-+ <property name="name">
-+ <cstring>mainWindow</cstring>
-+ </property>
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>761</width>
-+ <height>764</height>
-+ </rect>
-+ </property>
-+ <property name="sizePolicy">
-+ <sizepolicy>
-+ <hsizetype>5</hsizetype>
-+ <vsizetype>5</vsizetype>
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="caption">
-+ <string>poldek package browser (python module demo)</string>
-+ </property>
-+ <vbox>
-+ <property name="name">
-+ <cstring>unnamed</cstring>
-+ </property>
-+ <property name="margin">
-+ <number>0</number>
-+ </property>
-+ <property name="spacing">
-+ <number>0</number>
-+ </property>
-+ <widget class="QSplitter">
-+ <property name="name">
-+ <cstring>splitter10</cstring>
-+ </property>
-+ <property name="orientation">
-+ <enum>Vertical</enum>
-+ </property>
-+ <widget class="QListView">
-+ <column>
-+ <property name="text">
-+ <string>Name</string>
-+ </property>
-+ <property name="clickable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="resizable">
-+ <bool>true</bool>
-+ </property>
-+ </column>
-+ <column>
-+ <property name="text">
-+ <string>Version</string>
-+ </property>
-+ <property name="clickable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="resizable">
-+ <bool>true</bool>
-+ </property>
-+ </column>
-+ <column>
-+ <property name="text">
-+ <string>Size</string>
-+ </property>
-+ <property name="clickable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="resizable">
-+ <bool>true</bool>
-+ </property>
-+ </column>
-+ <property name="name">
-+ <cstring>PackageListView</cstring>
-+ </property>
-+ </widget>
-+ <widget class="QTabWidget">
-+ <property name="name">
-+ <cstring>packageTab</cstring>
-+ </property>
-+ <property name="tabPosition">
-+ <enum>Bottom</enum>
-+ </property>
-+ <property name="tabShape">
-+ <enum>Rounded</enum>
-+ </property>
-+ <widget class="QWidget">
-+ <property name="name">
-+ <cstring>descr</cstring>
-+ </property>
-+ <attribute name="title">
-+ <string>Description</string>
-+ </attribute>
-+ <vbox>
-+ <property name="name">
-+ <cstring>unnamed</cstring>
-+ </property>
-+ <property name="margin">
-+ <number>0</number>
-+ </property>
-+ <property name="spacing">
-+ <number>0</number>
-+ </property>
-+ <widget class="QTextBrowser">
-+ <property name="name">
-+ <cstring>DescriptionText</cstring>
-+ </property>
-+ </widget>
-+ </vbox>
-+ </widget>
-+ <widget class="QWidget">
-+ <property name="name">
-+ <cstring>caps</cstring>
-+ </property>
-+ <attribute name="title">
-+ <string>Provides</string>
-+ </attribute>
-+ <hbox>
-+ <property name="name">
-+ <cstring>unnamed</cstring>
-+ </property>
-+ <property name="margin">
-+ <number>0</number>
-+ </property>
-+ <widget class="QListView">
-+ <column>
-+ <property name="text">
-+ <string>Capability</string>
-+ </property>
-+ <property name="clickable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="resizable">
-+ <bool>true</bool>
-+ </property>
-+ </column>
-+ <property name="name">
-+ <cstring>CapsListView</cstring>
-+ </property>
-+ </widget>
-+ </hbox>
-+ </widget>
-+ <widget class="QWidget">
-+ <property name="name">
-+ <cstring>TabPage</cstring>
-+ </property>
-+ <attribute name="title">
-+ <string>Requires</string>
-+ </attribute>
-+ <hbox>
-+ <property name="name">
-+ <cstring>unnamed</cstring>
-+ </property>
-+ <property name="margin">
-+ <number>0</number>
-+ </property>
-+ <widget class="QListView">
-+ <column>
-+ <property name="text">
-+ <string>Capability</string>
-+ </property>
-+ <property name="clickable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="resizable">
-+ <bool>true</bool>
-+ </property>
-+ </column>
-+ <column>
-+ <property name="text">
-+ <string>Type</string>
-+ </property>
-+ <property name="clickable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="resizable">
-+ <bool>true</bool>
-+ </property>
-+ </column>
-+ <property name="name">
-+ <cstring>ReqsListView</cstring>
-+ </property>
-+ </widget>
-+ </hbox>
-+ </widget>
-+ <widget class="QWidget">
-+ <property name="name">
-+ <cstring>TabPage</cstring>
-+ </property>
-+ <attribute name="title">
-+ <string>Conflicts</string>
-+ </attribute>
-+ <vbox>
-+ <property name="name">
-+ <cstring>unnamed</cstring>
-+ </property>
-+ <property name="margin">
-+ <number>0</number>
-+ </property>
-+ <widget class="QListView">
-+ <column>
-+ <property name="text">
-+ <string>Capability</string>
-+ </property>
-+ <property name="clickable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="resizable">
-+ <bool>true</bool>
-+ </property>
-+ </column>
-+ <column>
-+ <property name="text">
-+ <string>Type</string>
-+ </property>
-+ <property name="clickable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="resizable">
-+ <bool>true</bool>
-+ </property>
-+ </column>
-+ <property name="name">
-+ <cstring>CnflListView</cstring>
-+ </property>
-+ </widget>
-+ </vbox>
-+ </widget>
-+ <widget class="QWidget">
-+ <property name="name">
-+ <cstring>files</cstring>
-+ </property>
-+ <attribute name="title">
-+ <string>Files</string>
-+ </attribute>
-+ <vbox>
-+ <property name="name">
-+ <cstring>unnamed</cstring>
-+ </property>
-+ <property name="margin">
-+ <number>0</number>
-+ </property>
-+ <property name="spacing">
-+ <number>0</number>
-+ </property>
-+ <widget class="QListView">
-+ <column>
-+ <property name="text">
-+ <string>Name</string>
-+ </property>
-+ <property name="clickable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="resizable">
-+ <bool>true</bool>
-+ </property>
-+ </column>
-+ <column>
-+ <property name="text">
-+ <string>Mode</string>
-+ </property>
-+ <property name="clickable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="resizable">
-+ <bool>true</bool>
-+ </property>
-+ </column>
-+ <column>
-+ <property name="text">
-+ <string>Size</string>
-+ </property>
-+ <property name="clickable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="resizable">
-+ <bool>true</bool>
-+ </property>
-+ </column>
-+ <property name="name">
-+ <cstring>FileListView</cstring>
-+ </property>
-+ </widget>
-+ </vbox>
-+ </widget>
-+ </widget>
-+ </widget>
-+ </vbox>
-+</widget>
-+<menubar>
-+ <property name="name">
-+ <cstring>qt_dead_widget_MenuBar</cstring>
-+ </property>
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <item text="&File" name="File">
-+ <action name="fileNewAction"/>
-+ <action name="fileOpenAction"/>
-+ <action name="fileSaveAction"/>
-+ <action name="fileSaveAsAction"/>
-+ <separator/>
-+ <action name="filePrintAction"/>
-+ <separator/>
-+ <action name="fileExitAction"/>
-+ </item>
-+ <item text="&Help" name="Help">
-+ <action name="helpContentsAction"/>
-+ <action name="helpIndexAction"/>
-+ <separator/>
-+ <action name="helpAboutAction"/>
-+ </item>
-+ <separator/>
-+</menubar>
-+<toolbars>
-+</toolbars>
-+<actions>
-+ <action>
-+ <property name="name">
-+ <cstring>fileNewAction</cstring>
-+ </property>
-+ <property name="iconSet">
-+ <iconset>image0</iconset>
-+ </property>
-+ <property name="text">
-+ <string>New</string>
-+ </property>
-+ <property name="menuText">
-+ <string>&New</string>
-+ </property>
-+ <property name="accel">
-+ <string>Ctrl+N</string>
-+ </property>
-+ </action>
-+ <action>
-+ <property name="name">
-+ <cstring>fileOpenAction</cstring>
-+ </property>
-+ <property name="iconSet">
-+ <iconset>image1</iconset>
-+ </property>
-+ <property name="text">
-+ <string>Open</string>
-+ </property>
-+ <property name="menuText">
-+ <string>&Open...</string>
-+ </property>
-+ <property name="accel">
-+ <string>Ctrl+O</string>
-+ </property>
-+ </action>
-+ <action>
-+ <property name="name">
-+ <cstring>fileSaveAction</cstring>
-+ </property>
-+ <property name="iconSet">
-+ <iconset>image2</iconset>
-+ </property>
-+ <property name="text">
-+ <string>Save</string>
-+ </property>
-+ <property name="menuText">
-+ <string>&Save</string>
-+ </property>
-+ <property name="accel">
-+ <string>Ctrl+S</string>
-+ </property>
-+ </action>
-+ <action>
-+ <property name="name">
-+ <cstring>fileSaveAsAction</cstring>
-+ </property>
-+ <property name="text">
-+ <string>Save As</string>
-+ </property>
-+ <property name="menuText">
-+ <string>Save &As...</string>
-+ </property>
-+ <property name="accel">
-+ <string></string>
-+ </property>
-+ </action>
-+ <action>
-+ <property name="name">
-+ <cstring>filePrintAction</cstring>
-+ </property>
-+ <property name="iconSet">
-+ <iconset>image3</iconset>
-+ </property>
-+ <property name="text">
-+ <string>Print</string>
-+ </property>
-+ <property name="menuText">
-+ <string>&Print...</string>
-+ </property>
-+ <property name="accel">
-+ <string>Ctrl+P</string>
-+ </property>
-+ </action>
-+ <action>
-+ <property name="name">
-+ <cstring>fileExitAction</cstring>
-+ </property>
-+ <property name="text">
-+ <string>Exit</string>
-+ </property>
-+ <property name="menuText">
-+ <string>E&xit</string>
-+ </property>
-+ <property name="accel">
-+ <string></string>
-+ </property>
-+ </action>
-+ <action>
-+ <property name="name">
-+ <cstring>helpContentsAction</cstring>
-+ </property>
-+ <property name="text">
-+ <string>Contents</string>
-+ </property>
-+ <property name="menuText">
-+ <string>&Contents...</string>
-+ </property>
-+ <property name="accel">
-+ <string></string>
-+ </property>
-+ </action>
-+ <action>
-+ <property name="name">
-+ <cstring>helpIndexAction</cstring>
-+ </property>
-+ <property name="text">
-+ <string>Index</string>
-+ </property>
-+ <property name="menuText">
-+ <string>&Index...</string>
-+ </property>
-+ <property name="accel">
-+ <string></string>
-+ </property>
-+ </action>
-+ <action>
-+ <property name="name">
-+ <cstring>helpAboutAction</cstring>
-+ </property>
-+ <property name="text">
-+ <string>About</string>
-+ </property>
-+ <property name="menuText">
-+ <string>&About</string>
-+ </property>
-+ <property name="accel">
-+ <string></string>
-+ </property>
-+ </action>
-+ <action>
-+ <property name="name">
-+ <cstring>Action</cstring>
-+ </property>
-+ <property name="text">
-+ <string>Unnamed</string>
-+ </property>
-+ </action>
-+</actions>
-+<images>
-+ <image name="image0">
-+ <data format="PNG" length="173">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000007449444154789cedd5c109c0200c05d06fe936812c10b2ffdd85d25385b6a991480f053f081af0291210f828c5a9d9c4de96cd2b9ad9eb0000660e2fe0c2519839c4f70c4c446d5e6b3538cf928245e4b2f6f014acaa8fda1d4fc1a5741b22079f9d111d96ea8a912c78c10bee64e60719f57e9203ad452a040318f5f70000000049454e44ae426082</data>
-+ </image>
-+ <image name="image1">
-+ <data format="PNG" length="210">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000009949444154789ced94410e85200c445f89c7367f61bc775d2848a42860ffced9548bbe8e13043e1d928177f481a123dc2b34f6f47a3de2b865a8843f4001982a0b3d5f62c58300aa1ad70550449ab9d507a773a8a4ba4f92a2df333c64c63bebbd82e5b8addecbcc7820eb4266c639745dfa80f36faf66c66fa19c3f882fb470ec05cdc0bed07893f68e171492635f686c3eeff6ba3c8fdd366dc4c0452cf153a9590000000049454e44ae426082</data>
-+ </image>
-+ <image name="image2">
-+ <data format="PNG" length="217">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000000a049444154789cd5954d0a802010859fd14668e18de662d222bc98376a21b4ac451992c66469e0b7f187f1f11c47052a218e762daddbfb9e99f6568f80b5364b8588ce35440400e80a398ce8f99034d2292cc37c8ebd530feb583a05e954341f8a027b2a7d3a1f09bf854dc5d5d953aa396e4f38cab199e2d2e108abe156f82e30977fcb4d8ff942d75dbebed2e143953a93f6caad3d6111f44b7d4f820ff9c0069bb51ecd122066740000000049454e44ae426082</data>
-+ </image>
-+ <image name="image3">
-+ <data format="PNG" length="725">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000029c49444154789c8d95ad76db4010853ff718cc3289d950d06136344c98c362964087256f503f426161021be6b2842550612e8be14299496c866dc14ab2fc77da2192665777eedc3b5af53813afafaf414448d3742f6f6600a82a005555912409575757bdeebefe396011613299b440876b4d946589f7fe68cf596080cd6673047658485571cefd3ff02900333b2a70aa23806fa792799e07336b9938e770ceede9dde82f2247fa9e65acaa244942599688486b54374eb5ff4fc6105b3c9c882e6853ec9c142719376c4e31ede655756f42ba71a40dc06ab50a5996311c0ecf8237467e7e7e022092309f5fb7787b8cdfdfdf83f79efc2347668288b40087d786695994e479ceb6daf2f0f01066b319d7d7d7bd5e1774b3f154c5163580d34c019ca408020e7ce159afffb0dd16a81a1717198bc5224ad130bd9c5ee2d2145503538e6c3103849c4f3e78656a53d2af94e79767fc57fcfad4946c7411419f9e7e85b228c3ffc457f80aa3300a12248cc228acd7ebf0e3fbcf301e8fc360908524494236c842bfda56dcdddd9c75f73052522e999223cc98311e8f4964486905cfbf5ea8aa8a7490d237c0fb22cea31988106b48ed36385c54dc14c4f160dfb9c133b4217fd88019e97018d76b77fa6551e045a29e66b4be39882ed69d38031520e604f0b6c5886788df6c5a4f1cf5b835096b00b17628148b35746f673b39d278da0945e9236065e705adc976371a200a76b8e2302ba9fb6c7a633299f20debb06cc96a7cb4faba07ea9a6d35680d58cb39180c582cee2263ef7d631588412540159d338b30d2b0b21d183bcd31430496cb25f3f9bcd7cfb28c8fb70f7ebfbda16ac4f347d81b3ee93ccb0eb2edb39ea6e572c9e3e3630f3a87d06ab50aabd51bdbfaffa5686dcace99dd5f0354cb785f1993e984dbdb5beeefef5bbcbfd1f69e0c0f8448030000000049454e44ae426082</data>
-+ </image>
-+</images>
-+<connections>
-+ <connection>
-+ <sender>fileNewAction</sender>
-+ <signal>activated()</signal>
-+ <receiver>mainWindow</receiver>
-+ <slot>fileNew()</slot>
-+ </connection>
-+ <connection>
-+ <sender>fileOpenAction</sender>
-+ <signal>activated()</signal>
-+ <receiver>mainWindow</receiver>
-+ <slot>fileOpen()</slot>
-+ </connection>
-+ <connection>
-+ <sender>fileSaveAction</sender>
-+ <signal>activated()</signal>
-+ <receiver>mainWindow</receiver>
-+ <slot>fileSave()</slot>
-+ </connection>
-+ <connection>
-+ <sender>fileSaveAsAction</sender>
-+ <signal>activated()</signal>
-+ <receiver>mainWindow</receiver>
-+ <slot>fileSaveAs()</slot>
-+ </connection>
-+ <connection>
-+ <sender>filePrintAction</sender>
-+ <signal>activated()</signal>
-+ <receiver>mainWindow</receiver>
-+ <slot>filePrint()</slot>
-+ </connection>
-+ <connection>
-+ <sender>fileExitAction</sender>
-+ <signal>activated()</signal>
-+ <receiver>mainWindow</receiver>
-+ <slot>fileExit()</slot>
-+ </connection>
-+ <connection>
-+ <sender>helpIndexAction</sender>
-+ <signal>activated()</signal>
-+ <receiver>mainWindow</receiver>
-+ <slot>helpIndex()</slot>
-+ </connection>
-+ <connection>
-+ <sender>helpContentsAction</sender>
-+ <signal>activated()</signal>
-+ <receiver>mainWindow</receiver>
-+ <slot>helpContents()</slot>
-+ </connection>
-+ <connection>
-+ <sender>helpAboutAction</sender>
-+ <signal>activated()</signal>
-+ <receiver>mainWindow</receiver>
-+ <slot>helpAbout()</slot>
-+ </connection>
-+</connections>
-+<tabstops>
-+ <tabstop>PackageListView</tabstop>
-+ <tabstop>packageTab</tabstop>
-+ <tabstop>DescriptionText</tabstop>
-+</tabstops>
-+<slots>
-+ <slot>fileNew()</slot>
-+ <slot>fileOpen()</slot>
-+ <slot>fileSave()</slot>
-+ <slot>fileSaveAs()</slot>
-+ <slot>filePrint()</slot>
-+ <slot>fileExit()</slot>
-+ <slot>helpIndex()</slot>
-+ <slot>helpContents()</slot>
-+ <slot>helpAbout()</slot>
-+</slots>
-+<layoutdefaults spacing="6" margin="11"/>
-+</UI>
-diff -urN poldek-0.20.org/python/qrowser/qrowser.py poldek-0.20/python/qrowser/qrowser.py
---- poldek-0.20.org/python/qrowser/qrowser.py 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/python/qrowser/qrowser.py 2006-07-26 20:25:54.335334500 +0200
-@@ -0,0 +1,137 @@
-+# $Id$
-+# Package browser app to try and train poldek python module
-+
-+import sys
-+import locale
-+from optparse import OptionParser
-+
-+import qt
-+import poldek
-+
-+from mainWindow import mainWindow
-+
-+class MainWindow(mainWindow):
-+ def fillPackageList(self, list):
-+ for p in list:
-+ evr = "%s-%s" % (p.ver, p.rel)
-+ item = qt.QListViewItem(self.PackageListView, p.name, evr, "%ldK" % (p.size / 1024))
-+ item.__package = p
-+
-+ self.connect( self.PackageListView, qt.SIGNAL("selectionChanged(QListViewItem *)"),
-+ self.selectedSlot)
-+
-+ def selectedSlot(self, item, *args, **kw):
-+ #print "package ", item.__package
-+ qt.QApplication.setOverrideCursor(qt.QCursor(qt.QApplication.WaitCursor))
-+
-+ self.showPackageDescription(item.__package)
-+ self.showPackageCaps(item.__package)
-+ self.showPackageFiles(item.__package)
-+
-+ qt.QApplication.restoreOverrideCursor()
-+
-+
-+ def showPackageFiles(self, pkg):
-+ self.FileListView.clear()
-+
-+ it = pkg.get_flist_it()
-+
-+ fi = it.get_tuple()
-+ while fi:
-+ item = qt.QListViewItem(self.FileListView, fi[0], "%o" % fi[2], "%i" % fi[1])
-+ fi = it.get_tuple()
-+
-+ def showPackageCaps(self, pkg):
-+ self.CapsListView.clear()
-+ self.ReqsListView.clear()
-+ self.CnflListView.clear()
-+
-+
-+ caps = pkg.provides()
-+ if caps:
-+ for c in caps:
-+ item = qt.QListViewItem(self.CapsListView, str(c))
-+
-+ caps = pkg.requires()
-+ if caps:
-+ for c in caps:
-+ type = ''
-+ if c.is_prereq():
-+ type += 'pre'
-+ if c.is_prereq_un():
-+ if len(type): type += ', '
-+ type += 'preun'
-+
-+ item = qt.QListViewItem(self.ReqsListView, str(c), type)
-+
-+ caps = pkg.conflicts()
-+ if caps:
-+ for c in caps:
-+ type = 'conflict';
-+ if c.is_obsl():
-+ type = 'obsolete'
-+
-+ item = qt.QListViewItem(self.CnflListView, str(c), type)
-+
-+
-+ def showPackageDescription(self, pkg):
-+ dsc = "";
-+
-+ inf = pkg.uinf()
-+
-+ dsc += "<table><tr><td><b>Package: </b></td><td>";
-+ dsc += str(pkg)
-+ dsc += "</td></tr><tr><td><b>Summary: </b></td><td>";
-+ dsc += inf.get(inf.SUMMARY)
-+
-+ dsc += "</td></tr><tr><td><b>License: </b></td><td>";
-+ dsc += inf.get(inf.LICENSE)
-+
-+ if inf.get(inf.URL):
-+ dsc += "</td></tr><tr><td><b>URL: </b></td><td>";
-+ dsc += '<a href="%s">%s</a>' % (inf.get(inf.URL), inf.get(inf.URL))
-+
-+ dsc += "</td></tr></table>";
-+ dsc += inf.get(inf.DESCRIPTION)
-+ self.DescriptionText.setText(dsc);
-+
-+
-+def get_options():
-+ parser = OptionParser()
-+ parser.add_option("-n", "--sn", dest="source")
-+ (options, args) = parser.parse_args()
-+ return options
-+
-+
-+locale.setlocale(locale.LC_ALL, '')
-+options = get_options()
-+if not options.source:
-+ print "no source specified"
-+ sys.exit(1)
-+
-+poldek.lib_init()
-+
-+ctx = poldek.poldek_ctx()
-+#poldek_set_verbose(1)
-+src = poldek.source(options.source)
-+ctx.configure(ctx.CONF_SOURCE, src)
-+ctx.load_config()
-+if not ctx.setup():
-+ print "poldek setup failed"
-+ sys.exit(1)
-+
-+print "Loading packages..."
-+arr = ctx.get_avail_packages()
-+print "Loaded %d packages" % len(arr)
-+if len(arr) == 0:
-+ sys.exit(0)
-+
-+a = qt.QApplication(sys.argv)
-+
-+w = MainWindow()
-+w.setGeometry(100, 100, 900, 700)
-+a.setMainWidget(w)
-+
-+w.fillPackageList(arr)
-+w.show()
-+sys.exit(a.exec_loop())
-diff -urN poldek-0.20.org/python/qrowser/qrowser.sh poldek-0.20/python/qrowser/qrowser.sh
---- poldek-0.20.org/python/qrowser/qrowser.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/python/qrowser/qrowser.sh 2006-07-26 20:25:54.335334500 +0200
-@@ -0,0 +1,3 @@
-+#!/bin/sh
-+
-+PYTHONPATH=../:../.libs python qrowser.py $@
-diff -urN poldek-0.20.org/python/run.sh poldek-0.20/python/run.sh
---- poldek-0.20.org/python/run.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/python/run.sh 2006-07-26 20:25:54.335334500 +0200
-@@ -0,0 +1,3 @@
-+#!/bin/sh
-+
-+PYTHONPATH=.libs python $@
-diff -urN poldek-0.20.org/python/test.py poldek-0.20/python/test.py
---- poldek-0.20.org/python/test.py 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/python/test.py 2006-07-26 20:25:54.335334500 +0200
-@@ -0,0 +1,108 @@
-+#!/usr/bin/python
-+import os
-+import re
-+import sys
-+import string
-+from types import *
-+import poldek
-+
-+def test_pkguinf(ctx):
-+ arr = ctx.get_avail_packages()
-+ print "Loaded %d packages" % len(arr)
-+ if len(arr) == 0:
-+ return
-+
-+ pkg = arr[0]
-+ inf = pkg.uinf()
-+ print "Package: ", pkg
-+ print "Summary: ", inf.get(inf.SUMMARY)
-+ print "License: ", inf.get(inf.LICENSE)
-+ print "URL: ", inf.get(inf.URL)
-+ print "Description:\n", inf.get(inf.DESCRIPTION)
-+
-+ it = pkg.get_flist_it()
-+ f = it.get_tuple()
-+ while f:
-+ print f
-+ f = it.get_tuple()
-+
-+
-+def test_avail(ctx):
-+ arr = ctx.get_avail_packages()
-+ print "Loaded %d packages" % len(arr)
-+ n = 0
-+ for ptr in arr:
-+ print n, ' ', ptr
-+ n += 1
-+
-+
-+def test_search(ctx):
-+ arr = ctx.get_avail_packages()
-+ print "Found %d package(s)" % len(arr)
-+ n = 0
-+ for ptr in arr:
-+ print n, ' ', ptr
-+ n += 1
-+
-+def test_install(ctx):
-+ ts = ctx.ts_new(poldek.poldek_ts.INSTALL | poldek.poldek_ts.UPGRADE)
-+ ts.add_pkgmask("python")
-+ ts.add_pkgmask("swig")
-+ ts.setop(ts.OP_TEST, True)
-+ ts.run(None)
-+
-+
-+
-+def test_cli_ls(cctx):
-+ cmd = cctx.rcmd_new(None)
-+ if cmd.execline("ls poldek*"):
-+ pkgs = cmd.get_packages()
-+ return
-+ print pkgs
-+ n = 0
-+ for p in pkgs:
-+ print n, ' ', p
-+ caps = p.requires()
-+ print caps
-+ for cap in caps:
-+ print " R: %s" % cap
-+ n += 1
-+
-+ if not pkgs:
-+ print cmd.get_str()
-+
-+poldek.lib_init()
-+
-+ctx = poldek.poldek_ctx()
-+#poldek_set_verbose(1)
-+src = poldek.source('ac-test')
-+ctx.configure(ctx.CONF_SOURCE, src)
-+ctx.load_config()
-+if not ctx.setup():
-+ raise Exception, "error"
-+
-+
-+cctx = poldek.poclidek_ctx(ctx);
-+cctx.load_packages(cctx.LOAD_ALL)
-+#test_cli_ls(cctx)
-+
-+
-+test_pkguinf(ctx)
-+#test_cli_ls(poldctx)
-+#arr = poldctx.get_avail_packages()
-+sys.exit(0)
-+
-+
-+ctx = poldek.poldek_ctx()
-+#poldek_set_verbose(1)
-+src = poldek.source('tt2')
-+ctx.configure(ctx.CONF_SOURCE, poldek.source('tt2'))
-+ctx.load_config()
-+ctx.setup()
-+
-+test_search(ctx)
-+
-+
-+print "END"
-+
-+
-diff -urN poldek-0.20.org/README poldek-0.20/README
---- poldek-0.20.org/README 2002-04-03 17:43:39.000000000 +0200
-+++ poldek-0.20/README 2006-07-26 20:25:54.335334500 +0200
-@@ -1,6 +1,6 @@
--# $Id$
-+# $Id$
-
--See man page for user documentation.
-+See man and info pages for user documentation.
-
- Project homepage: <http://team.pld.org.pl/~mis/poldek/>.
-
-@@ -9,7 +9,7 @@
- mail to <poldek-subscribe@pld-linux.org>
-
-
--Copyright (C) 2000 - 2002 Pawel A. Gajda
-+Copyright (C) 2000 - 2002 Pawel A. Gajda <mis @ pld.org.pl>
- The poldek is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2 as
- published by the Free Software Foundation (see file COPYING for details).
-diff -urN poldek-0.20.org/README.package-sets poldek-0.20/README.package-sets
---- poldek-0.20.org/README.package-sets 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/README.package-sets 2006-07-26 20:25:54.335334500 +0200
-@@ -0,0 +1,29 @@
-+# $Id$
-+
-+Syntax of package set file.
-+
-+Each package is specified in one line:
-+
-+[!]NAME [EVR] | @VIRTUAL [DEFAULT_NAME [DEFAULT_EVR]]
-+
-+'~' ('~' obsolets '!') before means that poldek in interactive mode
-+will ask user before install it, in batch mode package will not be
-+installed.
-+
-+'@' specifies virtual package, like '~', in interactive mode poldek
-+will ask user which one of available packages he want to install,
-+otherwise, in batch mode the default package will be selected.
-+
-+Hashed lines are treated as comments.
-+
-+Example:
-+
-+FHS 2.1
-+basesystem
-+pdksh
-+@bootloader lilo 2.1
-+@smtpdaemon exim
-+~dhcp-client
-+
-+After every modification set should be verified by:
-+$ poldek -s YOUR_SOURCE -V --pkgset=PKGSETFILE
-diff -urN poldek-0.20.org/scparchive.sh poldek-0.20/scparchive.sh
---- poldek-0.20.org/scparchive.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/scparchive.sh 2006-07-26 20:25:54.335334500 +0200
-@@ -0,0 +1,26 @@
-+#! /bin/sh
-+# $Id$
-+
-+ROOTDIR="public_html/poldek"
-+HOST="team.pld.org.pl"
-+
-+if [ -z "$1" -o -z "$2" ]; then
-+ echo "usage: $(basename $0) [FILE...] (${ROOTDIR}/)DESTDIR"
-+ exit;
-+fi
-+
-+FILES=""
-+while test $# -gt 1 ; do
-+ FILES="$FILES $1"
-+ shift
-+done
-+
-+DEST=$1
-+
-+
-+DESTDIR="${ROOTDIR}/$DEST"
-+
-+scp -p $FILES "${HOST}:${DESTDIR}" && \
-+ssh $HOST \
-+"(cd $DESTDIR && find . -type f | xargs md5sum > md5sums && \
-+ \$HOME/mkindexpage.pl *.* > index.html && find . -type f | xargs chmod 644 && ls -l)"
-diff -urN poldek-0.20.org/swigs.h poldek-0.20/swigs.h
---- poldek-0.20.org/swigs.h 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/swigs.h 2006-07-26 20:25:54.335334500 +0200
-@@ -0,0 +1,19 @@
-+#ifndef SWIGMACRO_H
-+#define SWIGMACRO_H
-+
-+#ifndef SWIG
-+# define STINLINE static inline
-+# define STINLINE_END
-+# define SWIG_immutable %immutable;
-+# define SWIG_mutable %mutable;
-+
-+#else /* SWIG */
-+
-+# define STINLINE %inline %{
-+# define STINLINE_END %}
-+# define SWIG_immutable
-+# define SWIG_mutable
-+
-+#endif /* SWIG */
-+
-+#endif
-diff -urN poldek-0.20.org/test_patch.sh poldek-0.20/test_patch.sh
---- poldek-0.20.org/test_patch.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/test_patch.sh 2006-07-26 20:25:54.335334500 +0200
-@@ -0,0 +1,149 @@
-+#! /bin/sh
-+
-+POLDEK_TESTING=1
-+export POLDEK_TESTING
-+
-+while [ $# -gt 0 ]; do
-+ case "$1" in
-+ -t )
-+ shift; ST=$1; shift ;;
-+
-+ --distdir )
-+ shift; DISTDIR="$1"; shift;;
-+
-+ --sdir )
-+ shift; SRCDIR="$1"; shift;;
-+
-+ --surl )
-+ shift; SRCURL="$1"; shift;;
-+
-+ --poldek )
-+ shift; POLDEK="$1"; shift;;
-+
-+ --poldekup )
-+ shift; POLDEKUP="$1"; shift;;
-+ esac
-+done
-+ST=${ST:-"pdir"}
-+
-+if [ -z "$DISTDIR" -o -z "$SRCDIR" -o -z "$SRCURL" ]; then
-+ echo "usage $(basename $0): -t INDEXTYPE --distdir DISTDIR --sdir $SRCDIR --surl $SRCURL"
-+ exit 1;
-+fi
-+
-+TMPDIR=${TMPDIR:-"/tmp"}
-+POLDEK=${POLDEK:-"poldek"}
-+POLDEKUP=${POLDEKUP:-"poldek"}
-+
-+echo "$POLDEK, $POLDEKUP"
-+
-+POLDEK018=
-+if $POLDEK --noconf --version | grep -q 0.18; then
-+ POLDEK018="1"
-+fi
-+
-+POLDEKUP018=
-+if $POLDEKUP --noconf --version | grep -q 0.18; then
-+ POLDEKUP018="1"
-+fi
-+
-+
-+create_index()
-+{
-+ if [ -n "$POLDEK018" ]; then
-+ $POLDEK --noconf -s $SRCDIR --mkidxz
-+ else
-+ $POLDEK --noconf -s $SRCDIR --mkidx --mt $ST
-+ fi
-+}
-+
-+update_index()
-+{
-+ if [ -n "$POLDEKUP018" ]; then
-+ $POLDEKUP --noconf -s $SRCURL --up
-+ else
-+ $POLDEKUP --noconf --st $ST -s $SRCURL --up -Oautoupa=n
-+ fi
-+}
-+
-+
-+test_loop()
-+{
-+ up_skip=$(perl -e 'print int(rand(2))');
-+ toadd=$(perl -e 'print chr(65 + rand(50))');
-+ torm=$(perl -e 'print chr(65 + rand(50))');
-+ while [ "$toadd" == "$torm" ]; do
-+ torm=$(perl -e 'print chr(65 + rand(56))');
-+ done
-+
-+ echo "ADD $toadd, REMOVE $torm";
-+
-+
-+ nremoved=0
-+ for i in $SRCDIR/${torm}*.rpm; do
-+ bn=$(basename $i);
-+
-+ if [ ! -f $i ]; then
-+ continue
-+ fi
-+ rm -f $i
-+ nremoved=$(expr $nremoved + 1)
-+ done
-+
-+
-+ nadded=0
-+ for i in $DISTDIR/${toadd}*.rpm; do
-+ bn=$(basename $i);
-+
-+ if [ ! -f $i ]; then
-+ continue
-+ fi
-+
-+ if [ -f $SRCDIR/$bn ]; then
-+ continue
-+ fi
-+ nadded=$(expr $n + 1)
-+ #echo "ADD $bn"
-+ ln -sf $i $SRCDIR/$bn
-+ done
-+
-+ if [ "$nadded" = "0" -a "$nremoved" = "0" ]; then
-+ return
-+ fi
-+
-+ echo -e "\n**** MAKE ****\n"
-+ echo "Added $nadded and $nremoved removed"
-+ create_index
-+
-+ if [ $? -ne 0 ]; then
-+ echo "MKIDX ERRROR"
-+ exit 1;
-+ fi
-+
-+ #up_skip=0
-+ if [ ${up_skip} = "0" ]; then
-+ echo -e "\n**** UP ****\n"
-+ update_index
-+
-+ if [ $? -ne 0 ]; then
-+ echo "ERRROR"
-+ exit 1;
-+ fi
-+ fi
-+}
-+
-+rm -f $SRCDIR/packages.$ST.*
-+rm -f $SRCDIR/packages.i/packages.$ST.*
-+create_index || exit 1
-+
-+if [ -n "$POLDEKUP018" ]; then
-+ $POLDEKUP --noconf -s $SRCURL --upa
-+else
-+ $POLDEKUP --noconf --st $ST -s $SRCURL --upa -Oautoupa=n
-+fi
-+
-+for n in $(seq 1 22000); do
-+ test_loop
-+ sleep 1
-+done
-+
-diff -urN poldek-0.20.org/tests/build-test-rpm.sh poldek-0.20/tests/build-test-rpm.sh
---- poldek-0.20.org/tests/build-test-rpm.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/tests/build-test-rpm.sh 2006-07-26 20:25:54.339334750 +0200
-@@ -0,0 +1,83 @@
-+#!/bin/sh
-+# $Id$
-+# Script for quick build fake foo-packages
-+
-+name=
-+version=
-+release="1"
-+requires=
-+provides=
-+files=
-+
-+usage_and_exit() {
-+ echo "Usage $0 -n NAME -v VERSION-[RELEASE [-p PROVIDES] [-r REQUIRES] [-f file] "
-+ exit 1
-+}
-+
-+while test $# -gt 0 ; do
-+ case "${1}" in
-+ -n)
-+ shift; name="${1}"; shift ;;
-+
-+ -v)
-+ shift; version="${1}"; shift ;;
-+
-+ -p)
-+ shift; provides="$provides ${1},"; shift ;;
-+
-+ -r)
-+ shift; requires="$requires ${1},"; shift ;;
-+
-+ -f)
-+ shift; files="$files ${1} "; shift ;;
-+
-+ *)
-+ echo "unknown option ${1}"; exit 1;
-+ esac
-+done
-+
-+[ -n "$name" -a -n "$version" ] || usage_and_exit;
-+
-+if echo $version | grep -q '-'; then
-+ release=$(echo $version | cut -f 2 -d -)
-+ version=$(echo $version | cut -f 1 -d -)
-+ [ -n "$version" -a -n "$release" ] || exit 1;
-+fi
-+
-+SPEC="/tmp/$name.spec"
-+> $SPEC
-+echo "Building $name $version-$release"
-+echo "Name: $name" >> $SPEC
-+echo "Version: $version" >> $SPEC
-+echo "Release: $release" >> $SPEC
-+echo "Summary: $name" >> $SPEC
-+echo "Group: System" >> $SPEC
-+echo "License: foo" >> $SPEC
-+echo "BuildArch: noarch" >> $SPEC
-+echo "BuildRoot: /tmp/%{name}-%{version}-root-%(id -u -n)" >> $SPEC
-+[ -n "$provides" ] && echo "Provides: $provides" >> $SPEC
-+[ -n "$requires" ] && echo "Requires: $requires" >> $SPEC
-+
-+echo -e "%description\n$name" >> $SPEC
-+echo -e "%prep\n%pre\n" >> $SPEC
-+
-+if [ -n "$files" ]; then
-+ echo "%install" >> $SPEC
-+ for f in $files; do
-+ dn=$(dirname $f)
-+ echo "mkdir -p \$RPM_BUILD_ROOT/$dn" >> $SPEC
-+ echo "touch \$RPM_BUILD_ROOT/$f" >> $SPEC
-+ done
-+fi
-+
-+echo -e "%files\n%defattr(644,root,root,755)" >> $SPEC
-+if [ -n "$files" ]; then
-+ for f in $files; do
-+ dn=$(dirname $f)
-+ echo "%dir $dn" >> $SPEC
-+ echo "$f" >> $SPEC
-+ done
-+fi
-+
-+echo -e "%clean\nrm -rf \$RPM_BUILD_ROOT" >> $SPEC
-+rpmbuild -bb $SPEC
-diff -urN poldek-0.20.org/tests/httpd.py poldek-0.20/tests/httpd.py
---- poldek-0.20.org/tests/httpd.py 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/tests/httpd.py 2006-07-26 20:25:54.339334750 +0200
-@@ -0,0 +1,12 @@
-+#!/usr/bin/python
-+
-+import SimpleHTTPServer
-+import SocketServer
-+
-+PORT = 10000
-+
-+Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
-+httpd = SocketServer.TCPServer(("127.0.0.1", PORT), Handler)
-+
-+print "serving at port", PORT
-+httpd.serve_forever()
-diff -urN poldek-0.20.org/tests/Makefile.am poldek-0.20/tests/Makefile.am
---- poldek-0.20.org/tests/Makefile.am 2005-10-27 00:52:42.000000000 +0200
-+++ poldek-0.20/tests/Makefile.am 2006-07-26 20:25:54.339334750 +0200
-@@ -3,12 +3,37 @@
- TESTS = test_poldek
- noinst_PROGRAMS = test_poldek
- test_poldek_SOURCES = test_poldek.c test_match.c test_env.c \
-- test_pmdb.c test_op.c
-+ test_pmdb.c test_op.c test_config.c
-
- EXTRA_DIST = utest_mkidx.sh
-
- test_poldek_INCLUDES= @CHECK_CFLAGS@
- test_poldek_LDADD = @CHECK_LIBS@ ../libpoldek_allsym.la ../vfile/libvfile.la
-
-+poldek_test_conf.conf: ../doc/conf-xml2testconf.xsl ../doc/poldek.conf.xml
-+ xsltproc ../doc/conf-xml2testconf.xsl ../doc/poldek.conf.xml > poldek_test_conf.conf
-+
- clean-local:
-- -rm -f core *.o *.bak *~ *% *\# TAGS gmon.out \#*\# dupa*
-+ -rm -f *.tmp core *.o *.bak *~ *% *\# TAGS gmon.out \#*\# dupa*
-+
-+
-+runtests: poldek_test_conf.conf
-+ $(MAKE) check
-+ @echo; echo "Running *.sh tests"; \
-+ n=0; nfails=0; \
-+ for i in utest_*.sh; do \
-+ [ -f $$i ] || continue; \
-+ n=$$(expr $$n + 1); \
-+ echo " running $$i"; \
-+ sh $$i; \
-+ if [ $$? -ne 0 ]; then \
-+ nfails=$$(expr $$nfails + 1); \
-+ echo " $$i FAILED"; \
-+ else \
-+ echo " $$i PASSED"; \
-+ fi; \
-+ done; \
-+ echo "====================================="; \
-+ echo "$$n tests passed / $$nfails failed"; \
-+ echo "====================================="
-+
-diff -urN poldek-0.20.org/tests/repo/foo.spec poldek-0.20/tests/repo/foo.spec
---- poldek-0.20.org/tests/repo/foo.spec 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/tests/repo/foo.spec 2006-07-26 20:25:54.339334750 +0200
-@@ -0,0 +1,40 @@
-+# $Revision$, $Date$
-+Summary: foo
-+Name: foo
-+Version: 1.0
-+Release: 1
-+License: GPL
-+Group: Base
-+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-+Requires: foo-lib = %{version}
-+
-+%description
-+foo
-+
-+%package lib
-+Summary: foo lib
-+Group: Base
-+
-+%description lib
-+
-+%prep
-+
-+%pre
-+
-+%files
-+%defattr(644,root,root,755)
-+
-+%files lib
-+%defattr(644,root,root,755)
-+
-+%clean
-+rm -rf $RPM_BUILD_ROOT
-+
-+%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
-+%changelog
-+* %{date} foo
-+
-+$Log$
-+Revision 1.1 2005/10/26 22:43:24 mis
-+- and spec
-+
-diff -urN poldek-0.20.org/tests/repo/poldek.conf poldek-0.20/tests/repo/poldek.conf
---- poldek-0.20.org/tests/repo/poldek.conf 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/tests/repo/poldek.conf 2006-07-26 20:25:54.339334750 +0200
-@@ -0,0 +1,12 @@
-+vfile retries = 1
-+
-+[source]
-+name = repo-pdir
-+path = ${PWD}/repo
-+type = pdir
-+
-+[source]
-+name = repo-pndir
-+path = ${PWD}/repo
-+type = pndir
-+
-diff -urN poldek-0.20.org/tests/test_config.c poldek-0.20/tests/test_config.c
---- poldek-0.20.org/tests/test_config.c 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/tests/test_config.c 2006-07-26 20:25:54.339334750 +0200
-@@ -0,0 +1,241 @@
-+#include "test.h"
-+#include "conf_intern.h"
-+#include "conf.h"
-+#include <trurl/nhash.h>
-+
-+const char *expand_env_var(const char *v)
-+{
-+ char tmp[PATH_MAX];
-+ const char *s;
-+
-+ s = poldek_util_expand_env_vars(tmp, sizeof(tmp), v);
-+ fail_if(s == NULL);
-+ return n_strdup(s);
-+}
-+
-+
-+START_TEST (test_config) {
-+ struct poldek_conf_tag *tags = NULL;
-+ tn_hash *cnf, *s;
-+ int i, j;
-+
-+ cnf = poldek_conf_load("poldek_test_conf.conf", 0);
-+ fail_if(cnf == NULL, "load config failed");
-+
-+ s = poldek_conf_get_section_ht(cnf, "global");
-+ fail_if(s == NULL, "no global section?");
-+
-+ i = 0;
-+ while (poldek_conf_sections[i].name) {
-+ const char *sname = poldek_conf_sections[i].name;
-+ tags = poldek_conf_sections[i++].tags;
-+
-+ s = poldek_conf_get_section_ht(cnf, sname);
-+ fail_if(s == NULL, "no %s section?", s);
-+
-+ j = 0;
-+ while (tags[j].name) {
-+ struct poldek_conf_tag *t = &tags[j++];
-+ const char *dv, *v;
-+
-+ if (strchr(t->name, '*')) /* legacy source?* and prefix*? */
-+ continue;
-+
-+ if (t->flags & CONF_TYPE_F_ALIAS)
-+ continue;
-+
-+ v = poldek_conf_get(s, t->name, NULL);
-+ fail_if(v == NULL, "%s: %s: missing?", sname, t->name);
-+
-+ dv = t->defaultv;
-+
-+ if (t->defaultv == NULL) { /* the xsl sets it to op name */
-+ char *p;
-+ p = n_strdup(t->name);
-+ dv = p;
-+ while (*p) {
-+ if (*p == ' ') *p = '_';
-+ p++;
-+ }
-+ DBGF("\n%s: %s %s\n", t->name, dv, v);
-+ }
-+
-+ if (t->flags & CONF_TYPE_BOOLEAN) { /* reverse value, see xsl */
-+ if (n_str_eq(dv, "yes"))
-+ dv = "no";
-+ else
-+ dv = "yes";
-+ }
-+
-+ if (t->flags & CONF_TYPE_F_ENV) {
-+ fail_ifnot(t->flags & CONF_TYPE_STRING);
-+ dv = expand_env_var(dv);
-+ }
-+
-+ fail_if(n_str_ne(dv, v), "%s: %s: %s != %s",
-+ sname, t->name, v, dv);
-+ }
-+ }
-+}
-+END_TEST
-+
-+
-+static char *values_list[] = { "foo", "bar", "baz", NULL };
-+
-+static char *make_conf_line(const char *opname, int no, int sep)
-+{
-+ char line[1024];
-+ int i = 0, n = 0;
-+
-+ n = n_snprintf(line, sizeof(line), "%s = ", opname);
-+ while (values_list[i]) {
-+ char buf[64];
-+ n_snprintf(buf, sizeof(buf), "%s%d", values_list[i], no);
-+ n += n_snprintf(&line[n], sizeof(line) - n,
-+ "%s %c", buf, sep);
-+ i++;
-+ }
-+ line[n - 1] = '\0'; /* remove last sep */
-+ return n_strdup(line);
-+}
-+
-+static int verify_list(tn_array *list, int maxno, const char *op)
-+{
-+ tn_hash *dict = n_hash_new(64, NULL);
-+ int no;
-+
-+ fail_if(n_array_size(list) != 3 * maxno,
-+ "%s: have %d, expected %d - some values lost",
-+ op, n_array_size(list), 3 * maxno);
-+
-+ for (no = maxno - 1; no >= 0; no--) { /* from max to 0, to test
-+ param overwriting
-+ (test_config_lists_excl) */
-+ int i = 0;
-+ while (values_list[i]) {
-+ char buf[64];
-+ n_snprintf(buf, sizeof(buf), "%s%d", values_list[i], no);
-+ n_hash_insert(dict, buf, NULL);
-+ i++;
-+ }
-+ }
-+
-+ while (n_array_size(list) > 0) {
-+ const char *op = n_array_pop(list);
-+ fail_ifnot(n_hash_exists(dict, op), "missing list element %s", op);
-+ }
-+ return 1;
-+}
-+
-+void make_conf_file(const char *name, tn_array *lines)
-+{
-+ FILE *f;
-+ int i;
-+
-+ f = fopen(name, "w");
-+ fail_if(f == NULL, "file open failed");
-+ for (i=0; i<n_array_size(lines); i++)
-+ fprintf(f, "%s\n", n_array_nth(lines, i));
-+ fclose(f);
-+}
-+
-+
-+
-+START_TEST (test_config_lists) {
-+ char *list_ops[] = { "hold", "ignore", "noproxy", "exclude_path", NULL };
-+ char maxno_ops[] = { 0, 0, 0, 0, 0 };
-+ tn_hash *cnf, *s;
-+ tn_array *lines, *list;
-+ int i, maxno = 0;
-+ FILE *f;
-+
-+ lines = n_array_new(16, 0, 0);
-+
-+ i = 0;
-+ while (list_ops[i]) {
-+ maxno = 0;
-+ n_array_push(lines, make_conf_line(list_ops[i], maxno++, ' '));
-+ n_array_push(lines, make_conf_line(list_ops[i], maxno++, ','));
-+ n_array_push(lines, make_conf_line(list_ops[i], maxno++, '\t'));
-+ if (n_str_eq(list_ops[i], "exclude_path"))
-+ n_array_push(lines, make_conf_line(list_ops[i], maxno++, ':'));
-+ if (n_str_eq(list_ops[i], "hold"))
-+ n_array_push(lines, make_conf_line("a hold alias for testing purposes",
-+ maxno++, ','));
-+ maxno_ops[i] = maxno;
-+ i++;
-+ }
-+ make_conf_file("poldek_test_conf.tmp", lines);
-+ cnf = poldek_conf_load("poldek_test_conf.tmp", 0);
-+ fail_if(cnf == NULL, "load config failed");
-+
-+ s = poldek_conf_get_section_ht(cnf, "global");
-+ fail_if(s == NULL, "no global section?");
-+
-+ i = 0;
-+ while (list_ops[i]) {
-+ list = poldek_conf_get_multi(s, list_ops[i]);
-+ fail_if(list == NULL, "no %s?", list_ops[i]);
-+ verify_list(list, maxno_ops[i], list_ops[i]);
-+ i++;
-+ }
-+}
-+END_TEST
-+
-+
-+START_TEST (test_config_lists_excl) {
-+ char *list_ops[] = { "sources", NULL };
-+ tn_hash *cnf, *s;
-+ tn_array *lines, *list;
-+ int i, maxno = 0;
-+
-+ lines = n_array_new(16, 0, 0);
-+
-+ i = 0;
-+ while (list_ops[i]) {
-+ maxno = 3;
-+ while (maxno >= 0) {
-+ n_array_push(lines, make_conf_line(list_ops[i], maxno, ' '));
-+ maxno--;
-+ }
-+ i++;
-+ }
-+
-+ cnf = poldek_conf_addlines(NULL, "source", lines);
-+ fail_if(cnf == NULL, "load config failed");
-+
-+ s = poldek_conf_get_section_ht(cnf, "source");
-+ fail_if(s == NULL, "no source section?");
-+
-+ i = 0;
-+ while (list_ops[i]) {
-+ list = poldek_conf_get_multi(s, list_ops[i]);
-+ fail_if(list == NULL, "no %s?", list_ops[i]);
-+ verify_list(list, 1, list_ops[i]); /* maxno = 1 */
-+ i++;
-+ }
-+}
-+END_TEST
-+
-+struct test_suite test_suite_config = {
-+ "config",
-+ {
-+ { "raw", test_config },
-+ { "lists", test_config_lists },
-+
-+// XXX: excl list not implemented yet
-+ { "lists excl", test_config_lists_excl },
-+ { NULL, NULL }
-+ }
-+};
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-diff -urN poldek-0.20.org/tests/test_env.c poldek-0.20/tests/test_env.c
---- poldek-0.20.org/tests/test_env.c 2005-10-23 10:12:45.000000000 +0200
-+++ poldek-0.20/tests/test_env.c 2006-07-26 20:25:54.339334750 +0200
-@@ -1,19 +1,68 @@
- #include "test.h"
- START_TEST (test_env) {
- char buf[PATH_MAX], tmp[PATH_MAX];
-+ const char *s;
-
- n_snprintf(buf, sizeof(buf), "${ENV1}${ENV2}");
- setenv("ENV1", "pol", 1);
- setenv("ENV2", "dek", 1);
-+
-+ s = poldek_util_expand_env_vars(tmp, sizeof(tmp), buf);
-+ fail_if(s == NULL, "expand_env_vars failed");
-+
-+ fail_if(n_str_ne(s, "poldek"),
-+ "expand_env_vars() failed: %s -> %s", buf, s);
-+
-+ fail_if(n_str_ne(tmp, "poldek"),
-+ "expand_env_vars() failed: %s -> %s", buf, tmp);
-+
-+
-+ n_snprintf(buf, sizeof(buf), "foobar");
-+ s = poldek_util_expand_env_vars(tmp, sizeof(tmp), buf);
-+
-+ fail_if(s == NULL, "expand_env_vars failed");
-+ fail_if(n_str_ne(s, buf),
-+ "expand_env_vars() failed: %s -> %s", buf, s);
-+}
-+END_TEST
-+
-+
-+
-+START_TEST (test_var) {
-+ char buf[PATH_MAX], tmp[PATH_MAX];
-+ const char *s;
-+ tn_hash *vars;
-+
-+ n_snprintf(buf, sizeof(buf), "%{1}%{2}");
-+
-+ vars = n_hash_new(16, NULL);
-+ n_hash_insert(vars, "1", "pol");
-+ n_hash_insert(vars, "2", "dek");
-+
-+ s = poldek_util_expand_vars(tmp, sizeof(tmp), buf, '%', vars);
-+ fail_if(s == NULL, "expand_vars failed");
-+
-+ fail_if(n_str_ne(s, "poldek"),
-+ "expand_vars() failed: %s -> %s", buf, s);
-+
-+ fail_if(n_str_ne(tmp, "poldek"),
-+ "expand_vars() failed: %s -> %s", buf, tmp);
-
-- expand_env_vars(tmp, sizeof(tmp), buf);
-- fail_unless(n_str_eq(tmp, "poldek"),
-- "expand_env_vars() failed: %s -> %s", buf, tmp);
-
-+ n_snprintf(buf, sizeof(buf), "foobar");
-+ s = poldek_util_expand_vars(tmp, sizeof(tmp), buf, '%', vars);
-+
-+ fail_if(s == NULL, "expand_vars failed");
-+ fail_if(n_str_ne(s, buf),
-+ "expand_vars() failed: %s -> %s", buf, s);
- }
- END_TEST
-
-
--struct test_case test_case_misc_env = {
-- "env vars expanding", test_env
-+struct test_case test_case_misc_env0 = {
-+ "env vars expanding", test_env,
-+};
-+
-+struct test_case test_case_misc_env1 = {
-+ "vars expanding", test_var
- };
-diff -urN poldek-0.20.org/tests/test.h poldek-0.20/tests/test.h
---- poldek-0.20.org/tests/test.h 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/tests/test.h 2006-07-26 20:25:54.339334750 +0200
-@@ -0,0 +1,37 @@
-+#ifndef POLDEK_TEST_H
-+#define POLDEK_TEST_H
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <sys/param.h> /* for PATH_MAX */
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+
-+#include <trurl/nassert.h>
-+#include <trurl/nmalloc.h>
-+#include <check.h>
-+
-+#include "i18n.h"
-+#include "log.h"
-+#include "pkg.h"
-+#include "misc.h"
-+#include "capreq.h"
-+#include "pm/pm.h"
-+#include "pm/rpm/pm_rpm.h"
-+#include "pkgmisc.h"
-+
-+#define fail_ifnot fail_unless
-+
-+struct test_case {
-+ const char *name;
-+ void (*test_fn)(void);
-+};
-+
-+struct test_suite {
-+ const char *name;
-+ struct test_case cases[];
-+};
-+
-+#endif
-diff -urN poldek-0.20.org/tests/test_op.c poldek-0.20/tests/test_op.c
---- poldek-0.20.org/tests/test_op.c 2005-10-23 10:12:45.000000000 +0200
-+++ poldek-0.20/tests/test_op.c 2006-07-26 20:25:54.339334750 +0200
-@@ -30,6 +30,8 @@
-
- fail_unless(is_op(ts, op, !defaultv),
- "%s not propagated to ts", opname);
-+ return 1;
-+
- }
-
- START_TEST (test_op_ts_postconf) {
-diff -urN poldek-0.20.org/tests/test_poldek.c poldek-0.20/tests/test_poldek.c
---- poldek-0.20.org/tests/test_poldek.c 2005-10-23 10:12:45.000000000 +0200
-+++ poldek-0.20/tests/test_poldek.c 2006-07-26 20:25:54.339334750 +0200
-@@ -1,24 +1,28 @@
- /*
-- $Id$
-+ $Id$
- */
- #include <check.h>
- #include "test.h"
--//#include "test_env.c"
-
- extern struct test_suite test_suite_match;
- extern struct test_suite test_suite_pmdb;
- extern struct test_suite test_suite_op;
-+extern struct test_suite test_suite_config;
-
- struct test_suite *suites[] = {
- &test_suite_match,
- &test_suite_pmdb,
- &test_suite_op,
-+ &test_suite_config,
- NULL,
- };
-
--extern struct test_case test_case_misc_env;
-+extern struct test_case test_case_misc_env0;
-+extern struct test_case test_case_misc_env1;
-+
- struct test_case *misc_cases[] = {
-- &test_case_misc_env,
-+ &test_case_misc_env0,
-+ &test_case_misc_env1,
- NULL,
- };
-
-@@ -66,22 +70,25 @@
- if (argc > 1 && n_str_eq(argv[1], "-v"))
- poldek_VERBOSE = 1;
-
-- while (suites[i]) {
-- Suite *s = make_suite(suites[i]);
-+ if (misc_cases[0]) {
-+ Suite *s = make_themisc_suite();
- SRunner *sr = srunner_create(s);
- srunner_run_all(sr, CK_NORMAL);
- nerr += srunner_ntests_failed(sr);
- srunner_free(sr);
-- i++;
- }
--
-- if (misc_cases[0]) {
-- Suite *s = make_themisc_suite();
-+
-+ while (suites[i]) {
-+ Suite *s = make_suite(suites[i]);
- SRunner *sr = srunner_create(s);
-+ printf("\n");
- srunner_run_all(sr, CK_NORMAL);
- nerr += srunner_ntests_failed(sr);
- srunner_free(sr);
-+ i++;
- }
-+
-+
-
- return (nerr == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
- }
-diff -urN poldek-0.20.org/trurlib/autogen.sh poldek-0.20/trurlib/autogen.sh
---- poldek-0.20.org/trurlib/autogen.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/trurlib/autogen.sh 2003-01-18 15:39:25.000000000 +0100
-@@ -0,0 +1,30 @@
-+#!/bin/sh
-+# $Id$
-+
-+FILE=n_array_new.c
-+PKG=trurlib
-+
-+if [ ! -f $FILE ]; then
-+ cd `dirname $0`;
-+ if [ ! -f $FILE ]; then
-+ echo "`pwd`: not a $PKG directory"
-+ exit 1
-+ fi
-+fi
-+
-+runcmd () {
-+ echo "$@"
-+ $@
-+ test $? -eq 0 || exit 1
-+}
-+
-+runcmd libtoolize --force --automake
-+runcmd aclocal
-+runcmd autoheader
-+runcmd automake --add-missing --no-force
-+runcmd autoconf
-+
-+if [ -z "$1" -o "$1" != "--no-configure" ]; then
-+ CONFOPTS="--enable-maintainer-mode --enable-compile-warnings $@"
-+ runcmd ./configure $CONFOPTS
-+fi
-diff -urN poldek-0.20.org/trurlib/ChangeLog poldek-0.20/trurlib/ChangeLog
---- poldek-0.20.org/trurlib/ChangeLog 2005-10-17 23:37:27.000000000 +0200
-+++ poldek-0.20/trurlib/ChangeLog 2005-11-06 21:01:23.000000000 +0100
-@@ -0,0 +1,699 @@
-+2005-11-06 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nbuf.c: - be paranoid
-+
-+ * include/trurl/narray.h:
-+ - new n_array_ctl_get_freefn(), to be consitent
-+
-+2005-10-17 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nstream.h, nstream.c:
-+ - prefixed nstream members to avoid conflicts with stdio macros (thanks to Olivier Thauvin (olivier.thauvin att aerov jussieu fr)
-+
-+ * include/trurl/narray.h: - more comments
-+
-+2005-06-13 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nstream.h: - comments
-+
-+ * configure.in, nmalloc.c:
-+ - do not make unalign obstack on sparc, alpha, etc
-+
-+2005-05-13 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * lib/obstack.c: - missing include
-+
-+ * libtrurl.sym: - missing symbols
-+
-+ * libtrurl.sym: - symtab
-+
-+ * configure.in, lib/.cvsignore, lib/Makefile.am, lib/obstack.c, lib/obstack.h, nmalloc.c, Makefile.am:
-+ - be more portable (obstack)
-+
-+2005-05-12 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nstream.c:
-+ - disabled usage of stdio cookies, too much troubles with them
-+
-+ * configure.in:
-+ - disaled usage of stdio cookies, too much troubles with them
-+
-+ * ndie.c: - horrible bug
-+
-+2005-04-21 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/narray.h, n_array_new.c: - new n_array_cfree()
-+
-+2005-04-16 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nstream.c:
-+ - cookie's gzfseek() fix: set offset to proper value (qboosh at pld-linux org)
-+
-+ * nbuf.c, test_common.c: - bugfix
-+
-+2005-04-11 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * configure.in, nstream.c:
-+ - tolerate missing gzungetc() (not used in fact)
-+
-+2004-11-16 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/narray.h, n_array_sorts.c, test_array.c:
-+ - +n_array_reverse()
-+
-+2004-11-03 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/n_obj_ref.h, include/trurl/trurl.h, include/trurl/nbuf.h:
-+ - be c++ friendly
-+
-+2004-10-23 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Makefile.am, include/trurl/nstr.h, nstr.c, test_nstr.c:
-+ - n_str_strip_ws()
-+
-+2004-10-15 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nassert.h, nassert.c, ndie.c:
-+ - set_hook() schema for both die and assert; die() cosmetics
-+
-+2004-10-14 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nstream.h, nstream.c, test_stream.c:
-+ - +n_stream_getline()
-+
-+2004-10-07 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * n_hash_dup.c: - dup()ed hash could not inherit NOCPKEY
-+
-+2004-10-05 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/narray.h, n_array_new.c: - cleanup
-+
-+2004-10-04 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nstr_tokl.c: - do not assume that WHITE is after quoted string
-+
-+ * nstr_tokl.c: - normal characters are not escapeable
-+
-+ * include/trurl/nstr.h, nstr_tokl.c: - no default escape char
-+
-+2004-10-02 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/narray.h, n_array_new.c: - +n_array_ctl_get_cmpfn()
-+
-+ * configure.in: - missing check
-+
-+ * n_array_sorts.c: - trace
-+
-+2004-09-30 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/narray.h: - SWIGing
-+
-+2004-09-27 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * test_stream.c: - more tests
-+
-+2004-09-26 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/trurl.h: - missing inc
-+
-+ * test_array.c: - more tests
-+
-+2004-09-21 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nstr.h, nstr_tok.c, nstr_tokl.c: - delim is const char
-+
-+2004-09-12 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/Attic/nobstack.h, Attic/test_obstack.c, Makefile.am, nmalloc.c:
-+ - obsoleted obstack.h
-+
-+2004-09-01 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Makefile.am: - 'symlink' is useless
-+
-+ * include/trurl/narray.h: - missing include
-+
-+2004-08-06 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/n_array_dup.c, include/trurl/narray.h, n_array_new.c:
-+ - +n_array_ctl_set*fn
-+
-+ * nmalloc.c: - smaller min. chunks
-+
-+2004-07-23 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * n_hash_keys.c: - fix
-+
-+ * include/trurl/nhash.h, n_hash_keys.c: - +n_hash_values()
-+
-+2004-07-14 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nhash.h, n_hash_free.c, n_hash_int.h, n_hash_new.c, n_hash_put.c:
-+ - tn_alloc support
-+
-+ * nbuf.c, include/trurl/nbuf.h: - n_ref() aware
-+
-+2004-07-13 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nmalloc.c: - refcount-able
-+
-+2004-07-12 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * n_hash_new.c, n_hash_put.c, trurl_internal.h, Attic/hash-string.h, Makefile.am, n_hash_int.h:
-+ - cleanups
-+
-+ * nmalloc.c: - bugfix
-+
-+2004-07-11 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * .cvsignore, Makefile.am, include/trurl/ntuple.h, n_array_sorts.c, ntuple.c:
-+ - +ntuple - python-like, semi-array
-+
-+ * include/trurl/narray.h: - bugfix
-+
-+2004-07-09 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/n_array_free.c, Makefile.am, include/trurl/narray.h, include/trurl/nmalloc.h, n_array_new.c, nmalloc.c:
-+ - +tn_alloc
-+
-+ * n_hash_map.c: - dump()
-+
-+2004-06-24 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nbuf.c: - improved restore()
-+
-+2004-06-23 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nhash.h, n_hash_free.c, n_hash_get.c, n_hash_int.h, n_hash_new.c, n_hash_put.c, nbuf.c:
-+ - fixes && improvements
-+
-+2004-06-22 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/n_hash_exists.c, Makefile.am, include/trurl/nbuf.h, n_hash_int.h, nbuf.c:
-+ - improvements
-+
-+ * n_hash_dup.c, n_hash_free.c, n_hash_get.c, n_hash_map.c, n_hash_new.c, n_hash_put.c, n_hash_remove.c, n_hash_stats.c, test_hash.c, trurl_internal.h:
-+ - hash table improvements
-+
-+2004-05-06 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * n_array_dump_stats.c, n_hash_stats.c, nstr_tokl.c:
-+ - type fixes, incl. SEGV on 64-bit archs (qboosh)
-+
-+2004-03-22 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/narray.h, include/trurl/trurl.h, n_array_push.c:
-+ - n_array_concat()
-+
-+2004-02-23 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/narray.h, n_array_nth.c: - SWIG'ed
-+
-+2004-02-22 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/Attic/nobstack.h, Attic/test_obstack.c, Makefile.am:
-+ - glibc's obstack wrapper
-+
-+2004-02-17 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Makefile.am: - 'make distcheck' fixes (wiget at pld-linux org)
-+
-+ * n_array_clone.c, include/trurl/narray.h:
-+ - merged _dup() and _clone() funcs
-+
-+2004-01-05 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nstr.h, nstr_basenam.c:
-+ - + n_dirname() alias for n_basedirnam()
-+
-+ * nstr_tokl.c: - commented out debug message
-+
-+ * include/trurl/nbuf.h: - new n_buf_it_read()
-+ - bugfixes
-+ - n_buf_it_read_*int*() aliases to n_buf_it_get_int*
-+
-+ * include/trurl/nstr.h: - new n_str_[eq,ne] macros
-+
-+2003-12-31 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nbuf.h: - replaced macros with inline funcs
-+
-+2003-12-30 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nmalloc.h, n_hash_free.c, n_hash_remove.c, nbuf.c, nstr_concat.c, nstr_len.c, nstring.c, test_nstr.c:
-+ - nothing shocking
-+
-+ * Makefile.am: - fixed *.h list
-+
-+ * nstream.c: - bugfix (added gzseek stdio-like wrapper)
-+
-+2003-04-30 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nstr.h, nstr_tokl.c: - + n_str_etokl() (line tokenizer)
-+
-+2003-04-23 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nstr.h, nstr_tokl.c: + n_str_tokl_n()
-+
-+2003-04-14 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nmalloc.h: + n_strdupap()
-+
-+2003-02-07 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nbuf.h: - missing inclusion
-+
-+ * n_hash_put.c: - do not free NULL pointers...
-+
-+2003-01-18 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * autogen.sh: - added --no-configure option
-+
-+ * include/trurl/narray.h, n_array_new.c: - +n_array_init()
-+
-+ * configure.in: - missing zlib
-+
-+2003-01-14 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nmalloc.h, nmalloc.c:
-+ +n_cfree() (frees and sets to NULL a pointer)
-+
-+2003-01-06 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * n_hash_dup.c: - bugfix
-+
-+2002-12-13 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nmalloc.h, include/trurl/narray.h, n_array_ctl.c, n_array_int.h, n_array_new.c, n_array_nth.c, n_array_push.c, n_array_set_nth.c, n_array_sorts.c, n_array_unshift.c, n_hash_new.c, nbuf.c, nmalloc.c, test_array.c:
-+ - + n_memdup()
-+ - few n_array's improvements
-+
-+2002-12-12 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/n_obj_ref.h, include/trurl/narray.h, include/trurl/nhash.h, include/trurl/nlist.h, Attic/n_array_dup.c, Attic/n_array_free.c, n_array_clone.c, n_array_int.h, n_array_new.c, n_hash_free.c, n_hash_int.h, n_hash_new.c, n_list_free.c, n_list_int.h, n_list_new.c, nstr_tok.c, nstr_tokl.c, test_nstr.c:
-+ - + n_(array|hash|list)_ref()
-+ - cleanups
-+
-+2002-12-10 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nhash.h, Makefile.am, n_hash_dup.c: + n_hash_dup()
-+
-+2002-12-02 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nbuf.h: - n_buf_it_get* fixes
-+
-+ * nbuf.c: - buffer with constant data may be cleaned too
-+
-+2002-11-13 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nmalloc.c, nstream.c: - cosmetics
-+
-+ * include/trurl/nhash.h, n_hash_keys.c: - improved n_hash_keys()
-+
-+ * include/trurl/nbuf.h, nbuf.c: - n_buf_gets() and co
-+
-+2002-11-07 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * ndie.c: - missing include
-+
-+ * include/trurl/nhash.h, Makefile.am, configure.in, n_hash_keys.c, n_hash_new.c:
-+ - new fn n_hash_keys()
-+ - released as 0.44.0
-+
-+2002-11-04 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/n2h.h, include/trurl/nbuf.h, include/trurl/nstream.h, nmalloc.c, nstream.c, test_common.c, test_stream.c, Makefile.am, Makefile.extra, configure.in, n_array_remove_ex.c, n_hash_int.h, n_hash_new.c, nbuf.c, ndie.c:
-+ - improved tn_buf: moved add_intXX() from poldek, stdio like interface
-+ is added
-+ - tn_stream fixes
-+ - moved n2h from poldek
-+ - killed gcc's warnings
-+
-+2002-10-29 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nbuf.h, include/trurl/nstore.h, include/trurl/nstream.h, Makefile.extra, configure.in, nbuf.c, nstore.c, nstream.c, test_array.c, test_stream.c, Makefile.am:
-+ - new tn_steam module with support for transparent access to compressed
-+ files and stdio-like interface.
-+ - new n_buf_(re)store*() functions
-+
-+ * Makefile.am: - updated library version info
-+
-+2002-10-18 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * configure.in:
-+ - ,,automake requires 'AM_CONFIG_HEADER', not 'AC_CONFIG_HEADER' ''
-+
-+2002-10-18 Artur Frysiak <wiget@pld.org.pl>
-+
-+ * .cvsignore: more ignores
-+
-+ * Attic/acconfig.h, configure.in, Makefile.am: - make distcheck passed
-+
-+2002-10-17 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Makefile.am, autogen.sh, configure.in:
-+ - adaptation to include/trurl headers location
-+
-+2002-10-16 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/narray.h: - +n_array_has_free_fn()
-+
-+2002-06-03 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nbuf.c: - minor bugfix
-+
-+2002-05-06 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Makefile.am, NEWS, configure.in, include/trurl/narray.h, n_array_int.h, n_array_nth.c:
-+ - make n_array_nth() inline (speed!)
-+
-+ * Attic/trurl_die.c, include/trurl/ndie.h, ndie.c:
-+ - make n_die() public
-+
-+ * include/trurl/nbuf.h, nbuf.c: - new n_buf_*printf()
-+
-+ * Makefile.am, nmalloc.c, xmalloc.c:
-+ - fixed static link: moved xmalloc*()s to separate module
-+
-+ * Makefile.am: - released as 0.43.7
-+
-+2002-04-26 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * NEWS, README: - updated && merged with PL versions
-+
-+ * Attic/CHANGES.PL, Attic/README.PL: - obsoleted
-+
-+2002-04-25 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nmalloc.h, nmalloc.c, test_common.c: - nicer fn name
-+
-+ * Attic/xmalloc.h, include/trurl/trurl.h, nstr_tok.c, nstr_tokl.c, nstring.c, test_array.c, test_common.c, test_list.c, xmalloc.c, include/trurl/nmalloc.h, n_array_grow_priv.c, n_array_int.h, n_array_new.c, n_hash_int.h, n_hash_new.c, n_hash_put.c, n_list_int.h, n_list_new.c, n_list_push.c, n_list_unshift.c, nbuf.c, nmalloc.c, nstr_basenam.c, nstr_concat.c, nstr_cpy.c, nstr_len.c, configure.in, n_array_clone.c, Makefile.am:
-+ - xmalloc()s -> n_malloc()s
-+
-+2002-04-21 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Makefile.am: - released as 0.43.6
-+
-+2002-04-05 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/n_snprintf.h: - bugfix
-+
-+ * include/trurl/trurl.h: - +#include <trurl/n_snprintf.h>
-+
-+ * NEWS, configure.in, include/trurl/n_snprintf.h, Makefile.am:
-+ - n_snprintf.h with [v]snprintf wrappers which always returns
-+ the number of characters printed
-+ - released as 0.43.6
-+
-+2002-03-15 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Makefile.am, NEWS, configure.in: - released as 0.43.5
-+
-+ * nbuf.c: - be 0.43.3 compatibile and provide n_buf_add symbol too
-+
-+2002-03-13 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * NEWS: - released as 0.43.4
-+
-+2002-03-12 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nstr.h, nstr_concat.c, nstr_len.c:
-+ - copy va_list via __va_copy() macro (to be portable to PPC)
-+
-+2002-02-19 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * .cvsignore, Makefile.am, configure.in, include/trurl/nbuf.h, nbuf.c:
-+ - added n_buff_addz(); pre 0.43.4
-+
-+ * Attic/ndbhash.c, Attic/ndbhash.h, Attic/test_dbhash.c:
-+ - removed dead code
-+
-+2002-02-08 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * test_array.c: - one more test
-+
-+2002-02-07 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * n_array_remove_ex.c, test_array.c: - bugfix
-+
-+ * include/trurl/nhash.h, n_hash_new.c: - added n_hash_size
-+
-+2001-09-06 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Makefile.am, configure.in, n_array_sorts.c: - fixed AUTOSORTED
-+ - simplified sort code
-+
-+2001-06-09 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * configure.in, NEWS: - 0.43.2
-+
-+ * n_array_clone.c: - fixed buggy func
-+
-+ * include/trurl/narray.h, nbuf.c: - bugfix
-+
-+2001-04-24 Tomasz K³oczko <kloczek@pld.org.pl>
-+
-+ * Makefile.am: - removed VERSION from EXTRA_DIST.
-+
-+ * Attic/VERSION, configure.in: - changed version to 0.43.1,
-+ - removed usinf VERSION file.
-+
-+2001-04-23 Rafa³ Kleger-Rudomin <klakier@pld.org.pl>
-+
-+ * configure.in: - AC_PROG_LIBTOOL -> AM_PROG_LIBTOOL
-+
-+2001-02-10 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Makefile.am, include/trurl/narray.h, n_array_clone.c: - new function
-+
-+2001-02-08 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/ChangeLog: - don't like ChangeLog from whole installer
-+
-+ * Makefile.am, configure.in: - cosmetics (up to new automake)
-+
-+ * n_array_map.c, n_array_map_arg.c, n_array_remove_nth.c: - bugfix
-+
-+ * include/trurl/narray.h, n_array_remove_ex.c: - new function
-+
-+2001-02-02 Nobody <nobody@pld.org.pl>
-+
-+ * Attic/ChangeLog: - ChangeLog update by changelog.sh
-+ (by Arkadiusz Miskiewicz <misiek@pld.org.pl>)
-+
-+2000-11-28 Nobody <nobody@pld.org.pl>
-+
-+ * Attic/ChangeLog: - ChangeLog update by changelog.sh
-+ (by Arkadiusz Miskiewicz <misiek@pld.org.pl>)
-+
-+2000-11-24 Nobody <nobody@pld.org.pl>
-+
-+ * Attic/ChangeLog: - ChangeLog update by changelog.sh
-+ (by Arkadiusz Miskiewicz <misiek@pld.org.pl>)
-+
-+2000-11-24 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/VERSION: - marked as 0.431
-+
-+ * .cvsignore, Makefile.am: - added spec to EXTRA_DIST
-+
-+2000-11-12 Nobody <nobody@pld.org.pl>
-+
-+ * Attic/ChangeLog: - ChangeLog update by changelog.sh
-+ (by Arkadiusz Miskiewicz <misiek@pld.org.pl>)
-+
-+2000-11-10 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/mkmake.sh, autogen.sh: - be more traditional
-+
-+2000-11-09 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Makefile.am, Makefile.extra: - make trurl -> . symlink
-+ - am's *CLEAN variables are used instead of removals in mclean goal
-+
-+2000-11-08 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nbuf.c: - fixed some bugs
-+
-+2000-10-31 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * configure.in: - check for db*.h headers instead of library
-+
-+ * Makefile.am: - use libtool version-info
-+
-+2000-10-29 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/narray.c, Attic/nhash.c, Attic/nlist.c, Attic/trurlib.spec, n_list_nth.c, n_list_pop.c, n_list_push.c, n_list_remove_ex.c, n_list_remove_nth.c, n_list_shift.c, n_list_size.c, n_list_unshift.c, nstr_cpy.c, nstring.c, trurlib.spec.in, Attic/VERSION, Attic/acconfig.h, Attic/mkmake.sh, Attic/n_array_dup.c, Attic/n_array_free.c, Attic/n_hash_exists.c, Makefile.am, Makefile.extra, NEWS, README, configure.in, mkarch.sh, n_array_bsearch_ex.c, n_array_clean.c, n_array_ctl.c, n_array_dump_stats.c, n_array_eq_ex.c, n_array_grow_priv.c, n_array_int.h, n_array_map.c, n_array_map_arg.c, n_array_new.c, n_array_nth.c, n_array_pop.c, n_array_push.c, n_array_remove_nth.c, n_array_set_nth.c, n_array_shift.c, n_array_sorts.c, n_array_uniq_ex.c, n_array_unshift.c, n_hash_clean.c, n_hash_ctl.c, n_hash_free.c, n_hash_get.c, n_hash_int.h, n_hash_map.c, n_hash_map_arg.c, n_hash_new.c, n_hash_put.c, n_hash_remove.c, n_hash_stats.c, n_list_contains_ex.c, n_list_free.c, n_list_int.h, n_list_iterator.c, n_list_lookup_ex.c, n_list_map_arg.c, n_list_new.c, .cvsignore, AUTHORS, Attic/ChangeLog, Attic/Makefile, COPYING, INSTALL:
-+ - automake/autoconf support
-+
-+2000-10-25 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * xmalloc.c: - allow NULL as xrealloc() arg
-+
-+2000-10-17 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nbuf.h, nbuf.c: - nbuf redesign
-+
-+2000-10-01 Tomasz K³oczko <kloczek@pld.org.pl>
-+
-+ * configure.in: - generated by autoscan.
-+
-+2000-09-20 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/Makefile, include/trurl/nstr.h, nstr_basenam.c:
-+ - basename() functions added
-+
-+ * Attic/trurlib.spec:
-+ - %{tmpdir} -> /tmp, distribution spec shouldn't be PLD dependent
-+
-+ * Attic/Makefile, Attic/VERSION, Attic/trurlib.spec:
-+ - current working version is v0.42
-+
-+ * Attic/Makefile: - bugfix
-+
-+ * include/trurl/nstr.h, nstr_cpy.c: - n_strncpy() added
-+
-+2000-09-07 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nstr_tok.c: - bugfix
-+
-+ * Attic/Makefile: - misarch goal added
-+
-+ * Attic/nhash.c, include/trurl/nhash.h, test_hash.c:
-+ - added hash function from D. J. Bernstein's cdb
-+ - n_hash_stats() added
-+
-+ * Attic/narray.c, include/trurl/narray.h, test_array.c:
-+ - removed growth control (nobody needs it)
-+ - autosort option added
-+ - cosmetics
-+
-+2000-08-07 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/tfn_types.h: - typedefs tn_fn_map{1,2,3} added
-+
-+2000-08-03 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * include/trurl/nhash.h, Attic/Makefile, Attic/nhash.c:
-+ - added n_hash_clean()
-+
-+2000-08-02 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nstr_tokl.c: - yet another bug is killed
-+
-+ * nstr_tokl.c: - another horrible bug is fixed
-+
-+2000-07-28 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * nbuf.c: - fixed horrible bug
-+
-+2000-07-27 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/nhash.c: - do not remalloc buckets during rehashing
-+
-+ * Attic/Makefile, Attic/nhash.c: - bugfix: n_hash_ctl.o is compiled now
-+
-+2000-07-20 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/VERSION, Attic/trurlib.spec: - version 0.41
-+
-+ * Attic/Makefile:
-+ - added fid-arch goal, which creates subset of library for fix-info-dir
-+
-+ * include/trurl/trurl.h: - nbuf header added
-+
-+ * include/trurl/nbuf.h, nbuf.c: - initial version
-+
-+ * Attic/narray.c, include/trurl/narray.h:
-+ - added n_array_bsearch_idx() (returns index of finded item)
-+
-+ * Attic/nhash.c, include/trurl/nhash.h, test_hash.c:
-+ - more flexible hash table: grow with rehashing and do not always copy keys,
-+ n_hash_ctl() added
-+
-+ * Attic/ndbhash.c, Attic/ndbhash.h, Attic/nlist.c, Attic/trurl_die.c, include/trurl/nassert.h, include/trurl/nlist.h, include/trurl/nstr.h, include/trurl/tfn_types.h, nassert.c, nstr_concat.c, nstr_len.c, nstr_tokl.c, trurl_cmpf.c, trurl_internal.h, xmalloc.c:
-+ - cosmetics
-+
-+2000-07-15 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/Makefile, Attic/narray.c, Attic/nhash.c, Attic/nlist.c, Attic/trurlib.spec, trurl_internal.h:
-+ - modularized narray, nhash and nlist modules
-+
-+2000-06-09 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/Makefile, Attic/trurlib.spec: - spec
-+
-+ * Attic/test_dbhash.c, nstr_tokl.c, test_array.c, test_common.c, test_hash.c, test_list.c, test_nstr.c, xmalloc.c:
-+ - minor #include fixes
-+
-+2000-05-22 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/nlist.c, include/trurl/nlist.h, test_list.c:
-+ - fixed list iterator
-+
-+ * Attic/nlist.c: - bugfix
-+
-+2000-05-19 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * .cvsignore: *** empty log message ***
-+
-+ * Attic/Makefile, Attic/README.PL, Attic/VERSION, Attic/hash-string.h, Attic/narray.c, Attic/nhash.c, Attic/nlist.c, include/trurl/narray.h, include/trurl/nhash.h, include/trurl/nlist.h, include/trurl/tfn_types.h, include/trurl/trurl.h, test_array.c, test_list.c:
-+ - allowed interlaced iterations on list (new tn_list_iterator type)
-+ - removed libc's qsort() i bsearch() functions from array
-+ - removed useless dup_fn member from list and array
-+ - reduced args list of n_array_new() (narray_ctl_growth() added)
-+
-+2000-05-04 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/xmalloc.h: - undef glibc's strdup macro
-+
-+ * Attic/VERSION: *** empty log message ***
-+
-+ * include/trurl/narray.h: - comment
-+
-+ * Attic/Makefile: - allow override CFLAGS
-+ - allow compilation without ndbhash
-+
-+2000-03-25 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/Makefile, Attic/narray.c, Attic/nhash.c, Attic/nlist.c, include/trurl/narray.h, include/trurl/nlist.h, include/trurl/nstr.h, trurl_cmpf.c, trurl_internal.h:
-+ - added n_list_map_arg()
-+ - added default compare function for array and list
-+ - bugfix in n_array_bsearch()
-+
-+2000-03-20 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/Makefile, Attic/xmalloc.h: - works with rpmlib.h
-+ - install: target
-+
-+2000-03-17 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/nlist.c: - fix bug in n_list_remove_ex()
-+
-+2000-01-18 Pawe³ Ko³odziej <pawelk@pld.org.pl>
-+
-+ * Attic/narray.c: Bug in qsort? Uses isort
-+
-+1999-11-06 Artur Frysiak <wiget@pld.org.pl>
-+
-+ * .cvsignore, Makefile.am: New file.
-+
-+1999-10-17 Pawe³ Gajda <mis@pld.org.pl>
-+
-+ * Attic/Makefile, Attic/README.PL, Attic/ndbhash.c, Attic/xmalloc.h:
-+ Detekcja wersji glibc na podstawie __GLIBC_MINOR__
-+
-+1999-09-17 Jarek Wo³oszyn <yossa@pld.org.pl>
-+
-+ * Attic/Makefile: gentocf - moje ostatnie zmiany
-+ main - przenioslem win.* i scrmsgs.* do newt-addon
-+ trurlib - glibc 2.1
-+
-+1999-07-22 Artur Frysiak <wiget@pld.org.pl>
-+
-+ * Attic/CHANGES.PL, Attic/Makefile, Attic/README.PL, Attic/VERSION, Attic/hash-string.h, Attic/narray.c, Attic/ndbhash.c, Attic/ndbhash.h, Attic/nhash.c, Attic/nlist.c, Attic/test_dbhash.c, Attic/trurl_die.c, Attic/xmalloc.h, include/trurl/narray.h, include/trurl/nassert.h, include/trurl/nhash.h, include/trurl/nlist.h, include/trurl/nstr.h, include/trurl/tfn_types.h, include/trurl/trurl.h, nassert.c, nstr_concat.c, nstr_len.c, nstr_tok.c, nstr_tokl.c, nstring.c, test_array.c, test_common.c, test_hash.c, test_list.c, test_nstr.c, xmalloc.c:
-+ New file.
-+
-+ * TODO.PL, nstring.h: pozbierane z diony
-+
-diff -urN poldek-0.20.org/trurlib/include/trurl/narray.h poldek-0.20/trurlib/include/trurl/narray.h
---- poldek-0.20.org/trurlib/include/trurl/narray.h 2005-10-17 23:19:39.000000000 +0200
-+++ poldek-0.20/trurlib/include/trurl/narray.h 2005-11-06 20:29:52.000000000 +0100
-@@ -1,7 +1,7 @@
- /*
- TRURLib
- Dynamic array of void*
-- $Id$
-+ $Id$
- */
-
- #ifndef TRURL_ARRAY_H
-@@ -57,9 +57,11 @@
- }
- #endif
- #define n_array_ctl_growth(arr, inctype) ((void) 0) /* backward API compat */
--#define n_array_has_free_fn(arr) (arr)->free_fn
-+#define n_array_has_free_fn(arr) (arr)->free_fn /* -"- */
-
-+#define n_array_ctl_get_freefn(arr) (arr)->free_fn
- tn_fn_free n_array_ctl_set_freefn(tn_array *arr, tn_fn_free free_fn);
-+
- tn_fn_cmp n_array_ctl_set_cmpfn(tn_array *arr, tn_fn_cmp cmp_fn);
- tn_fn_cmp n_array_ctl_get_cmpfn(tn_array *arr);
-
-diff -urN poldek-0.20.org/trurlib/mkarch.sh poldek-0.20/trurlib/mkarch.sh
---- poldek-0.20.org/trurlib/mkarch.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/trurlib/mkarch.sh 2000-10-29 22:12:21.000000000 +0100
-@@ -0,0 +1,9 @@
-+#! /bin/sh
-+CPDIR=/z
-+make -f Makefile.extra mclean
-+
-+if [ -w $CPDIR ]; then
-+ make -f Makefile.extra backup cparch=1 backupdir=$CPDIR
-+else
-+ make -f Makefile.extra backup
-+fi
-diff -urN poldek-0.20.org/trurlib/nbuf.c poldek-0.20/trurlib/nbuf.c
---- poldek-0.20.org/trurlib/nbuf.c 2005-10-26 10:11:00.000000000 +0200
-+++ poldek-0.20/trurlib/nbuf.c 2005-11-06 20:32:22.000000000 +0100
-@@ -20,7 +20,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <stdlib.h>
-diff -urN poldek-0.20.org/trurlib/nstring.c poldek-0.20/trurlib/nstring.c
---- poldek-0.20.org/trurlib/nstring.c 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/trurlib/nstring.c 2003-12-30 19:07:57.000000000 +0100
-@@ -0,0 +1,234 @@
-+/*
-+ Not finished
-+ */
-+#include <stdarg.h>
-+#include <stdlib.h>
-+#include <string.h>
-+
-+#ifdef USE_N_ASSERT
-+#include "nassert.h"
-+#else
-+#include <assert.h>
-+#define n_assert(expr) assert(expr)
-+#endif
-+
-+#include "nstring.h"
-+
-+static char *vconcat(const char *s, va_list * ap);
-+static char *concat(const char *s,...);
-+
-+struct trurl_string {
-+ int16_t _refcnt;
-+ int16_t len;
-+ char s[0];
-+};
-+
-+
-+tn_string n_string_construct(char *s)
-+{
-+ int len;
-+ tn_string str;
-+
-+ len = strlen(s);
-+ if (len > 0) {
-+ str.s = n_strdup(s);
-+ str.len = len;
-+ str.size = len + 1;
-+ }
-+ return str;
-+}
-+
-+
-+static tn_string *n_string_generic_new(char *s)
-+{
-+ int len;
-+ tn_string *str;
-+
-+ if ((str = n_malloc(sizeof(*str))) == NULL)
-+ return NULL;
-+
-+ len = strlen(s);
-+ if (len > 0) {
-+ str->s = s;
-+ str->len = len;
-+ str->size = len + 1;
-+ } else {
-+ str->s = NULL;
-+ str->len = 0;
-+ str->size = 0;
-+
-+ }
-+
-+ return str;
-+}
-+
-+
-+tn_string *n_string_new(char *s)
-+{
-+ return n_string_generic_new(n_strdup(s));
-+}
-+
-+
-+tn_string *n_string_vnew(const char *s,...)
-+{
-+ register char *t;
-+ va_list ap;
-+
-+ va_start(ap, s);
-+ t = vconcat(s, ap);
-+ va_end(ap);
-+
-+ return n_string_generic_new(t);
-+}
-+
-+
-+/* str = '' */
-+tn_string *n_string_clean(tn_string * str)
-+{
-+ if (str->s != NULL)
-+ free(str->s);
-+ str->size = str->len = 0;
-+
-+ return str;
-+}
-+
-+
-+void n_string_free(tn_string * str)
-+{
-+ n_string_clean(str);
-+ free(str);
-+}
-+
-+
-+static tn_string *n_string_grow(tn_string * str, size_t size)
-+{
-+
-+ if (str->len + size >= str->size) {
-+ char *s;
-+ if ((s = n_realloc(str->s, str->size + size)) == NULL)
-+ return NULL;
-+
-+ str->s = s;
-+ str->size += size;
-+ }
-+ return str;
-+}
-+
-+
-+const char *n_string_ptr(const tn_string * str)
-+{
-+ return str->s;
-+}
-+
-+
-+tn_string *n_string_dup(const tn_string * str)
-+{
-+ return n_string_new(str->s);
-+}
-+
-+
-+/* s += "aaaaa" + "bbbbbbb" + "ccccccc" */
-+tn_string *n_string_append_ptr(tn_string * str, const char *src)
-+{
-+ register int len;
-+ register char *p;
-+
-+ if (str->s == src) { /* self */
-+ len = str->len;
-+ strcpy(p, src);
-+
-+ } else {
-+ len = strlen(src);
-+ p = (char *) src;
-+ }
-+
-+ n_string_grow(str, len);
-+ strncpy(str->s + str->len, p, len);
-+ str->len += len;
-+
-+ return str;
-+}
-+
-+/* s += s2 */
-+tn_string *n_string_append(tn_string * str, const tn_string * src)
-+{
-+ return n_string_append_ptr(str, n_string_ptr(src));
-+}
-+
-+/* s = "a" + s */
-+tn_string *n_string_prepend_ptr(tn_string * str, const char *src)
-+{
-+ int len;
-+
-+ len = strlen(src);
-+ n_string_grow(str, len);
-+
-+ memmove(str->s + str->len, src, len);
-+ str->len += len;
-+ return str;
-+}
-+
-+
-+/* s = s1 + s2 */
-+tn_string *n_string_add(const tn_string * str1, const tn_string * str2)
-+{
-+ char *s;
-+ s = concat(n_string_ptr(str1), n_string_ptr(str2), NULL);
-+
-+ return n_string_generic_new(s);
-+}
-+
-+
-+int n_string_cmp(const tn_string * str1, const tn_string * str2)
-+{
-+ return strcmp(str1->s, str2->s);
-+}
-+
-+int n_string_eq(const tn_string * str1, const tn_string * str2)
-+{
-+ return strcmp(str1->s, str2->s) == 0;
-+}
-+
-+
-+
-+
-+static char *concat(const char *s,...)
-+{
-+ char *t;
-+ va_list ap;
-+
-+ va_start(ap, s);
-+ t = vconcat(s, ap);
-+ va_end(ap);
-+
-+ return t;
-+}
-+
-+
-+static char *vconcat(const char *s, va_list * ap)
-+{
-+ int len;
-+ char *p, *rstr;
-+ va_list *tmp_ap;
-+
-+ len = strlen(s);
-+
-+ tmp_ap = ap;
-+
-+ while ((p = va_arg(ap, char *)) != NULL) { /* calculate length of args */
-+ len += strlen(p);
-+ }
-+
-+ if ((rstr = n_malloc(len + 1)) == NULL)
-+ return NULL;
-+
-+ strcpy(rstr, s);
-+
-+ ap = tmp_ap;
-+
-+ while ((p = va_arg(ap, char *)) != NULL) {
-+ strcat(rstr, p);
-+ }
-+
-+ return rstr;
-+}
-diff -urN poldek-0.20.org/trurlib/nstring.h poldek-0.20/trurlib/nstring.h
---- poldek-0.20.org/trurlib/nstring.h 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/trurlib/nstring.h 1999-07-22 17:29:29.000000000 +0200
-@@ -0,0 +1,42 @@
-+/*
-+ TRURLib
-+
-+ $Id$
-+*/
-+#ifndef __TN_STRING_H
-+#define __TN_STRING_H
-+
-+typedef struct string tn_string;
-+
-+tn_string n_string_construct(char *s);
-+tn_string *n_string_new(char *s);
-+tn_string *n_string_newv(const char *s, ...);
-+void n_string_free(tn_string *str);
-+
-+/* str = '' */
-+tn_string *n_string_clean(tn_string *str);
-+const char *n_string_ptr(const tn_string *str);
-+
-+/* s = new String(s2) */
-+tn_string *n_string_dup(const tn_string *str);
-+
-+/* s += "aaaaa" */
-+tn_string *n_string_append_ptr(tn_string *str, const char *src);
-+
-+/* s = "a" + s */
-+tn_string *n_string_prepend_ptr(tn_string *str, const char *src);
-+
-+
-+/* s += s2 */
-+tn_string *n_string_append(tn_string *str, const tn_string *src);
-+
-+
-+/* s = s1 + s2 */
-+tn_string *n_string_add(const tn_string *str1, const tn_string *str2);
-+
-+
-+int n_string_cmp(const tn_string *str1, const tn_string *str2);
-+int n_string_eq(const tn_string *str1, const tn_string *str2);
-+
-+
-+#endif
-diff -urN poldek-0.20.org/trurlib/TODO.PL poldek-0.20/trurlib/TODO.PL
---- poldek-0.20.org/trurlib/TODO.PL 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/trurlib/TODO.PL 1999-07-22 17:29:29.000000000 +0200
-@@ -0,0 +1,7 @@
-+* nlist
-+ - obs³uga listy posortowanej
-+ - lista 2-kierunkowa, jako opcja
-+
-+* nstring
-+ - dokoñczenie (odpowiedniki str* z libc)
-+
-diff -urN poldek-0.20.org/uninstall.c poldek-0.20/uninstall.c
---- poldek-0.20.org/uninstall.c 2005-10-12 21:28:02.000000000 +0200
-+++ poldek-0.20/uninstall.c 2006-07-26 20:25:54.343335000 +0200
-@@ -1,5 +1,5 @@
- /*
-- Copyright (C) 2000 - 2005 Pawel A. Gajda <mis@k2.net.pl>
-+ Copyright (C) 2000 - 2006 Pawel A. Gajda <mis@k2.net.pl>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2 as
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <errno.h>
-@@ -227,6 +227,7 @@
- MEMINF("START");
- DBGF("%s\n", pkg_id(pkg));
-
-+ msg_i(3, indent, "%s\n", pkg_id(pkg));
- for (i=0; i < n_array_size(pkg->reqs); i++) {
- struct capreq *req = n_array_nth(pkg->reqs, i);
-
-@@ -235,7 +236,7 @@
-
- DBGF("req %s\n", capreq_snprintf_s(req));
-
-- if (pkg_satisfies_req(pkg, req, 1)) { /* self match, should be handled
-+ if (pkg_satisfies_req(pkg, req, 1)) { /* XXX: self match, should be handled
- at lower level; TOFIX */
- DBGF("%s: satisfied by itself\n", capreq_snprintf_s(req));
-
-@@ -243,7 +244,7 @@
- uctx->uninst_set->dbpkgs)) {
-
- DBGF("%s: satisfied by db\n", capreq_snprintf_s(req));
-- msg_i(3, indent, "%s: satisfied by db\n", capreq_snprintf_s(req));
-+ msg_i(3, indent, " %s: satisfied by db\n", capreq_snprintf_s(req));
-
- } else if (!uctx->ts->getop(uctx->ts, POLDEK_OP_FOLLOW)) {
- logn(LOGERR, _("%s (cap %s) is required by %s"),
-@@ -402,12 +403,13 @@
-
- static
- int do_resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts,
-- const char *mask, const struct capreq *cr)
-+ const char *mask, const struct capreq *cr,
-+ const char *arch)
- {
- tn_array *dbpkgs;
- int i, nmatches = 0;
-
--
-+ n_assert(cr);
- DBGF("get_provides %s\n", capreq_snprintf_s(cr));
- dbpkgs = pkgdb_get_provides_dbpkgs(ts->db, cr, NULL, uninst_LDFLAGS);
-
-@@ -431,7 +433,8 @@
- } else { /* with version */
- if (ts->getop(ts, POLDEK_OP_CAPLOOKUP)) {
- if (pkg_xmatch_req(dbpkg, cr, POLDEK_MA_PROMOTE_REQEPOCH))
-- matched = 1;
-+ matched = 1;
-+
- } else {
- if (strcmp(dbpkg->name, capreq_name(cr)) == 0) {
- DBGF("n (%s, %s) %d\n", dbpkg->name,
-@@ -445,6 +448,12 @@
- pkg_evr_match_req(dbpkg, cr, POLDEK_MA_PROMOTE_REQEPOCH))
- matched = 1;
- }
-+
-+ if (matched && arch) {
-+ const char *dbarch = pkg_arch(dbpkg);
-+ matched = n_str_eq(arch, dbarch ? dbarch : "none");
-+ }
-+
- }
-
- if (matched) {
-@@ -457,15 +466,20 @@
- return nmatches;
- }
-
--static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts, const char *mask)
-+static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts,
-+ const char *mask, const char *arch)
- {
- char *p;
- struct capreq *cr, *cr_evr;
- int resolved = 0;
-
- cr = NULL; cr_evr = NULL;
--
-- if ((p = strchr(mask, '#')) == NULL) {
-+
-+ DBGF("mask=%s\n", mask);
-+ /* No EVR mask or empty EVR (last char '#') */
-+ if ((p = strchr(mask, '#')) == NULL || *(p + 1) == '\0') {
-+ if (p)
-+ *p = '\0';
- capreq_new_name_a(mask, cr);
-
- } else {
-@@ -479,11 +493,13 @@
- *p = '\0';
- p++;
-
-- if (poldek_util_parse_evr(p, &epoch, &ver, &rel))
-+ if (poldek_util_parse_evr(p, &epoch, &ver, &rel)) {
- cr = cr_evr = capreq_new(NULL, tmp, epoch, ver, rel, REL_EQ, 0);
-+ DBGF("cap=%s\n", capreq_snprintf_s(cr));
-+ }
- }
-
-- if (do_resolve_package(uctx, ts, mask, cr))
-+ if (do_resolve_package(uctx, ts, mask, cr, arch))
- resolved = 1;
-
- if (cr_evr)
-@@ -492,6 +508,58 @@
- return resolved;
- }
-
-+static int resolve_mask(struct uninstall_ctx *uctx, struct poldek_ts *ts,
-+ const char *mask)
-+{
-+ char *p, *tmp;
-+ const char *n, *v, *r;
-+ char nmask[256];
-+ int32_t e = 0;
-+ int matched = 0;
-+
-+ msgn(2, "Trying %s\n", mask);
-+ if (resolve_package(uctx, ts, mask, NULL))
-+ return 1;
-+
-+ if ((p = strchr(mask, '-')) == NULL) /* try N-[E:]V */
-+ return 0;
-+
-+ /* try N-[E:]V-R */
-+ n_strdupap(mask, &tmp);
-+ p = strrchr(tmp, '-');
-+ *p = '#';
-+
-+ msgn(2, " Trying %s\n", tmp);
-+
-+ if (resolve_package(uctx, ts, tmp, NULL))
-+ return 1;
-+
-+ n_strdupap(mask, &tmp);
-+ if (poldek_util_parse_nevr(tmp, &n, &e, &v, &r)) {
-+ if (e)
-+ n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
-+ else
-+ n_snprintf(nmask, sizeof(nmask), "%s#%s-%s", n, v, r);
-+
-+ msgn(2, " Trying %s\n", nmask);
-+ DBGF("try %s => %s (%s, %s, %s)\n", mask, nmask, n, v, r);
-+ matched = resolve_package(uctx, ts, nmask, NULL);
-+
-+ if (!matched && (p = strchr(r, '.'))) { /* try N-[E:]-V-R.ARCH */
-+ *p = '\0';
-+ p++;
-+
-+ if (e)
-+ n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
-+ else
-+ n_snprintf(nmask, sizeof(nmask), "%s#%s-%s", n, v, r);
-+ msgn(2, " Trying %s (arch=%s)\n", nmask, p);
-+ matched = resolve_package(uctx, ts, nmask, p);
-+ }
-+ }
-+
-+ return matched;
-+}
-
- static int resolve_packages(struct uninstall_ctx *uctx, struct poldek_ts *ts)
- {
-@@ -501,52 +569,11 @@
- masks = poldek_ts_get_args_asmasks(ts, 1);
-
- for (i=0; i < n_array_size(masks); i++) {
-- char *mask = n_array_nth(masks, i);
-- int matched = 0;
--
-- msgn(2, "Trying %s\n", mask);
-- if (resolve_package(uctx, ts, mask)) {
-- matched = 1;
--
-- } else {
-- char *p;
--
-- if ((p = strchr(mask, '-'))) { /* try N-[E:]V */
-- char *tmp;
-- n_strdupap(mask, &tmp);
--
-- p = strrchr(tmp, '-');
-- *p = '#';
--
-- msgn(2, " Trying %s\n", tmp);
--
-- if (resolve_package(uctx, ts, tmp)) {
-- matched = 1;
--
-- } else { /* try N-[E:]V-R */
-- const char *n, *v, *r;
-- char nmask[256];
-- int32_t e = 0;
-+ char *mask = n_array_nth(masks, i);
-
-- n_strdupap(mask, &tmp);
--
-- if (poldek_util_parse_nevr(tmp, &n, &e, &v, &r)) {
-- if (e)
-- n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
-- else
-- n_snprintf(nmask, sizeof(nmask), "%s#%s-%s", n, v, r);
--
-- msgn(2, " Trying %s\n", nmask);
-- DBGF("try %s => %s (%s, %s, %s)\n", mask, nmask, n, v, r);
-- matched = resolve_package(uctx, ts, tmp);
-- }
-- }
-- }
--
-- if (!matched) {
-- logn(LOGERR, _("%s: no such package"), mask);
-- nerr++;
-- }
-+ if (!resolve_mask(uctx, ts, mask)) {
-+ logn(LOGERR, _("%s: no such package"), mask);
-+ nerr++;
- }
- }
-
-diff -urN poldek-0.20.org/vfcompr poldek-0.20/vfcompr
---- poldek-0.20.org/vfcompr 2004-09-21 01:47:00.000000000 +0200
-+++ poldek-0.20/vfcompr 2006-07-26 20:25:54.343335000 +0200
-@@ -1,5 +1,8 @@
- #! /bin/sh
--# $Id$
-+# $Id$
-+#
-+# File (de)compression helper script. Used by vfile library when external
-+# (de)compression requested ("vfile external compress" config option).
-
- PATH="/bin:/sbin:/usr/bin:/usr/sbin"
-
-@@ -19,7 +22,7 @@
- typeset src=$1
- typeset dest=$2
-
-- md5file="${src}-vfcompr.md5"
-+ md5file="${dest}-vfcompr.md5"
- #echo "$md5file"
- if [ -f $dest -a -f "$md5file" ]; then
- #echo md5sum --check "$md5file"
-diff -urN poldek-0.20.org/vfile/extcompr.c poldek-0.20/vfile/extcompr.c
---- poldek-0.20.org/vfile/extcompr.c 2005-05-15 17:46:59.000000000 +0200
-+++ poldek-0.20/vfile/extcompr.c 2006-07-26 20:25:54.343335000 +0200
-@@ -10,7 +10,7 @@
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
--/* $Id$ */
-+/* $Id$ */
-
- #include <ctype.h>
- #include <errno.h>
-@@ -195,7 +195,7 @@
- if (uncompr == NULL)
- return -1;
-
-- if (*vfile_verbose)
-+ if (*vfile_verbose > 0)
- vf_loginfo(_("Decompressing %s...\n"), n_basenam(path));
- return vf_do_compr(uncompr, "-d", path, destpath);
- }
-diff -urN poldek-0.20.org/vfile/fetch.c poldek-0.20/vfile/fetch.c
---- poldek-0.20.org/vfile/fetch.c 2005-07-16 13:56:12.000000000 +0200
-+++ poldek-0.20/vfile/fetch.c 2006-07-26 20:25:54.351335500 +0200
-@@ -10,7 +10,7 @@
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
--/* $Id$ */
-+/* $Id$ */
-
- #include <ctype.h>
- #include <errno.h>
-@@ -440,16 +440,12 @@
- }
- vf_loginfo(_("Running %s\n"), s);
- }
--
--
--
-
- verbose = *vfile_verbose;
- if (fftch->urltypes & VFURL_CDROM) {
- p_open_flags |= P_OPEN_KEEPSTDIN;
- if (*vfile_verbose < 1)
- *vfile_verbose = 1;
--
- }
-
- p_st_init(&pst);
-diff -urN poldek-0.20.org/vfile/foo.sh poldek-0.20/vfile/foo.sh
---- poldek-0.20.org/vfile/foo.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/vfile/foo.sh 2006-07-26 20:25:54.351335500 +0200
-@@ -0,0 +1,7 @@
-+#!/bin/sh
-+
-+echo "$0: ARGS: $@"
-+while read LINE; do
-+ echo "grep.sh: $LINE"
-+done
-+echo "foo: exit!"
-diff -urN poldek-0.20.org/vfile/Makefile.am poldek-0.20/vfile/Makefile.am
---- poldek-0.20.org/vfile/Makefile.am 2005-05-15 17:16:13.000000000 +0200
-+++ poldek-0.20/vfile/Makefile.am 2006-07-26 20:25:54.351335500 +0200
-@@ -1,14 +1,9 @@
--# $Id$
-+# $Id$
-
--VFCURL_SRCS = vfcurl.c # obsoleted
- SUBDIRS = vfff
-
- LIBS = -ltrurl -lz @INTLLIBS@
-
--#if ENABLE_VFILE_CURL
--#VFCURL_SRCS_ = $(VFCURL_SRCS)
--#endif
--
- INCLUDES = @TRURL_INCLUDE@ -I$(top_srcdir)
- AM_CFLAGS = @AM_CFLAGS@
-
-@@ -18,8 +13,7 @@
-
- libvfile_la_SOURCES = vfile.c fetch.c vfetch.c vfprogress.c misc.c \
- p_open.c extcompr.c vfreq.c vfreq.h \
-- vflock.c \
-- vfffmod.c $(VFCURL_SRCS_) \
-+ vflock.c vfffmod.c \
- vopen3.c vopen3.h vfile_intern.h
-
- libvfile_la_LIBADD = vfff/libvfff.la
-@@ -27,7 +21,7 @@
- pkgincludedir = $(includedir)/vfile
- pkginclude_HEADERS = vfile.h p_open.h vopen3.h
-
--noinst_PROGRAMS = vfget test_vopen3 test_vfile
-+noinst_PROGRAMS = vfget test_vopen3
- TEST_LDADDS = libvfile.la -lutil
-
- vfget_SOURCES = vfget.c
-@@ -35,13 +29,8 @@
-
- test_vopen3_SOURCES = test_vopen3.c
- test_vopen3_LDADD = $(TEST_LDADDS)
--test_vfile_SOURCES = test_vfile.c
--test_vfile_LDADD = $(TEST_LDADDS)
--
--EXTRA_DIST = libvfile.sym $(VFCURL_SRCS) \
-- testcookie.c test_progress.c test_vfile.c
--
-
-+EXTRA_DIST = libvfile.sym testcookie.c test_progress.c
-
- dist-hook:
- rm -rf $(distdir)/.deps
-diff -urN poldek-0.20.org/vfile/misc.c poldek-0.20/vfile/misc.c
---- poldek-0.20.org/vfile/misc.c 2005-07-17 19:07:40.000000000 +0200
-+++ poldek-0.20/vfile/misc.c 2006-07-26 20:25:54.359336000 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
- #ifdef HAVE_CONFIG_H
- # include "config.h"
-@@ -58,7 +58,7 @@
-
- p = path;
- p++;
-- ndots = 0;
-+ ndots = -1;
-
- while (*p) {
- switch (*p) {
-@@ -71,11 +71,12 @@
- break;
-
- case '.':
-- ndots++;
-+ if (ndots >= 0)
-+ ndots++;
- break;
-
- default:
-- ndots = 0;
-+ ndots = -1;
-
- if (!isalnum(*p) && strchr("-+/._@!~", *p) == NULL) {
- vf_logerr("%s:%c non alphanumeric characters not allowed\n",
-diff -urN poldek-0.20.org/vfile/sample.c poldek-0.20/vfile/sample.c
---- poldek-0.20.org/vfile/sample.c 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/vfile/sample.c 2006-07-26 20:25:54.359336000 +0200
-@@ -0,0 +1,72 @@
-+#include <stdio.h>
-+#include <stdlib.h>
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <errno.h>
-+#include <signal.h>
-+#include "i18n.h"
-+#include "vfile.h"
-+
-+void dump_file(const char *url)
-+{
-+ struct vfile *vf;
-+ char buf[1024];
-+
-+ vf = vfile_open(url, VFT_STDIO, VFM_RO | VFM_NORM);
-+ if (vf == NULL)
-+ return;
-+
-+ while (fgets(buf, sizeof(buf), vf->vf_stream))
-+ printf("%s", buf);
-+
-+ vfile_close(vf);
-+}
-+
-+void fetch_ext(const char *url)
-+{
-+ tn_array *protocols;
-+
-+ protocols = n_array_new(4, NULL, NULL);
-+ n_array_push(protocols, "http");
-+ n_array_push(protocols, "ftp");
-+ if (!vfile_register_ext_handler("wget", protocols,
-+ "/usr/bin/wget -N -P %d %Pn")) {
-+ printf("bad handler def\n");
-+ return;
-+ }
-+
-+ if (vf_fetch("/tmp", url))
-+ puts("OK\n");
-+ else
-+ puts("FAIL\n");
-+}
-+
-+void fetch(const char *url)
-+{
-+ if (vf_fetch("/tmp", url))
-+ puts("OK\n");
-+ else
-+ puts("FAIL\n");
-+}
-+
-+
-+
-+int main(int argc, char *argv[])
-+{
-+ int verbose = 10;
-+
-+ vfile_verbose = &verbose;
-+ vfile_configure(VFILE_CONF_CACHEDIR, "/tmp");
-+
-+ while (1) {
-+ printf("verbose = %d\n", *vfile_verbose);
-+ fetch("ftp://localhost/bigg");
-+ unlink("/tmp/bigg");
-+ }
-+
-+//dump_file("ftp://ftp.pld.org.pl/PLD-1.0/i686/PLD/RPMS/tocfile.lst");
-+ //fetch_ext("http://sunsite.icm.edu.pl/index.html");
-+ //dump_file("/tmp/index.html");
-+ return 0;
-+}
-diff -urN poldek-0.20.org/vfile/test_retr.sh poldek-0.20/vfile/test_retr.sh
---- poldek-0.20.org/vfile/test_retr.sh 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/vfile/test_retr.sh 2006-07-26 20:25:54.359336000 +0200
-@@ -0,0 +1,61 @@
-+#! /bin/sh
-+
-+md5() {
-+ typeset fn=$1
-+ md5sum $1 | awk '{print $1}'
-+}
-+
-+files_eq() {
-+ typeset fn0=$1
-+ typeset fn1=$2
-+
-+ md0=$(md5 $fn0)
-+ md1=$(md5 $fn1)
-+# echo -e "\n$md0 $fn0\n$md1 $fn1" >&2
-+ if [ "$md0" != "$md1" ]; then
-+ return 1
-+ fi
-+ return 0
-+}
-+
-+TMPDIR=${TMPDIR:-"/tmp"}
-+
-+do_test() {
-+ typeset dir=$1
-+ typeset fn=$2
-+ typeset url=$3
-+
-+ [ -d $dir ] || mkdir $dir
-+ cp -a $fn $dir || return 1
-+
-+ bn=$(basename $fn)
-+ url="$url/$bn"
-+ ./vfget $url $TMPDIR || return 1
-+
-+ files_eq $TMPDIR/$bn $dir/$bn
-+ return $?
-+}
-+#
-+
-+file=$0
-+uri=$(basename $0)
-+
-+
-+run_test() {
-+ no=$1; shift;
-+
-+ echo -n "test $no $@.."
-+ $@ # > $TMPDIR/$(basename 0).log
-+ if [ $? -eq 0 ]; then
-+ echo "OK"
-+ else
-+ echo "FAILED"
-+ fi
-+}
-+
-+HTTP_DIR=/home/httpd/html/tmp
-+FTP_DIR=/home/ftp/incoming/tmp
-+
-+
-+run_test "01" "do_test" $HTTP_DIR $file http://localhost/tmp
-+#run_test "02" "do_test" $FTP_DIR $file ftp://localhost/incoming/tmp
-diff -urN poldek-0.20.org/vfile/tests/httpd.py poldek-0.20/vfile/tests/httpd.py
---- poldek-0.20.org/vfile/tests/httpd.py 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/vfile/tests/httpd.py 2006-07-26 20:25:54.367336500 +0200
-@@ -0,0 +1,12 @@
-+#!/usr/bin/python
-+
-+import SimpleHTTPServer
-+import SocketServer
-+
-+PORT = 10000
-+
-+Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
-+httpd = SocketServer.TCPServer(("127.0.0.1", PORT), Handler)
-+
-+print "serving at port", PORT
-+httpd.serve_forever()
-diff -urN poldek-0.20.org/vfile/tests/Makefile.am poldek-0.20/vfile/tests/Makefile.am
---- poldek-0.20.org/vfile/tests/Makefile.am 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/vfile/tests/Makefile.am 2006-07-26 20:25:54.367336500 +0200
-@@ -0,0 +1,35 @@
-+
-+
-+TESTS = test_vfile
-+noinst_PROGRAMS = test_vfile
-+test_vfile_SOURCES = test_vfile.c test_misc.c test_file.c
-+
-+EXTRA_DIST = utest_mkidx.sh
-+
-+test_vfile_INCLUDES= @CHECK_CFLAGS@
-+test_vfile_LDADD = @CHECK_LIBS@ ../libvfile.la
-+
-+clean-local:
-+ -rm -f *.tmp core *.o *.bak *~ *% *\# TAGS gmon.out \#*\# dupa*
-+
-+
-+runtests: poldek_test_conf.conf
-+ $(MAKE) check
-+ @echo; echo "Running *.sh tests"; \
-+ n=0; nfails=0; \
-+ for i in utest_*.sh; do \
-+ [ -f $$i ] || continue; \
-+ n=$$(expr $$n + 1); \
-+ echo " running $$i"; \
-+ sh $$i; \
-+ if [ $$? -ne 0 ]; then \
-+ nfails=$$(expr $$nfails + 1); \
-+ echo " $$i FAILED"; \
-+ else \
-+ echo " $$i PASSED"; \
-+ fi; \
-+ done; \
-+ echo "====================================="; \
-+ echo "$$n tests passed / $$nfails failed"; \
-+ echo "====================================="
-+
-diff -urN poldek-0.20.org/vfile/tests/test_file.c poldek-0.20/vfile/tests/test_file.c
---- poldek-0.20.org/vfile/tests/test_file.c 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/vfile/tests/test_file.c 2006-07-26 20:25:54.367336500 +0200
-@@ -0,0 +1,38 @@
-+#include "test.h"
-+
-+int test_append(const char *path, int vft_io)
-+{
-+ struct vfile *vf;
-+
-+ vf = vfile_open(path, vft_io, VFM_APPEND);
-+ fail_if(vf == NULL);
-+ fail_if(n_stream_write(vf->vf_tnstream, "foo\n", 4) != 4);
-+ vfile_close(vf);
-+ return 1;
-+}
-+
-+START_TEST (test_vfile_append) {
-+ int ec;
-+
-+ test_append("tmp.txt.gz", VFT_TRURLIO);
-+ test_append("tmp.txt.gz", VFT_TRURLIO);
-+ test_append("tmp.txt.gz", VFT_TRURLIO);
-+
-+ test_append("tmp.txt", VFT_TRURLIO);
-+ test_append("tmp.txt", VFT_TRURLIO);
-+ test_append("tmp.txt", VFT_TRURLIO);
-+
-+ ec = system("zdiff tmp.txt tmp.txt.gz");
-+ fail_if(ec != 0);
-+
-+
-+}
-+END_TEST
-+
-+struct test_suite test_suite_vfile = {
-+ "vfile",
-+ {
-+ { "append", test_vfile_append },
-+ { NULL, NULL }
-+ }
-+};
-diff -urN poldek-0.20.org/vfile/tests/test.h poldek-0.20/vfile/tests/test.h
---- poldek-0.20.org/vfile/tests/test.h 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/vfile/tests/test.h 2006-07-26 20:25:54.367336500 +0200
-@@ -0,0 +1,29 @@
-+#ifndef VFILE_TEST_H
-+#define VFILE_TEST_H
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <sys/param.h> /* for PATH_MAX */
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+
-+#include <trurl/nassert.h>
-+#include <trurl/nmalloc.h>
-+#include <check.h>
-+
-+#include "../vfile.h"
-+#define fail_ifnot fail_unless
-+
-+struct test_case {
-+ const char *name;
-+ void (*test_fn)(void);
-+};
-+
-+struct test_suite {
-+ const char *name;
-+ struct test_case cases[];
-+};
-+
-+#endif
-diff -urN poldek-0.20.org/vfile/tests/test_misc.c poldek-0.20/vfile/tests/test_misc.c
---- poldek-0.20.org/vfile/tests/test_misc.c 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/vfile/tests/test_misc.c 2006-07-26 20:25:54.371336750 +0200
-@@ -0,0 +1,39 @@
-+#include "test.h"
-+
-+START_TEST (test_valid_path) {
-+ char *inv_paths[] = {
-+ "../ala/ma/kota",
-+ "dupa/blada",
-+ "/ala/../foo",
-+ NULL
-+ };
-+ char *valid_paths[] = {
-+ "/",
-+ "/ala/ma/kota",
-+ "/dupa/..blada",
-+ "/ala../foo",
-+ "/home/foo/.poldek-cache/_www.rpm.xx.redhat-7.3../.vflock__home.foo..poldek-cache..www.rpm.xx.redhat-7.3..",
-+ NULL
-+ };
-+ int i;
-+
-+ i = 0;
-+ while (inv_paths[i] != NULL) {
-+ fail_if(vf_valid_path(inv_paths[i]),
-+ "validated invalid '%s'", inv_paths[i]);
-+ i++;
-+ }
-+
-+ i = 0;
-+ while (valid_paths[i] != NULL) {
-+ fail_if(!vf_valid_path(valid_paths[i]),
-+ "invalid valid '%s'", valid_paths[i]);
-+ i++;
-+ }
-+}
-+END_TEST
-+
-+
-+struct test_case test_case_misc = {
-+ "vf_valid_path", test_valid_path
-+};
-diff -urN poldek-0.20.org/vfile/tests/test_vfile.c poldek-0.20/vfile/tests/test_vfile.c
---- poldek-0.20.org/vfile/tests/test_vfile.c 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/vfile/tests/test_vfile.c 2006-07-26 20:25:54.379337250 +0200
-@@ -0,0 +1,90 @@
-+/*
-+ $Id$
-+*/
-+#include <check.h>
-+#include "test.h"
-+
-+//extern struct test_suite test_suite_match;
-+
-+extern struct test_case test_case_misc;
-+
-+
-+struct test_suite test_suite_vfile;
-+struct test_suite *suites[] = {
-+ &test_suite_vfile,
-+ NULL,
-+};
-+
-+extern struct test_case test_case_misc_env;
-+struct test_case *misc_cases[] = {
-+ &test_case_misc,
-+ NULL,
-+};
-+
-+Suite *make_suite(struct test_suite *tsuite)
-+{
-+ Suite *s = suite_create(tsuite->name);
-+ int i = 0;
-+
-+ while (tsuite->cases[i].name) {
-+ TCase *tc = tcase_create(tsuite->cases[i].name);
-+ tcase_add_test(tc, tsuite->cases[i].test_fn);
-+ suite_add_tcase(s, tc);
-+ i++;
-+ }
-+ return s;
-+}
-+
-+Suite *make_themisc_suite(void)
-+{
-+ Suite *s = suite_create("misc");
-+ int i = 0;
-+
-+ while (misc_cases[i]) {
-+ TCase *tc = tcase_create(misc_cases[i]->name);
-+ tcase_add_test(tc, misc_cases[i]->test_fn);
-+ suite_add_tcase(s, tc);
-+ i++;
-+ }
-+ return s;
-+}
-+
-+/*
-+ tc = tcase_create("op_ts_postconf");
-+ tcase_add_test(tc, test_op_ts_postconf);
-+ suite_add_tcase (s, tc);
-+
-+ return s;
-+}
-+*/
-+
-+int main(int argc, char *argv[])
-+{
-+ int i = 0, nerr = 0;
-+
-+ //if (argc > 1 && n_str_eq(argv[1], "-v"))
-+
-+ if (misc_cases[0]) {
-+ Suite *s = make_themisc_suite();
-+ SRunner *sr = srunner_create(s);
-+ srunner_run_all(sr, CK_NORMAL);
-+ nerr += srunner_ntests_failed(sr);
-+ srunner_free(sr);
-+ }
-+
-+ i = 0;
-+ while (suites[i]) {
-+ Suite *s = make_suite(suites[i]);
-+ SRunner *sr = srunner_create(s);
-+ printf("\n");
-+ srunner_run_all(sr, CK_NORMAL);
-+ nerr += srunner_ntests_failed(sr);
-+ srunner_free(sr);
-+ i++;
-+ }
-+
-+
-+
-+ return (nerr == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-+}
-+
-diff -urN poldek-0.20.org/vfile/ttest.c poldek-0.20/vfile/ttest.c
---- poldek-0.20.org/vfile/ttest.c 1970-01-01 01:00:00.000000000 +0100
-+++ poldek-0.20/vfile/ttest.c 2006-07-26 20:25:54.379337250 +0200
-@@ -0,0 +1,40 @@
-+#include <stdio.h>
-+#include <stdlib.h>
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+
-+#include "i18n.h"
-+#include "vfile.h"
-+
-+void fetch(const char *url)
-+{
-+ vf_fetch("/tmp", url);
-+}
-+
-+
-+int main(int argc, char *argv[])
-+{
-+ int verbose = 1;
-+// const char *up = "/a/b/c/d/e/f/ftp.pld.org.pl/PLD-1.0/i686/PLD/RPMS/kernel-video-nvidia-1.0.2880-1@2.2.20_18.i686.rpm";
-+
-+ const char *up = "ftp://mis:dupa@smok/a/b/c/d/e/f/ftp.pld.org.pl/PLD-1.0/i686/PLD/RPMS/kernel-video-nvidia-1.0.2880-1kldd4443.i686.rpm";
-+
-+
-+ const char *u = "ftp://ftp.pld.org.pl/PLD-1.0/i686/PLD/RPMS/kernel-video-nvidia-1.0.2880-1@2.2.20_18.i686.rpm";
-+
-+ const char *uu = "/a/v/b/ftp:,,ftp.pld.org.pl,PLD-1.0,i686,PLD,RPMS,kernel-video-nvidia-1.0.2880-1@2.2.20_18.i686.rpm";
-+
-+ vfile_configure(VFILE_CONF_CACHEDIR, ",tmp");
-+ vfile_verbose = &verbose;
-+
-+ printf("%s\n", vf_url_slim_s(up, 0));
-+ printf("%s\n", vf_url_slim_s(u, 0));
-+ printf("%s\n", vf_url_slim_s(uu, 0));
-+
-+
-+ fetch("ftp://bb/PLD/i686/PLD/RPMS/glibc-2.2.3-3.i686.rpm");
-+ fetch("ftp://bb/PLD/i686/PLD/RPMS/portmap-5beta-6.i686.rpm");
-+ fetch("ftp://bb/PLD/i686/PLD/RPMS/nfs-utils-0.3.1-1.i686.rpm");
-+ return 0;
-+}
-diff -urN poldek-0.20.org/vfile/vfetch.c poldek-0.20/vfile/vfetch.c
---- poldek-0.20.org/vfile/vfetch.c 2005-09-11 15:07:07.000000000 +0200
-+++ poldek-0.20/vfile/vfetch.c 2006-07-26 20:25:54.379337250 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
- #ifdef HAVE_CONFIG_H
- # include "config.h"
-@@ -32,10 +32,6 @@
- #include <time.h>
-
- #include <zlib.h>
--#include <rpm/rpmlib.h>
--#include <rpm/rpmio.h>
--#include <rpm/rpmurl.h>
--#include <rpm/rpmmacro.h>
- #include <trurl/nassert.h>
- #include <trurl/nstr.h>
- #include <trurl/nhash.h>
-@@ -299,7 +295,7 @@
- snprintf(url, sizeof(url), req->url);
- vf_request_free(req);
- req = NULL;
-- rc = vf_fetch(req->url, destdir, flags, NULL);
-+ rc = vf_fetch(url, destdir, flags, NULL);
- }
- }
- if (req)
-diff -urN poldek-0.20.org/vfile/vfff/vfff.c poldek-0.20/vfile/vfff/vfff.c
---- poldek-0.20.org/vfile/vfff/vfff.c 2005-05-15 14:50:30.000000000 +0200
-+++ poldek-0.20/vfile/vfff/vfff.c 2006-07-26 20:25:54.387337750 +0200
-@@ -1,5 +1,5 @@
- /*
-- Copyright (C) 2002 Pawel A. Gajda <mis@k2.net.pl>
-+ Copyright (C) 2002 - 2005 Pawel A. Gajda <mis@k2.net.pl>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License version 2 as
-@@ -10,24 +10,24 @@
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
--/* $Id$ */
-+/* $Id$ */
-
-+#include <arpa/inet.h>
- #include <ctype.h>
- #include <errno.h>
- #include <fcntl.h>
- #include <netdb.h>
-+#include <signal.h>
- #include <stdarg.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
--#include <time.h>
- #include <sys/socket.h>
- #include <sys/time.h>
- #include <sys/types.h>
-+#include <time.h>
- #include <unistd.h>
--#include <signal.h>
-
--#include <arpa/inet.h>
- #include <trurl/nbuf.h>
- #include <trurl/nassert.h>
- #include <trurl/nhash.h>
-@@ -39,11 +39,11 @@
- #include "vfff.h"
- #include "vfile/vfile_intern.h"
-
-+#define VCN_ALIVE_TTL 10
-+
- extern void vhttp_vcn_init(struct vcn *cn);
- extern void vftp_vcn_init(struct vcn *cn);
-
--
--
- static char errmsg[512] = { '\0' };
- static int verbose = 0;
-
-@@ -146,8 +146,6 @@
- vfff_errno = 0;
-
- do {
-- vfile_sigint_reached(1); /* just reset */
--
- sockfd = socket(resp->ai_family, resp->ai_socktype, resp->ai_protocol);
- if (sockfd < 0)
- continue;
-@@ -173,6 +171,8 @@
-
- else if (af)
- *af = resp->ai_family;
-+
-+ //DBGF("sigint reached %d, errno %m\n", vfff_sigint_reached());
-
- uninstall_alarm();
- freeaddrinfo(res);
-@@ -321,6 +321,15 @@
- int vcn_is_alive(struct vcn *cn)
- {
- vfff_errno = 0;
-+
-+ if (cn->ts_is_alive > 0) {
-+ time_t ts = time(0);
-+
-+ if (ts - cn->ts_is_alive < VCN_ALIVE_TTL)
-+ return 1;
-+ }
-+
-+ cn->ts_is_alive = time(0);
- return cn->m_is_alive(cn);
- }
-
-diff -urN poldek-0.20.org/vfile/vfff/vfff.h poldek-0.20/vfile/vfff/vfff.h
---- poldek-0.20.org/vfile/vfff/vfff.h 2005-05-15 17:47:05.000000000 +0200
-+++ poldek-0.20/vfile/vfff/vfff.h 2006-07-26 20:25:54.387337750 +0200
-@@ -1,4 +1,4 @@
--/* $Id$ */
-+/* $Id$ */
- /*
- Copyright (C) 2000 - 2003 Pawel A. Gajda <mis@pld.org.pl>
-
-@@ -82,6 +82,8 @@
-
- void (*m_free)(void *resp);
- void *resp;
-+
-+ time_t ts_is_alive;
- };
-
- struct vcn *vcn_new(int proto, const char *host, int port,
-diff -urN poldek-0.20.org/vfile/vfile.c poldek-0.20/vfile/vfile.c
---- poldek-0.20.org/vfile/vfile.c 2005-10-07 21:00:19.000000000 +0200
-+++ poldek-0.20/vfile/vfile.c 2006-07-26 20:25:54.387337750 +0200
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
- #ifdef HAVE_CONFIG_H
- # include "config.h"
-@@ -28,10 +28,6 @@
- #include <time.h>
-
- #include <zlib.h>
--#include <rpm/rpmlib.h>
--#include <rpm/rpmio.h>
--#include <rpm/rpmurl.h>
--#include <rpm/rpmmacro.h>
- #include <trurl/nassert.h>
- #include <trurl/nstr.h>
- #include <trurl/nhash.h>
-@@ -171,12 +167,12 @@
-
- break;
- }
--
-
- case VFILE_CONF_STUBBORN_NRETRIES:
- v = va_arg(ap, int);
-- if (v > 0)
-- vfile_conf.nretries = v;
-+ if (v == 0)
-+ v = 1;
-+ vfile_conf.nretries = v;
- break;
-
- case VFILE_CONF_SIGINT_REACHED:
---- poldek.org/vfile//Makefile.am.org 2006-07-30 12:30:57.073506000 +0000
-+++ poldek/vfile//Makefile.am 2006-07-30 12:29:25.715796500 +0000
-@@ -2,7 +2,7 @@
-
- SUBDIRS = vfff
-
--LIBS = -ltrurl -lz @INTLLIBS@
-+LIBS = -ltrurl -lz -lutil @INTLLIBS@
-
- INCLUDES = @TRURL_INCLUDE@ -I$(top_srcdir)
- AM_CFLAGS = @AM_CFLAGS@