Sprout from master 2006-05-15 13:39:46 UTC Elan Ruusamäe <glen@pld-linux.org> '- ignore vserver-packages in default install'
Delete:
poldek-aliases.conf
poldek-ask-abort.patch
poldek-cli-hist.patch
poldek-cvs-fixes.patch
poldek-multilib.conf
poldek-obsoletes.patch
poldek-rpm_4_4_3.patch
poldek.conf
poldek.spec
+++ /dev/null
-# System wide aliases
-# ls
-ll = ls -l
-llu = ls -lu
-llU = ls -lU
-lli = ls -lI
-
-# install
-freshen = install -FN
-upgrade = install -F
-
-# for backward compatybility, greedy is on by default now
-greedy-upgrade = install -FG
-
-just-install = install -IN
-
-# search
-what-requires = search -r
-what-provides = search -p
-rsearch = search --perlre
-
-exit = quit
-
-# for fun
-#ls = uninstall kernel
-
-less = !less
-grep = !grep
-awk = !awk
-
+++ /dev/null
-Index: ask.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/ask.c,v
-retrieving revision 1.6
-retrieving revision 1.7
-diff -u -r1.6 -r1.7
---- ask.c 14 Apr 2003 16:28:09 -0000 1.6
-+++ ask.c 3 Nov 2005 00:16:58 -0000 1.7
-@@ -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);
-Index: pkgset-install.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/pkgset-install.c,v
-retrieving revision 1.148
-retrieving revision 1.149
-diff -u -r1.148 -r1.149
---- pkgset-install.c 1 Nov 2005 19:36:36 -0000 1.148
-+++ pkgset-install.c 3 Nov 2005 00:21:00 -0000 1.149
-@@ -1243,7 +1249,8 @@
-
- DBGF("req %s\n", capreq_snprintf_s(req));
-
-- if (upg->ts->getop(upg->ts, POLDEK_OP_EQPKG_ASKUSER) && upg->ts->askpkg_fn)
-+ if (upg->ts->getop(upg->ts, POLDEK_OP_EQPKG_ASKUSER) &&
-+ upg->ts->askpkg_fn)
- tomark_candidates_ptr = &tomark_candidates;
-
- if (find_req(pkg, req, &tomark, tomark_candidates_ptr, ps, upg)) {
-@@ -1301,6 +1308,14 @@
- int n;
- n = upg->ts->askpkg_fn(capreq_snprintf_s(req),
- tomark_candidates, tomark);
-+
-+ if (n == -1) { /* user abort */
-+ free(tomark_candidates);
-+ tomark_candidates = NULL;
-+ upg->nerr_fatal++;
-+ return 0;
-+ }
-+
- real_tomark = tomark_candidates[n];
- free(tomark_candidates);
- tomark_candidates = NULL;
-@@ -1437,12 +1452,15 @@
-
- if (pkg->reqs)
- process_pkg_reqs(indent, pkg, ps, upg, process_as);
--
-+
- if (process_as == PROCESS_AS_NEW) {
- process_pkg_conflicts(indent, pkg, ps, upg);
- //process_pkg_obsl(pkg, ps, upg, indent);
- }
-
-+ if (upg->nerr_fatal || sigint_reached())
-+ return 0;
-+
- DBGF("END PROCESSING [%d] %s as %s\n", indent, pkg_id(pkg),
- process_as == PROCESS_AS_NEW ? "NEW" : "ORPHAN");
-
-@@ -1532,7 +1550,14 @@
- struct pkg *real_tomark = tomark;
- if (tomark_candidates) {
- int n;
-- n = upg->ts->askpkg_fn(capreq_snprintf_s(req), tomark_candidates, tomark);
-+ n = upg->ts->askpkg_fn(capreq_snprintf_s(req), tomark_candidates,
-+ tomark);
-+ if (n == -1) {
-+ n_cfree(&tomark_candidates);
-+ upg->nerr_fatal++;
-+ goto l_end;
-+ }
-+
- real_tomark = tomark_candidates[n];
- n_cfree(&tomark_candidates);
- }
-@@ -1808,6 +1833,9 @@
-
- db = upg->ts->db;
-
-+ if (upg->nerr_fatal || sigint_reached())
-+ return 0;
-+
- if (!upg->ts->getop(upg->ts, POLDEK_OP_CONFLICTS))
- return 1;
-
-@@ -1850,7 +1878,9 @@
- if (n)
- pkg_set_unmetdeps(upg->unmetpms, pkg);
- }
--
-+
-+ if (upg->nerr_fatal || sigint_reached())
-+ return 0;
-
- if (pkg->cnfls != NULL)
- for (i = 0; i < n_array_size(pkg->cnfls); i++) {
-@@ -2317,103 +2347,8 @@
- return nmarked;
- }
-
--static
--int prepare_icap(struct poldek_ts *ts, const char *capname, tn_array *pkgs)
--{
-- int i, found = 0;
-- tn_array *dbpkgs;
-- struct capreq *cap;
--
-- capreq_new_name_a(capname, cap);
-- dbpkgs = pkgdb_get_provides_dbpkgs(ts->db, cap, NULL, 0);
-- if (dbpkgs == NULL) {
-- struct pkg *pkg;
-- if (ts->getop(ts, POLDEK_OP_FRESHEN))
-- return 0;
--
-- n_array_sort_ex(pkgs, (tn_fn_cmp)pkg_cmp_name_evr_rev);
-- pkg = n_array_nth(pkgs, 0);
-- pkg_hand_mark(ts->pms, pkg);
-- return 1;
-- }
--
-- n_array_sort_ex(pkgs, (tn_fn_cmp)pkg_cmp_name_evr_rev);
-- for (i=0; i < n_array_size(dbpkgs); i++) {
-- struct pkg *dbpkg = n_array_nth(dbpkgs, i);
-- int n = n_array_bsearch_idx_ex(pkgs, dbpkg,
-- (tn_fn_cmp)pkg_cmp_name);
--
-- DBGF("%s: %s\n", capname, pkg_id(dbpkg));
--
-- if (n < 0)
-- continue;
--
-- for (; n < n_array_size(pkgs); n++) {
-- struct pkg *pkg = n_array_nth(pkgs, n);
-- int cmprc, mark = 0;
--
-- DBGF("%s: %s cmp %s\n", capname, pkg_id(pkg),
-- pkg_id(dbpkg));
-- if (pkg_cmp_name(pkg, dbpkg) != 0)
-- break;
--
-- cmprc = pkg_cmp_name_evr(pkg, dbpkg);
-- if (cmprc > 0)
-- mark = 1;
--
-- else if (cmprc == 0 && poldek_ts_issetf(ts, POLDEK_TS_REINSTALL))
-- mark = 1;
--
-- else if (cmprc < 0 && poldek_ts_issetf(ts, POLDEK_TS_DOWNGRADE))
-- mark = 1;
--
-- if (mark) {
-- found = 1;
-- msgn(1, _("%s: marked as %s's provider"), pkg_id(pkg),
-- capname);
--
-- pkg_hand_mark(ts->pms, pkg);
-- goto l_end;
--
-- } else if (cmprc <= 0) {
-- char *eqs = cmprc == 0 ? "equal" : "newer";
-- msgn(1, _("%s: %s version of %s is installed (%s), skipped"),
-- capname, eqs, pkg_id(dbpkg),
-- pkg_id(pkg));
--
-- } else {
-- n_assert(0);
--
-- }
-- }
-- }
--l_end:
-- if (dbpkgs)
-- n_array_free(dbpkgs);
--
-- return found;
--}
--
--static
--int prepare_icaps(struct poldek_ts *ts)
--{
-- tn_array *keys;
-- tn_hash *icaps;
-- int i;
--
-- icaps = arg_packages_get_resolved_caps(ts->aps);
-- keys = n_hash_keys_cp(icaps);
-- for (i=0; i < n_array_size(keys); i++) {
-- const char *cap = n_array_nth(keys, i);
-- tn_array *pkgs = n_hash_get(icaps, cap);
-- prepare_icap(ts, cap, pkgs);
-- }
-- n_array_free(keys);
-- n_hash_free(icaps);
-- return 1;
--}
--
--
-+/* use install/ in_prepare_icaps() */
-+extern int in_prepare_icaps(struct poldek_ts *ts);
-
- int do_poldek_ts_install(struct poldek_ts *ts, struct poldek_iinf *iinf)
- {
-@@ -2424,7 +2359,9 @@
-
- n_assert(ts->type == POLDEK_TS_INSTALL);
-
-- prepare_icaps(ts);
-+ if (in_prepare_icaps(ts) == -1) /* user abort */
-+ return 1;
-+
- if (unmark_name_dups(ts->pms, ps->pkgs) == 0) {
- msgn(1, _("Nothing to do"));
- return 1;
-Index: install/conflicts.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/install/conflicts.c,v
-retrieving revision 1.1
-retrieving revision 1.2
-diff -u -r1.1 -r1.2
---- install/conflicts.c 9 Jul 2005 17:51:18 -0000 1.1
-+++ install/conflicts.c 3 Nov 2005 00:21:05 -0000 1.2
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include "ictx.h"
-@@ -96,10 +96,13 @@
- if (found) {
- struct pkg *real_tomark = tomark;
- if (tomark_candidates) {
-- int n;
-- n = ictx->ts->askpkg_fn(capreq_snprintf_s(req), tomark_candidates, tomark);
-- real_tomark = tomark_candidates[n];
-+ real_tomark = in_choose_equiv(ictx->ts, req, tomark_candidates,
-+ tomark);
- n_cfree(&tomark_candidates);
-+ if (real_tomark == NULL) { /* user aborts */
-+ ictx->nerr_fatal++;
-+ found = 0;
-+ }
- }
- tomark = real_tomark;
-
-Index: install/icaps.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/install/icaps.c,v
-retrieving revision 1.1
-retrieving revision 1.2
-diff -u -r1.1 -r1.2
---- install/icaps.c 9 Jul 2005 17:51:18 -0000 1.1
-+++ install/icaps.c 3 Nov 2005 00:21:05 -0000 1.2
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include "ictx.h"
-@@ -25,13 +25,32 @@
-
- capreq_new_name_a(capname, cap);
- dbpkgs = pkgdb_get_provides_dbpkgs(ts->db, cap, NULL, 0);
-+
- if (dbpkgs == NULL) {
-- struct pkg *pkg;
-+ struct pkg *pkg = NULL;
-+
- if (ts->getop(ts, POLDEK_OP_FRESHEN))
- return 0;
-
- n_array_sort_ex(pkgs, (tn_fn_cmp)pkg_cmp_name_evr_rev);
-- pkg = n_array_nth(pkgs, 0);
-+
-+ if (ts->getop(ts, POLDEK_OP_EQPKG_ASKUSER) && ts->askpkg_fn && n_array_size(pkgs) > 1) {
-+ struct pkg **candidates = alloca(sizeof(struct pkg *) *
-+ (n_array_size(pkgs) + 1));
-+ for (i=0; i < n_array_size(pkgs); i++)
-+ candidates[i] = n_array_nth(pkgs, i);
-+ candidates[i] = NULL;
-+
-+ pkg = in_choose_equiv(ts, cap, candidates, NULL);
-+ if (pkg == NULL) { /* user aborts */
-+ found = -1;
-+ goto l_end;
-+ }
-+ }
-+
-+ if (pkg == NULL)
-+ pkg = n_array_nth(pkgs, 0);
-+
- pkg_hand_mark(ts->pms, pkg);
- return 1;
- }
-@@ -65,7 +84,7 @@
-
- else if (cmprc < 0 && poldek_ts_issetf(ts, POLDEK_TS_DOWNGRADE))
- mark = 1;
--
-+
- if (mark) {
- found = 1;
- msgn(1, _("%s: marked as %s's provider"), pkg_id(pkg),
-@@ -82,10 +101,10 @@
-
- } else {
- n_assert(0);
--
- }
- }
- }
-+
- l_end:
- if (dbpkgs)
- n_array_free(dbpkgs);
-@@ -93,20 +112,26 @@
- return found;
- }
-
-+/* handles --caplookup */
- int in_prepare_icaps(struct poldek_ts *ts)
- {
- tn_array *keys;
- tn_hash *icaps;
-- int i;
--
-+ int i, rc = 1;
-+
- icaps = arg_packages_get_resolved_caps(ts->aps);
- keys = n_hash_keys_cp(icaps);
- for (i=0; i < n_array_size(keys); i++) {
- const char *cap = n_array_nth(keys, i);
- tn_array *pkgs = n_hash_get(icaps, cap);
-- prepare_icap(ts, cap, pkgs);
-+
-+ if (prepare_icap(ts, cap, pkgs) == -1) {
-+ rc = -1;
-+ break;
-+ }
- }
-+
- n_array_free(keys);
- n_hash_free(icaps);
-- return 1;
-+ return rc;
- }
-Index: install/ictx.h
-===================================================================
-RCS file: /cvsroot/installer/poldek/install/ictx.h,v
-retrieving revision 1.2
-retrieving revision 1.3
-diff -u -r1.2 -r1.3
---- install/ictx.h 20 Oct 2005 18:19:16 -0000 1.2
-+++ install/ictx.h 3 Nov 2005 00:21:05 -0000 1.3
-@@ -138,4 +138,7 @@
- int in_process_package(int indent, struct install_ctx *ictx,
- struct pkg *pkg, int process_as);
-
-+
-+struct pkg *in_choose_equiv(struct poldek_ts *ts, struct capreq *cap,
-+ struct pkg **candidates, struct pkg *defaultpkg);
- #endif
-Index: install/install.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/install/install.c,v
-retrieving revision 1.3
-retrieving revision 1.4
-diff -u -r1.3 -r1.4
---- install/install.c 15 Sep 2005 18:00:35 -0000 1.3
-+++ install/install.c 3 Nov 2005 00:21:05 -0000 1.4
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <vfile/vfile.h>
-@@ -352,7 +352,9 @@
- struct install_ctx ictx;
- n_assert(ts->type == POLDEK_TS_INSTALL);
-
-- in_prepare_icaps(ts);
-+ if (in_prepare_icaps(ts) < 0) /* user aborts, no error */
-+ return 1;
-+
- if (unmark_name_dups(ts->pms, ts->ctx->ps->pkgs) == 0) {
- msgn(1, _("Nothing to do"));
- return 1;
-Index: install/misc.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/install/misc.c,v
-retrieving revision 1.4
-retrieving revision 1.5
-diff -u -r1.4 -r1.5
---- install/misc.c 20 Oct 2005 17:57:51 -0000 1.4
-+++ install/misc.c 3 Nov 2005 00:18:36 -0000 1.5
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include "ictx.h"
-@@ -439,7 +439,7 @@
-
- l_end:
-
-- if (candidates && nsuspkgs) {
-+ if (candidates && nsuspkgs > 1) {
- n_assert(suspkgs);
- *candidates = suspkgs;
-
-@@ -460,3 +460,16 @@
- ictx->uninst_set->dbpkgs);
- }
-
-+struct pkg *in_choose_equiv(struct poldek_ts *ts, struct capreq *cap,
-+ struct pkg **candidates, struct pkg *defaultpkg)
-+{
-+ int n;
-+
-+ if (defaultpkg == NULL)
-+ defaultpkg = candidates[0];
-+
-+ n = ts->askpkg_fn(capreq_snprintf_s(cap), candidates, defaultpkg);
-+ if (n == -1)
-+ return NULL;
-+ return candidates[n];
-+}
-Index: install/requirements.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/install/requirements.c,v
-retrieving revision 1.3
-retrieving revision 1.4
-diff -u -r1.3 -r1.4
---- install/requirements.c 20 Oct 2005 18:19:16 -0000 1.3
-+++ install/requirements.c 3 Nov 2005 00:21:05 -0000 1.4
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include "ictx.h"
-@@ -165,12 +165,15 @@
-
- struct pkg *real_tomark = tomark;
- if (tomark_candidates) {
-- int n;
-- n = ictx->ts->askpkg_fn(capreq_snprintf_s(req),
-- tomark_candidates, tomark);
-- real_tomark = tomark_candidates[n];
-+ real_tomark = in_choose_equiv(ictx->ts, req, tomark_candidates,
-+ tomark);
- free(tomark_candidates);
- tomark_candidates = NULL;
-+
-+ if (real_tomark == NULL) { /* user abort */
-+ ictx->nerr_fatal++;
-+ return 0;
-+ }
- }
-
- if (in_is_marked_for_removal_by_req(ictx, real_tomark, req)) {
+++ /dev/null
-===================================================================
-RCS file: /cvsroot/poldek/poldek/cli/shell.c,v
-retrieving revision 1.28
-retrieving revision 1.29
-diff -u -r1.28 -r1.29
---- poldek/poldek/cli/shell.c 2006/01/07 01:06:48 1.28
-+++ poldek/poldek/cli/shell.c 2006/05/11 09:51:53 1.29
-@@ -356,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);
-
+++ /dev/null
-===================================================================
-RCS file: /cvsroot/installer/poldek/pkgset-install.c,v
-retrieving revision 1.147
-retrieving revision 1.148
-diff -u -r1.147 -r1.148
---- installer/poldek/pkgset-install.c 2005/10/24 15:30:40 1.147
-+++ installer/poldek/pkgset-install.c 2005/11/01 19:36:36 1.148
- #ifdef HAVE_CONFIG_H
-@@ -1174,7 +1174,9 @@
- memset(&successor, 0, sizeof(successor));
- if (process_as == PROCESS_AS_ORPHAN &&
- upg->ts->getop(upg->ts, POLDEK_OP_AGGREEDY)) {
-- if (pkg_drags(pkg, ps, upg) == 0) {
-+ int ndrags = pkg_drags(pkg, ps, upg);
-+ DBGF("%s, ndrags %d\n", pkg_id(pkg), ndrags);
-+ if (ndrags == 0 || 1) { /* XXX cond temporary disabled - needs test */
- struct pkg *p;
- int is_marked = 0, ndragged = 0, by_obsoletes = 0;
-
-@@ -1186,9 +1188,10 @@
- successor.realpkg = p;
- successor.by_obsoletes = by_obsoletes;
-
-- /* do not follow successor if package drags something and
-- is not marked */
-- if (p && (ndragged = pkg_drags(p, ps, upg)) > 0 && is_marked == 0) {
-+ /* do not follow successor if it drags more packages than orphaned one
-+ * and successor is not marked */
-+
-+ if (p && (ndragged = pkg_drags(p, ps, upg)) > ndrags && is_marked == 0) {
- DBGF("OMIT select_successor %s -> %s (%d)\n",
- pkg_id(pkg), pkg_id(p), ndragged);
- p = NULL;
-===================================================================
-RCS file: /cvsroot/installer/poldek/vfile/misc.c,v
-retrieving revision 1.11
-retrieving revision 1.12
-diff -u -r1.11 -r1.12
---- installer/poldek/vfile/misc.c 2005/07/17 15:04:34 1.11
-+++ installer/poldek/vfile/misc.c 2005/11/02 19:45:40 1.12
-@@ -58,7 +58,7 @@
-
- p = path;
- p++;
-- ndots = 0;
-+ ndots = -1;
-
- while (*p) {
- switch (*p) {
-@@ -71,11 +71,12 @@
- break;
-
- case '.':
-- ndots++;
-+ if (ndots >= 0)
-+ ndots++;
- break;
-
- default:
-- ndots = 0;
-+ ndots = -1;
-
- if (!isalnum(*p) && strchr("-+/._@!~", *p) == NULL) {
- vf_logerr("%s:%c non alphanumeric characters not allowed\n",
-===================================================================
-RCS file: /cvsroot/installer/poldek/vfile/extcompr.c,v
-retrieving revision 1.7
-retrieving revision 1.8
-diff -u -r1.7 -r1.8
---- installer/poldek/vfile/extcompr.c 2005/05/15 15:46:59 1.7
-+++ installer/poldek/vfile/extcompr.c 2005/11/02 20:10:36 1.8
-@@ -195,7 +195,7 @@
- if (uncompr == NULL)
- return -1;
-
-- if (*vfile_verbose)
-+ if (*vfile_verbose > 0)
- vf_loginfo(_("Decompressing %s...\n"), n_basenam(path));
- return vf_do_compr(uncompr, "-d", path, destpath);
- }
-===================================================================
-RCS file: /cvsroot/installer/poldek/cli/uninstall.c,v
-retrieving revision 1.25
-retrieving revision 1.26
-diff -u -r1.25 -r1.26
---- installer/poldek/cli/uninstall.c 2005/07/12 17:29:09 1.25
-+++ installer/poldek/cli/uninstall.c 2005/11/05 00:14:38 1.26
-@@ -171,6 +171,7 @@
-
- ts->setop(ts, POLDEK_OP_GREEDY, bool);
- }
-+ break;
-
- case 't':
- if (ts->getop(ts, POLDEK_OP_TEST))
-===================================================================
-RCS file: /cvsroot/installer/poldek/vfcompr,v
-retrieving revision 1.4
-retrieving revision 1.6
-diff -u -r1.4 -r1.6
---- installer/poldek/vfcompr 2004/07/05 19:15:10 1.4
-+++ installer/poldek/vfcompr 2005/11/02 20:25:37 1.6
-@@ -19,7 +22,7 @@
- typeset src=$1
- typeset dest=$2
-
-- md5file="${src}-vfcompr.md5"
-+ md5file="${dest}-vfcompr.md5"
- #echo "$md5file"
- if [ -f $dest -a -f "$md5file" ]; then
- #echo md5sum --check "$md5file"
-===================================================================
-RCS file: /cvsroot/poldek/poldek/pkg.c,v
-retrieving revision 1.107
-retrieving revision 1.108
-diff -u -r1.107 -r1.108
---- poldek/poldek/pkg.c 2005/10/13 15:39:27 1.107
-+++ poldek/poldek/pkg.c 2006/03/18 16:29:00 1.108
-@@ -1,5 +1,5 @@
- /*
-- Copyright (C) 2000 - 2004 Pawel A. Gajda <mis@k2.net.pl>
-+ Copyright (C) 2000 - 2006 Pawel A. Gajda (mis@k2.net.pl)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2 as
-@@ -15,7 +15,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -694,8 +694,8 @@
- int n;
-
- DBGF("\npkg_caps_match_req %s %s\n", pkg_snprintf_s(pkg),
-- capreq_snprintf_s(req));
--
-+ capreq_snprintf_s(req));
-+
- if (pkg->caps == NULL || n_array_size(pkg->caps) == 0)
- return 0; /* not match */
-
-@@ -703,40 +703,25 @@
- return 0;
-
- } else {
-- struct capreq *cap;
- int i;
-+ for (i = n; i < n_array_size(pkg->caps); i++) {
-+ struct capreq *cap = n_array_nth(pkg->caps, i);
-
-- cap = n_array_nth(pkg->caps, n);
-- if (cap_xmatch_req(cap, req, flags)) {
-- DBGF("chk%d (%s-%s-%s) -> match (flags=%d)\n", n, capreq_name(cap),
-- capreq_ver(cap), capreq_rel(cap), flags);
-- return 1;
-- }
-- n++;
--
-- for (i = n; i<n_array_size(pkg->caps); i++) {
-- struct capreq *cap;
--
-- cap = n_array_nth(pkg->caps, n);
-- if (strcmp(capreq_name(cap), capreq_name(req)) != 0) {
-- DBGF("chk%d %s-%s-%s -> NOT match IRET\n", i,
-- capreq_name(cap), capreq_ver(cap),
-- capreq_rel(cap));
-+ /* names not equal -> return with false;
-+ eq test omitting for first cap */
-+ if (i > n && n_str_ne(capreq_name(cap), capreq_name(req))) {
-+ DBGF(" cap[%d] %s -> NOT match, IRET\n", i,
-+ capreq_snprintf_s(cap));
- return 0;
- }
--
--
-+
- if (cap_xmatch_req(cap, req, flags)) {
-- DBGMSG("chk %s-%s-%s -> match\n", capreq_name(cap),
-- capreq_ver(cap), capreq_rel(cap));
-+ DBGF(" cap[%d] %s -> match\n", i, capreq_snprintf_s(cap));
- return 1;
-- } else {
-- DBGMSG("chk%d %s-%s-%s -> NOT match\n", i,
-- capreq_name(cap), capreq_ver(cap),
-- capreq_rel(cap));
- }
-+
-+ DBGF(" cap[%d] %s -> NOT match\n", i, capreq_snprintf_s(cap));
- }
-- DBGMSG("NONE\n");
- }
-
- return 0;
---- poldek/poldek/pm/pkgdb.c 2005/10/24 15:25:58 1.21
-+++ poldek/poldek/pm/pkgdb.c 2006/03/18 15:18:04 1.22
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <stdlib.h>
-@@ -440,6 +440,9 @@
- tn_array *unistdbpkgs, unsigned ldflags)
- {
- tn_array *dbpkgs = NULL;
-+
-+ n_assert(db);
-+ n_assert(cap);
- pkgdb_search(db, &dbpkgs, PMTAG_CAP, capreq_name(cap),
- unistdbpkgs, ldflags);
- return dbpkgs;
-diff -u poldek/poldek/uninstall.c poldek/poldek/uninstall.c
---- poldek/poldek/uninstall.c 2006/03/18 15:18:04 1.38
-+++ poldek/poldek/uninstall.c 2006/03/18 17:03:48 1.39
-@@ -1,5 +1,5 @@
- /*
-- Copyright (C) 2000 - 2005 Pawel A. Gajda <mis@k2.net.pl>
-+ Copyright (C) 2000 - 2006 Pawel A. Gajda <mis@k2.net.pl>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2 as
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <errno.h>
-@@ -407,7 +407,7 @@
- tn_array *dbpkgs;
- int i, nmatches = 0;
-
--
-+ n_assert(cr);
- DBGF("get_provides %s\n", capreq_snprintf_s(cr));
- dbpkgs = pkgdb_get_provides_dbpkgs(ts->db, cr, NULL, uninst_LDFLAGS);
-
-@@ -431,7 +431,8 @@
- } else { /* with version */
- if (ts->getop(ts, POLDEK_OP_CAPLOOKUP)) {
- if (pkg_xmatch_req(dbpkg, cr, POLDEK_MA_PROMOTE_REQEPOCH))
-- matched = 1;
-+ matched = 1;
-+
- } else {
- if (strcmp(dbpkg->name, capreq_name(cr)) == 0) {
- DBGF("n (%s, %s) %d\n", dbpkg->name,
-@@ -457,15 +458,20 @@
- return nmatches;
- }
-
--static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts, const char *mask)
-+static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts,
-+ const char *mask)
- {
- char *p;
- struct capreq *cr, *cr_evr;
- int resolved = 0;
-
- cr = NULL; cr_evr = NULL;
--
-- if ((p = strchr(mask, '#')) == NULL) {
-+
-+ DBGF("mask=%s\n", mask);
-+ /* No EVR mask or empty EVR (last char '#') */
-+ if ((p = strchr(mask, '#')) == NULL || *(p + 1) == '\0') {
-+ if (p)
-+ *p = '\0';
- capreq_new_name_a(mask, cr);
-
- } else {
-@@ -479,8 +485,10 @@
- *p = '\0';
- p++;
-
-- if (poldek_util_parse_evr(p, &epoch, &ver, &rel))
-+ if (poldek_util_parse_evr(p, &epoch, &ver, &rel)) {
- cr = cr_evr = capreq_new(NULL, tmp, epoch, ver, rel, REL_EQ, 0);
-+ DBGF("cap=%s\n", capreq_snprintf_s(cr));
-+ }
- }
-
- if (do_resolve_package(uctx, ts, mask, cr))
-@@ -529,7 +537,6 @@
- int32_t e = 0;
-
- n_strdupap(mask, &tmp);
--
- if (poldek_util_parse_nevr(tmp, &n, &e, &v, &r)) {
- if (e)
- n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
-@@ -538,7 +545,7 @@
-
- msgn(2, " Trying %s\n", nmask);
- DBGF("try %s => %s (%s, %s, %s)\n", mask, nmask, n, v, r);
-- matched = resolve_package(uctx, ts, tmp);
-+ matched = resolve_package(uctx, ts, nmask);
- }
- }
- }
---- poldek/poldek/conf.c 2005/11/05 17:47:55 1.79
-+++ poldek/poldek/conf.c 2006/03/18 15:27:47 1.80
-@@ -1,5 +1,5 @@
- /*
-- Copyright (C) 2000 - 2005 Pawel A. Gajda <mis@k2.net.pl>
-+ Copyright (C) 2000 - 2006 Pawel A. Gajda <mis@k2.net.pl>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2 as
-@@ -137,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);
-
-@@ -166,6 +172,7 @@
- }
- p++;
- }
-+
- n_str_tokl_free(v);
- return 1;
- }
---- poldek/poldek/cli/main.c 2005/11/06 19:26:27 1.54
-+++ poldek/poldek/cli/main.c 2006/03/18 15:55:37 1.55
-@@ -115,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 },
+++ /dev/null
-# Alternative multilib PLD 3.0 (Th)
-[source]
-type = %{_th_idxtype}
-name = th-%{_pld_alt_arch}
-path = %{_pld_prefix}/PLD/%{_pld_alt_arch}/PLD/RPMS/
-noauto = yes
-
-[source]
-type = %{_th_idxtype}
-name = th-updates-security-%{_pld_alt_arch}
-path = %{_pld_prefix}/updates/security/%{_pld_alt_arch}/
-noauto = yes
-
-[source]
-type = %{_th_idxtype}
-name = th-updates-general-%{_pld_alt_arch}
-path = %{_pld_prefix}/updates/general/%{_pld_alt_arch}/
-noauto = yes
-
-[source]
-type = %{_th_idxtype}
-name = th-supported-%{_pld_alt_arch}
-path = %{_pld_prefix}/supported/%{_pld_alt_arch}/
-noauto = yes
-
-[source]
-type = %{_th_idxtype}
-name = th-ready-%{_pld_alt_arch}
-path = %{_pld_prefix}/ready/%{_pld_alt_arch}/
-noauto = yes
-
-[source]
-type = %{_th_idxtype}
-name = th-test-%{_pld_alt_arch}
-path = %{_pld_prefix}/test/%{_pld_alt_arch}/
-noauto = yes
+++ /dev/null
-Index: pkgset-install.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/pkgset-install.c,v
-retrieving revision 1.149
-diff -u -r1.149 pkgset-install.c
---- pkgset-install.c 3 Nov 2005 00:21:00 -0000 1.149
-+++ pkgset-install.c 21 Nov 2005 20:42:04 -0000
-@@ -126,6 +126,13 @@
- static int marked_for_removal(struct pkg *pkg, struct upgrade_s *upg);
-
-
-+#define mark_package(a, b) do_mark_package(a, b, PKGMARK_MARK);
-+
-+static int do_mark_package(struct pkg *pkg, struct upgrade_s *upg,
-+ unsigned mark);
-+
-+
-+
- /* anyone of pkgs is marked? */
- static inline int one_is_marked(struct pkgmark_set *pms, struct pkg *pkgs[],
- int npkgs)
-@@ -226,6 +233,30 @@
- return install;
- }
-
-+static
-+struct pkg *installset_obsoletes(const struct pkg *pkg, struct pkgset *ps,
-+ struct upgrade_s *upg)
-+{
-+ tn_array *pkgs;
-+ int i;
-+
-+ pkgs = pkgset_search(ps, PS_SEARCH_OBSL, pkg->name);
-+ DBGF("%s => found %d packages\n", pkg->name, pkgs ? n_array_size(pkgs) : 0);
-+ if (pkgs == NULL)
-+ return NULL;
-+
-+ for (i=0; i<n_array_size(pkgs); i++) {
-+ struct pkg *pkg = n_array_nth(pkgs, i);
-+
-+ if (pkg_is_marked_i(upg->ts->pms, pkg))
-+ mark_package(pkg, upg);
-+
-+ if (pkg_is_marked(upg->ts->pms, pkg))
-+ return pkg;
-+ }
-+ return NULL;
-+}
-+
-
- /* looks into Obsoletes only */
- static
-@@ -235,14 +266,21 @@
- struct pkg *bypkg = NULL;
- tn_array *pkgs;
- int i, best_i;
--
-- if ((pkgs = pkgset_search(ps, PS_SEARCH_CAP, pkg->name)) == NULL)
-+
-+ pkgs = pkgset_search(ps, PS_SEARCH_CAP, pkg->name);
-+ if (pkgs == NULL) {
-+ DBGF("%s => found 0 packages\n");
- return NULL;
-+ }
-+
-
- best_i = select_best_pkg(pkg, pkgs, ps, upg);
-+ DBGF("%s => found %d packages, best=%d\n", pkg->name, n_array_size(pkgs),
-+ best_i);
-+
- for (i=best_i; i < n_array_size(pkgs); i++) {
- struct pkg *p = n_array_nth(pkgs, i);
--
-+
- if (strcmp(pkg->name, p->name) == 0)
- continue;
-
-@@ -264,6 +302,8 @@
- return bypkg;
- }
-
-+
-+
- static
- int other_version_marked(struct pkgmark_set *pms, struct pkg *pkg,
- tn_array *pkgs, struct capreq *req)
-@@ -605,8 +645,6 @@
-
-
-
--#define mark_package(a, b) do_mark_package(a, b, PKGMARK_MARK);
--
- static int do_mark_package(struct pkg *pkg, struct upgrade_s *upg,
- unsigned mark)
- {
-@@ -1146,8 +1184,11 @@
- p = select_pkg(pkg->name, ps->pkgs, upg);
- if ((p == NULL || pkg_cmp_evr(p, pkg) == 0) &&
- upg->ts->getop(upg->ts, POLDEK_OP_OBSOLETES)) {
-- p = select_supersede_pkg(pkg, ps, upg);
-- *by_obsoletes = 1;
-+ if ((p = installset_obsoletes(pkg, ps, upg)) == NULL)
-+ p = select_supersede_pkg(pkg, ps, upg);
-+
-+ if (p)
-+ *by_obsoletes = 1;
- }
- return p;
- }
+++ /dev/null
-Index: pm/rpm/misc.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/pm/rpm/misc.c,v
-retrieving revision 1.4
-retrieving revision 1.5
-diff -u -r1.4 -r1.5
---- pm/rpm/misc.c 12 May 2005 15:44:41 -0000 1.4
-+++ pm/rpm/misc.c 21 Nov 2005 17:01:34 -0000 1.5
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -23,6 +23,9 @@
- #include <string.h>
-
- #include <rpm/rpmlib.h>
-+#if HAVE_RPMDSRPMLIB
-+# include <rpm/rpmds.h>
-+#endif
-
- #include <trurl/nassert.h>
- #include <trurl/nstr.h>
-@@ -33,21 +36,49 @@
- #include "log.h"
- #include "pm/pm.h"
-
--tn_array *pm_rpm_rpmlib_caps(void)
-+#if HAVE_RPMDSRPMLIB /* rpmdsRpmlib() => rpm >= 4.4.3 */
-+static int get_rpmlib_caps(tn_array *caps)
-+{
-+ rpmds ds = NULL;
-+
-+ if (rpmdsRpmlib(&ds, NULL) != 0)
-+ return 0;
-+
-+ ds = rpmdsInit(ds);
-+ while (rpmdsNext(ds) >= 0) {
-+ const char *name, *evr;
-+ char tmp[256];
-+ struct capreq *cr;
-+ uint32_t flags;
-+
-+ name = rpmdsN(ds);
-+ evr = rpmdsEVR(ds);
-+ flags = rpmdsFlags(ds);
-+
-+ n_assert(flags & RPMSENSE_EQUAL);
-+ n_assert((flags & (RPMSENSE_LESS | RPMSENSE_GREATER)) == 0);
-+
-+ n_strncpy(tmp, evr, 128);
-+ cr = capreq_new_evr(name, tmp, REL_EQ, 0);
-+ if (cr)
-+ n_array_push(caps, cr);
-+ }
-+ ds = rpmdsFree(ds);
-+ return n_array_size(caps);
-+}
-+#endif /* HAVE_RPMDSRPMLIB */
-+
-+#if HAVE_RPMGETRPMLIBPROVIDES /* rpmGetRpmlibProvides() => rpm < 4.4.3 */
-+static int get_rpmlib_caps_rpm_lt_4_4_3(tn_array *caps)
- {
- char **names = NULL, **versions = NULL, *evr;
- int *flags = NULL, n = 0, i;
-- tn_array *caps;
--
--#if HAVE_RPMGETRPMLIBPROVIDES
-+
- n = rpmGetRpmlibProvides((const char ***)&names, &flags, (const char ***)&versions);
--#endif
--
- if (n <= 0)
-- return NULL;
-+ return 0;
-
- caps = capreq_arr_new(0);
--
- evr = alloca(128);
-
- for (i=0; i<n; i++) {
-@@ -62,19 +93,39 @@
- n_array_push(caps, cr);
- }
-
-- if (names)
-- free(names);
--
-- if (flags)
-- free(flags);
-+ n_cfree(&names);
-+ n_cfree(&flags);
-+ n_cfree(&versions);
-+ return 1;
-+}
-+#endif
-
-- if (versions)
-- free(versions);
-+tn_array *pm_rpm_rpmlib_caps(void)
-+{
-+ tn_array *caps;
-+ int rc = 0;
-+
-+ caps = capreq_arr_new(0);
-
-- n_array_sort(caps);
-+#if HAVE_RPMDSRPMLIB /* rpm >= 4.4.3 */
-+ rc = get_rpmlib_caps(caps);
-+#else
-+# if HAVE_RPMGETRPMLIBPROVIDES
-+ rc = get_rpmlib_caps_rpm_lt_4_4_3(caps);
-+# endif
-+#endif
-+
-+ if (rc) {
-+ n_array_sort(caps);
-+
-+ } else {
-+ n_array_free(caps);
-+ caps = NULL;
-+ }
- return caps;
- }
-
-+
- const char *pm_rpm_get_arch(void *pm_rpm)
- {
- pm_rpm = pm_rpm;
-Index: pm/rpm/pm_rpm.h
-===================================================================
-RCS file: /cvsroot/installer/poldek/pm/rpm/pm_rpm.h,v
-retrieving revision 1.11
-retrieving revision 1.12
-diff -u -r1.11 -r1.12
---- pm/rpm/pm_rpm.h 24 Oct 2005 15:25:58 -0000 1.11
-+++ pm/rpm/pm_rpm.h 21 Nov 2005 17:01:34 -0000 1.12
-@@ -10,6 +10,14 @@
- # include <rpm/rpmts.h>
- #endif
-
-+/* RPMTAG_COPYRIGHT disappears in 4.4.3 but don't know from
-+ when RPMTAG_LICENSE starts */
-+#ifdef RPMTAG_COPYRIGHT
-+# define PM_RPMTAG_LICENSE RPMTAG_COPYRIGHT
-+#else
-+# define PM_RPMTAG_LICENSE RPMTAG_LICENSE
-+#endif
-+
- #include <trurl/trurl.h>
- #include "poldek.h"
- #include "pm/pm.h"
-Index: pkgu.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/pkgu.c,v
-retrieving revision 1.30
-retrieving revision 1.31
-diff -u -r1.30 -r1.31
---- pkgu.c 18 Oct 2005 16:25:12 -0000 1.30
-+++ pkgu.c 21 Nov 2005 17:01:34 -0000 1.31
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <ctype.h>
-@@ -337,7 +337,7 @@
- }
-
- pkgu->vendor = cp_tag(pkgu->_na, h, RPMTAG_VENDOR);
-- pkgu->license = cp_tag(pkgu->_na, h, RPMTAG_COPYRIGHT);
-+ pkgu->license = cp_tag(pkgu->_na, h, PM_RPMTAG_LICENSE);
- pkgu->url = cp_tag(pkgu->_na, h, RPMTAG_URL);
- pkgu->distro = cp_tag(pkgu->_na, h, RPMTAG_DISTRIBUTION);
- pkgu->buildhost = cp_tag(pkgu->_na, h, RPMTAG_BUILDHOST);
-@@ -370,7 +370,7 @@
- headerAddEntry(hdr, RPMTAG_VENDOR, RPM_STRING_TYPE, pkgu->vendor, 1);
-
- if (pkgu->license)
-- headerAddEntry(hdr, RPMTAG_COPYRIGHT, RPM_STRING_TYPE, pkgu->license, 1);
-+ headerAddEntry(hdr, PM_RPMTAG_LICENSE, RPM_STRING_TYPE, pkgu->license, 1);
-
- if (pkgu->url)
- headerAddEntry(hdr, RPMTAG_URL, RPM_STRING_TYPE, pkgu->url, 1);
-Index: configure.in
-===================================================================
-RCS file: /cvsroot/installer/poldek/configure.in,v
-retrieving revision 1.121
-retrieving revision 1.122
-diff -u -r1.121 -r1.122
---- configure.in 4 Nov 2005 17:44:21 -0000 1.121
-+++ configure.in 21 Nov 2005 17:01:34 -0000 1.122
-@@ -293,9 +293,10 @@
- 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])
-
-
- dnl metadata & xml2
+++ /dev/null
-# PLD <http://www.pld-linux.org/>
-
-_pld_arch = %ARCH%
-_pld_alt_arch = %ALT_ARCH%
-_pld_prefix = ftp://ftp.th.pld-linux.org/dists/th
-## Some mirrors
-## You can use them if you have better connection there
-# CI TASK:
-#_pld_prefix = ftp://ftp.task.pld-linux.org/dists/th
-
-
-_th_idxtype = pndir
-
-# PLD 3.0 (Th)
-[source]
-type = %{_th_idxtype}
-name = th
-path = %{_pld_prefix}/PLD/%{_pld_arch}/RPMS/
-
-[source]
-type = %{_th_idxtype}
-name = th
-path = %{_pld_prefix}/PLD/noarch/RPMS/
-
-[source]
-type = %{_th_idxtype}
-name = th-updates-security
-path = %{_pld_prefix}/updates-security/%{_pld_arch}/RPMS/
-
-[source]
-type = %{_th_idxtype}
-name = th-updates-security
-path = %{_pld_prefix}/updates-security/noarch/RPMS/
-
-[source]
-type = %{_th_idxtype}
-name = th-updates-general
-path = %{_pld_prefix}/updates-general/%{_pld_arch}/RPMS/
-noauto = yes
-
-[source]
-type = %{_th_idxtype}
-name = th-updates-general
-path = %{_pld_prefix}/updates-general/noarch/RPMS/
-noauto = yes
-
-
-#[source]
-#type = %{_th_idxtype}
-#name = th-supported
-#path = %{_pld_prefix}/supported/%{_pld_arch}/
-#noauto = yes
-
-[source]
-type = %{_th_idxtype}
-name = th-ready
-path = %{_pld_prefix}/ready/%{_pld_arch}/RPMS/
-noauto = yes
-
-[source]
-type = %{_th_idxtype}
-name = th-ready
-path = %{_pld_prefix}/ready/noarch/RPMS/
-noauto = yes
-
-[source]
-type = %{_th_idxtype}
-name = th-test
-path = %{_pld_prefix}/test/%{_pld_arch}/RPMS/
-noauto = yes
-
-[source]
-type = %{_th_idxtype}
-name = th-test
-path = %{_pld_prefix}/test/noarch/RPMS/
-noauto = yes
-
+++ /dev/null
-#
-# Conditional build:
-%bcond_with static # don't use shared libraries
-%bcond_without imode # don't build interactive mode
-#
-# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
-%define ver_db 4.3.27-1
-%define ver_rpm 4.4.3
-Summary: RPM packages management helper tool
-Summary(pl): Pomocnicze narzêdzie do zarz±dzania pakietami RPM
-Name: poldek
-Version: 0.20
-Release: 5
-License: GPL v2
-Group: Applications/System
-Source0: http://poldek.pld-linux.org/download/%{name}-%{version}.tar.bz2
-# Source0-md5: 61c0c03ee4a9de36339fc943b6901266
-Source1: %{name}.conf
-Source2: %{name}-multilib.conf
-Source3: %{name}-aliases.conf
-# drop?
-#PatchX: %{name}-etc_dir.patch
-# drop?
-#PatchX: %{name}-retr_term.patch
-# is still needed?
-#Patch2: %{name}-simplestatic.patch
-Patch0: %{name}-cvs-fixes.patch
-Patch1: %{name}-ask-abort.patch
-Patch2: %{name}-obsoletes.patch
-Patch3: %{name}-rpm_4_4_3.patch
-Patch4: %{name}-cli-hist.patch
-URL: http://poldek.pld-linux.org/
-BuildRequires: autoconf
-BuildRequires: automake
-BuildRequires: bzip2-devel
-BuildRequires: check
-BuildRequires: db-devel >= %{ver_db}
-BuildRequires: gettext-autopoint
-BuildRequires: libtool
-BuildRequires: libxml2-devel
-BuildRequires: openssl-devel >= 0.9.7d
-BuildRequires: pcre-devel
-BuildRequires: perl-tools-pod
-BuildRequires: popt-devel
-BuildRequires: readline-devel >= 5.0
-BuildRequires: rpm-devel >= %{ver_rpm}
-BuildRequires: zlib-devel
-%if %{with static}
-BuildRequires: bzip2-static
-BuildRequires: db-static >= %{ver_db}
-BuildRequires: glibc-static
-BuildRequires: libselinux-static
-BuildRequires: libxml2-static
-BuildRequires: ncurses-static
-BuildRequires: openssl-static
-BuildRequires: pcre-static
-BuildRequires: popt-static
-BuildRequires: readline-static
-BuildRequires: rpm-static
-BuildRequires: zlib-static
-%endif
-Requires(triggerpostun): awk
-Requires(triggerpostun): sed >= 4.0
-Requires: %{name}-libs = %{version}-%{release}
-Requires: db >= %{ver_db}
-Requires: rpm >= %{ver_rpm}
-Requires: sed
-BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-poldek is an RPM package management tool which allows you to easily
-perform package verification, installation (including system
-installation from scratch), upgrading, and removal.
-
-Program can be used in batch (like apt-get from Debian's APT) or
-interactive mode. The interactive mode puts you into a readline
-interface with command line autocompletion and history, similar to the
-shell mode of Perl's CPAN.
-
-%{?with_static:This version is statically linked.}
-
-%{!?with_imode:This version hasn't got interactive mode.}
-#'vim
-
-%description -l pl
-poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
-instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
-usuwania pakietów.
-
-Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
-interaktywnym. Tryb interaktywny posiada interfejs readline z
-dope³nianiem komend i histori±, podobny do trybu shell perlowego
-modu³u CPAN.
-
-%{?with_static:Ta wersja jest konsolidowana statycznie.}
-
-%{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
-
-%package libs
-Summary: poldek libraries
-Summary(pl): Biblioteki poldka
-Group: Libraries
-
-%description libs
-poldek libraries.
-
-%description libs -l pl
-Biblioteki poldka.
-
-%package devel
-Summary: Header files for poldek libraries
-Summary(pl): Pliki nag³ówkowe bibliotek poldka
-Group: Development/Libraries
-Requires: %{name}-libs = %{version}-%{release}
-
-%description devel
-Header files for poldek libraries.
-
-%description devel -l pl
-Pliki nag³ówkowe bibliotek poldka.
-
-%package static
-Summary: poldek static libraries
-Summary(pl): Biblioteki statyczne poldka
-Group: Development/Libraries
-Requires: %{name}-devel = %{version}-%{release}
-
-%description static
-poldek static libraries.
-
-%description static -l pl
-Biblioteki statyczne poldka.
-
-%prep
-%setup -q
-%patch0 -p2
-%patch1 -p0
-%patch2 -p0
-%patch3 -p0
-%patch4 -p2
-
-%build
-%{__autopoint}
-%{__aclocal} -I m4
-%{__autoconf}
-%{__automake}
-cp -f config.sub trurlib
-
-%configure \
- %{?with_static:--enable-static --disable-shared} \
- %{!?with_imode:--disable-imode} \
- --enable-nls
-%{__make}
-
-%install
-rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_sysconfdir}
-
-%{__make} install \
- DESTDIR=$RPM_BUILD_ROOT
-
-%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
-
-%ifarch i486 i686 ppc sparc alpha athlon
-%define _ftp_arch %{_target_cpu}
-%else
-%ifarch %{x8664}
-%define _ftp_arch x86_64
-%define _ftp_alt_arch i686
-%else
-%ifarch i586
-%define _ftp_arch i486
-%else
-%ifarch pentium2 pentium3 pentium4
-%define _ftp_arch i686
-%else
-%ifarch sparcv9 sparc64
-%define _ftp_arch sparc
-%endif
-%endif
-%endif
-%endif
-%endif
-
-%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
-
-sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
-%ifarch %{x8664}
- -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
-%else
- -e '/%%ALT_ARCH%%/d' \
-%endif
- < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
-
-%ifarch %{x8664}
-sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
-%endif
-
-install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
-
-# get rid of non-pld sources
-rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
-# include them in %doc
-rm -rf configs
-cp -a conf configs
-rm -f configs/Makefile*
-
-%find_lang %{name}
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%post
-[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
-
-%postun
-[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
-
-%post libs -p /sbin/ldconfig
-%postun libs -p /sbin/ldconfig
-
-%triggerpostun -- poldek <= 0.18.3-5
-if [ -f /etc/poldek.conf ]; then
- sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
-fi
-
-# otherwise don't touch
-%ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
-%triggerpostun -- poldek <= 0.18.7-1
-if [ -f /etc/poldek.conf ]; then
- sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
-fi
-%endif
-
-%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
-if [ -f /etc/poldek.conf.rpmsave ]; then
- awk '/^source/ {
- name = $3;
- path = $4;
- auto = "yes";
- autoup = "yes";
- type = "pdir";
- pri = "";
-
- if (sub(",noauto", "", name)) {
- auto = "no";
- }
-
- # process pri=\d+
- if (match(name, /,pri=[0-9]+/)) {
- pri = substr(name, RSTART + 5, RLENGTH - 5);
- name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
- }
-
- # skip ac sources. already in new config.
- if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
- print "";
- print "[source]";
- print "name = " name;
- print "type = " type;
- print "path = " path;
- print "auto = " auto;
- print "autoup = " autoup;
- if (pri) {
- print "pri = " pri;
- }
- }
-
- }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
- echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
-
- # copy hold=
- hold=$(grep ^hold /etc/poldek.conf.rpmsave)
- if [ "$hold" ]; then
- sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
- fi
-fi
-
-%files -f %{name}.lang
-%defattr(644,root,root,755)
-%doc README* NEWS TODO configs/
-%dir %{_sysconfdir}/%{name}
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
-%attr(755,root,root) %{_bindir}/*
-%dir %{_libdir}/%{name}
-%attr(755,root,root) %{_libdir}/%{name}/*
-%{_mandir}/man1/%{name}*
-%lang(pl) %{_mandir}/pl/man1/%{name}*
-%{_infodir}/poldek.info*
-
-%if %{without static}
-%files libs
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
-%endif
-
-%files devel
-%defattr(644,root,root,755)
-%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
-%{_libdir}/lib*.la
-%{_includedir}/*
-
-%files static
-%defattr(644,root,root,755)
-%{_libdir}/lib*.a