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 @@ -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 #include #include #include -#include #include #include @@ -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 /* 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 + Copyright (C) 2000 - 2005 Pawel A. Gajda 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 +#include #include #include -#include #include -#include -#include +#include #include +#include #include -#include -#include +#include #include #include @@ -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 + 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 #include #include -#include #include -#include +#include #include #include -#include +#include #include #include #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 #include #include -#include #include #include 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 @@ -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 @@ -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 @@ -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 + Copyright (C) 2000 - 2005 Pawel A. Gajda 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 -#include #include @@ -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 @@ -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 @@ -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 #include #include -#include #include @@ -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 #include +#include #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 @@ -121,7 +121,7 @@ " perl-regexp[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 #include #include -#include #include #include -#include #include #include @@ -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 @@ -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 + Copyright (C) 2000 - 2006 Pawel A. Gajda 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 @@ -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("
\n", sect->name); - - while (1) { - tag = sect->tags[i++]; - if (tag.name == NULL) - break; - - if (tag.flags & TYPE_F_OBSL) - continue; - - printf(" \n\n"); - } - printf("
\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 @@ + + + + + + + +/* This file is generated from poldek.conf.xml. Do not edit */ +#include <stdlib.h> +#include "conf_intern.h" +#include "poldek_ts.h" + +static struct poldek_conf_tag _tags[] = { + + + { "", + CONF_TYPE_ + | CONF_TYPE_F_MULTI + | CONF_TYPE_F_REQUIRED + | CONF_TYPE_F_ENV + | CONF_TYPE_F_LIST + | CONF_TYPE_F_PATH + | CONF_TYPE_F_OBSL, + + "" + NULL + , + + POLDEK_OP_ + 0 + , { 0 } }, + + { "", CONF_TYPE_F_ALIAS | CONF_TYPE_F_OBSL, NULL, 0, { 0 } }, + + + + + { NULL, 0, NULL, 0, { 0 } } +}; + + + + +struct poldek_conf_section poldek_conf_sections[] = { + + { "", _tags, + + 1 + 0 + , + }, + + { NULL, 0, 0 } +}; + + + + 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 @@ + + + + + + + +[] + + + + + = no + + + = yes + + + = auto + + + = yes + + + + + + + + + = + + + = + + + # + + + + + + + = + + + = 100; + + + # + + + + + + + + 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 @@
  • poldek-POLDEK_VERSION.tar.bz2
  • poldek-POLDEK_VERSION-1.src.rpm
  • -

    An older versions are available here. - Development snapshots are available here

    +

    +An older versions are available here. +Development snapshots are available here +

    Binary packages

    -

    PLD Linux

    +

    PLD Linux

    -

    Packages for other architectures as for developement PLD branches are available on PLD +

    +Packages for other architectures as for developement PLD branches are available on PLD FTP site. +

    + +

    Fedora Core

    -

    Fedora Core

    +

    +An older versions of packages for several RedHat versions can be found here. +

    +

    CentOS

    +

    +CentOS aims to be 100% binary compatible with +Red Hat Enterprise Linux. +

    +

    +Packages maintained by Arkadiusz Patyk <areq att pld-linux org>, +available here. +

    +

    Other

    +

    Send me a links to packages + for your system +

    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 @@ + +

    Mailing list

    Program mailing list poldek@pld-linux.org. @@ -5,14 +14,18 @@ web interface, or by sending a message to poldek-subscribe@pld-linux.org.

    +

    List archives: http://lists.pld-linux.org/mailman/pipermail/poldek/. +

    List traffic is rather low, most poldek issues are discussed on PLD mailing lists. - +

    Issue Tracker

    +

    Project bugs and other issues database is placed in PLD -BTS. Use it to report a bug or request a feature. +BTS. Please use it to report a bug or request a feature, although you may mail author directly as well. +

    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 @@ + + + + +
    + [poldek home] +
    +
    + +
    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 @@ -$Date$ -$Id$ +$Date$ +$Id$ package management @@ -85,7 +85,7 @@ Overview &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. @@ -95,11 +95,12 @@ Easy to use - 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. @@ -108,12 +109,11 @@ &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 rpmlib, - 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. @@ -121,9 +121,11 @@ Incremental repository updates - &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. @@ -582,12 +584,13 @@ Managing packages &poldek; operates in two basic modes - the first one is more generic -and compliant with &rpm; (&poldek; command) and second interactive -mode with simplified and more intuitive command set. +and compliant with &rpm; (&poldek; command) and the second, +called interactive mode with simplified and +intuitive command set. -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 example. @@ -664,7 +667,7 @@ To install packages in &rpm; sense, i.e. do not upgrade even if older version is already installed: -&poldek-prompt; [OPTION..] --install (&rpm; mode) +&poldek-prompt; [OPTION..] --install (command line mode) &ipoldek-prompt; [OPTION..] install -IN (interactive mode) @@ -686,9 +689,9 @@ -To install package or upgrade it if older version is already installed: +To install or upgrade package if older version is already installed: -&poldek-prompt; [OPTION..] --upgrade (&rpm; mode) +&poldek-prompt; [OPTION..] --upgrade (command line mode) &ipoldek-prompt; [OPTION..] install (interactive mode) This is most used installation type. Example: @@ -732,7 +735,7 @@ To upgrade packages, i.e. install only if older version is already installed: -&poldek-prompt; [OPTION..] --upgrade --fresh (&rpm; mode) +&poldek-prompt; [OPTION..] --upgrade --fresh (command line mode) &ipoldek-prompt; [OPTION..] upgrade (interactive mode) @@ -763,8 +766,9 @@ &poldek-prompt; --install-dist=DIR [PACKAGE...] -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. As example, command which installs system under /mnt/dest might looks like: @@ -789,7 +793,7 @@ To remove installed packages: -&poldek-prompt; [OPTION..] --erase (&rpm; mode) +&poldek-prompt; [OPTION..] --erase (command line mode) &ipoldek-prompt; [OPTION..] uninstall [ERASE_OPTION...] (interactive mode) @@ -803,6 +807,7 @@ + + + + + + + +
    + +poldek NEWS + + + + +
    +
    + + + + + + + + + + <xsl:value-of select="@version"/> (<xsl:value-of select="@focus"/>; <xsl:value-of select="@date"/>) + + + + + + + + + <xsl:value-of select="title"/> + + + + + + + + + + + + + + + + + + + + + + + + + () + + + + + + + + + + + + + + + + + + + + + + + + + with help of <>, + + + + + + +
    + + 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{ + +This project has been alive for several years. Many people have provided +feedback that have improved poldek, especially +PLD Linux Team people. Thanks! + Here follows a list of people that have +contributed (in alphabetical order). Please let +me +know if somebody is missing. + +}; + +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{

    Credits

    $preable}; + print q{
      }; + + foreach (@$credits) { + #print STDERR "$_->{name}\n"; + print qq{
    • $_->{name} <$_->{email}>
    • \n}; + } + print q{
    }; +} + +sub to_CREDITS_docb { + my $ref = shift; + my $credits = get_credits($ref); + + print q{ + +
    Credits +}; + + print $PREABLE; + + print q{ + + }; + + foreach (@$credits) { + print qq{ + + $_->{name} <$_->{email}> + + }; + } + print q{ + + +
    + }; +} + +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 @@ + + +$Id$ + + + + let a user to choose equivalents selected by --caplookup option + + + + choosing equivalents prompt are interrupt-able now. + + + + added 0.18.x's --mkdir to be bacward compatible + + + + fixed path validation ("/foo../" is not a relative path) + + + + vfcompr: temporary *vfcompr.md5 files moved from source to destination + (a cache) directory + + + + orphaned package are upgraded if its successor drags more new packages + than orphaned one + + + + "use sudo" default value is explicit set to "auto" (new 3var boolean-like + type is added). + + + + configuration for CentOS has been added. + Arkadiusz Patyk + + + + + +This release introduces new series of poldek. +Significant changes and differences from 0.18.x series + + +
    Package repositories + + + 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. + + + + + + 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). + + + + + 'hdrl' aka 'apt' format are update-able + + + + support for Yum and Metadata XML repositories + + + + + repository indexes could be created in many formats at once + using --mt switch, ex: + + + $ poldek -s /foo/bar --mkdix --mt=pdir,pndir + + + + + + indexes may be created from any index format, i.e conversion to + to another format is supported, ex: + + + $ poldek --st apt -s /foo/bar --mkidx=/ala/ma --mt=pdir + + + + + + (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. + + +
    + +
    Installation related + + + 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 + + + + + + poldek can perform 'to repository' installation, i.e packages + are copied from source to destination repository with full + dependency checking, ex: + + + $ poldek -n ... --dt pdir --destination /foo/bar/RPMS --upgrade-dist -v + $ poldek -n ... --dn name --upgrade-dist -v + + +
    +
    Interactive mode + + + interactive mode commands are available directly from command line + + + $ poldek --cmd ls foo + $ ipoldek ls foo + + + + + + command aliases are defined in external configuration file + + Mariusz Mazur + + + + commands may be piped, ex: + + poldek> rsearch /poldek/ | ls -l + + + + + external commands are supported: + + poldek> rsearch /pol/ | !grep ^pol + + +
    + +
    Configuration + + + 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. + + + + + + default location of configuration file has been changed to "${_sysconfdir}/poldek/poldek.conf", old /etc location is still supported. + + + + + + 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. + + + + + + environment variables in config files are expanded, for example: + + + cachedir = $HOME/.cache + + + + + + support for simple macros has been added to make configuration easier to write + and read, for example: + + + _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}/ + + + + + + %include directive has been added, it can include both local and remote files: + + + %include source.conf + %include ftp://ftp.pld.org.pl/dists/ra/source.conf + + + Remote files once downloaded are stored in cache directory. To resynchronize them + with it's remote copy use --upconf option. + + + + + + support for APT sources configuration has been added - new + "load apt sources list" configuration option. + + +
    +
    General + + + some command line switches has been changed, but all obsoleted switches are still + supported *except* "-f" (not important IMO). + Changes: + + + 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) + + + + + configuration options may be set from command line by -O switch, for + example: + + + $ poldek -Ovfile_external_compress=yes + + + + + + PLD-FreeBSD port (ftp://beliar.pld-freebsd.org/dists/1.0/ready/i386/RPMS/) + + Tomasz Trojanowski + + + + manual have been rewritten and enhanced + +
    +
    + + + + + + + fixed writing diff list file (packages.diff.toc) + + + update to rpm 4.4 (dropped legacy PreReq support) + Jakub Bogusz + + + renamed trurlib's nstream members to avoid conflicts with stdio macros + Olivier Thauvin + + + fixed package version selection on greedy upgrade + + + + + + + handle package file 'mtime' tag ('t' tag) to be compatible with devel branch. + + + fixes related to glibc 2.3.5 + Jakub Bogusz + Arkadiusz Miskiewicz +
      +
    • fixed cookie seek functions
    • +
    • setvbuf() with small buffer to avoid reverse gzseeks on small forward fseeks
    • +
    • do fread() instead of small forward fseeks
    • +
    +
    + + fixed compilation with gcc 4.x (PLD's poldek-gcc4.patch) + + + dependency resolving issues + Mariusz Krynski +
      +
    • packages marked for removal are not treated as candidates to upgrade
    • +
    • user can choose among equivalents during conflict resolving.
    • +
    +
    + + new --pmcmd to set rpm binary in place of default /bin/rpm + Jan Rekorajski + +
    + + + fixed checking file-based dependencies of packages being removed + + + fixed another dependency processing bug (hard to explain) + + + 'ls' output fixes to be parsable by external scripts + Patryk Zawadzki + + + removed usage of superfluous n_free() + Tomasz Wittner + + + vfile's progress bar: fixed displaying total transfer and rate + Lukasz Masko + + + support for RPM 4.4 + + + fixed build under Owl (rpm 4.0.2 without libelf) + + + workaround for "group not found" bug + + + pl and de translation fixes (PLD Team) + + + + + another stupid SIGSEGV killed (happened occasionally while dependency processing) + + + vfile's progress bar improvements + Patryk Zawadzki + + + fix: disabled package Epoch's autopromotion while checking if it matches requirement + + + with rpm >= 4.1 packages with same provide are obsoleted, not just name + + + fixed processing dependencies of orphaned packages + + + SIGSEGV killed while reading packages with dir/file names longer than 127 bytes + + + fixed package ordering bug + + + with --caplookup packages may be installed by specifying +its capabilities, i.e: "poldek --caplookup -uv foo" will install +package provides "foo" (if any). + + + + + fixed broken dist installation + + + fixed serious bug with dependency processing of obsoleted packages + + + fixed --rpmdef '_dbpath DIR' (do not read rpm's configs many times) + + + fix: --nofollow with --install-dist works as expected (#920) + + + vfile: fixed progress bar displaying on std sized terminal (79 cols) + + + + + fixed dowloading packages from apt-like sources + + + + + package filenames in "non-standard" form (N-V.R.ARCH.rpm) are supported + + + killed SIGSEGVs on 64bit architecture + Jakub Bogusz + + + fixed Epoch comparison bug while checking uninstalled capabilities + + + vfile: progress bar shows remaining time and transfer rate + Patryk Zawadzki + + + fixed setting cache directory bug + Andreas Piesk + + + fixed serious bug of checking unversioned dependencies + + + --ignore{arch,os} rpm options are honored + + + rpm options could be passed as --rpm=OPTION too, +i.e. --rpm=ignorearch is equivalent of -- --rpm-ignorearch + + + new cmdline options --rpm-{force,nodeps} which are passed +as --force and --nodeps to /bin/rpm only. + + + 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. + + + "greedy" upgrade mode is enabled by default + + + 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. + + + displaying package size summary of installed package +set + + + --unique-pkg-names (-Q) behavior is more intuitive now - +highest version of package are taken instead of one from highest +prioritizedsource + + + + + internal HTTP client does not prevent proxy caching + Arkadiusz Miskiewicz + + + fixed bug on getting package capabilities having EVR with +empty Epoch like "foo = :1.0-1" + + + do not die if rpmdb iterator returns NULL (possibly broken rpm database) + Arkadiusz Miskiewicz + + + 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) + + + kill unaligned traps on Alpha, time_t is not 32bit long (Jakub Bogusz <qboosh att pld-linux org>) + Jakub Bogusz + + + new "promoteepoch" config and cmdline option switches Epoch +to comparision compatible with rpm prior to 4.2.1 + Jakub Bogusz + + + support for RPM 4.2/4.3 + + + dependency processing fixes + + + RPM 4.1 related fixes + + + + + ability of creation empty indexes + + + killed SIGSEV on '$ poldek -s /' (#443) + + + fixed presentation of dependency tree during +unistallations; information about what package marks an others was +completely broken + + + killed SIGSEV during dependencies processing + + + fixed vfile's progress bar + + + fixed 'hold' and 'ignore' package patterns matching + + + fixed bug of interactive mode; after interrupted +installation selected packages are properly unmarked +now. + + + + + support for RPM 4.1 + Artur Frysiak + + + few dependency processing improvements +
      +
    • greedy upgrades are performed instead of marking different versions of the same package
    • +
    • with --greedy packages are selected by Obsoletes tag too
    • +
    +
    + + '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. + + + new: with --unique-pkg-names (-Q) packages with the same name + are removed from available package set + + + 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. + + + fixed available package list management in interactive mode + + + AM/AC stuff cleanup and adaptation to their new versions + (automake 1.7 and autoconf 2.54) + Artur Frysiak + + + Polish translation of manual page + Tomasz Pala + + + fix: progress bar isn't refreshed so frequently (#367) + +
    + + + Obsoletes tag is used during upgrades (if --greedy is set) + + + + fixed dependency EVR matching + + + + 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. + + + + bugfix: -s URL works fine + + + + added poldek's logo + Karol Krenski + + + + + + package installation is verified with rpm database if rpm reports failure + + + fixed obsoletes matching + Jakub Bogusz + + + improved and fixed file based conflicts detection + + + fixed size units display + Tomasz Pala + + + + + improved package conflicts resolving + + + split: SIGSEV killed + + + fixed package removal + + + shell: search: fixed default options processing + + + another "desynchronized index" bug is fixed + + + fixed Epoch matching + + + vhttp: program doesn't die on doubled HTTP headers + + + + + new "--ignore" option makes packages invisible to the poldek + + + "hdrl" sources can be refreshed with --upa + + + fixed package removal: don't follow dependencies if only one of +multiple-installed packages is intended to uninstall + + + 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. + + + fixed package auto-selection among equivalents: dependencies aren't verified strictly +during package scoring. + + + fixed bug of equivalent package selection (<Enter> was select first, +notdefault package). + + + shell: with 'upgrade' and 'greedy-upgrade' commands only upgradeable +packages are auto-completed. + + + + + about 75% less memory is used by incremental update of packages.dir + + + improved package auto-selection among equivalents: package which marks + less packages to install is preferred + + + vftp: fixed logging in when server doesn't ask for password + Przemyslaw Frasunek + + + bugfix: root directory (--rootdir) is always passed to rpm as absolute path + + + shell: desc: file mode is displayed in human readable form + + + fixed vfjuggle: packages.dir.md* are copied to hdd too + + + few SIGSEVs killed on "search" command when APT's pkglist file is used as package index + + Gustavo Niemeyer + + + + + new (major) modes: --downgrade downgrade given packages; + --reinstall major mode reinstalls given packages; + --erase removes packages with its reverse dependent ones + + + shell: fixed C-c handling (connecting phase can be interrupted) + + + improved splitting +
      +
    • packages are auto-rearranged on chunk's boundaries
    • +
    • masks with priority less than 0 are always applied at first
    • +
    +
    + + killed SIGSEV on long URL's basenames + + + source prefix is handled properly with --mkidx* + +
    + + + 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. + + + + 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'. + + + 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). + + + simple HTTP client (with partly HTTP/1.1 support), it is used for HTTP downloads; cURL backend is not compiled by default. + + + added IPv6 support to internal FTP client + + + new "--clean" and "--clean-whole" options for cache directorycleanup + + + URLs with user and password (ftp://user:passwd at host:port/path/ syntax) are supported + Andreas Piesk + + + new "ftp_sysuser_as_anon_passwd" option causes sending login at + hostname as anonymous FTP password + + + new "noautoup" source option tells poldek to do not update source by default. + + + shell: added long listig format of file list (poldek> desc -ll) + + + misc fixes to compile on SuSE + + + fixed rpm 3.x support + Roger Luethi + + + fixed and improved handling of bool configuration options, added on/off and enable/disable + to the list of valid choices + Andreas Piesk + + + fixed detection of file based conflicts between available packages. + + + packages with capabilities with the same name and different + versions are handled properly + + + misc fixes to compile and work with glibc2.1 + Andreas Piesk + + + installation of multiple instances of package is allowed (by poldek -i) + + + fixes and improvements of dependency resolution +
      +
    • fixed greedy mode
    • +
    • fixed handling package conflicts added by poldek
    • +
    • faster dependency checking
    • +
    +
    + + German translation + Andreas Piesk + + + various bugs are fixed +
      +
    • double '/' in paths handling
    • +
    • huge mem leak on --update
    • +
    • ambiguous p_open() flags (Michal Moskal <malekith att pld-linux org>)
    • +
    • removed [v]snprintf() (wrong) usage; trurlib's n_[v]snprintf() are used instead
    • +
    • automake/autoconf fixes (Artur Frysiak <wiget att pld-linux org>)
    • +
    +
    +
    + + + "ported" to RedHat 7.2 (with rpm 4.0.4) + + + install-dist: --force forces installation of broken package sets + + + corrected package installation progress bar + Michal Moskal + + + install-dist: log INST-{OK,ERR} for PLD Installer + Michal Moskal + + + --dump* works properly + + + vftp: fixed error handling + + + + + ftp: fixed multiline responses handling + + + + + added support for package.dir's "patches" (new option --update-whole updates + whole index; --update looking for patches first) + + + 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. + + + improved dependency processing +
      +
    • package may be marked for install as a consequence of conflict
    • +
    • dependency loops detected during install time are noticed in human readable form
    • +
    • improved "greedy" selection - if foo-VER is upgraded, then "greedy" marks will mark + foo-{devel,static,etc} in version VER too.
    • +
    +
    + + added simple ftp client; it is used for FTP downloads by default + + + shell +
      +
    • db package list is cached what speeds up program start
    • +
    • ls: long listings are passed to $PAGER program (default is "less")
    • +
    • ls: new switches -n (list package names only), -G (list group) + and -O (show package summaries)
    • +
    +
    + + added log file support (--log option) + + + 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. + + + packages.dir's integrity is verified before each loadingwhat prevents program + SIGSEVs on load broken indexes + + + changed default cache directory to $HOME/.poldek-cache + + + package MD5 sums are verified before install + + + with --ask program confirms each installation (confirm_install config option) + and allows the user to choose among equivalent packages + (choose_equivalents_manually config option) + + + few (nice) improvements and (not so nice ;-) bugs fixed + +
    + + + fixed removable media support in non-install-dist modes + + + shell: uninstall: fix: don't remove pkg from install list if removal fails + + + + + shell +
      +
    • desc: added package file size display
    • +
    • search: added Group search
    • +
    • install: unhidden --mercy
    • +
    • uninstall: fix: don't remove pkg from install list if --test is used
    • +
    • added -h opt. to all commands
    • +
    +
    + + removed GCC's nested functions usage -- seems that it causes SIGSEVs on some machines + Arkadiusz Patyk + + + fix: don't include trailing whitespaces in config values + +
    + + + curl: disabled timeouts, cURL's timeout it's a time to transfer file + + + curl: amount and total sizes are displayed in progress bar + + + fix: enabled --hold + + + fix: SIGSEV killed when pkg description requested while pkg index +doesn't contain package descriptions at all + + + shell: fixed installed package list management + + + curl: fixed progress bar if total file size is unknown + Michal Moskal + + + "mercy" mode bugfix + + + + + downloaded packages are removed after successful installation by default +(keep_downloads=yes in config can change to previous behavior) + + + changed semantics of --test: -t causes poldek's checks only, + -tt turns on tests performed by rpm too. + + + "mercy" dependency checking mode may be enabled in config + + + added workarounds and traps for (probably) curl's bugs + + + "update" option can be used with other commands simultaneously + + + shell mode is now the default + + + shell: added greedy option to install cmd + + + + + package priorities could be used during installation too + (/etc/poldek-pkgsplit.conf or /etc/poldek-pri.conf is used by default) + + + added global config /etc/poldek.conf usage + + + fixed prereq loop detection + + + added '@' to list of valid characters in package filename + Rafal Kleger-Rudomin + + + vfjuggle: sed is used instead of awk + Rafal Kleger-Rudomin + + + shell: ls: fixed packages sorting + + + minor bugfixes + + + + + another bugfix of dependency processing + + + shell: new ls options: -t, -T, -r + + + added --shcmd option which allows to execute poldek's shell command +without entering shell mode + + + detect if stdout is connected to a terminal and display progress bars accordingly. + + + install-dist: retry to fetch packages if connection is down + + + + + conflicts detection bugfix + + + + + another bugfix of dependency processing + + + splitted verify option to verify, verify-conflicts and verify-fileconflicts + + + more user friendly output on package set verification + + + + + added "hold" and "greedy" commands + + + added FIRST_FREE_SPACE param to split option + + + fixed bug of dependency processing + + + minor bugfixes + + + + + spliting: changed packages.chunk* format: full package filenames are printed + and removed comments. + + + bugfixes + + + + + updated vfcurl progress bar handling (according to curl 7.8) + + + better index format version handling (minor.major ver schema), current + version is 1.0, older versions not supported... + + + package's integer fields are stored in binary form, groups are stored as separate, global tag + + + remote indexes are verified after download + + + added checking of package architecture and OS + + + added support for removable media (vfjuggle script is added) + + + added package file size to index (for spliting) + + + added "nofollow" option to cmdline and "follow" one to config + + + renamed "freshen" to "fresh" and changed its semantics, now rpm's +"--freshen" <=> "--nofollow --fresh" + + + changed default index name to "packages.dir" + + + added mkpackagedir script + + + added spliting (--split* options) + + + package-set file syntax: changed "maybe" mark to '~' ('!' still work, but obsoleted) + + + shell +
      +
    • added aliases for commands ("ll", "llu", "freshen", "what-requires", etc)
    • +
    • better completition context switching
    • +
    • extended "desc" and "search" commands -- almost allpackage fields could be specified
    • +
    • colorized output
    • +
    +
    + + many bugfixes + Rafal Kleger-Rudomin + Michal Moskal + +
    + + + support for multiple sources + + + Packages SHA1 digest is computed and checked (Packages.md is created) + + + capabilities/requirement are stored in binary form (v0.4 of Packages format) + + + default name (Packages[.gz]) is used if only dir is given as source (i.e. it's last character is '/') + + + shell: both installed and available packages list is maintained properly during installs/unistalls without reloading rpm database + + + shell: added "search" command + + + removed unused support for rpmidx (aka tocfile) + + + cleanup and bugfixes + + +
    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 @@ + + + + + + + + +text/css + + + + + + 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 @@ -This manual page contains only option reference, the full documentation for poldek -is available as a Texinfo manual. Do info poldek to get it. +This manual page contains only command line option reference, the full documentation +for poldek is available as a Texinfo manual. Do info poldek to get it. @@ -61,6 +61,15 @@ &ref-miscellaneous_options; +AUTHOR + +Pawel A. Gajda <mis at pld.org.pl> + + +See CREDITS file for a list of contributors. + + + See also 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 @@ + + +
    @@ -133,6 +152,18 @@ + + - @@ -182,21 +213,13 @@ - - - - - - - - - Installation options - - - - - - - - - - - - - - - + + + + @@ -439,7 +470,7 @@
    - + This section contains poldek's repository configuration. Every repository is configured in its own [ source ] section. @@ -453,7 +484,7 @@ - - + - - - + +