summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2git2006-04-26 17:38:21 (GMT)
committercvs2git2012-06-24 12:13:13 (GMT)
commit01b06ad11e040db5774e6bc0eccb856d968a3d08 (patch)
tree7f31a6a0cfb325a7f5b795d9d914f63ffe1a8b35
parent9cd2f827e3ea3daf4edf5414e045787ced2afe6c (diff)
downloadpoldek-auto/ac/poldek-0_20-6.zip
poldek-auto/ac/poldek-0_20-6.tar.gz
This commit was manufactured by cvs2git to create tag 'auto-ac-poldek-auto/ac/poldek-0_20-6
0_20-6'. Sprout from master 2006-04-02 20:24:23 UTC Elan Ruusamäe <glen@pld-linux.org> '- bugfixes from mis' Cherrypick from master 2005-09-06 12:43:03 UTC Elan Ruusamäe <glen@pld-linux.org> '- (perhaps) better comment': poldek-multilib.conf -> 1.5 Cherrypick from AC-branch 2005-12-10 19:30:43 UTC sparky <sparky@pld-linux.org> '- avoid cvs ID problem': poldek-completion.patch -> 1.1.2.1 Cherrypick from unlabeled-1.197.2 2006-04-26 17:38:21 UTC Elan Ruusamäe <glen@pld-linux.org> '- rel 6': poldek.spec -> 1.197.2.72 Cherrypick from unlabeled-1.35.2 2005-09-24 14:14:09 UTC Sławomir Paszkiewicz <paszczus@pld-linux.org> '- using pndir by default': poldek.conf -> 1.35.2.7 Delete: poldek-am-ac.patch poldek-broken-rpmdb.patch poldek-bugfix.patch poldek-compare.patch poldek-cvs-20040109.patch poldek-distver.patch poldek-endian.patch poldek-epoch0.patch poldek-etc_dir.patch poldek-home_etc.patch poldek-nodebug.patch poldek-prereq.patch poldek-retr_term.patch poldek-rpm4.1-fix.patch poldek-rpm4.2.patch poldek-rpm_4_4_3.patch poldek-simplestatic.patch poldek-split64.patch poldek-static.patch poldek-tests.patch poldek-unaligned.patch poldek-vf_append.patch
-rw-r--r--poldek-am-ac.patch11
-rw-r--r--poldek-broken-rpmdb.patch12
-rw-r--r--poldek-bugfix.patch12
-rw-r--r--poldek-compare.patch12
-rw-r--r--poldek-cvs-20040109.patch2149
-rw-r--r--poldek-distver.patch473
-rw-r--r--poldek-endian.patch12
-rw-r--r--poldek-epoch0.patch47
-rw-r--r--poldek-etc_dir.patch127
-rw-r--r--poldek-home_etc.patch127
-rw-r--r--poldek-multilib.conf27
-rw-r--r--poldek-nodebug.patch12
-rw-r--r--poldek-prereq.patch18
-rw-r--r--poldek-retr_term.patch50
-rw-r--r--poldek-rpm4.1-fix.patch16
-rw-r--r--poldek-rpm4.2.patch94
-rw-r--r--poldek-rpm_4_4_3.patch213
-rw-r--r--poldek-simplestatic.patch10
-rw-r--r--poldek-split64.patch219
-rw-r--r--poldek-static.patch47
-rw-r--r--poldek-tests.patch21
-rw-r--r--poldek-unaligned.patch51
-rw-r--r--poldek-vf_append.patch47
-rw-r--r--poldek.conf75
-rw-r--r--poldek.spec38
25 files changed, 60 insertions, 3860 deletions
diff --git a/poldek-am-ac.patch b/poldek-am-ac.patch
deleted file mode 100644
index 039b3ae..0000000
--- a/poldek-am-ac.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -urNbB poldek-0.19.0-cvs20050921.00.org/configure.in poldek-0.19.0-cvs20050921.00/configure.in
---- poldek-0.19.0-cvs20050921.00.org/configure.in 2005-07-17 14:45:53.000000000 +0200
-+++ poldek-0.19.0-cvs20050921.00/configure.in 2005-09-21 09:03:23.915451128 +0200
-@@ -53,7 +53,6 @@
- AC_CHECK_PROG(POD2MAN, pod2man, pod2man)
- AM_GNU_GETTEXT([external])
- AM_GNU_GETTEXT_VERSION(0.11.5)
--AM_PATH_CHECK()
-
- AM_CFLAGS="-Wall -W"
- AC_SUBST(AM_CFLAGS)
diff --git a/poldek-broken-rpmdb.patch b/poldek-broken-rpmdb.patch
deleted file mode 100644
index 35b8a63..0000000
--- a/poldek-broken-rpmdb.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urN poldek-0.18.1.org/rpm.c poldek-0.18.1/rpm.c
---- poldek-0.18.1.org/rpm.c 2003-08-19 01:32:35.000000000 +0200
-+++ poldek-0.18.1/rpm.c 2003-08-19 01:32:51.000000000 +0200
-@@ -531,7 +531,7 @@
- if (count > 0 && (cmprc || dbrecp)) {
- dbrec = rpmdb_it_get(&it);
-
-- if (cmprc)
-+ if (cmprc && dbrec)
- *cmprc = -hdr_pkg_cmp_evr(dbrec->h, pkg);
-
- if (dbrecp) {
diff --git a/poldek-bugfix.patch b/poldek-bugfix.patch
deleted file mode 100644
index 5296f6b..0000000
--- a/poldek-bugfix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur poldek-0.17.2-/vfile/p_open.h poldek-0.17.2/vfile/p_open.h
---- poldek-0.17.2-/vfile/p_open.h Sat Mar 2 14:32:35 2002
-+++ poldek-0.17.2/vfile/p_open.h Tue Apr 9 14:15:14 2002
-@@ -22,7 +22,7 @@
- void p_st_destroy(struct p_open_st *pst);
-
- #define P_OPEN_KEEPSTDIN (1 << 0) /* don't close stdin */
--#define P_OPEN_OUTPTYS (1 << 0) /* pass output through pseudo-tty */
-+#define P_OPEN_OUTPTYS (1 << 1) /* pass output through pseudo-tty */
-
- FILE *p_open(struct p_open_st *pst, unsigned flags, const char *cmd,
- char *const argv[]);
diff --git a/poldek-compare.patch b/poldek-compare.patch
deleted file mode 100644
index 96b3712..0000000
--- a/poldek-compare.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urN poldek-0.19.0-cvs20050921.00.org/pkgset-req.c poldek-0.19.0-cvs20050921.00/pkgset-req.c
---- poldek-0.19.0-cvs20050921.00.org/pkgset-req.c 2005-07-10 14:25:02.000000000 +0200
-+++ poldek-0.19.0-cvs20050921.00/pkgset-req.c 2005-10-03 11:40:10.333900296 +0200
-@@ -256,7 +256,7 @@
-
- j = i;
-
-- while (j > 0 && pkg_cmp_name_evr(tmp, pkgs[j - 1]) < 0) {
-+ while (j > 0 && pkg_cmp_name_evr_rev(tmp, pkgs[j - 1]) < 0) {
- pkgs[j] = pkgs[j - 1];
- j--;
- }
diff --git a/poldek-cvs-20040109.patch b/poldek-cvs-20040109.patch
deleted file mode 100644
index 05ff987..0000000
--- a/poldek-cvs-20040109.patch
+++ /dev/null
@@ -1,2149 +0,0 @@
-Index: installer/poldek/Makefile.am
-diff -u installer/poldek/Makefile.am:1.54 installer/poldek/Makefile.am:1.54.4.2
---- installer/poldek/Makefile.am:1.54 Thu Nov 7 17:43:25 2002
-+++ installer/poldek/Makefile.am Fri Dec 19 02:29:31 2003
-@@ -1,4 +1,4 @@
--# $Id$
-+# $Id$
-
- AUTOMAKE_OPTIONS =
- ACLOCAL_AMFLAGS = -I m4
-@@ -42,6 +42,7 @@
- pkgset-load.c pkgset-load.h \
- pkgset.c pkgset.h \
- pkgset-req.c pkgset-req.h \
-+ pkgset-merge.c \
- pkgset-order.c \
- pkgset-install.c \
- dbdep.c dbdep.h \
-@@ -66,11 +67,11 @@
-
- SHELL_MOD = shell/libshell.a
-
--poldek_DEPENDENCIES_ = libpoldek.a \
-- sigint/libsigint.a \
-- vfile/libvfile.a \
-+poldek_DEPENDENCIES_ = libpoldek.a \
-+ vfile/libvfile.a \
- vfile/vftp/libvftp.a \
-- vfile/vhttp/libvhttp.a
-+ vfile/vhttp/libvhttp.a \
-+ sigint/libsigint.a
-
- if ENABLE_INTERACTIVE_MODE
- SHELL_MOD_ = $(SHELL_MOD)
-@@ -83,11 +84,12 @@
- LDADD_ = @INTLLIBS@
-
- bin_PROGRAMS = poldek rpmvercmp
--dist_bin_SCRIPTS = mkpackagedir vfjuggle vfuncompr
-+dist_bin_SCRIPTS = mkpackagedir vfjuggle vfcompr
- poldek_SOURCES = main.c
--poldek_LDADD = libpoldek.a sigint/libsigint.a vfile/libvfile.a \
-- vfile/vftp/libvftp.a vfile/vhttp/libvhttp.a \
-- $(SHELL_MOD_) $(LDADD_)
-+poldek_LDADD = libpoldek.a vfile/libvfile.a \
-+ vfile/vftp/libvftp.a vfile/vhttp/libvhttp.a \
-+ sigint/libsigint.a \
-+ $(SHELL_MOD_) $(LDADD_)
-
- rpmvercmp_SOURCES = rpmvercmp.c
- rpmvercmp_LDADD = $(LDADD_)
-@@ -97,7 +99,7 @@
- noinst_PROGRAMS = test_match
- test_match_SOURCES = test_match.c
- test_match_LDADD = $(poldek_LDADD)
--
-+test_match_DEPENDENCIES = $(poldek_DEPENDENCIES)
-
- EXTRA_DIST = \
- poldek.1 poldek.pod \
-Index: installer/poldek/NEWS
-diff -u installer/poldek/NEWS:1.56 installer/poldek/NEWS:1.56.4.2
---- installer/poldek/NEWS:1.56 Wed Nov 27 19:56:09 2002
-+++ installer/poldek/NEWS Sun Dec 7 22:07:32 2003
-@@ -1,3 +1,9 @@
-+0.18.2 (minor bugfix && improvements release; 2003/07/23)
-+
-+* support for RPM 4.2/4.3
-+* dependency processing bugfix
-+* RPM 4.1 related fixes
-+
- 0.18.1 (major bugfix release; 2002/11/27)
-
- * ability of creation empty indexes
-@@ -13,7 +19,7 @@
-
- 0.18 (bugfix/minor enhancements release; 2002/11/07)
-
--* support for RPM 4.1 (with help of Artur Frysiak <wiget@pld.org.pl>)
-+* support for RPM 4.1 (with help of Artur Frysiak <wiget at pld-linux org>)
-
- * few dependency processing improvements:
- - greedy upgrades are performed instead of marking different versions
-@@ -35,9 +41,9 @@
- * 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 <wiget@pld.org.pl>)
-+ (Artur Frysiak <wiget at pld-linux org>)
-
--* Polish translation of manual page (GoTaR <gotar@pld.org.pl>)
-+* Polish translation of manual page (GoTaR <gotar at pld-linux org>)
-
- * fix: progress bar isn't refreshed so frequently (#367)
-
-@@ -55,9 +61,9 @@
- 0.17.8 (major bugfix release; 2002/08/18)
-
- * package installation is verified with rpm database if rpm reports failure
--* fixed obsoletes matching (Jakub Bogusz <qboosh@pld.org.pl>)
-+* fixed obsoletes matching (Jakub Bogusz <qboosh at pld-linux org>)
- * improved and fixed file based conflicts detection
--* fixed size units display (GoTaR <gotar@poczta.onet.pl>)
-+* fixed size units display (GoTaR <gotar at poczta.onet.pl>)
-
-
- 0.17.7 (bugfix release; 2002/06/14)
-@@ -94,12 +100,12 @@
- * 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 <venglin@freebsd.lublin.pl>)
-+ (Przemyslaw Frasunek <venglin at freebsd.lublin.pl>)
- * 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 (thanks to Gustavo Niemeyer <niemeyer@conectiva.com>)
-+ is used as package index (thanks to Gustavo Niemeyer <niemeyer at conectiva.com>)
-
-
- 0.17.4 (bugfix/minor enhancements release; 2002/05/06)
-@@ -144,11 +150,11 @@
- * new "--clean" and "--clean-whole" options for cache directory
- cleanup
-
--* URLs with user and password (ftp://user:passwd@host:port/path/ syntax)
-- are supported (Andreas Piesk <a.piesk@gmx.net>)
-+* URLs with user and password (ftp://user:passwd at host:port/path/ syntax)
-+ are supported (Andreas Piesk <a.piesk at gmx.net>)
-
- * new "ftp_sysuser_as_anon_passwd" option causes sending
-- login@hostname as anonymous FTP password
-+ login at hostname as anonymous FTP password
-
- * new "noautoup" source option tells poldek to do not update
- source by default.
-@@ -157,11 +163,11 @@
-
- * misc fixes to compile on SuSE
-
--* fixed rpm 3.x support (with help of Roger Luethi <rl@hellgate.ch>)
-+* fixed rpm 3.x support (with help of Roger Luethi <rl at hellgate.ch>)
-
- * fixed and improved handling of bool configuration options,
- added on/off and enable/disable to the list of valid choices
-- (Andreas Piesk <a.piesk@gmx.net>)
-+ (Andreas Piesk <a.piesk at gmx.net>)
-
- * fixed detection of file based conflicts between available packages.
-
-@@ -169,7 +175,7 @@
- versions are handled properly
-
- * misc fixes to compile and work with glibc2.1 (with
-- help of Andreas Piesk <a.piesk@gmx.net>)
-+ help of Andreas Piesk <a.piesk at gmx.net>)
-
- * installation of multiple instances of package is allowed (by poldek -i)
-
-@@ -178,24 +184,24 @@
- - fixed handling package conflicts added by poldek
- - faster dependency checking
-
--* German translation (Andreas Piesk <a.piesk@gmx.net>)
-+* German translation (Andreas Piesk <a.piesk at gmx.net>)
-
- * various bugs are fixed:
- - double '/' in paths handling
- - huge mem leak on --update
-- - ambiguous p_open() flags (Michal Moskal <malekith@pld.org.pl>)
-+ - ambiguous p_open() flags (Michal Moskal <malekith at pld-linux org>)
- - removed [v]snprintf() (wrong) usage; trurlib's n_[v]snprintf()
- are used instead
-- - automake/autoconf fixes (Artur Frysiak <wiget@pld.org.pl>)
-- - many minor fixes (thanks to Andreas Piesk <a.piesk@gmx.net>)
-+ - automake/autoconf fixes (Artur Frysiak <wiget at pld-linux org>)
-+ - many minor fixes (thanks to Andreas Piesk <a.piesk at gmx.net>)
-
- 0.17.2
- * "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 <malekith@pld.org.pl>)
-+ (Michal Moskal <malekith at pld-linux org>)
- * install-dist: log INST-{OK,ERR} for PLD Installer
-- (Michal Moskal <malekith@pld.org.pl>)
-+ (Michal Moskal <malekith at pld-linux org>)
- * --dump* works properly
- * vftp: fixed error handling
-
-@@ -260,7 +266,7 @@
- - 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 <areq@pld.org.pl>)
-+ some machines (Arkadiusz Patyk <areq at pld-linux org>)
- * fix: don't include trailing whitespaces in config values
-
- 0.15.8:
-@@ -271,7 +277,7 @@
- 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 <malekith@pld.org.pl>)
-+ (Michal Moskal <malekith at pld-linux org>)
- * "mercy" mode bugfix
-
- 0.15.7:
-@@ -292,8 +298,8 @@
- * added global config /etc/poldek.conf usage
- * fixed prereq loop detection
- * added '@' to list of valid characters in package filename
-- (Rafal Kleger-Rudomin <klakier@pld.org.pl>)
--* vfjuggle: sed is used instead of awk (Rafal Kleger-Rudomin <klakier@pld.org.pl>)
-+ (Rafal Kleger-Rudomin <klakier at pld-linux org>)
-+* vfjuggle: sed is used instead of awk (Rafal Kleger-Rudomin <klakier at pld-linux org>)
- * shell: ls: fixed packages sorting
- * minor bugfixes
-
-@@ -351,8 +357,8 @@
- - extended "desc" and "search" commands -- almost all
- package fields could be specified
- - colorized output
--* bugfixes (thanks to Rafal Kleger-Rudomin <klakier@pld.org.pl> and
-- Michal Moskal <malekith@pld.org.pl>)
-+* bugfixes (thanks to Rafal Kleger-Rudomin <klakier at pld-linux org> and
-+ Michal Moskal <malekith at pld-linux org>)
-
- 0.14:
-
-@@ -373,10 +379,10 @@
- * support for rpm 4.0.2 pre/post requirements
- * readline 4.2 updates
- * vfile: added curl backend (curl >= 7.7.4-pre1 is needed)
--* added --nodesc option for index creation (Michal Moskal <malekith@pld.org.pl>)
-+* added --nodesc option for index creation (Michal Moskal <malekith at pld-linux org>)
- * rpmvercmp returns 2 instead of -1
- * file names are stored without trailing '\0' (saves about 100 kB disk space)
- * temporary dir may be set by $TMPDIR
- * fixed checking dependencies of unistalled packages
- * shell: added "desc" command
--* fixed a lot of bugs (with help of Michal Moskal <malekith@pld.org.pl>)
-+* fixed a lot of bugs (with help of Michal Moskal <malekith at pld-linux org>)
-Index: installer/poldek/README.merging
-diff -u /dev/null installer/poldek/README.merging:1.1.2.1
---- /dev/null Fri Jan 9 13:45:49 2004
-+++ installer/poldek/README.merging Wed Apr 2 16:54:08 2003
-@@ -0,0 +1,24 @@
-+
-+With --merge option poldek merges two or more sources with esure
-+that result package set will not contain unsatisfied dependencies.
-+Usage:
-+
-+$ poldek --merge DST_SOURCE SRC_SOURCE...
-+
-+Examples:
-+
-+Assume you have 2 repositories, the first is "stable", the second
-+"test" one.
-+
-+$ poldek -l
-+stable /dists/ac/PLD/i686/PLD/RPMS/
-+test /dists/ac/test/i686/RPMS/
-+
-+To merge them do:
-+
-+$ poldek --merge -n stable -n test | grep 'merge: ' | sed 's/merge: //g' | sh
-+
-+The program produces "rm FILE" and "mv FILE" commands after 'merge: '
-+prefix, so after filtering out the 'merge: ' prefix the commands could
-+be passed to shell. After that "$ poldek -n stable -V" should not
-+reports any unsatisfied dependencies.
-Index: installer/poldek/conf.c
-diff -u installer/poldek/conf.c:1.31 installer/poldek/conf.c:1.31.4.3
---- installer/poldek/conf.c:1.31 Fri Oct 18 18:19:42 2002
-+++ installer/poldek/conf.c Tue Dec 30 19:14:07 2003
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <ctype.h>
-@@ -79,6 +79,8 @@
- { "particle_install", TYPE_BOOL, { 0 } },
- { "unique_package_names", TYPE_BOOL, { 0 } },
- { "ftp_sysuser_as_anon_passwd", TYPE_BOOL , { 0 } },
-+ { "vfile_external_compress", TYPE_BOOL, { 0 } },
-+ { "promoteepoch", TYPE_BOOL, { 0 } },
- { NULL, 0, { 0 } },
- };
-
-Index: installer/poldek/configure.in
-diff -u installer/poldek/configure.in:1.76 installer/poldek/configure.in:1.76.4.5
---- installer/poldek/configure.in:1.76 Wed Nov 27 19:56:09 2002
-+++ installer/poldek/configure.in Sun Dec 7 22:04:35 2003
-@@ -1,15 +1,16 @@
- dnl Process this file with autoconf to produce a configure script.
--dnl $Id$
-+dnl $Id$
-
--AC_INIT(poldek, 0.18.1)
-+AC_INIT(poldek, 0.18.2)
- AC_CONFIG_SRCDIR([capreq.c])
-
--VERSION=0.18.1
-+VERSION=0.18.2
- VERSION_STATUS="stable"
- VERSION_CVSTAG="v$(echo $VERSION | sed 's/\./_/g')"
- AH_TEMPLATE([ENABLE_TRACE],[])
- AH_TEMPLATE([HAVE_RPM_4_0_4],[])
- AH_TEMPLATE([HAVE_RPM_4_1],[])
-+AH_TEMPLATE([HAVE_RPM_4_2],[])
- AH_TEMPLATE([HAVE_RPM_EXTDEPS],[])
- AH_TEMPLATE([HAVE_TM_GMTOFF],[])
- AH_TEMPLATE([HAVE_TM___GMTOFF],[])
-@@ -29,6 +30,11 @@
- dnl Checks for programs.
- AC_PROG_CC()
- AC_C_INLINE
-+
-+if test "$GCC." = "yes."; then
-+ CFLAGS="$CFLAGS -fno-builtin-log"
-+fi
-+
- AC_PROG_INSTALL
- AC_PROG_RANLIB
- AC_CHECK_PROG(POD2MAN, pod2man, pod2man)
-@@ -240,9 +246,10 @@
- DBLIB="$DBLIB -ldb1"
- fi
- else
-- AC_CHECK_LIB(db-4.0, db_create, [DBLIB="-ldb-4.0"],
-+ AC_CHECK_LIB(db-4.1, db_create, [DBLIB="-ldb-4.1"],
-+ [AC_CHECK_LIB(db-4.0, db_create, [DBLIB="-ldb-4.0"],
- [AC_CHECK_LIB(db, db_create, [DBLIB="-ldb"],,[$LIBS])],
-- [$LIBS])
-+ [$LIBS])],, [$LIBS])
-
- if test "${ENABLE_STATIC}." = "yes."; then
- DBLIB="$DBLIB"
-@@ -264,11 +271,11 @@
- fi
-
-
--AC_CHECK_LIB(rpm, rpmReadPackageInfo,[LIBS="$LIBS -lrpm $DBLIB"],
-+AC_CHECK_LIB(rpm, rpmReadPackageInfo,[LIBS="-lrpm $DBLIB $LIBS"],
- AC_CHECK_LIB(rpm, rpmReadPackageHeader,
-- [LIBS="$LIBS -lrpm -lrpmdb $DBLIB"],
-+ [LIBS="-lrpm -lrpmdb $DBLIB $LIBS"],
- AC_CHECK_LIB(rpm, rpmReadPackageFile,
-- [LIBS="$LIBS -lrpm -lrpmdb $DBLIB"
-+ [LIBS="-lrpm -lrpmdb -lelf $DBLIB $LIBS"
- AC_DEFINE([HAVE_RPM_4_1],1,[])],
- AC_MSG_ERROR(["rpmlib not found"]),
- [$DBLIB -lrpmdb]),
-@@ -278,14 +285,19 @@
- AC_CHECK_FUNCS(rpmMachineScore,,[ AC_MSG_ERROR(["rpmlib not found"])])
- AC_CHECK_FUNCS(rpmlog rpmCheckSig rpmVerifySignature)
-
-+dnl rpm 4.2?
-+AC_CHECK_FUNCS(rpmtsColor, [LIBS="$LIBS -lpthread"
-+ AC_DEFINE([HAVE_RPM_4_2],1,[])])
-+#AC_DEFINE([HAVE_RPM_4_2],1,[]))
-+
- AC_CHECK_HEADERS(db_185.h,,[
- AC_MSG_WARN(["disabled synchronization with db file-dependencies"]) ])
- AC_CHECK_FUNCS(__db185_open)
-
- dnl 4.0.4 has cross dependenecies(?)
- if test ${is_rpm4_0_4}. = yes. -a ${ENABLE_STATIC}. = yes. ; then
-- if ${have_beecrypt}. = yes. ; then
-- LIBS="$LIBS -lbz2 -lrpmio"
-+ if test ${have_beecrypt}. = yes. ; then
-+ LIBS="$LIBS -lbz2 -lrpmio -lbeecrypt -lpthread"
- fi
- LIBS="$LIBS -lbz2 -lrpmio"
- fi
-@@ -298,7 +310,7 @@
-
- AC_CHECK_FUNCS(openpty,,
- AC_CHECK_LIB(util, openpty,
-- [AC_DEFINE([HAVE_OPENPTY],1,[defined if openpty() is avialable])] [LIBS="$LIBS -lutil"]))
-+ [AC_DEFINE([HAVE_OPENPTY],1,[defined if openpty() is avialable])] [LIBS="-lutil $LIBS"]))
-
- AC_CHECK_FUNCS(rpmGetRpmlibProvides,,
- [AC_MSG_WARN("[poldek will not work fine with rpmlib\(...\) capabilities"])],
-@@ -311,6 +323,10 @@
- )],
- [$CONF_IN_LDFLAGS])
-
-+if test -f /etc/redhat-release; then
-+ LIBS="$LIBS -ldl" # rh's crypto needs this
-+fi
-+
-
- dnl trullib 0.43.5 has n_hash_size; test if linked with system copy only
- NARRAY="<trurl/narray.h>"
-@@ -318,7 +334,7 @@
- AC_CHECK_LIB(trurl, n_hash_size,,
- [AC_MSG_ERROR(["trurlib >= 0.43.5 not found"])], [$CONF_IN_LDFLAGS])
- else
-- LIBS="$LIBS -ltrurl"
-+ LIBS="-ltrurl $LIBS"
- AC_CONFIG_SUBDIRS(trurlib)
- NARRAY="\"$srcdir/$TRURL_DIR/include/trurl/narray.h\""
- fi
-Index: installer/poldek/dbdep.c
-diff -u installer/poldek/dbdep.c:1.8 installer/poldek/dbdep.c:1.8.4.1
---- installer/poldek/dbdep.c:1.8 Thu Nov 14 20:23:24 2002
-+++ installer/poldek/dbdep.c Tue Dec 30 19:15:27 2003
-@@ -9,7 +9,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- Module used in pkgset-install.c only
- */
-
-@@ -34,7 +34,7 @@
- #include "misc.h"
- #include "dbdep.h"
-
--static db_dep_free_pkgs(struct db_dep *db_dep)
-+static void db_dep_free_pkgs(struct db_dep *db_dep)
- {
- if (db_dep->pkgs) {
- n_array_free(db_dep->pkgs);
-Index: installer/poldek/main.c
-diff -u installer/poldek/main.c:1.110 installer/poldek/main.c:1.110.4.6
---- installer/poldek/main.c:1.110 Tue Nov 26 17:32:15 2002
-+++ installer/poldek/main.c Tue Dec 30 19:14:07 2003
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -80,9 +80,9 @@
- #define MODE_SPLIT (1 << 7)
- #define MODE_SRCLIST (1 << 8)
- #define MODE_UNINSTALL (1 << 9)
--
-+#define MODE_MERGE (1 << 10)
- #ifdef ENABLE_INTERACTIVE_MODE
--# define MODE_SHELL (1 << 10)
-+# define MODE_SHELL (1 << 11)
- #endif
-
- #define MODE_IS_NOSCORE (MODE_VERIFY | MODE_MKIDX | MODE_SPLIT | MODE_SRCLIST)
-@@ -171,6 +171,7 @@
- tn_hash *htcnf = NULL; /* config file values */
-
- #define OPT_VERIFY_MERCY 'm'
-+#define OPT_VERIFY_PROMOTEPOCH 901
- #define OPT_VERIFY_DEPS 'V'
- #define OPT_VERIFY_CNFLS 902
- #define OPT_VERIFY_FILECNFLS 903
-@@ -242,6 +243,7 @@
- #define OPT_ASK 2006
- #define OPT_NOASK 2007
-
-+#define OPT_MERGE 2101
- #define OPT_SW_V016 (1 << 0)
- #define OPT_SW_NOASK (1 << 1)
- #define OPT_SW_NOCONF (1 << 2)
-@@ -298,6 +300,10 @@
- N_("Verify dependencies, conflicts and file conflicts"), 50 },
- {"mercy", OPT_VERIFY_MERCY, 0, 0,
- N_("Be tolerant for bugs which RPM tolerates"), 50 },
-+
-+{"promoteepoch", OPT_VERIFY_PROMOTEPOCH, 0, 0,
-+ N_("Promote non-existent requiremet's epoch to package's one"), 50 },
-+
-
-
- {0,0,0,0, N_("Index creation:"), 60},
-@@ -415,7 +421,14 @@
- N_("Take package priorities from FILE"), 71 },
-
- {"split-out", OPT_SPLITOUTPATH, "PREFIX", 0,
-- N_("Write chunks to PREFIX.XX, default PREFIX is packages.chunk"), 90 },
-+ N_("Write chunks to PREFIX.XX, default PREFIX is packages.chunk"), 90 },
-+
-+#if 0 //nfy
-+{0,0,0,0, N_("Merging:"), 100},
-+#endif
-+{"merge", OPT_MERGE, 0, OPTION_HIDDEN,
-+ N_("Merging given sources, the first one is treated as \"destination\", "
-+ "the others as \"source\" ones"), 100 },
-
- {0,0,0,0, N_("Other:"), 500},
- {"cachedir", OPT_SOURCECACHE, "DIR", 0,
-@@ -690,14 +703,20 @@
- argsp->idx_path = prepare_path(arg);
- argsp->idx_type = INDEXTYPE_TXTZ;
- break;
-+
-+ case OPT_MERGE:
-+ check_mjrmode(argsp);
-+ argsp->mjrmode = MODE_MERGE;
-+ //argsp->psflags |= PSVERIFY_DEPS;
-+ break;
-
- case OPT_NODESC:
-- argsp->pkgdir_creat_flags |= PKGDIR_CREAT_NODESC;
-- break;
-+ argsp->pkgdir_creat_flags |= PKGDIR_CREAT_NODESC;
-+ break;
-
- case OPT_NODIFF:
-- argsp->pkgdir_nodiff = 1;
-- break;
-+ argsp->pkgdir_nodiff = 1;
-+ break;
-
- case OPT_UNINSTALL:
- check_mjrmode(argsp);
-@@ -1217,7 +1236,6 @@
- argp_parse(&argp, argc, argv, 0, 0, &args);
-
- pkgdir_v016compat = (args.switches & OPT_SW_V016);
--
-
- if ((args.switches & OPT_SW_NOCONF) && args.conf_path) {
- logn(LOGERR, _("--noconf and --conf are exclusive, aren't they?"));
-@@ -1287,7 +1305,12 @@
- args.has_pkgdef = n_array_size(args.pkgdef_sets) +
- n_array_size(args.pkgdef_defs) +
- n_array_size(args.pkgdef_files);
--
-+
-+ if (conf_get_bool(htcnf, "vfile_external_compress", 0))
-+ pkgdir_redhat9_zlib_in_rpm_workaround = 1;
-+
-+ if (conf_get_bool(htcnf, "promoteepoch", 0))
-+ poldek_conf_promote_epoch = 1;
-
- if (conf_get_bool(htcnf, "use_sudo", 0))
- args.inst.flags |= INSTS_USESUDO;
-@@ -1430,6 +1453,52 @@
- }
- }
-
-+static int do_merge(tn_array *sources, unsigned psflags)
-+{
-+ struct pkgset *ps_src, *ps_dst;
-+ struct source *src;
-+ tn_array *dst_sources;
-+ int rc = 1;
-+
-+ n_assert(n_array_size(sources) > 1);
-+ n_array_sort_ex(sources, (tn_fn_cmp)source_cmp_pri_name);
-+ dst_sources = n_array_clone(sources);
-+
-+ n_array_push(dst_sources, n_array_shift(args.sources));
-+
-+ ps_src = pkgset_new(psflags);
-+ ps_dst = pkgset_new(psflags);
-+
-+ msgn(1, "Loading \"destination\" source...");
-+ if (!pkgset_load(ps_dst, 0, dst_sources))
-+ logn(LOGWARN, _("%s: no packages loaded"),
-+ source_idstr((struct source*)n_array_nth(dst_sources, 0)));
-+
-+ if (!pkgset_setup(ps_dst, 0))
-+ logn(LOGWARN, "%s: source is not clean",
-+ source_idstr((struct source*)n_array_nth(dst_sources, 0)));
-+
-+ msgn(1, "Loading \"source\" sources...");
-+ if (!pkgset_load(ps_src, 0, args.sources)) {
-+ logn(LOGERR, _("%s: no packages loaded"),
-+ source_idstr((struct source*)n_array_nth(args.sources, 0)));
-+ rc = 0;
-+ }
-+
-+ if (rc) {
-+ pkgset_setup(ps_src, 0);
-+ msgn(1, "Merging...");
-+ pkgset_merge(ps_dst, ps_src, psflags);
-+ }
-+
-+ pkgset_free(ps_src);
-+ pkgset_free(ps_dst);
-+
-+ n_array_unshift(args.sources, n_array_shift(dst_sources));
-+ n_array_free(dst_sources);
-+ return rc;
-+}
-+
- static struct pkgset *load_pkgset(int ldflags)
- {
- struct pkgset *ps;
-@@ -1658,6 +1727,19 @@
- rc = prepare_given_packages();
- break;
-
-+ case MODE_MERGE:
-+ if (verbose >= 0)
-+ verbose += 1;
-+
-+ n_assert(args.sources);
-+
-+ if (n_array_size(args.sources) < 2) {
-+ logn(LOGERR, _("merging needs at least 2 sources"));
-+ exit(EXIT_FAILURE);
-+ }
-+
-+ break;
-+
- case MODE_MKIDX:
- if (verbose >= 0)
- verbose += 1;
-@@ -1867,6 +1949,11 @@
- if (args.mjrmode == MODE_UNINSTALL) {
- if ((rc = usrpkgset_size(args.ups)))
- rc = uninstall(args.ups, &args.inst);
-+ goto l_end;
-+ }
-+
-+ if (args.mjrmode == MODE_MERGE) {
-+ rc = do_merge(args.sources, args.psflags);
- goto l_end;
- }
-
-Index: installer/poldek/make.sh
-diff -u /dev/null installer/poldek/make.sh:1.4.2.2
---- /dev/null Fri Jan 9 13:45:49 2004
-+++ installer/poldek/make.sh Fri Dec 19 02:29:31 2003
-@@ -0,0 +1,4 @@
-+#!/bin/sh
-+
-+cd $(dirname $0) || exit 1
-+make CFLAGS="-fno-builtin-log -O0 -g -Wall -W -pipe" $@
-Index: installer/poldek/pkg.c
-diff -u installer/poldek/pkg.c:1.51 installer/poldek/pkg.c:1.51.4.2
---- installer/poldek/pkg.c:1.51 Fri Oct 18 18:19:42 2002
-+++ installer/poldek/pkg.c Tue Dec 30 19:19:52 2003
-@@ -7,7 +7,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
- #ifdef HAVE_CONFIG_H
- # include "config.h"
-@@ -32,6 +32,8 @@
- #include "pkgdir.h"
- #include "pkgroup.h"
-
-+int poldek_conf_promote_epoch = 0;
-+
- static void *(*pkg_alloc_fn)(size_t) = n_malloc;
- static void (*pkg_free_fn)(void*) = n_free;
-
-@@ -47,11 +49,13 @@
- struct pkg *pkg_new(const char *name, int32_t epoch,
- const char *version, const char *release,
- const char *arch, const char *os,
-+ const char *fn,
- uint32_t size, uint32_t fsize,
- uint32_t btime)
- {
- struct pkg *pkg;
-- int name_len = 0, version_len = 0, release_len = 0, arch_len = 0, os_len = 0;
-+ int name_len = 0, version_len = 0, release_len = 0,
-+ arch_len = 0, os_len = 0, fn_len = 0;
- char *buf;
- int len;
-
-@@ -80,6 +84,11 @@
- os_len = strlen(os);
- len += os_len + 1;
- }
-+
-+ if (fn) {
-+ fn_len = strlen(fn);
-+ len += fn_len + 1;
-+ }
-
- pkg = pkg_alloc_fn(sizeof(*pkg) + len);
- memset(pkg, 0, sizeof(*pkg));
-@@ -122,6 +131,14 @@
- buf += os_len;
- *buf++ = '\0';
- }
-+
-+ pkg->fn = NULL;
-+ if (fn) {
-+ pkg->fn = buf;
-+ memcpy(buf, fn, fn_len);
-+ buf += fn_len;
-+ *buf++ = '\0';
-+ }
-
- pkg->reqs = NULL;
- pkg->caps = NULL;
-@@ -253,10 +270,11 @@
-
- if (!headerGetEntry(h, RPMTAG_BUILDTIME, &type, (void *)&btime, NULL))
- btime = NULL;
--
-- pkg = pkg_new(name, epoch ? *epoch : 0, version, release, arch, os,
-+
-+ pkg = pkg_new(name, epoch ? *epoch : 0, version, release, arch, os,
-+ fname ? n_basenam(fname) : NULL,
- size ? *size : 0, fsize, btime ? *btime : 0);
--
-+
- if (pkg == NULL)
- return NULL;
-
-@@ -698,7 +716,27 @@
-
- if ((strcmp(capreq_name(cap), capreq_name(req))) != 0)
- return 0;
--
-+
-+ if (capreq_has_epoch(cap)) {
-+ if (!capreq_has_epoch(req) && poldek_conf_promote_epoch) {
-+ if (verbose > 1)
-+ logn(LOGWARN, "req '%s' needs an epoch (assuming same epoch as %s)\n",
-+ capreq_snprintf_s(req), capreq_snprintf_s0(cap));
-+ cmprc = 0;
-+
-+ } else {
-+ cmprc = capreq_epoch(cap) - capreq_epoch(req);
-+ if (cmprc != 0)
-+ return rel_match(cmprc, req);
-+ }
-+ evr = 1;
-+
-+ } else if (capreq_epoch(req) > 0) { /* always promote cap's epoch */
-+ cmprc = 0;
-+ evr = 1;
-+ }
-+
-+#if 0
- if (capreq_has_epoch(req)) {
- if (!capreq_has_epoch(cap))
- return strict == 0;
-@@ -708,7 +746,8 @@
- return rel_match(cmprc, req);
- evr = 1;
- }
--
-+#endif
-+
- if (capreq_has_ver(req)) {
- if (!capreq_has_ver(cap))
- return strict == 0;
-@@ -742,14 +781,22 @@
-
- if (!capreq_versioned(req))
- return 1;
--
-- if (capreq_has_epoch(req) && pkg->epoch) {
-- cmprc = pkg->epoch - capreq_epoch(req);
-- if (cmprc != 0)
-- return rel_match(cmprc, req);
-+
-+ if (pkg->epoch) {
-+ if (!capreq_has_epoch(req) && poldek_conf_promote_epoch) {
-+ if (verbose > 1)
-+ logn(LOGWARN, "req '%s' needs an epoch (assuming same epoch as %s)\n",
-+ capreq_snprintf_s(req), pkg_snprintf_s(pkg));
-+ cmprc = 0;
-+
-+ } else {
-+ cmprc = pkg->epoch - capreq_epoch(req);
-+ if (cmprc != 0)
-+ return rel_match(cmprc, req);
-+ }
- evr = 1;
-
-- } else if (capreq_epoch(req) > 0) {
-+ } else if (capreq_epoch(req) > 0) { /* always promote package's epoch */
- cmprc = 0;
- evr = 1;
- }
-@@ -1198,6 +1245,19 @@
- {
- static char str[256];
- snprintf(str, sizeof(str), "%s-%s-%s", pkg->name, pkg->ver, pkg->rel);
-+ return str;
-+}
-+
-+
-+char *pkg_snprintf_epoch_s(const struct pkg *pkg)
-+{
-+ static char str[256];
-+ char es[16] = {0};
-+
-+ if (pkg->epoch)
-+ snprintf(es, sizeof(es), "%d:", pkg->epoch);
-+
-+ snprintf(str, sizeof(str), "%s-%s%s-%s", pkg->name, es, pkg->ver, pkg->rel);
- return str;
- }
-
-Index: installer/poldek/pkg.h
-diff -u installer/poldek/pkg.h:1.37 installer/poldek/pkg.h:1.37.4.2
---- installer/poldek/pkg.h:1.37 Fri Oct 18 18:19:42 2002
-+++ installer/poldek/pkg.h Tue Dec 30 19:19:52 2003
-@@ -1,4 +1,4 @@
--/* $Id$ */
-+/* $Id$ */
- #ifndef POLDEK_PKG_H
- #define POLDEK_PKG_H
-
-@@ -106,6 +106,7 @@
- char *rel;
- char *arch;
- char *os;
-+ char *fn;
-
- tn_array *caps; /* capabilities */
- tn_array *reqs; /* requirements */
-@@ -143,6 +144,7 @@
- struct pkg *pkg_new(const char *name, int32_t epoch,
- const char *version, const char *release,
- const char *arch, const char *os,
-+ const char *fn,
- uint32_t size, uint32_t fsize,
- uint32_t btime);
-
-@@ -199,6 +201,10 @@
-
- int pkg_eq_capreq(const struct pkg *pkg, const struct capreq *cr);
-
-+
-+
-+extern int poldek_conf_promote_epoch; /* be compatibile with rpm < 4.2.1 */
-+
- /* look up into package caps only */
- int pkg_caps_match_req(const struct pkg *pkg, const struct capreq *req,
- int strict);
-@@ -239,6 +245,9 @@
- char *pkg_snprintf_s(const struct pkg *pkg);
- char *pkg_snprintf_s0(const struct pkg *pkg);
- char *pkg_snprintf_s1(const struct pkg *pkg);
-+
-+
-+char *pkg_snprintf_epoch_s(const struct pkg *pkg);
-
- /* load and returns not loaded file list (l: tag in package index) */
- tn_array *pkg_other_fl(const struct pkg *pkg);
-Index: installer/poldek/pkgdir.c
-diff -u installer/poldek/pkgdir.c:1.39 installer/poldek/pkgdir.c:1.39.4.3
---- installer/poldek/pkgdir.c:1.39 Tue Nov 26 17:32:16 2002
-+++ installer/poldek/pkgdir.c Tue Dec 30 19:19:52 2003
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -54,6 +54,7 @@
- #include "pkgroup.h"
-
- int pkgdir_v016compat = 0; /* public */
-+int pkgdir_redhat9_zlib_in_rpm_workaround = 0;
-
- #define PKGT_HAS_NAME (1 << 0)
- #define PKGT_HAS_EVR (1 << 1)
-@@ -179,9 +180,12 @@
- static
- int do_open_idx(struct idx_s *idx, char *path, int path_len, int vfmode)
- {
-+ if (pkgdir_redhat9_zlib_in_rpm_workaround)
-+ vfmode |= VFM_UNCOMPR;
-+
- if ((idx->pdg = pdigest_new(path, vfmode, pkgdir_v016compat))) {
- if ((idx->vf = vfile_open(path, VFT_STDIO, vfmode)) == NULL) {
-- if (path_len && strcmp(&path[path_len - 3], ".gz") == 0) {
-+ if (path_len > 3 && strcmp(&path[path_len - 3], ".gz") == 0) {
- path[path_len - 3] = '\0'; /* trim *.gz */
- idx->vf = vfile_open(path, VFT_STDIO, vfmode);
- }
-@@ -1219,9 +1223,9 @@
- break;
-
- default:
-- logn(LOGERR, "%s:%ld: unknown tag '%c'", pkgdir->path, offs, *line);
-- nerr++;
-- goto l_end;
-+ logn(LOGWARN, "%s:%ld: unknown tag '%c' (skipped)",
-+ pkgdir->path, offs, *line);
-+ break;
- }
- }
-
-@@ -1389,7 +1393,7 @@
- return NULL;
- }
-
-- pkg = pkg_new(pkgt->name, epoch, version, release, arch, os,
-+ pkg = pkg_new(pkgt->name, epoch, version, release, arch, os, NULL,
- pkgt->size, pkgt->fsize, pkgt->btime);
- pkg->groupid = pkgt->groupid;
-
-@@ -1457,7 +1461,7 @@
- int32_t epoch = 0;
-
- if (*p && parse_nevr(p, &name, &epoch, &ver, &rel)) {
-- struct pkg *pkg = pkg_new(name, epoch, ver, rel, NULL, NULL,
-+ struct pkg *pkg = pkg_new(name, epoch, ver, rel, NULL, NULL, NULL,
- 0, 0, 0);
- n_array_push(pkgs, pkg);
- }
-Index: installer/poldek/pkgdir.h
-diff -u installer/poldek/pkgdir.h:1.22 installer/poldek/pkgdir.h:1.22.6.1
---- installer/poldek/pkgdir.h:1.22 Sat Aug 24 09:59:11 2002
-+++ installer/poldek/pkgdir.h Sun Dec 7 22:01:53 2003
-@@ -1,4 +1,4 @@
--/* $Id$ */
-+/* $Id$ */
- #ifndef POLDEK_PKGDIR_H
- #define POLDEK_PKGDIR_H
-
-@@ -41,6 +41,7 @@
- };
-
- extern int pkgdir_v016compat;
-+extern int pkgdir_redhat9_zlib_in_rpm_workaround;
-
- struct pkgdir {
- char *name;
-Index: installer/poldek/pkgdir_save.c
-diff -u installer/poldek/pkgdir_save.c:1.8 installer/poldek/pkgdir_save.c:1.8.6.1
---- installer/poldek/pkgdir_save.c:1.8 Mon Jun 10 19:56:34 2002
-+++ installer/poldek/pkgdir_save.c Fri Dec 19 02:29:31 2003
-@@ -7,7 +7,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -248,8 +248,12 @@
- char suffix[64] = "", tocsuffix[64] = ".toc",
- difftoc_suffix[PATH_MAX] = "";
- const char *orig_pathname;
-- int i, with_toc = 1;
-+ int i, with_toc = 1, vfmode;
-
-+
-+ vfmode = VFM_RW;
-+ if (pkgdir_redhat9_zlib_in_rpm_workaround)
-+ vfmode |= VFM_UNCOMPR;
-
- if ((flags & PKGDIR_CREAT_asCACHE) == 0 &&
- (pkgdir->flags & (PKGDIR_DIFF | PKGDIR_UNIQED)) == 0) {
-@@ -313,14 +317,14 @@
- msgn_f(1, _("Writing %s..."), path);
-
- if (with_toc) {
-- if ((vf_toc = vfile_open(tocpath, VFT_STDIO, VFM_RW)) == NULL)
-+ if ((vf_toc = vfile_open(tocpath, VFT_STDIO, vfmode)) == NULL)
- return 0;
- put_fheader(vf_toc->vf_stream, pdir_poldeksindex_toc, pkgdir);
- }
-
- do_unlink(path);
-
-- if ((vf = vfile_open(path, VFT_STDIO, VFM_RW)) == NULL) {
-+ if ((vf = vfile_open(path, VFT_STDIO, vfmode)) == NULL) {
- if (vf_toc)
- vfile_close(vf_toc);
- return 0;
-@@ -397,8 +401,10 @@
- return 0;
- }
-
-- if ((vf = vfile_open(difftoc_path, VFT_STDIO, VFM_APPEND)) == NULL)
-+ if ((vf = vfile_open(difftoc_path, VFT_STDIO,
-+ vfmode | VFM_APPEND)) == NULL)
- return 0;
-+
- fprintf(vf->vf_stream, "%s %lu %s %lu\n",
- n_basenam(path), pkgdir->ts, pkgdir->mdd_orig, pkgdir->ts_orig);
- vfile_close(vf);
-Index: installer/poldek/pkgroup.c
-diff -u installer/poldek/pkgroup.c:1.10 installer/poldek/pkgroup.c:1.10.6.1
---- installer/poldek/pkgroup.c:1.10 Thu Apr 25 18:34:11 2002
-+++ installer/poldek/pkgroup.c Fri Dec 19 02:19:25 2003
-@@ -7,7 +7,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
- #ifdef HAVE_CONFIG_H
- # include "config.h"
-@@ -246,7 +246,7 @@
- if (fread(&nid, sizeof(nid), 1, stream) != 1)
- return 0;
-
-- if (fread(&nlen, sizeof(nlen), 1, stream) != 1 || nlen > sizeof(name))
-+ if (fread(&nlen, sizeof(nlen), 1, stream) != 1)
- return 0;
-
- if (fread(name, nlen, 1, stream) != 1)
-Index: installer/poldek/pkgset-install.c
-diff -u installer/poldek/pkgset-install.c:1.82 installer/poldek/pkgset-install.c:1.82.4.2
---- installer/poldek/pkgset-install.c:1.82 Sat Nov 16 01:23:22 2002
-+++ installer/poldek/pkgset-install.c Tue Dec 30 19:19:52 2003
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -224,11 +224,11 @@
-
- if (p != pkg && pkg_is_marked(p)) {
- if (req == NULL || pkg_statisfies_req(p, req, 0)) {
-- DBGF("%s -> yes, %s\n", pkg_snprintf_s0(pkg), pkg_snprintf_s1(p));
-- return 1;
-+ DBGF("%s -> yes, %s\n", pkg_snprintf_s0(pkg), pkg_snprintf_s1(p));
-+ return 1;
-+ }
- }
- }
-- }
-
- return 0;
- }
-@@ -303,7 +303,7 @@
- struct pkg **candidates, int npkgs,
- struct pkgset *ps, struct upgrade_s *upg)
- {
-- int *ncnfls, i, j, i_min, cnfl_min;
-+ int *ncnfls, i, j, i_best, cnfl_min;
- int i_ver_eq = -1, i_evr_eq = -1;
-
- DBGF("%s (%d)\n", pkg_snprintf_s(marker), npkgs);
-@@ -345,38 +345,44 @@
- return i_ver_eq;
-
- cnfl_min = INT_MAX;
-- i_min = -1;
-+ i_best = -1;
- for (i=0; i < npkgs; i++) {
- DBGF("%d. %s %d\n", i, pkg_snprintf_s(candidates[i]), ncnfls[i]);
- if (cnfl_min > ncnfls[i]) {
- cnfl_min = ncnfls[i];
-- i_min = i;
-+ i_best = i;
- }
- }
-
-- DBGF("[after cnfls] i_min = %d\n", i_min);
-+ DBGF("[after cnfls] i_best = %d\n", i_best);
- if (cnfl_min == 0) {
- int n = INT_MAX, *nmarks;
-
- nmarks = alloca(npkgs * sizeof(*nmarks));
-
- for (i=0; i < npkgs; i++) {
-+ if (other_version_marked(candidates[i], ps->pkgs, NULL)) {
-+ DBGF("%d. %s other version is already marked, skipped\n",
-+ i, pkg_snprintf_s(candidates[i]));
-+ continue;
-+ }
-+
- nmarks[i] = pkg_drags(candidates[i], ps, upg);
-- DBGF("%d %s -> %d\n", i, pkg_snprintf_s(candidates[i]), nmarks[i]);
-- if (n > nmarks[i]) {
-+ DBGF("%d. %s -> %d\n", i, pkg_snprintf_s(candidates[i]), nmarks[i]);
-+ if (n > nmarks[i])
- n = nmarks[i];
-- }
--
-+
- if (n == 0 && ncnfls[i] == 0) {
-- i_min = i;
-+ i_best = i;
- break;
- }
- }
- }
-
-- if (i_min == -1)
-- i_min = 0;
-- return i_min;
-+ if (i_best == -1)
-+ i_best = 0;
-+ DBGF("RET %d. %s\n", i_best, pkg_snprintf_s(candidates[i]));
-+ return i_best;
- }
-
- #define FINDREQ_BESTSEL 0
-@@ -1009,7 +1015,7 @@
- capreq_snprintf(reqname, 256, req);
- }
-
-- DBGF("req %s\n", capreq_snprintf_s(req));
-+ DBGF("%s: REQ %s\n", pkg_snprintf_s(pkg), capreq_snprintf_s(req));
-
- if ((upg->inst->flags & INSTS_EQPKG_ASKUSER) && upg->inst->askpkg_fn)
- tomark_candidates_ptr = &tomark_candidates;
-@@ -1022,7 +1028,8 @@
- goto l_end_loop;
- }
- }
--
-+ DBGF("%s: TOMARK %s\n", pkg_snprintf_s1(pkg),
-+ tomark ? pkg_snprintf_s0(tomark) : "NULL");
- /* don't check foreign dependencies */
- if (process_as == PROCESS_AS_ORPHAN) {
- #if 0 /* buggy, TODO - unmark foreign on adding to uninst_set */
-@@ -1854,7 +1861,8 @@
- if (is_installed == 0)
- n_array_push(iinf->uninstalled_pkgs,
- pkg_new(pkg->name, pkg->epoch, pkg->ver, pkg->rel,
-- pkg->arch, pkg->os, pkg->size, pkg->fsize,
-+ pkg->arch, pkg->os, NULL,
-+ pkg->size, pkg->fsize,
- pkg->btime));
- }
-
-Index: installer/poldek/pkgset-merge.c
-diff -u /dev/null installer/poldek/pkgset-merge.c:1.1.2.1
---- /dev/null Fri Jan 9 13:45:49 2004
-+++ installer/poldek/pkgset-merge.c Wed Apr 2 16:54:08 2003
-@@ -0,0 +1,153 @@
-+/*
-+ Copyright (C) 2000 Pawel A. Gajda (mis@k2.net.pl)
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License published by
-+ the Free Software Foundation (see file COPYING for details).
-+*/
-+
-+/*
-+ $Id$
-+*/
-+
-+#include <limits.h>
-+#include <stdint.h>
-+#include <string.h>
-+#include <errno.h>
-+
-+#include <rpm/rpmlib.h>
-+#include <trurl/nassert.h>
-+#include <trurl/narray.h>
-+#include <trurl/nhash.h>
-+
-+#include "i18n.h"
-+#include "log.h"
-+#include "pkg.h"
-+#include "pkgset.h"
-+#include "misc.h"
-+
-+static
-+int find_replacement(struct pkgset *ps, struct pkg *pkg, struct pkg **rpkg)
-+{
-+ const struct capreq_idx_ent *ent;
-+ struct pkg *bypkg = NULL;
-+
-+
-+ *rpkg = NULL;
-+
-+ if ((bypkg = pkgset_lookup_pkgn(ps, pkg->name)) &&
-+ pkg_cmp_name_evr(bypkg, pkg) > 0) {
-+
-+ *rpkg = bypkg;
-+
-+ } else if ((ent = capreq_idx_lookup(&ps->obs_idx, pkg->name))) {
-+ int i;
-+
-+ for (i=0; i < ent->items; i++) {
-+ if (pkg_caps_obsoletes_pkg_caps(ent->pkgs[i], pkg) &&
-+ pkg_cmp_name_evr(ent->pkgs[i], pkg) > 0) {
-+
-+ *rpkg = ent->pkgs[i];
-+ break;
-+ }
-+ }
-+ }
-+
-+ if (*rpkg && strcmp((*rpkg)->name, pkg->name) != 0 &&
-+ (*rpkg)->caps && pkg->caps) {
-+
-+ int i;
-+ for (i=0; i < n_array_size((*rpkg)->caps); i++) {
-+ struct capreq *cap = n_array_nth((*rpkg)->caps, i);
-+
-+ if (strcmp(capreq_name(cap), (*rpkg)->name) == 0)
-+ continue;
-+
-+ if (capreq_arr_find(pkg->caps, capreq_name(cap))) {
-+ msg(2, "%s is NOT obsoleted by %s (same %s)\n", pkg_snprintf_s(pkg),
-+ pkg_snprintf_s0(*rpkg), capreq_name(cap));
-+ *rpkg = NULL;
-+ break;
-+ }
-+ }
-+ }
-+
-+ return (*rpkg != NULL);
-+}
-+
-+void pkgset_merge(struct pkgset *ps_dst, struct pkgset *ps_src,
-+ unsigned psflags) /* TODO: psflags should be extractable
-+ from existing ps */
-+{
-+ struct pkg *pkg, *rpkg;
-+ tn_array *rm_pkgs, *pkgs;
-+ struct pkgset *ps;
-+ struct pkgdir *pkgdir;
-+ int i;
-+
-+ n_assert(n_array_size(ps_dst->pkgdirs) == 1);
-+
-+ rm_pkgs = pkgs_array_new(1024);
-+ pkgs = pkgs_array_new(n_array_size(ps_dst->pkgdirs));
-+
-+ for (i=0; i < n_array_size(ps_src->pkgs); i++) {
-+ pkg = n_array_nth(ps_src->pkgs, i);
-+ pkg_clr_badreqs(pkg);
-+ n_array_push(pkgs, pkg_link(pkg));
-+ }
-+
-+ for (i=0; i < n_array_size(ps_dst->pkgs); i++) {
-+ pkg = n_array_nth(ps_dst->pkgs, i);
-+ pkg_clr_badreqs(pkg);
-+
-+ if (!find_replacement(ps_src, pkg, &rpkg)) {
-+ n_array_push(pkgs, pkg_link(pkg));
-+
-+ } else {
-+ n_array_push(rm_pkgs, pkg_link(pkg));
-+ n_array_push(rm_pkgs, pkg_link(rpkg));
-+ msg(2, "%s is obsoleted by %s\n", pkg_snprintf_s(pkg),
-+ pkg_snprintf_s0(rpkg));
-+ }
-+ }
-+
-+ ps = pkgset_new(psflags | PSVERIFY_DEPS);
-+ ps->pkgs = n_ref(pkgs);
-+ pkgset_setup(ps, NULL);
-+
-+ pkgdir = n_array_nth(ps_dst->pkgdirs, 0);
-+ for (i=0; i<n_array_size(ps->pkgs); i++) {
-+ pkg = n_array_nth(ps->pkgs, i);
-+ if (pkg_has_badreqs(pkg)) {
-+ if (pkg->pkgdir != pkgdir) {
-+ logn(LOGWARN, "%s: could not be moved\n", pkg_filename_s(pkg));
-+
-+ } else {
-+ logn(LOGWARN, "%s: will be REMOVED from destination\n",
-+ pkg_filename_s(pkg));
-+ printf("merge: rm %s\n", pkg_path_s(pkg));
-+ }
-+ } else if (pkg->pkgdir != pkgdir)
-+ printf("merge: mv %s %s\n", pkg_path_s(pkg), pkgdir->path);
-+ }
-+
-+ while (n_array_size(rm_pkgs)) {
-+ pkg = n_array_shift(rm_pkgs);
-+ rpkg = n_array_shift(rm_pkgs);
-+
-+ if (pkg_has_badreqs(rpkg)) {
-+ logn(LOGWARN, "%s: could not be moved\n", pkg_path_s(pkg));
-+
-+ } else {
-+ printf("merge: rm %s\n", pkg_path_s(pkg));
-+ }
-+
-+
-+ pkg_free(pkg);
-+ pkg_free(rpkg);
-+ }
-+
-+ n_array_free(pkgs);
-+ pkgset_free(ps);
-+}
-+
-Index: installer/poldek/pkgset-req.c
-diff -u installer/poldek/pkgset-req.c:1.23 installer/poldek/pkgset-req.c:1.23.4.1
---- installer/poldek/pkgset-req.c:1.23 Thu Nov 7 17:43:26 2002
-+++ installer/poldek/pkgset-req.c Wed Jul 23 18:15:11 2003
-@@ -7,7 +7,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <limits.h>
-@@ -186,7 +186,7 @@
- static int add_reqpkg(struct pkg *pkg, struct capreq *req, struct pkg *dpkg)
- {
- struct reqpkg *rpkg;
-- struct reqpkg tmp_rpkg = {NULL, 0, {NULL}};
-+ struct reqpkg tmp_rpkg = {NULL, 0};
-
- tmp_rpkg.pkg = dpkg;
- rpkg = n_array_bsearch(pkg->reqpkgs, &tmp_rpkg);
-@@ -368,7 +368,7 @@
- int isneq;
- uint8_t flags;
- struct reqpkg *rpkg;
-- struct reqpkg tmp_rpkg = {NULL, 0, {NULL}};
-+ struct reqpkg tmp_rpkg = {NULL, 0};
-
- flags = 0;
- flags |= capreq_is_prereq(req) ? REQPKG_PREREQ : 0;
-Index: installer/poldek/pkgset.h
-diff -u installer/poldek/pkgset.h:1.37 installer/poldek/pkgset.h:1.37.4.1
---- installer/poldek/pkgset.h:1.37 Thu Nov 14 19:21:42 2002
-+++ installer/poldek/pkgset.h Wed Apr 2 16:54:08 2003
-@@ -1,4 +1,4 @@
--/* $Id$ */
-+/* $Id$ */
- #ifndef POLDEK_PKGSET_H
- #define POLDEK_PKGSET_H
-
-@@ -120,6 +120,10 @@
- void pkgset_free(struct pkgset *ps);
-
- int pkgset_setup(struct pkgset *ps, const char *pri_fpath);
-+
-+/* --merge */
-+void pkgset_merge(struct pkgset *ps_dst, struct pkgset *ps_src,
-+ unsigned psflags);
-
- /* returns sorted list of packages, free it by n_array_free() */
- tn_array *pkgset_getpkgs(const struct pkgset *ps);
-Index: installer/poldek/poldek.spec.in
-diff -u installer/poldek/poldek.spec.in:1.20 installer/poldek/poldek.spec.in:1.20.4.1
---- installer/poldek/poldek.spec.in:1.20 Thu Nov 7 18:41:07 2002
-+++ installer/poldek/poldek.spec.in Wed Jul 23 19:04:16 2003
-@@ -1,4 +1,4 @@
--# $Revision$, $Date$
-+# $Revision$, $Date$
- #
- # spec is based on PLD's poldek.spec available at <http://cvs.pld.org.pl/SPECS/>
- #
-@@ -14,16 +14,16 @@
- Group: Applications/System
- Source0: http://team.pld.org.pl/~mis/poldek/download/%{name}-%{version}.tar.bz2
- URL: http://team.pld.org.pl/~mis/poldek/
--Requires: /bin/rpm
-+#Requires: /bin/rpm
- BuildRequires: bzip2-devel
--BuildRequires: db3-devel >= 3.1.14-2
-+#BuildRequires: db3-devel >= 3.1.14-2
- #BuildRequires: curl-devel >= 7.8
- BuildRequires: rpm-devel >= 4.0
- #BuildRequires: popt-static
- BuildRequires: openssl-devel
- BuildRequires: readline-devel
- BuildRequires: zlib-devel
--BuildRequires: /usr/bin/pod2man
-+#BuildRequires: /usr/bin/pod2man
- BuildRequires: pcre-devel
- %{?_with_static:BuildRequires: bzip2-static}
- %{?_with_static:BuildRequires: curl-static}
-@@ -78,6 +78,9 @@
- All persons listed below can be reached at <cvs_login>@pld.org.pl
-
- $Log$
-+Revision 1.20.4.1 2003/07/23 17:04:16 mis
-+- removed unneeded dependencies
-+
- Revision 1.20 2002/11/07 17:41:07 mis
- - used tar.bz2 source
-
-Index: installer/poldek/rpm.c
-diff -u installer/poldek/rpm.c:1.41 installer/poldek/rpm.c:1.41.4.1
---- installer/poldek/rpm.c:1.41 Fri Nov 22 18:07:26 2002
-+++ installer/poldek/rpm.c Sun Dec 7 21:58:15 2003
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -188,10 +188,10 @@
- while((dbrec = rpmdb_it_get(&it)) != NULL) {
- if (dbpkg_array_has(unistdbpkgs, dbrec->recno) ||
- dbpkg_array_has(cnfldbpkgs, dbrec->recno))
-- continue;
-+ continue;
-
- n_array_push(cnfldbpkgs, dbpkg_new(dbrec->recno, dbrec->h, ldflags));
-- break;
-+ break;
- }
- rpmdb_it_destroy(&it);
-
-@@ -215,12 +215,12 @@
- rpmdb_it_init(db, &it, RPMITER_NAME, capreq_name(req));
- while ((dbrec = rpmdb_it_get(&it)) != NULL) {
- if (dbpkg_array_has(unistdbpkgs, dbrec->recno))
-- continue;
-+ continue;
-
- if (header_evr_match_req(dbrec->h, req)) {
-- rc = 1;
-- break;
-- }
-+ rc = 1;
-+ break;
-+ }
- }
- rpmdb_it_destroy(&it);
-
-@@ -237,9 +237,9 @@
- rpmdb_it_init(db, &it, RPMITER_FILE, capreq_name(req));
- while ((dbrec = rpmdb_it_get(&it)) != NULL) {
- if (dbpkg_array_has(unistdbpkgs, dbrec->recno))
-- continue;
-- finded = 1;
-- break;
-+ continue;
-+ finded = 1;
-+ break;
- }
- rpmdb_it_destroy(&it);
- return finded;
-@@ -288,11 +288,10 @@
- pkg.epoch = 0;
-
- if (pkg_evr_match_req(&pkg, req)) {
-- DBGF("%s[%d] match %s!\n", pkg_snprintf_s(&pkg), pkg.epoch, capreq_snprintf_s0(req));
-+ DBGF("%s[%d] match %s!\n", pkg_snprintf_s(&pkg), pkg.epoch,
-+ capreq_snprintf_s0(req));
- return 1;
- }
--
--
-
- return 0;
- }
-@@ -376,7 +375,7 @@
- rpmdbMatchIterator mi;
- mi = rpmdbInitIterator(db, RPMDBI_PACKAGES, NULL, 0);
- while ((h = rpmdbNextIterator(mi)) != NULL) {
-- unsigned int recno = rpmdbGetIteratorOffset(mi);
-+ unsigned int recno = rpmdbGetIteratorOffset(mi);
- #ifdef HAVE_RPM_4_1 /* omit pubkeys */
- if (headerIsEntry(h, RPMTAG_PUBKEYS))
- continue;
-@@ -385,7 +384,7 @@
- return 0;
-
- mapfn(recno, h, arg);
-- n++;
-+ n++;
- }
- rpmdbFreeIterator(mi);
- #else /* !HAVE_RPM_4_0 */
-@@ -526,17 +525,25 @@
- struct rpmdb_it it;
- const struct dbrec *dbrec;
-
-+
- rpmdb_it_init(db, &it, RPMITER_NAME, pkg->name);
- count = rpmdb_it_get_count(&it);
- if (count > 0 && (cmprc || dbrecp)) {
- dbrec = rpmdb_it_get(&it);
--
-- if (cmprc)
-- *cmprc = -hdr_pkg_cmp_evr(dbrec->h, pkg);
--
-- if (dbrecp) {
-- dbrecp->recno = dbrec->recno;
-- dbrecp->h = headerLink(dbrec->h);
-+
-+ if (dbrec == NULL) {
-+ log(LOGWARN, _("%s: rpm iterator returns NULL"
-+ " (corrupted RPM database?). Ignored"), pkg->name);
-+ count = 0; /* assume that package isn't installed */
-+
-+ } else {
-+ if (cmprc)
-+ *cmprc = -hdr_pkg_cmp_evr(dbrec->h, pkg);
-+
-+ if (dbrecp) {
-+ dbrecp->recno = dbrec->recno;
-+ dbrecp->h = headerLink(dbrec->h);
-+ }
- }
- }
-
-Index: installer/poldek/rpm_signature.c
-diff -u installer/poldek/rpm_signature.c:1.4 installer/poldek/rpm_signature.c:1.4.4.2
---- installer/poldek/rpm_signature.c:1.4 Fri Oct 18 12:34:03 2002
-+++ installer/poldek/rpm_signature.c Wed Jul 16 12:49:28 2003
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -56,8 +56,10 @@
-
- static int rpm_read_signature(FD_t fd, Header *sighp, int sig_type)
- {
--#ifdef HAVE_RPM_4_1
-- return rpmReadSignature(fd, sighp, sig_type) == 0;
-+#ifdef HAVE_RPM_4_2
-+ return rpmReadSignature(fd, sighp, sig_type, NULL) == 0;
-+#elif HAVE_RPM_4_1
-+ return rpmReadSignature(fd, sighp, sig_type, NULL) == 0;
- #elif HAVE_RPM_4_0
- return rpmReadSignature(fd, sighp, sig_type, NULL) == 0;
- #endif
-Index: installer/poldek/rpmadds.c
-diff -u installer/poldek/rpmadds.c:1.8 installer/poldek/rpmadds.c:1.8.4.1
---- installer/poldek/rpmadds.c:1.8 Thu Nov 7 17:43:26 2002
-+++ installer/poldek/rpmadds.c Tue Apr 15 19:03:02 2003
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -34,15 +34,17 @@
- #include "misc.h"
- #include "log.h"
-
--
- int rpm_headerReadFD(FD_t fdt, Header *hdr, const char *path)
- {
- int rc = 0;
-
--#ifdef HAVE_RPM_4_1
-+#ifndef HAVE_RPM_4_1
-+ rc = rpmReadPackageHeader(fdt, hdr, NULL, NULL, NULL);
-+#else
- rpmRC rpmrc;
- rpmts ts = rpmtsCreate();
-
-+ rpmtsSetVSFlags(ts, RPMVSF_NODSA | RPMVSF_NORSA | RPMVSF_NOMD5);
- rpmrc = rpmReadPackageFile(ts, fdt, path, hdr);
- switch (rpmrc) {
- case RPMRC_NOTTRUSTED:
-@@ -54,18 +56,12 @@
- default:
- rc = 1;
- }
--
--#else
-- rc = rpmReadPackageHeader(fdt, hdr, NULL, NULL, NULL);
-+ rpmtsFree(ts);
- #endif
--
-+
- if (rc != 0)
- logn(LOGERR, _("%s: read header failed"), path);
-
--#ifdef HAVE_RPM_4_1
-- rpmtsFree(ts);
--#endif
--
- return rc == 0;
- }
-
-Index: installer/poldek/rpmvercmp.c
-diff -u installer/poldek/rpmvercmp.c:1.5 installer/poldek/rpmvercmp.c:1.5.6.1
---- installer/poldek/rpmvercmp.c:1.5 Mon May 13 22:27:17 2002
-+++ installer/poldek/rpmvercmp.c Tue Dec 30 19:15:08 2003
-@@ -1,4 +1,5 @@
- #include <stdio.h>
-+#include <string.h>
- #include <stdlib.h>
- #include <rpm/rpmlib.h>
-
-Index: installer/poldek/test_match.c
-diff -u installer/poldek/test_match.c:1.8 installer/poldek/test_match.c:1.8.4.1
---- installer/poldek/test_match.c:1.8 Thu Nov 7 17:43:26 2002
-+++ installer/poldek/test_match.c Fri Dec 19 02:29:31 2003
-@@ -7,7 +7,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
- #include <stdio.h>
- #include <stdlib.h>
-@@ -26,7 +26,7 @@
- #include "misc.h"
- #include "rpm.h"
-
--int test_match(int argc, char *argv[])
-+int old_test_match(int argc, char *argv[])
- {
- struct pkg *pkg;
- struct capreq *req;
-@@ -54,7 +54,7 @@
- int rc1, rc2;
- char evr[255];
-
-- snprintf(evr, sizeof(evr), "1:1.1");
-+ snprintf(evr, sizeof(evr), "0:1.1");
- req = capreq_new_evr("poldek", n_strdup(evr), rels[k++], 0);
-
- rc1 = pkg_match_req(pkg, req, 1) ? 1:0;
-@@ -73,49 +73,54 @@
- return 0;
- }
-
--int test_match_(int epoch, char *ver, char *rel, char *evr, int relation)
-+
-+int test_match(int epoch, char *ver, char *rel, char *evr, int relation)
- {
- struct pkg *pkg;
-- struct capreq *req;
-- int rc1;
-+ struct capreq *req, *cap;
-+ int rc;
-
- pkg = pkg_new("poldek", epoch, ver, rel, NULL, NULL, 0, 0, 0);
-+ cap = capreq_new("poldek", epoch, ver, rel, REL_EQ, 0);
-
- req = capreq_new_evr("poldek", n_strdup(evr), relation, 0);
-
-- rc1 = pkg_match_req(pkg, req, 1) ? 1:0;
-- printf("P %s[%d] match %s ? %s\n", pkg_snprintf_s(pkg),
-- pkg->epoch, capreq_snprintf_s(req),
-- rc1 ? "YES" : "NO");
-+ rc = pkg_match_req(pkg, req, 1) ? 1:0;
-+ printf("pkg %s match req %s ? %s\n", pkg_snprintf_epoch_s(pkg),
-+ capreq_snprintf_s(req), rc ? "YES" : "NO");
-+
-+ rc = cap_match_req(cap, req, 1) ? 1:0;
-+ printf("cap %s match req %s ? %s\n", capreq_snprintf_s0(cap),
-+ capreq_snprintf_s(req), rc ? "YES" : "NO");
-
- return 1;
- }
-
-
--int test_match2(void)
-+int dotest(void)
- {
- printf("\n");
-- test_match_(0, "1.2", "1", "0:1.1", REL_GT);
-- test_match_(3, "1.2", "1", "0:1.1", REL_GT);
-- test_match_(0, "1.2", "1", "3:1.1", REL_GT);
-+ test_match(1, "5.8.2", "2", "0:5.00403", REL_GT);
-+ test_match(3, "1.2", "1", "0:1.1", REL_GT);
-+ test_match(0, "1.2", "1", "3:1.1", REL_GT);
- printf("\n");
-- test_match_(0, "1.2", "1", "1:1.1", REL_GT);
-- test_match_(1, "1.2", "1", "0:1.1", REL_GT);
-+ test_match(0, "1.2", "1", "1:1.1", REL_GT);
-+ test_match(1, "1.2", "1", "0:1.1", REL_GT);
-
- printf("\n");
-- test_match_(0, "1.2", "1", "0:1.2", REL_EQ);
-- test_match_(3, "1.2", "1", "0:1.2", REL_EQ);
-- test_match_(0, "1.2", "1", "3:1.2", REL_EQ);
-+ test_match(0, "1.2", "1", "0:1.2", REL_EQ);
-+ test_match(3, "1.2", "1", "0:1.2", REL_EQ);
-+ test_match(0, "1.2", "1", "3:1.2", REL_EQ);
- printf("\n");
-- test_match_(0, "1.2", "1", "1:1.2", REL_EQ);
-- test_match_(1, "1.2", "1", "0:1.2", REL_EQ);
-+ test_match(0, "1.2", "1", "1:1.2", REL_EQ);
-+ test_match(1, "1.2", "1", "0:1.2", REL_EQ);
-
- printf("\n");
-- test_match_(0, "1.2", "1", "1:2.2", REL_EQ | REL_GT);
-- test_match_(1, "1.2", "1", "1:1.2", REL_EQ | REL_GT);
-- test_match_(1, "1.2", "1", "2:1.2", REL_EQ | REL_GT);
-- test_match_(2, "1.2", "1", "2:1.2", REL_EQ | REL_GT);
-- test_match_(3, "1.2", "1", "2:1.2", REL_EQ | REL_GT);
-+ test_match(0, "1.2", "1", "1:2.2", REL_EQ | REL_GT);
-+ test_match(1, "1.2", "1", "1:1.2", REL_EQ | REL_GT);
-+ test_match(1, "1.2", "1", "2:1.2", REL_EQ | REL_GT);
-+ test_match(2, "1.2", "1", "2:1.2", REL_EQ | REL_GT);
-+ test_match(3, "1.2", "1", "2:1.2", REL_EQ | REL_GT);
- return 0;
- }
-
-@@ -136,8 +141,12 @@
- int main(int argc, char *argv[])
- {
- rpmdb db;
-- //test_expand_env(argc, argv);
-- //test_match2();
-+ log_init(NULL, stdout, "");
-+
-+ if (argc > 1 && strcmp(argv[1], "--promote") == 0)
-+ poldek_conf_promote_epoch = 1;
-+ dotest();
-+ exit(0);
- log_init(NULL, stdout, "aa");
- rpm_initlib(NULL);
- db = rpm_opendb("/var/lib/rpm", "/", O_RDONLY);
-Index: installer/poldek/usrset.c
-diff -u installer/poldek/usrset.c:1.12 installer/poldek/usrset.c:1.12.6.1
---- installer/poldek/usrset.c:1.12 Thu Apr 25 18:34:12 2002
-+++ installer/poldek/usrset.c Tue Dec 30 19:19:52 2003
-@@ -7,7 +7,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <ctype.h>
-@@ -184,7 +184,7 @@
- if (release == NULL)
- release = "";
-
-- pdef->pkg = pkg_new(name, epoch, version, release, NULL, NULL,
-+ pdef->pkg = pkg_new(name, epoch, version, release, NULL, NULL, NULL,
- 0, 0, 0);
- }
-
-Index: installer/poldek/vfcompr
-diff -u /dev/null installer/poldek/vfcompr:1.1.2.1
---- /dev/null Fri Jan 9 13:45:49 2004
-+++ installer/poldek/vfcompr Fri Dec 19 02:29:31 2003
-@@ -0,0 +1,77 @@
-+#! /bin/sh
-+# $Id$
-+
-+PATH="/bin:/sbin:/usr/bin:/usr/sbin"
-+
-+compr() {
-+ typeset src=$1
-+ typeset dest=$2
-+
-+ cmd="bzip2 --stdout ${src}"
-+ if echo ${dest} | egrep ".gz" >/dev/null; then
-+ cmd="gzip -9nf --stdout ${src}"
-+ fi
-+ echo "$cmd > $dest"
-+ $cmd > $dest && rm -f $src
-+}
-+
-+uncompr() {
-+ typeset src=$1
-+ typeset dest=$2
-+
-+ cmd="bunzip2 --keep --stdout ${src}"
-+ if echo ${src} | egrep ".gz" >/dev/null; then
-+ cmd="gunzip --stdout ${src}"
-+ fi
-+ echo "$cmd > $dest"
-+ #echo -e "$cmd\n -> ${dest}"
-+ $cmd > ${dest}
-+}
-+
-+usage() {
-+ echo "usage: `basename $0` FILE DESTFILE[.gz][.bz2]"
-+ echo " `basename $0` -d FILE DESTFILE[.gz][.bz2]"
-+}
-+
-+if [ "$#" -lt 2 ]; then
-+ usage
-+ exit 0
-+fi
-+
-+un=$1
-+if [ "$un" == "-d" ]; then
-+ src=$2
-+ if [ "$#" -lt 3 ]; then
-+ usage
-+ exit 1
-+ fi
-+ dest=$3
-+else
-+ src=$1
-+ dest=$2
-+ un=""
-+fi
-+
-+
-+#if [ ! -r $src -o ! -f $src ]; then
-+# echo "$src: no such file"
-+# exit 1
-+#fi
-+
-+if [ -r $dest ]; then
-+ echo "$dest: file exists"
-+ exit 1
-+fi
-+
-+
-+if [ $dest == $src ]; then
-+ echo "dest and src are the same"
-+ exit 1
-+fi
-+
-+if [ -z "$un" ]; then
-+ compr $src $dest
-+else
-+ uncompr $src $dest
-+fi
-+
-Index: installer/poldek/vfuncompr
-diff -u installer/poldek/vfuncompr:1.1 installer/poldek/vfuncompr:removed
---- installer/poldek/vfuncompr:1.1 Mon Apr 8 03:14:41 2002
-+++ installer/poldek/vfuncompr Fri Jan 9 13:45:49 2004
-@@ -1,38 +0,0 @@
--#! /bin/sh
--# $Id$
--
--PATH="/bin:/sbin:/usr/bin:/usr/sbin"
--
--if [ "$#" != "2" ]; then
-- echo "usage: `basename $0` FILE[.gz][.bz2] DESTFILE"
-- exit 1
--fi
--
--src=$1
--dest=$2
--
--cmd="bunzip2 --keep --stdout ${src}"
--if echo ${src} | egrep ".gz" >/dev/null; then
-- cmd="gunzip --stdout ${src}"
--fi
--
--if [ ! -r $src -o ! -f $src ]; then
-- echo "$src: no such file"
-- exit 1
--fi
--
--if [ -r $dest ]; then
-- echo "$dest: file exists"
-- exit 1
--fi
--
--if [ $dest == $src ]; then
-- echo "dest and src are the same"
-- exit 1
--fi
--
--
--echo -e "$cmd\n -> ${dest}"
--$cmd > ${dest}
--
--
-Index: installer/poldek/conf/rh.src
-diff -u installer/poldek/conf/rh.src:1.4 installer/poldek/conf/rh.src:1.4.6.1
---- installer/poldek/conf/rh.src:1.4 Mon Jun 3 17:27:04 2002
-+++ installer/poldek/conf/rh.src Thu Sep 18 01:43:01 2003
-@@ -1,21 +1,21 @@
--# $Id$
-+# $Id$
-
-+# RedHat 9
-+source1 = rh,noautoup,type=hdrl,pri=-1 \
-+ ftp://ftp.uninett.no/pub/linux/apt/redhat/9/en/i386/redhat/base/pkglist.os.bz2
-
--# RedHat 7.3; package info is taken from hdlist file
--source1 = rh,noautoup,type=hdrl \
-- ftp://ftp.redhat.com/pub/redhat/redhat-7.3-en/os/i386/RedHat/base/hdlist
-+prefix1 = ftp://ftp.uninett.no/pub/linux/apt/redhat/9/en/i386/redhat/RPMS.os
-
--prefix1 = ftp://ftp.redhat.com/pub/redhat/redhat-7.3-en/os/i386/RedHat/RPMS/
-+source2 = rh-up,noautoup,type=hdrl,pri=-1 \
-+ ftp://ftp.uninett.no/pub/linux/apt/redhat/9/en/i386/redhat/base/pkglist.updates-os.bz2
-
-+prefix2 = ftp://ftp.uninett.no/pub/linux/apt/redhat/9/en/i386/redhat/RPMS.updates-os
-
--# RedHat 7.2; package info is taken from hdlist file
--source2 = rh7.2,noautoup,type=hdrl \
-- ftp://ftp.redhat.com/pub/redhat/redhat-7.2-en/os/i386/RedHat/base/hdlist
-
--prefix2 = ftp://ftp.redhat.com/pub/redhat/redhat-7.2-en/os/i386/RedHat/RPMS/
-
--# RedHat 6.2
--source3 = rh6.2,noautoup,noauto,type=hdrl \
-- ftp://ftp.redhat.com/pub/redhat/redhat-6.2-en/os/i386/RedHat/base/hdlist
-+# RedHat 8
-+source8 = rh8,noautoup,noauto,type=hdrl \
-+ ftp://ftp.uninett.no/pub/linux/apt/redhat/8.0/en/i386/redhat/base/pkglist.os.bz2
-+
-+prefix8 = ftp://ftp.uninett.no/pub/linux/apt/redhat/8.0/en/i386/redhat/RPMS.os
-
--prefix3 = ftp://ftp.redhat.com/pub/redhat/redhat-6.2-en/os/i386/RedHat/RPMS/
-Index: installer/poldek/shell/desc.c
-diff -u installer/poldek/shell/desc.c:1.18 installer/poldek/shell/desc.c:1.18.4.1
---- installer/poldek/shell/desc.c:1.18 Thu Nov 7 17:43:28 2002
-+++ installer/poldek/shell/desc.c Sun Dec 7 22:30:46 2003
-@@ -7,7 +7,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <time.h>
-@@ -665,6 +665,7 @@
- char unit = 'K';
- const char *group;
- double pkgsize;
-+ time_t tmpt;
-
-
- if ((pkgu = pkg_info(pkg)) == NULL) {
-@@ -674,10 +675,11 @@
- }
-
-
-- if (pkg->btime)
-+ if (pkg->btime) {
-+ tmpt = pkg->btime;
- strftime(timbuf, sizeof(timbuf), "%Y/%m/%d %H:%M",
-- localtime((time_t*)&pkg->btime));
-- else
-+ localtime(&tmpt));
-+ } else
- *timbuf = '\0';
-
- if (pkgu->summary) {
-Index: installer/poldek/shell/ls.c
-diff -u installer/poldek/shell/ls.c:1.20 installer/poldek/shell/ls.c:1.20.4.1
---- installer/poldek/shell/ls.c:1.20 Thu Nov 7 17:43:28 2002
-+++ installer/poldek/shell/ls.c Sun Dec 7 22:30:46 2003
-@@ -7,7 +7,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <string.h>
-@@ -393,6 +393,7 @@
- char sizbuf[30];
- char unit = 'K';
- double pkgsize = pkg->size/1024;
-+ time_t tmpt;
-
- if (pkgsize >= 1024) {
- pkgsize /= 1024;
-@@ -401,10 +402,11 @@
-
- snprintf(sizbuf, sizeof(sizbuf), "%.1f %cB", pkgsize, unit);
-
-- if (pkg->btime)
-+ if (pkg->btime) {
-+ tmpt = pkg->btime;
- strftime(timbuf, sizeof(timbuf), "%Y/%m/%d %H:%M",
-- localtime((time_t*)&pkg->btime));
-- else
-+ localtime(&tmpt));
-+ } else
- *timbuf = '\0';
-
- if ((flags & OPT_LS_UPGRADEABLE) == 0) {
-Index: installer/poldek/vfile/uncompr.c
-diff -u installer/poldek/vfile/uncompr.c:1.2 installer/poldek/vfile/uncompr.c:1.2.6.1
---- installer/poldek/vfile/uncompr.c:1.2 Wed Apr 17 00:33:40 2002
-+++ installer/poldek/vfile/uncompr.c Fri Dec 19 02:16:56 2003
-@@ -10,7 +10,7 @@
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
--/* $Id$ */
-+/* $Id$ */
-
- #include <ctype.h>
- #include <errno.h>
-@@ -44,8 +44,8 @@
- };
-
- struct uncompr uncompr_tab[] = {
-- { COMPRESST_BZIP2, "/usr/bin/vfuncompr", "bz2" },
-- { COMPRESST_GZIP, "/usr/bin/vfuncompr", "gz" },
-+ { COMPRESST_BZIP2, "/usr/bin/vfcompr", "bz2" },
-+ { COMPRESST_GZIP, "/usr/bin/vfcompr", "gz" },
- { 0, NULL, NULL }
- };
-
-@@ -101,7 +101,8 @@
-
-
- static
--int vf_do_uncompr(struct uncompr *uncompr, const char *src, const char *dst)
-+int vf_do_compr(struct uncompr *uncompr, const char *param,
-+ const char *src, const char *dst)
- {
- char **argv;
- struct p_open_st pst;
-@@ -112,16 +113,15 @@
- argv = alloca(sizeof(*argv) * 10);
- n = 0;
- argv[n++] = uncompr->cmd;
-+ if (param)
-+ argv[n++] = (char*)param;
-+
- argv[n++] = (char*)src;
- argv[n++] = (char*)dst;
- argv[n++] = NULL;
-
-- if (*vfile_verbose)
-- vfile_msg_fn(_("Uncompressing %s...\n"), n_basenam(src));
--
- p_st_init(&pst);
-
--
- verbose = *vfile_verbose;
- if (p_open(&pst, p_open_flags, uncompr->cmd, argv) == NULL) {
- vfile_err_fn("p_open: %s\n", pst.errmsg);
-@@ -185,8 +185,36 @@
- return -1;
-
- vf_localunlink(destpath);
-+ if (*vfile_verbose)
-+ vfile_msg_fn(_("Uncompressing %s...\n"), n_basenam(path));
-+ return vf_do_compr(uncompr, "-d", path, destpath);
-+}
-+
-+
-+int vf_compr_do(const char *path, const char *ext)
-+{
-+ struct uncompr *uncompr;
-+ char destpath[PATH_MAX];
-+ int i;
-+
-
-- return vf_do_uncompr(uncompr, path, destpath);
-+ uncompr = NULL;
-+ i = 0;
-+ while (uncompr_tab[i].type > 0) {
-+ if (strcmp(ext, uncompr_tab[i].ext) == 0)
-+ uncompr = &uncompr_tab[i];
-+ i++;
-+ }
-+
-+
-+ if (uncompr == NULL)
-+ return -1;
-+
-+ snprintf(destpath, sizeof(destpath), "%s.%s", path, ext);
-+ unlink(destpath);
-+ if (*vfile_verbose)
-+ vfile_msg_fn(_("Compressing %s...\n"), n_basenam(path));
-+ return vf_do_compr(uncompr, NULL, path, destpath);
- }
-
-
-Index: installer/poldek/vfile/vfile.c
-diff -u installer/poldek/vfile/vfile.c:1.43 installer/poldek/vfile/vfile.c:1.43.4.2
---- installer/poldek/vfile/vfile.c:1.43 Tue Oct 29 17:55:56 2002
-+++ installer/poldek/vfile/vfile.c Mon Dec 29 21:11:14 2003
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
- #ifdef HAVE_CONFIG_H
- # include "config.h"
-@@ -491,8 +491,19 @@
- rpath = path;
-
- if (vfmode & VFM_UNCOMPR) {
-- if ((rpath = vfuncompr(path, buf, sizeof(buf))) == NULL)
-- return 0;
-+ if (vfmode & VFM_RW) {
-+ if (vf_uncompr_able(path)) {
-+ char *p;
-+ n_snprintf(buf, sizeof(buf), path);
-+ p = strrchr(buf, '.');
-+ n_assert(p);
-+ *p = '\0';
-+ rpath = buf;
-+ }
-+ } else {
-+ if ((rpath = vfuncompr(path, buf, sizeof(buf))) == NULL)
-+ return 0;
-+ }
- }
-
- if (openvf(&vf, rpath, vfmode))
-@@ -646,6 +657,18 @@
- n_assert(0);
- }
-
-+ if (vf->vf_path && (vf->vf_mode & VFM_UNCOMPR) && (vf->vf_mode & VFM_RW)) {
-+ if (vf_uncompr_able(vf->vf_path)) {
-+ char src[PATH_MAX], *p;
-+ snprintf(src, sizeof(src), vf->vf_path);
-+ p = strrchr(src, '.');
-+ n_assert(p);
-+ *p = '\0';
-+ vf_compr_do(src, "gz");
-+ }
-+
-+ }
-+
- if (vf->vf_path) {
- free(vf->vf_path);
- vf->vf_path = NULL;
-Index: installer/poldek/vfile/vfile.h
-diff -u installer/poldek/vfile/vfile.h:1.29 installer/poldek/vfile/vfile.h:1.29.4.1
---- installer/poldek/vfile/vfile.h:1.29 Thu Nov 7 17:43:29 2002
-+++ installer/poldek/vfile/vfile.h Fri Dec 19 02:16:56 2003
-@@ -10,7 +10,7 @@
- 59 Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
--/* $Id$ */
-+/* $Id$ */
-
- #ifndef POLDEK_VFILE_H
- #define POLDEK_VFILE_H
-@@ -195,6 +195,7 @@
-
-
- int vf_uncompr_able(const char *path);
-+int vf_compr_do(const char *path, const char *ext);
- int vf_uncompr_do(const char *path, const char *destpath);
-
- void vf_sigint_cb(void);
diff --git a/poldek-distver.patch b/poldek-distver.patch
deleted file mode 100644
index 92916b9..0000000
--- a/poldek-distver.patch
+++ /dev/null
@@ -1,473 +0,0 @@
---- poldek-0.18.6.orig/conf.c 2004-09-15 16:03:02.000000000 +0000
-+++ poldek-0.18.6/conf.c 2004-09-15 18:56:34.000000000 +0000
-@@ -83,6 +83,7 @@
- { "ftp_sysuser_as_anon_passwd", TYPE_BOOL , { 0 } },
- { "vfile_external_compress", TYPE_BOOL, { 0 } },
- { "promoteepoch", TYPE_BOOL, { 0 } },
-+ { "nodistver", TYPE_BOOL, { 0 } },
- { NULL, 0, { 0 } },
- };
-
---- poldek-0.18.6.orig/main.c 2004-09-15 16:03:02.000000000 +0000
-+++ poldek-0.18.6/main.c 2004-09-15 19:32:03.000000000 +0000
-@@ -247,6 +247,7 @@
- #define OPT_ASK 2006
- #define OPT_NOASK 2007
- #define OPT_RPMOPT 2008
-+#define OPT_NODISTVER 2009
- #define OPT_MERGE 2101
- #define OPT_SW_V016 (1 << 0)
- #define OPT_SW_NOASK (1 << 1)
-@@ -459,6 +460,8 @@
-
- {"conf", OPT_CONF, "FILE", 0, N_("Read configuration from FILE"), 500 },
- {"noconf", OPT_NOCONF, 0, 0, N_("Do not read configuration"), 500 },
-+{"nodistver", OPT_NODISTVER, 0, 0, N_("Do not check distribution versions"),
-+ 500 },
-
- {"version", OPT_BANNER, 0, 0, N_("Display program version information and exit"), 500 },
- {"log", OPT_LOG, "FILE", 0, N_("Log program messages to FILE"), 500 },
-@@ -850,6 +853,12 @@
- n_array_push(argsp->inst.rpmacros, arg);
- break;
-
-+ case OPT_NODISTVER:
-+ n_assert(argsp->inst.rpmacros);
-+ n_array_push(argsp->inst.rpmacros,
-+ n_strdup("_dont_compare_distversion 1"));
-+ no_distver=1;
-+ break;
-
- case OPT_INST_FETCH:
- if (arg)
-@@ -1385,6 +1394,15 @@
- if (conf_get_bool(htcnf, "particle_install", 1))
- args.inst.flags |= INSTS_PARTICLE;
-
-+ if (no_distver == 0) { /* no --nodistver specified */
-+ if (conf_get_bool(htcnf, "nodistver", 0))
-+ {
-+ n_assert(args.inst.rpmacros);
-+ n_array_push(args.inst.rpmacros,
-+ n_strdup("_dont_compare_distversion 1"));
-+ no_distver = 1;
-+ }
-+ }
-
- if ((args.inst.flags & INSTS_GREEDY) == 0) { /* no --greedy specified */
- if (conf_get_bool(htcnf, "greedy", 1))
---- poldek-0.18.6.orig/misc.h 2004-06-28 20:19:28.000000000 +0000
-+++ poldek-0.18.6/misc.h 2004-09-15 17:09:29.000000000 +0000
-@@ -11,6 +11,8 @@
- #include <vfile/p_open.h>
- #include <trurl/narray.h>
-
-+extern int no_distver;
-+
- const char *ngettext_n_packages_fmt(int n);
- void translate_argp_options(struct argp_option *arr);
-
---- poldek-0.18.6.orig/pkg.c 2004-09-15 16:03:02.000000000 +0000
-+++ poldek-0.18.6/pkg.c 2004-09-15 17:19:00.000000000 +0000
-@@ -49,13 +49,13 @@
- struct pkg *pkg_new(const char *name, int32_t epoch,
- const char *version, const char *release,
- const char *arch, const char *os,
-- const char *fn,
-+ const char *fn, const char *dist,
- uint32_t size, uint32_t fsize,
- uint32_t btime)
- {
- struct pkg *pkg;
- int name_len = 0, version_len = 0, release_len = 0,
-- arch_len = 0, os_len = 0, fn_len = 0;
-+ arch_len = 0, os_len = 0, fn_len = 0, dist_len = 0;
- char *buf;
- int len;
-
-@@ -85,6 +85,11 @@
- len += os_len + 1;
- }
-
-+ if(dist) {
-+ dist_len = strlen(dist);
-+ len += dist_len + 1;
-+ }
-+
- if (fn && arch) {
- char pkg_fn[1024];
-
-@@ -142,6 +147,14 @@
- *buf++ = '\0';
- }
-
-+ pkg->dist=NULL;
-+ if(dist) {
-+ pkg->dist = buf;
-+ memcpy(buf, dist, dist_len);
-+ buf += dist_len;
-+ *buf++ = '\0';
-+ }
-+
- pkg->fn = NULL;
- if (fn) {
- pkg->fn = buf;
-@@ -248,6 +261,7 @@
- struct pkg *pkg;
- uint32_t *epoch, *size, *btime;
- char *name, *version, *release, *arch = NULL, *os = NULL;
-+ char *dist = NULL;
- int type;
-
- headerNVR(h, (void*)&name, (void*)&version, (void*)&release);
-@@ -267,6 +281,13 @@
- if (type != RPM_STRING_TYPE)
- arch = NULL;
-
-+ if (!headerGetEntry(h, RPMTAG_DISTRIBUTION, &type, (void *)&dist, NULL)) {
-+ dist = NULL;
-+ }
-+
-+ if (type != RPM_STRING_TYPE)
-+ dist = NULL;
-+
- if (!headerGetEntry(h, RPMTAG_OS, &type, (void *)&os, NULL)) {
- if (verbose > 1)
- logn(LOGWARN, _("%s: missing OS tag"), fname);
-@@ -282,7 +303,7 @@
- btime = NULL;
-
- pkg = pkg_new(name, epoch ? *epoch : 0, version, release, arch, os,
-- fname ? n_basenam(fname) : NULL,
-+ fname ? n_basenam(fname) : NULL, dist,
- size ? *size : 0, fsize, btime ? *btime : 0);
-
- if (pkg == NULL)
-@@ -444,6 +465,19 @@
- return pkg_cmp_ver(p1, p2);
- }
-
-+int pkg_cmp_dist_evr(const struct pkg *p1, const struct pkg *p2)
-+{
-+ int rc;
-+
-+ if(p1->dist && p2->dist)
-+ {
-+ rc = rpmdistcmp(p1->dist, p2->dist);
-+ if(rc != 0)
-+ return rc;
-+ }
-+
-+ return pkg_cmp_evr(p1, p2);
-+}
-
- int pkg_cmp_evr(const struct pkg *p1, const struct pkg *p2)
- {
-@@ -487,6 +521,15 @@
- //return rc;
- }
-
-+int pkg_cmp_name_dist_evr_rev(const struct pkg *p1, const struct pkg *p2)
-+{
-+ register int rc;
-+
-+ if ((rc = pkg_cmp_name(p1, p2)))
-+ return rc;
-+
-+ return -pkg_cmp_dist_evr(p1, p2);
-+}
-
- int pkg_cmp_name_evr_rev_srcpri(const struct pkg *p1, const struct pkg *p2)
- {
-@@ -612,6 +655,15 @@
- return pkg_cmp_name_evr_rev(p1, p2);
- }
-
-+int pkg_cmp_dist_pri(struct pkg *p1, struct pkg *p2)
-+{
-+ register int cmprc = 0;
-+
-+ if ((cmprc = p1->pri - p2->pri))
-+ return cmprc;
-+
-+ return pkg_cmp_name_dist_evr_rev(p1, p2);
-+}
-
- int pkg_cmp_btime(struct pkg *p1, struct pkg *p2)
- {
-@@ -1352,8 +1404,12 @@
- {
- tn_array *arr;
-
-- arr = n_array_new(size, (tn_fn_free)pkg_free,
-+ if(no_distver)
-+ arr = n_array_new(size, (tn_fn_free)pkg_free,
- (tn_fn_cmp)pkg_cmp_name_evr_rev);
-+ else
-+ arr = n_array_new(size, (tn_fn_free)pkg_free,
-+ (tn_fn_cmp)pkg_cmp_name_dist_evr_rev);
- n_array_ctl(arr, TN_ARRAY_AUTOSORTED);
- return arr;
- }
---- poldek-0.18.6.orig/pkg.h 2004-03-22 17:31:51.000000000 +0000
-+++ poldek-0.18.6/pkg.h 2004-09-15 16:11:48.000000000 +0000
-@@ -107,6 +107,7 @@
- char *arch;
- char *os;
- char *fn;
-+ char *dist;
-
- tn_array *caps; /* capabilities */
- tn_array *reqs; /* requirements */
-@@ -144,7 +145,7 @@
- struct pkg *pkg_new(const char *name, int32_t epoch,
- const char *version, const char *release,
- const char *arch, const char *os,
-- const char *fn,
-+ const char *fn, const char *dist,
- uint32_t size, uint32_t fsize,
- uint32_t btime);
-
-@@ -181,6 +182,7 @@
- int pkg_cmp_name_evr_rev_srcpri(const struct pkg *p1, const struct pkg *p2);
-
- int pkg_cmp_pri(struct pkg *p1, struct pkg *p2);
-+int pkg_cmp_dist_pri(struct pkg *p1, struct pkg *p2);
-
- int pkg_cmp_btime(struct pkg *p1, struct pkg *p2);
- int pkg_cmp_btime_rev(struct pkg *p1, struct pkg *p2);
---- poldek-0.18.6.orig/pkgdir.c 2004-05-06 07:57:31.000000000 +0000
-+++ poldek-0.18.6/pkgdir.c 2004-09-15 17:52:26.000000000 +0000
-@@ -55,6 +55,7 @@
-
- int pkgdir_v016compat = 0; /* public */
- int pkgdir_redhat9_zlib_in_rpm_workaround = 0;
-+int no_distver = 0;
-
- #define PKGT_HAS_NAME (1 << 0)
- #define PKGT_HAS_EVR (1 << 1)
-@@ -69,6 +70,7 @@
- #define PKGT_HAS_BTIME (1 << 11)
- #define PKGT_HAS_GROUPID (1 << 12)
- #define PKGT_HAS_FN (1 << 13)
-+#define PKGT_HAS_DIST (1 << 14)
-
- struct pkgtags_s {
- unsigned flags;
-@@ -77,6 +79,7 @@
- char arch[64];
- char os[64];
- char fn[1024];
-+ char dist[64];
- uint32_t size;
- uint32_t fsize;
- uint32_t btime;
-@@ -1093,6 +1096,7 @@
- case 'A':
- case 'O':
- case 'n':
-+ case 'D':
- if (!add2pkgtags(&pkgt, *line, val, pkgdir->path, offs)) {
- nerr++;
- goto l_end;
-@@ -1320,6 +1324,16 @@
- }
- break;
-
-+ case 'D':
-+ if (pkgt->flags & PKGT_HAS_DIST) {
-+ logn(LOGERR, errmg_double_tag, pathname, offs, tag);
-+ err++;
-+ } else {
-+ memcpy(pkgt->dist, value, sizeof(pkgt->dist) - 1);
-+ pkgt->dist[ sizeof(pkgt->dist) - 1 ] = '\0';
-+ pkgt->flags |= PKGT_HAS_DIST;
-+ }
-+ break;
-
- case 'S':
- if (pkgt->flags & PKGT_HAS_SIZE) {
-@@ -1393,7 +1407,7 @@
- struct pkg *pkg_new_from_tags(struct pkgtags_s *pkgt)
- {
- struct pkg *pkg;
-- char *version, *release, *arch = NULL, *os = NULL, *fn = NULL;
-+ char *version, *release, *arch = NULL, *os = NULL, *fn = NULL, *dist = NULL;
- int32_t epoch;
-
- if (!(pkgt->flags & (PKGT_HAS_NAME | PKGT_HAS_EVR)))
-@@ -1407,6 +1421,9 @@
-
- if (pkgt->flags & PKGT_HAS_FN)
- fn = pkgt->fn;
-+
-+ if (pkgt->flags & PKGT_HAS_DIST)
-+ dist = pkgt->dist;
-
- if (*pkgt->name == '\0' || *pkgt->evr == '\0' || *pkgt->arch == '\0')
- return NULL;
-@@ -1419,7 +1436,7 @@
- return NULL;
- }
-
-- pkg = pkg_new(pkgt->name, epoch, version, release, arch, os, fn,
-+ pkg = pkg_new(pkgt->name, epoch, version, release, arch, os, fn, dist,
- pkgt->size, pkgt->fsize, pkgt->btime);
- pkg->groupid = pkgt->groupid;
-
-@@ -1488,7 +1505,7 @@
-
- if (*p && parse_nevr(p, &name, &epoch, &ver, &rel)) {
- struct pkg *pkg = pkg_new(name, epoch, ver, rel, NULL, NULL, NULL,
-- 0, 0, 0);
-+ NULL, 0, 0, 0);
- n_array_push(pkgs, pkg);
- }
- }
---- poldek-0.18.6.orig/pkgdir_save.c 2004-05-05 16:56:43.000000000 +0000
-+++ poldek-0.18.6/pkgdir_save.c 2004-09-15 19:28:21.000000000 +0000
-@@ -170,6 +170,9 @@
-
- if (pkg->fn)
- fprintf(stream, "n: %s\n", pkg->fn);
-+
-+ if (pkg->dist && !no_distver)
-+ fprintf(stream, "D: %s\n", pkg->dist);
-
- fprintf(stream, "F:\n");
- store_pkg_fields(stream, pkg->size, pkg->fsize, pkg->btime, pkg->groupid);
---- poldek-0.18.6.orig/pkgset-install.c 2004-09-15 16:03:02.000000000 +0000
-+++ poldek-0.18.6/pkgset-install.c 2004-09-15 17:20:34.000000000 +0000
-@@ -1995,7 +1995,7 @@
- if (is_installed == 0)
- n_array_push(iinf->uninstalled_pkgs,
- pkg_new(pkg->name, pkg->epoch, pkg->ver, pkg->rel,
-- pkg->arch, pkg->os, NULL,
-+ pkg->arch, pkg->os, NULL, NULL,
- pkg->size, pkg->fsize,
- pkg->btime));
- }
-@@ -2186,10 +2186,14 @@
- struct upgrade_s *upg = upgptr;
- struct pkg *pkg, tmpkg;
- uint32_t *epoch;
-- int i, cmprc;
-+ int i, cmprc, type, count;
-
-
- recno = recno;
-+
-+ if (!(headerGetEntry(h, RPMTAG_DISTRIBUTION, &type, (void *)&tmpkg.dist,
-+ &count) && type == RPM_STRING_TYPE && count == 1))
-+ tmpkg.dist=NULL;
-
- if (!rpmhdr_nevr(h, &tmpkg.name, &epoch, &tmpkg.ver, &tmpkg.rel)) {
- logn(LOGERR, _("db package header corrupted (!?)"));
-@@ -2205,7 +2209,10 @@
- }
-
- pkg = n_array_nth(upg->avpkgs, i);
-- cmprc = pkg_cmp_evr(pkg, &tmpkg);
-+ if(no_distver)
-+ cmprc = pkg_cmp_evr(pkg, &tmpkg);
-+ else
-+ cmprc = pkg_cmp_dist_evr(pkg, &tmpkg);
- if (verbose) {
- if (cmprc == 0)
- msg(3, "%-32s up to date\n", pkg_snprintf_s(&tmpkg));
---- poldek-0.18.6.orig/rpm.c 2004-09-15 16:03:02.000000000 +0000
-+++ poldek-0.18.6/rpm.c 2004-09-15 17:24:02.000000000 +0000
-@@ -519,6 +519,36 @@
- return n;
- }
-
-+static
-+int hdr_pkg_cmp_dist_evr(Header h, const struct pkg *pkg)
-+{
-+ int rc;
-+ struct pkg tmpkg;
-+ uint32_t *epoch;
-+ int count;
-+ int type;
-+
-+ if (!(headerGetEntry(h, RPMTAG_DISTRIBUTION, &type, (void *)&tmpkg.dist,
-+ &count) && type == RPM_STRING_TYPE && count == 1))
-+ tmpkg.dist=NULL;
-+
-+ headerNVR(h, (void*)&tmpkg.name, (void*)&tmpkg.ver,
-+ (void*)&tmpkg.rel);
-+
-+ if (tmpkg.name == NULL || tmpkg.ver == NULL || tmpkg.rel == NULL) {
-+ logn(LOGERR, "headerNVR() failed");
-+ return 0;
-+ }
-+
-+ if (headerGetEntry(h, RPMTAG_EPOCH, &rc, (void *)&epoch, NULL))
-+ tmpkg.epoch = *epoch;
-+ else
-+ tmpkg.epoch = 0;
-+
-+ rc = pkg_cmp_dist_evr(&tmpkg, pkg);
-+
-+ return rc;
-+}
-
- static
- int hdr_pkg_cmp_evr(Header h, const struct pkg *pkg)
-@@ -566,7 +596,10 @@
-
- } else {
- if (cmprc)
-- *cmprc = -hdr_pkg_cmp_evr(dbrec->h, pkg);
-+ if(no_distver)
-+ *cmprc = -hdr_pkg_cmp_evr(dbrec->h, pkg);
-+ else
-+ *cmprc = -hdr_pkg_cmp_dist_evr(dbrec->h, pkg);
-
- if (dbrecp) {
- dbrecp->recno = dbrec->recno;
---- poldek-0.18.6.orig/shell/shell.c 2004-09-15 16:03:02.000000000 +0000
-+++ poldek-0.18.6/shell/shell.c 2004-09-15 17:18:04.000000000 +0000
-@@ -997,7 +997,10 @@
- return 0;
-
- if (compare_ver == 0)
-- *cmprc = pkg_cmp_evr(lshpkg->pkg, shpkg->pkg);
-+ if(no_distver)
-+ *cmprc = pkg_cmp_evr(lshpkg->pkg, shpkg->pkg);
-+ else
-+ *cmprc = pkg_cmp_dist_evr(lshpkg->pkg, shpkg->pkg);
- else
- *cmprc = pkg_cmp_ver(lshpkg->pkg, shpkg->pkg);
-
---- poldek-0.18.6.orig/test_match.c 2004-05-05 16:57:09.000000000 +0000
-+++ poldek-0.18.6/test_match.c 2004-09-15 16:11:48.000000000 +0000
-@@ -49,7 +49,7 @@
- struct capreq *cap;
-
- pkg = pkg_new("poldek", epoch, versions[i], relases[j],
-- NULL, NULL, NULL, 0, 0, 0);
-+ NULL, NULL, NULL, NULL, 0, 0, 0);
- cap = capreq_new("poldek", epoch, versions[i++], relases[j++],
- REL_EQ, 0);
- k = 0;
-@@ -83,7 +83,7 @@
- struct capreq *req, *cap;
- int rc;
-
-- pkg = pkg_new("poldek", epoch, ver, rel, NULL, NULL, NULL, 0, 0, 0);
-+ pkg = pkg_new("poldek", epoch, ver, rel, NULL, NULL, NULL, NULL, 0, 0, 0);
- cap = capreq_new("poldek", epoch, ver, rel, REL_EQ, 0);
-
- req = capreq_new_evr("poldek", n_strdup(evr), relation, 0);
---- poldek-0.18.6.orig/usrset.c 2004-09-15 16:03:02.000000000 +0000
-+++ poldek-0.18.6/usrset.c 2004-09-15 16:11:48.000000000 +0000
-@@ -185,7 +185,7 @@
- release = "";
-
- pdef->pkg = pkg_new(name, epoch, version, release, NULL, NULL, NULL,
-- 0, 0, 0);
-+ NULL, 0, 0, 0);
- }
-
- if (virtname)
diff --git a/poldek-endian.patch b/poldek-endian.patch
deleted file mode 100644
index 9dca5b4..0000000
--- a/poldek-endian.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urN poldek-0.19.0-cvs20050613.22.org/tndb/tndb.c poldek-0.19.0-cvs20050613.22/tndb/tndb.c
---- poldek-0.19.0-cvs20050613.22.org/tndb/tndb.c 2005-05-12 20:21:53.000000000 +0200
-+++ poldek-0.19.0-cvs20050613.22/tndb/tndb.c 2005-09-11 19:57:11.000000000 +0200
-@@ -295,7 +295,7 @@
- if (write)
- return n_stream_write_uint32(st, v);
- else
-- tndb_sign_update(&hdr->sign, &v, sizeof(v));
-+ tndb_sign_update_int32(&hdr->sign, v);
-
- return 1;
- }
diff --git a/poldek-epoch0.patch b/poldek-epoch0.patch
deleted file mode 100644
index 3e4dbf0..0000000
--- a/poldek-epoch0.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-diff -Nur poldek-0.18.1.orig/pkg.c poldek-0.18.1/pkg.c
---- poldek-0.18.1.orig/pkg.c Fri Oct 18 18:19:42 2002
-+++ poldek-0.18.1/pkg.c Sun Nov 23 02:22:57 2003
-@@ -699,8 +699,8 @@
- if ((strcmp(capreq_name(cap), capreq_name(req))) != 0)
- return 0;
-
-- if (capreq_has_epoch(req)) {
-- if (!capreq_has_epoch(cap))
-+ if (capreq_has_epoch(req) || capreq_has_ver(req)) {
-+ if (!(capreq_has_epoch(cap) || capreq_has_ver(cap)))
- return strict == 0;
-
- cmprc = capreq_epoch(cap) - capreq_epoch(req);
-@@ -743,18 +743,13 @@
- if (!capreq_versioned(req))
- return 1;
-
-- if (capreq_has_epoch(req) && pkg->epoch) {
-+ if (capreq_has_epoch(req) && (pkg->epoch || pkg->ver)) {
- cmprc = pkg->epoch - capreq_epoch(req);
- if (cmprc != 0)
- return rel_match(cmprc, req);
- evr = 1;
--
-- } else if (capreq_epoch(req) > 0) {
-- cmprc = 0;
-- evr = 1;
- }
--
--
-+
- if (capreq_has_ver(req)) {
- cmprc = rpmvercmp(pkg->ver, capreq_ver(req));
- if (cmprc != 0)
-diff -Nur poldek-0.18.1.orig/pkgset.c poldek-0.18.1/pkgset.c
---- poldek-0.18.1.orig/pkgset.c Thu Nov 14 19:21:42 2002
-+++ poldek-0.18.1/pkgset.c Sun Nov 23 02:21:01 2003
-@@ -815,7 +815,7 @@
- {
- int rc = 1;
-
-- if (pdef->pkg->epoch && pkg->epoch != pdef->pkg->epoch)
-+ if ((pdef->pkg->epoch /* || pdef->pkg->ver */) && pkg->epoch != pdef->pkg->epoch)
- rc = 0;
-
- if (rc && *pdef->pkg->ver)
diff --git a/poldek-etc_dir.patch b/poldek-etc_dir.patch
deleted file mode 100644
index a4a13f3..0000000
--- a/poldek-etc_dir.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-diff -Nru poldek-0.18.1/conf.c poldek-0.18.1.new/conf.c
---- poldek-0.18.1/conf.c Fri Oct 18 16:19:42 2002
-+++ poldek-0.18.1.new/conf.c Mon Mar 10 07:39:16 2003
-@@ -374,14 +374,23 @@
- tn_hash *ldconf_deafult(void)
- {
- char *homedir;
-+ char *etc_dir;
- char *etcpath = "/etc/poldek.conf";
-
-- if ((homedir = getenv("HOME")) != NULL) {
-+ if ((etc_dir = getenv("HOME_ETC")) != NULL) {
-+ char path[PATH_MAX];
-+
-+ snprintf(path, sizeof(path), "%s/.poldekrc", etc_dir);
-+ if (access(path, R_OK) == 0)
-+ return ldconf(path);
-+ } else {
-+ if ((homedir = getenv("HOME")) != NULL) {
- char path[PATH_MAX];
-
- snprintf(path, sizeof(path), "%s/.poldekrc", homedir);
- if (access(path, R_OK) == 0)
- return ldconf(path);
-+ }
- }
-
- if (access(etcpath, R_OK) == 0)
-diff -Nru poldek-0.18.1/pkgscore.c poldek-0.18.1.new/pkgscore.c
---- poldek-0.18.1/pkgscore.c Fri Nov 22 17:08:53 2002
-+++ poldek-0.18.1.new/pkgscore.c Mon Mar 10 07:44:02 2003
-@@ -40,26 +40,46 @@
-
- if (fpath == NULL) {
- char *homedir;
-+ char *etc_dir;
-
-- if ((homedir = getenv("HOME")) == NULL)
-+ if ((etc_dir = getenv("HOME_ETC")) != NULL) {
-+ switch (type) {
-+ case PKG_HELD:
-+ snprintf(path, sizeof(path), "%s/.poldek-hold", etc_dir);
-+ if (access(path, R_OK) != 0) /* backward compat */
-+ snprintf(path, sizeof(path), "%s/.poldek_hold", etc_dir);
-+
-+ break;
-+
-+ case PKG_IGNORED:
-+ snprintf(path, sizeof(path), "%s/.poldek-ignore", etc_dir);
-+ break;
-+
-+ default:
-+ n_assert(0);
-+ break;
-+ }
-+ } else {
-+ if ((homedir = getenv("HOME")) == NULL)
- return NULL;
-
-- switch (type) {
-- case PKG_HELD:
-- snprintf(path, sizeof(path), "%s/.poldek-hold", homedir);
-- if (access(path, R_OK) != 0) /* backward compat */
-+ switch (type) {
-+ case PKG_HELD:
-+ snprintf(path, sizeof(path), "%s/.poldek-hold", homedir);
-+ if (access(path, R_OK) != 0) /* backward compat */
- snprintf(path, sizeof(path), "%s/.poldek_hold", homedir);
--
-- break;
-+
-+ break;
-+
-+ case PKG_IGNORED:
-+ snprintf(path, sizeof(path), "%s/.poldek-ignore", homedir);
-+ break;
-
-- case PKG_IGNORED:
-- snprintf(path, sizeof(path), "%s/.poldek-ignore", homedir);
-- break;
--
-- default:
-- n_assert(0);
-- break;
-- }
-+ default:
-+ n_assert(0);
-+ break;
-+ }
-+ }
-
- if (access(path, R_OK) != 0)
- return patterns;
-diff -Nru poldek-0.18.1/shell/shell.c poldek-0.18.1.new/shell/shell.c
---- poldek-0.18.1/shell/shell.c Tue Oct 29 16:55:58 2002
-+++ poldek-0.18.1.new/shell/shell.c Mon Mar 10 07:50:21 2003
-@@ -1226,7 +1226,7 @@
-
- int shell_main(struct pkgset *ps, struct inst_s *inst, int skip_installed)
- {
-- char *line, *s, *home;
-+ char *line, *s, *home, *etc_dir;
-
-
- if (!isatty(fileno(stdout))) {
-@@ -1240,12 +1240,19 @@
- initialize_readline();
- histfile = NULL;
-
-- if ((home = getenv("HOME"))) {
-+ if ((etc_dir = getenv("HOME_ETC"))) {
-+ int len = strlen(etc_dir) + strlen("/.poldek_history") + 2;
-+ histfile = alloca(len);
-+ snprintf(histfile, len, "%s/.poldek_history", etc_dir);
-+ read_history(histfile);
-+ } else {
-+ if ((home = getenv("HOME"))) {
- int len = strlen(home) + strlen("/.poldek_history") + 2;
- histfile = alloca(len);
- snprintf(histfile, len, "%s/.poldek_history", home);
- read_history(histfile);
-- }
-+ }
-+ }
-
- sigint_init();
- sigint_reached_cb = sigint_reached_fn;
diff --git a/poldek-home_etc.patch b/poldek-home_etc.patch
deleted file mode 100644
index 45f15d5..0000000
--- a/poldek-home_etc.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-diff -Nru poldek-0.18.1/conf.c poldek-0.18.1.new/conf.c
---- poldek-0.18.1/conf.c Fri Oct 18 16:19:42 2002
-+++ poldek-0.18.1.new/conf.c Mon Mar 10 07:39:16 2003
-@@ -374,14 +374,23 @@
- tn_hash *ldconf_deafult(void)
- {
- char *homedir;
-+ char *config_dir;
- char *etcpath = "/etc/poldek.conf";
-
-- if ((homedir = getenv("HOME")) != NULL) {
-+ if ((config_dir = getenv("CONFIG_DIR")) != NULL) {
-+ char path[PATH_MAX];
-+
-+ snprintf(path, sizeof(path), "%s/poldekrc", config_dir);
-+ if (access(path, R_OK) == 0)
-+ return ldconf(path);
-+ } else {
-+ if ((homedir = getenv("HOME")) != NULL) {
- char path[PATH_MAX];
-
- snprintf(path, sizeof(path), "%s/.poldekrc", homedir);
- if (access(path, R_OK) == 0)
- return ldconf(path);
-+ }
- }
-
- if (access(etcpath, R_OK) == 0)
-diff -Nru poldek-0.18.1/pkgscore.c poldek-0.18.1.new/pkgscore.c
---- poldek-0.18.1/pkgscore.c Fri Nov 22 17:08:53 2002
-+++ poldek-0.18.1.new/pkgscore.c Mon Mar 10 07:44:02 2003
-@@ -40,26 +40,46 @@
-
- if (fpath == NULL) {
- char *homedir;
-+ char *config_dir;
-
-- if ((homedir = getenv("HOME")) == NULL)
-+ if ((config_dir = getenv("CONFIG_DIR")) != NULL) {
-+ switch (type) {
-+ case PKG_HELD:
-+ snprintf(path, sizeof(path), "%s/poldek-hold", config_dir);
-+ if (access(path, R_OK) != 0) /* backward compat */
-+ snprintf(path, sizeof(path), "%s/poldek_hold", config_dir);
-+
-+ break;
-+
-+ case PKG_IGNORED:
-+ snprintf(path, sizeof(path), "%s/poldek-ignore", config_dir);
-+ break;
-+
-+ default:
-+ n_assert(0);
-+ break;
-+ }
-+ } else {
-+ if ((homedir = getenv("HOME")) == NULL)
- return NULL;
-
-- switch (type) {
-- case PKG_HELD:
-- snprintf(path, sizeof(path), "%s/.poldek-hold", homedir);
-- if (access(path, R_OK) != 0) /* backward compat */
-+ switch (type) {
-+ case PKG_HELD:
-+ snprintf(path, sizeof(path), "%s/.poldek-hold", homedir);
-+ if (access(path, R_OK) != 0) /* backward compat */
- snprintf(path, sizeof(path), "%s/.poldek_hold", homedir);
--
-- break;
-+
-+ break;
-+
-+ case PKG_IGNORED:
-+ snprintf(path, sizeof(path), "%s/.poldek-ignore", homedir);
-+ break;
-
-- case PKG_IGNORED:
-- snprintf(path, sizeof(path), "%s/.poldek-ignore", homedir);
-- break;
--
-- default:
-- n_assert(0);
-- break;
-- }
-+ default:
-+ n_assert(0);
-+ break;
-+ }
-+ }
-
- if (access(path, R_OK) != 0)
- return patterns;
-diff -Nru poldek-0.18.1/shell/shell.c poldek-0.18.1.new/shell/shell.c
---- poldek-0.18.1/shell/shell.c Tue Oct 29 16:55:58 2002
-+++ poldek-0.18.1.new/shell/shell.c Mon Mar 10 07:50:21 2003
-@@ -1226,7 +1226,7 @@
-
- int shell_main(struct pkgset *ps, struct inst_s *inst, int skip_installed)
- {
-- char *line, *s, *home;
-+ char *line, *s, *home, *config_dir;
-
-
- if (!isatty(fileno(stdout))) {
-@@ -1240,12 +1240,19 @@
- initialize_readline();
- histfile = NULL;
-
-- if ((home = getenv("HOME"))) {
-+ if ((config_dir = getenv("CONFIG_DIR"))) {
-+ int len = strlen(config_dir) + strlen("/poldek_history") + 2;
-+ histfile = alloca(len);
-+ snprintf(histfile, len, "%s/poldek_history", config_dir);
-+ read_history(histfile);
-+ } else {
-+ if ((home = getenv("HOME"))) {
- int len = strlen(home) + strlen("/.poldek_history") + 2;
- histfile = alloca(len);
- snprintf(histfile, len, "%s/.poldek_history", home);
- read_history(histfile);
-- }
-+ }
-+ }
-
- sigint_init();
- sigint_reached_cb = sigint_reached_fn;
diff --git a/poldek-multilib.conf b/poldek-multilib.conf
index f256983..9650831 100644
--- a/poldek-multilib.conf
+++ b/poldek-multilib.conf
@@ -1,36 +1,37 @@
-# Alternative multilib PLD 3.0 (Th)
+
+# Alternative multilib PLD 2.0 (Ac)
[source]
-type = %{_th_idxtype}
-name = th-%{_pld_alt_arch}
+type = %{_ac_idxtype}
+name = ac-%{_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}
+type = %{_ac_idxtype}
+name = ac-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}
+type = %{_ac_idxtype}
+name = ac-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}
+type = %{_ac_idxtype}
+name = ac-supported-%{_pld_alt_arch}
path = %{_pld_prefix}/supported/%{_pld_alt_arch}/
noauto = yes
[source]
-type = %{_th_idxtype}
-name = th-ready-%{_pld_alt_arch}
+type = %{_ac_idxtype}
+name = ac-ready-%{_pld_alt_arch}
path = %{_pld_prefix}/ready/%{_pld_alt_arch}/
noauto = yes
[source]
-type = %{_th_idxtype}
-name = th-test-%{_pld_alt_arch}
+type = %{_ac_idxtype}
+name = ac-test-%{_pld_alt_arch}
path = %{_pld_prefix}/test/%{_pld_alt_arch}/
noauto = yes
diff --git a/poldek-nodebug.patch b/poldek-nodebug.patch
deleted file mode 100644
index 9cdb9aa..0000000
--- a/poldek-nodebug.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urbB poldek-0.19.0-cvs20050921.00.org/tndb/read.c poldek-0.19.0-cvs20050921.00/tndb/read.c
---- poldek-0.19.0-cvs20050921.00.org/tndb/read.c 2005-09-11 18:28:10.000000000 +0200
-+++ poldek-0.19.0-cvs20050921.00/tndb/read.c 2005-09-22 20:02:31.885659750 +0200
-@@ -288,7 +288,7 @@
- tndb_sign_final(&hdr->sign);
- n = 0;
-
-- printf("Xmd_compute =\n (%s)\n (%s)\n %d\n",
-+ DBGF("Xmd_compute =\n (%s)\n (%s)\n %d\n",
- n_strdup(tndb_bin2hex_s(hdr->sign.md, sizeof(sign.md))),
- n_strdup((char*)tndb_bin2hex_s(sign.md, sizeof(sign.md))),
- memcmp(sign.md, hdr->sign.md, sizeof(sign.md)));
diff --git a/poldek-prereq.patch b/poldek-prereq.patch
deleted file mode 100644
index ba29074..0000000
--- a/poldek-prereq.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- poldek-0.18.9/capreq.c.orig 2004-12-30 13:05:19.000000000 +0100
-+++ poldek-0.18.9/capreq.c 2005-07-25 15:16:01.000000000 +0200
-@@ -646,10 +646,13 @@
- cr->cr_flags |= CAPREQ_PREREQ | CAPREQ_PREREQ_UN;
- }
- #else
-+# if RPMSENSE_PREREQ != RPMSENSE_ANY /* rpm 4.4 drops legacy PreReq support */
- if (isLegacyPreReq(flag)) { /* prepared by rpm < 4.0.2 */
- cr->cr_flags |= CAPREQ_PREREQ | CAPREQ_PREREQ_UN;
--
-- } else if (isInstallPreReq(flag)) {
-+
-+ } else
-+# endif
-+ if (isInstallPreReq(flag)) {
- cr->cr_flags |= CAPREQ_PREREQ;
-
- } else if (isErasePreReq(flag)) {
diff --git a/poldek-retr_term.patch b/poldek-retr_term.patch
deleted file mode 100644
index 0704ddc..0000000
--- a/poldek-retr_term.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-diff -urN poldek-0.18.1.orig/vfile/Makefile.am poldek-0.18.1/vfile/Makefile.am
---- poldek-0.18.1.orig/vfile/Makefile.am Thu Oct 24 18:23:12 2002
-+++ poldek-0.18.1/vfile/Makefile.am Fri May 2 10:55:06 2003
-@@ -21,10 +21,10 @@
- vlibs = vftp/libvftp.a vhttp/libvhttp.a
-
- noinst_PROGRAMS = sample ttest
--sample_SOURCES = sample.c
-+sample_SOURCES = sample.c ../poldek_term.c ../log.c
- sample_LDADD = libvfile.a $(vlibs) @TRURL_LDFLAG@ $(LDADD_) $(top_srcdir)/sigint/libsigint.a
-
--ttest_SOURCES = ttest.c
-+ttest_SOURCES = ttest.c ../poldek_term.c ../log.c
- ttest_LDADD = libvfile.a $(vlibs) @TRURL_LDFLAG@ $(LDADD_) $(top_srcdir)/sigint/libsigint.a
- EXTRA_DIST = $(VFCURL_SRCS) \
- testcookie.c test_progress.c
-diff -urN poldek-0.18.1.orig/vfile/vfile.c poldek-0.18.1/vfile/vfile.c
---- poldek-0.18.1.orig/vfile/vfile.c Tue Oct 29 17:55:56 2002
-+++ poldek-0.18.1/vfile/vfile.c Fri May 2 10:59:25 2003
-@@ -42,6 +42,7 @@
- #include <trurl/nmalloc.h>
-
- #include "i18n.h"
-+#include "../poldek_term.h"
-
- #define VFILE_INTERNAL
- #include "vfile.h"
-@@ -224,6 +225,10 @@
- return mod;
- }
-
-+const char *PR_URL(const char *url) {
-+ return vf_url_slim_s(url, term_get_width()-strlen(_("Retrieving %s...\n"))-4);
-+}
-+
- int vfile_fetcha(const char *destdir, tn_array *urls, int urltype)
- {
- const struct vf_module *mod = NULL;
-diff -urN poldek-0.18.1.orig/vfile/vfile.h poldek-0.18.1/vfile/vfile.h
---- poldek-0.18.1.orig/vfile/vfile.h Thu Nov 7 17:43:29 2002
-+++ poldek-0.18.1/vfile/vfile.h Fri May 2 10:20:18 2003
-@@ -189,7 +189,7 @@
-
- /* short alias for */
- #define CL_URL(url) vf_url_hidepasswd_s(url)
--#define PR_URL(url) vf_url_slim_s(url, 60)
-+//#define PR_URL(url) vf_url_slim_s(url, 60)
-
-
-
diff --git a/poldek-rpm4.1-fix.patch b/poldek-rpm4.1-fix.patch
deleted file mode 100644
index dbca76f..0000000
--- a/poldek-rpm4.1-fix.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: rpm_signature.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/Attic/rpm_signature.c,v
-retrieving revision 1.4.4.1
-diff -u -r1.4.4.1 rpm_signature.c
---- rpm_signature.c 2 Apr 2003 11:39:17 -0000 1.4.4.1
-+++ rpm_signature.c 30 Apr 2003 09:28:08 -0000
-@@ -59,7 +59,7 @@
- #ifdef HAVE_RPM_4_2
- return rpmReadSignature(fd, sighp, sig_type, NULL) == 0;
- #elif HAVE_RPM_4_1
-- return rpmReadSignature(fd, sighp, sig_type) == 0;
-+ return rpmReadSignature(fd, sighp, sig_type, NULL) == 0;
- #elif HAVE_RPM_4_0
- return rpmReadSignature(fd, sighp, sig_type, NULL) == 0;
- #endif
diff --git a/poldek-rpm4.2.patch b/poldek-rpm4.2.patch
deleted file mode 100644
index 3eee7ff..0000000
--- a/poldek-rpm4.2.patch
+++ /dev/null
@@ -1,94 +0,0 @@
---- poldek-0.18.1/configure.in Wed Apr 2 07:55:45 2003
-+++ poldek-0.18.1-/configure.in Wed Apr 2 07:55:14 2003
-@@ -10,6 +10,7 @@
- AH_TEMPLATE([ENABLE_TRACE],[])
- AH_TEMPLATE([HAVE_RPM_4_0_4],[])
- AH_TEMPLATE([HAVE_RPM_4_1],[])
-+AH_TEMPLATE([HAVE_RPM_4_2],[])
- AH_TEMPLATE([HAVE_RPM_EXTDEPS],[])
- AH_TEMPLATE([HAVE_TM_GMTOFF],[])
- AH_TEMPLATE([HAVE_TM___GMTOFF],[])
-@@ -240,9 +241,10 @@
- DBLIB="$DBLIB -ldb1"
- fi
- else
-- AC_CHECK_LIB(db-4.0, db_create, [DBLIB="-ldb-4.0"],
-+ AC_CHECK_LIB(db-4.1, db_create, [DBLIB="-ldb-4.1"],
-+ [AC_CHECK_LIB(db-4.0, db_create, [DBLIB="-ldb-4.0"],
- [AC_CHECK_LIB(db, db_create, [DBLIB="-ldb"],,[$LIBS])],
-- [$LIBS])
-+ [$LIBS])],, [$LIBS])
-
- if test "${ENABLE_STATIC}." = "yes."; then
- DBLIB="$DBLIB"
-@@ -278,6 +280,9 @@
- AC_CHECK_FUNCS(rpmMachineScore,,[ AC_MSG_ERROR(["rpmlib not found"])])
- AC_CHECK_FUNCS(rpmlog rpmCheckSig rpmVerifySignature)
-
-+dnl rpm 4.2?
-+AC_CHECK_FUNCS(rpmtsColor, AC_DEFINE([HAVE_RPM_4_2],1,[]))
-+
- AC_CHECK_HEADERS(db_185.h,,[
- AC_MSG_WARN(["disabled synchronization with db file-dependencies"]) ])
- AC_CHECK_FUNCS(__db185_open)
-Only in poldek-0.18.1-: configure.in.orig
-diff -ur poldek-0.18.1/rpm_signature.c poldek-0.18.1-/rpm_signature.c
---- poldek-0.18.1/rpm_signature.c Fri Oct 18 12:34:03 2002
-+++ poldek-0.18.1-/rpm_signature.c Wed Apr 2 07:55:14 2003
-@@ -56,7 +56,9 @@
-
- static int rpm_read_signature(FD_t fd, Header *sighp, int sig_type)
- {
--#ifdef HAVE_RPM_4_1
-+#ifdef HAVE_RPM_4_2
-+ return rpmReadSignature(fd, sighp, sig_type, NULL) == 0;
-+#elif HAVE_RPM_4_1
- return rpmReadSignature(fd, sighp, sig_type) == 0;
- #elif HAVE_RPM_4_0
- return rpmReadSignature(fd, sighp, sig_type, NULL) == 0;
-Only in poldek-0.18.1-: rpm_signature.c.orig
-diff -ur poldek-0.18.1/rpmadds.c poldek-0.18.1-/rpmadds.c
---- poldek-0.18.1/rpmadds.c 7 Nov 2002 16:43:26 -0000 1.8
-+++ poldek-0.18.1-/rpmadds.c 15 Apr 2003 16:56:10 -0000
-@@ -34,15 +34,17 @@
- #include "misc.h"
- #include "log.h"
-
--
- int rpm_headerReadFD(FD_t fdt, Header *hdr, const char *path)
- {
- int rc = 0;
-
--#ifdef HAVE_RPM_4_1
-+#ifndef HAVE_RPM_4_1
-+ rc = rpmReadPackageHeader(fdt, hdr, NULL, NULL, NULL);
-+#else
- rpmRC rpmrc;
- rpmts ts = rpmtsCreate();
-
-+ rpmtsSetVSFlags(ts, RPMVSF_NODSA | RPMVSF_NORSA | RPMVSF_NOMD5);
- rpmrc = rpmReadPackageFile(ts, fdt, path, hdr);
- switch (rpmrc) {
- case RPMRC_NOTTRUSTED:
-@@ -54,18 +56,12 @@
- default:
- rc = 1;
- }
--
--#else
-- rc = rpmReadPackageHeader(fdt, hdr, NULL, NULL, NULL);
-+ rpmtsFree(ts);
- #endif
--
-+
- if (rc != 0)
- logn(LOGERR, _("%s: read header failed"), path);
-
--#ifdef HAVE_RPM_4_1
-- rpmtsFree(ts);
--#endif
--
- return rc == 0;
- }
-
-
diff --git a/poldek-rpm_4_4_3.patch b/poldek-rpm_4_4_3.patch
deleted file mode 100644
index 43c3ab3..0000000
--- a/poldek-rpm_4_4_3.patch
+++ /dev/null
@@ -1,213 +0,0 @@
-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
diff --git a/poldek-simplestatic.patch b/poldek-simplestatic.patch
deleted file mode 100644
index a4bccab..0000000
--- a/poldek-simplestatic.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- configure.in-orig 2004-03-21 20:38:00.000000000 +0000
-+++ configure.in 2004-03-21 20:38:09.000000000 +0000
-@@ -97,6 +97,7 @@
- if test "${ENABLE_STATIC}." = "yes."; then
- AC_DEFINE([ENABLE_STATIC],1, [defined if static linking is requested])
- poldek_LDFLAGS="-static"
-+ LIBS="$LIBS -lselinux"
-
- if test "${INTERACTIVE_MODE}." = "yes."; then
- LIBS="$LIBS -lncurses"
diff --git a/poldek-split64.patch b/poldek-split64.patch
deleted file mode 100644
index d44d3da..0000000
--- a/poldek-split64.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-Index: cli/op_split.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/cli/op_split.c,v
-retrieving revision 1.10
-retrieving revision 1.11
-diff -u -r1.10 -r1.11
---- cli/op_split.c 10 Jul 2005 13:30:17 -0000 1.10
-+++ cli/op_split.c 3 Oct 2005 19:57:05 -0000 1.11
-@@ -7,7 +7,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #ifdef HAVE_CONFIG_H
-@@ -167,9 +167,6 @@
- logn(LOGERR, _("first free space bigger than chunk size"));
- return 0;
- }
--
-- arg_s->size *= 1024 * 1024;
-- arg_s->first_free_space *= 1024 * 1024;
-
- return poldek_split(ctx, arg_s->size, arg_s->first_free_space,
- arg_s->prefix);
-Index: split.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/split.c,v
-retrieving revision 1.22
-retrieving revision 1.23
-diff -u -r1.22 -r1.23
---- split.c 5 Jul 2005 21:11:12 -0000 1.22
-+++ split.c 3 Oct 2005 19:57:04 -0000 1.23
-@@ -11,7 +11,7 @@
- */
-
- /*
-- $Id$
-+ $Id$
- */
-
- #include <ctype.h>
-@@ -39,8 +39,8 @@
-
- struct chunk {
- int no;
-- unsigned size;
-- unsigned maxsize;
-+ uint64_t size;
-+ uint64_t maxsize;
- int items;
- tn_array *pkgs;
- };
-@@ -50,7 +50,7 @@
- char mask[0];
- };
-
--static struct chunk *chunk_new(int no, int maxsize)
-+static struct chunk *chunk_new(int no, uint64_t maxsize)
- {
- struct chunk *chunk;
-
-@@ -241,7 +241,7 @@
-
-
- static
--int try_package(int deep, unsigned *chunk_size, unsigned maxsize,
-+int try_package(int deep, uint64_t *chunk_size, uint64_t maxsize,
- struct pkg *pkg, tn_array *stack)
- {
- int i, rc = 1;
-@@ -256,7 +256,7 @@
- n_array_push(stack, pkg_link(pkg));
- *chunk_size += pkg->fsize;
-
-- DBGF("trying %s: %d (%d) > %d\n", pkg_snprintf_s(pkg), *chunk_size,
-+ DBGF("trying %s: %lld (%d) > %lld\n", pkg_snprintf_s(pkg), *chunk_size,
- pkg->fsize, maxsize);
-
- if (*chunk_size > maxsize)
-@@ -281,7 +281,7 @@
- int chunk_add(struct chunk *chunk, struct pkg *pkg)
- {
- int i, rc = 0;
-- int chunk_size = 0;
-+ uint64_t chunk_size = 0;
- tn_array *stack = NULL;
-
-
-@@ -320,9 +320,46 @@
- return rc;
- }
-
-+static
-+int snprintf_size64(char *buf, int bufsize, uint64_t nbytes,
-+ int ndigits, int longunit)
-+{
-+ char unit[3], fmt[32];
-+ double nb;
-+
-+
-+ nb = nbytes;
-+ unit[0] = 'B';
-+ unit[1] = unit[2] = '\0';
-+
-+ if (nb > 1024) {
-+ nb /= 1024.0;
-+
-+ unit[0] = 'K';
-+ unit[1] = 'B';
-+
-+ if (nb > 1024) {
-+ nb /= 1024;
-+ unit[0] = 'M';
-+ }
-+
-+ if (nb > 1024) {
-+ nb /= 1024;
-+ unit[0] = 'G';
-+ }
-+ }
-+
-+ n_snprintf(fmt, sizeof(fmt), "%%.%df%%s", ndigits);
-+ if (!longunit)
-+ unit[1] = '\0';
-+
-+ return n_snprintf(buf, bufsize, fmt, nb, unit);
-+}
-+
-+
-
- static
--int make_chunks(tn_array *pkgs, unsigned split_size, unsigned first_free_space,
-+int make_chunks(tn_array *pkgs, uint64_t split_size, uint64_t first_free_space,
- const char *outprefix)
- {
- int i, chunk_no = 0, rc = 1;
-@@ -356,7 +393,7 @@
- }
-
- for (i=0; i < n_array_size(chunks); i++) {
-- struct vfile *vf;
-+ FILE *stream;
- char path[PATH_MAX], strsize[128];
- struct chunk *chunk;
- struct pkg *pkg;
-@@ -373,21 +410,21 @@
- pri_max = pkg->pri;
-
- snprintf(path, sizeof(path), "%s.%.2d", outprefix, chunk->no);
-- snprintf_size(strsize, sizeof(strsize), chunk->size, 2, 0);
-- msgn(0, _("Writing %s (%4d packages, %s, "
-+ snprintf_size64(strsize, sizeof(strsize), chunk->size, 2, 0);
-+ msgn(0, _("Writing %s (%4d packages, %s (%lldb), "
- "pri min, max = %d, %d)"),
-- path, chunk->items, strsize, pri_min, pri_max);
-+ path, chunk->items, strsize, chunk->size, pri_min, pri_max);
-
-
-- if ((vf = vfile_open(path, VFT_STDIO, VFM_RW)) == NULL)
-+ if ((stream = fopen(path, "w")) == NULL)
- return 0;
-
- #if 0
-- fprintf(vf->vf_stream, "# chunk #%d: %d packages, %d bytes\n",
-+ fprintf(vf->vf_stream, "# chunk #%d: %d packages, %lld bytes\n",
- i, chunk->items, chunk->size);
- #endif
-- chunk_dump(chunk, vf->vf_stream);
-- vfile_close(vf);
-+ chunk_dump(chunk, stream);
-+ fclose(stream);
- }
-
- l_end:
-@@ -444,12 +481,18 @@
- }
-
- static
--int packages_split(const tn_array *pkgs, unsigned split_size,
-- unsigned first_free_space, const char *outprefix)
-+int packages_split(const tn_array *pkgs, unsigned split_size_mb,
-+ unsigned first_free_space_mb, const char *outprefix)
- {
- tn_array *packages = NULL, *ordered_pkgs = NULL;
- int i, rc = 1;
-+ uint64_t split_size, first_free_space;
-+
-+ split_size = (uint64_t)split_size_mb * 1024L * 1024L;
-+ first_free_space = (uint64_t)first_free_space_mb * 1024L * 1024L;
-
-+ DBGF("%dM (%lld), %dM %lld\n", split_size_mb, split_size,
-+ first_free_space_mb, first_free_space);
-
- packages = n_array_dup(pkgs, (tn_fn_dup)pkg_link);
- // pre-sort packages with pkg_cmp_pri_name_evr_rev()
-@@ -482,8 +525,8 @@
- return rc;
- }
-
--int poldek_split(const struct poldek_ctx *ctx, unsigned size,
-- unsigned first_free_space, const char *outprefix)
-+int poldek_split(const struct poldek_ctx *ctx, unsigned size_mb,
-+ unsigned first_free_space_mb, const char *outprefix)
- {
- if (outprefix == NULL)
- outprefix = "packages.chunk";
-@@ -492,6 +535,7 @@
- logn(LOGERR, "split: %s", _("no available packages found"));
- return 0;
- }
--
-- return packages_split(ctx->ps->pkgs, size, first_free_space, outprefix);
-+
-+ return packages_split(ctx->ps->pkgs, size_mb, first_free_space_mb,
-+ outprefix);
- }
diff --git a/poldek-static.patch b/poldek-static.patch
deleted file mode 100644
index 68f3a4e..0000000
--- a/poldek-static.patch
+++ /dev/null
@@ -1,47 +0,0 @@
---- poldek-0.18.1/configure.in.wiget Wed Nov 27 19:56:09 2002
-+++ poldek-0.18.1/configure.in Thu Mar 6 20:11:53 2003
-@@ -264,11 +264,11 @@
- fi
-
-
--AC_CHECK_LIB(rpm, rpmReadPackageInfo,[LIBS="$LIBS -lrpm $DBLIB"],
-+AC_CHECK_LIB(rpm, rpmReadPackageInfo,[LIBS="-lrpm $DBLIB $LIBS"],
- AC_CHECK_LIB(rpm, rpmReadPackageHeader,
-- [LIBS="$LIBS -lrpm -lrpmdb $DBLIB"],
-+ [LIBS="-lrpm -lrpmdb $DBLIB $LIBS"],
- AC_CHECK_LIB(rpm, rpmReadPackageFile,
-- [LIBS="$LIBS -lrpm -lrpmdb $DBLIB"
-+ [LIBS="-lrpm -lrpmdb -lelf $DBLIB $LIBS"
- AC_DEFINE([HAVE_RPM_4_1],1,[])],
- AC_MSG_ERROR(["rpmlib not found"]),
- [$DBLIB -lrpmdb]),
-@@ -298,7 +298,7 @@
-
- AC_CHECK_FUNCS(openpty,,
- AC_CHECK_LIB(util, openpty,
-- [AC_DEFINE([HAVE_OPENPTY],1,[defined if openpty() is avialable])] [LIBS="$LIBS -lutil"]))
-+ [AC_DEFINE([HAVE_OPENPTY],1,[defined if openpty() is avialable])] [LIBS="-lutil $LIBS"]))
-
- AC_CHECK_FUNCS(rpmGetRpmlibProvides,,
- [AC_MSG_WARN("[poldek will not work fine with rpmlib\(...\) capabilities"])],
-@@ -318,7 +318,7 @@
- AC_CHECK_LIB(trurl, n_hash_size,,
- [AC_MSG_ERROR(["trurlib >= 0.43.5 not found"])], [$CONF_IN_LDFLAGS])
- else
-- LIBS="$LIBS -ltrurl"
-+ LIBS="-ltrurl $LIBS"
- AC_CONFIG_SUBDIRS(trurlib)
- NARRAY="\"$srcdir/$TRURL_DIR/include/trurl/narray.h\""
- fi
---- poldek-0.18.1/configure.in Thu May 22 23:02:25 2003
-+++ poldek-0.18.1/configure.in-new Thu May 22 23:02:37 2003
-@@ -290,7 +290,7 @@
- dnl 4.0.4 has cross dependenecies(?)
- if test ${is_rpm4_0_4}. = yes. -a ${ENABLE_STATIC}. = yes. ; then
-- if ${have_beecrypt}. = yes. ; then
-+ if test ${have_beecrypt}. = yes. ; then
-- LIBS="$LIBS -lbz2 -lrpmio"
-+ LIBS="$LIBS -lbz2 -lrpmio -lbeecrypt -lpthread"
- fi
- LIBS="$LIBS -lbz2 -lrpmio"
- fi
diff --git a/poldek-tests.patch b/poldek-tests.patch
deleted file mode 100644
index 3566de0..0000000
--- a/poldek-tests.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -urN poldek-0.18.1.org/test_match.c poldek-0.18.1/test_match.c
---- poldek-0.18.1.org/test_match.c 2004-01-09 19:48:04.198189038 +0100
-+++ poldek-0.18.1/test_match.c 2004-01-09 19:48:23.112218155 +0100
-@@ -47,7 +47,7 @@
- while (relases[j]) {
- struct capreq *cap;
-
-- pkg = pkg_new("poldek", epoch, versions[i], relases[j], NULL, NULL, 0, 0, 0);
-+ pkg = pkg_new("poldek", epoch, versions[i], relases[j], NULL, NULL, NULL, 0, 0, 0);
- cap = capreq_new("poldek", epoch, versions[i++], relases[j++], REL_EQ, 0);
- k = 0;
- while (rels[k] > 0) {
-@@ -80,7 +80,7 @@
- struct capreq *req, *cap;
- int rc;
-
-- pkg = pkg_new("poldek", epoch, ver, rel, NULL, NULL, 0, 0, 0);
-+ pkg = pkg_new("poldek", epoch, ver, rel, NULL, NULL, NULL, 0, 0, 0);
- cap = capreq_new("poldek", epoch, ver, rel, REL_EQ, 0);
-
- req = capreq_new_evr("poldek", n_strdup(evr), relation, 0);
diff --git a/poldek-unaligned.patch b/poldek-unaligned.patch
deleted file mode 100644
index 58eb29a..0000000
--- a/poldek-unaligned.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Kills unaligned traps on alpha (sizeof(time_t) is 8, pkg->btime is 4-aligned)
---- poldek-0.18.1/shell/ls.c.orig 2002-11-07 16:43:28.000000000 +0000
-+++ poldek-0.18.1/shell/ls.c 2003-12-05 18:40:28.000000000 +0000
-@@ -393,6 +393,7 @@
- char sizbuf[30];
- char unit = 'K';
- double pkgsize = pkg->size/1024;
-+ time_t tmpt;
-
- if (pkgsize >= 1024) {
- pkgsize /= 1024;
-@@ -401,10 +402,11 @@
-
- snprintf(sizbuf, sizeof(sizbuf), "%.1f %cB", pkgsize, unit);
-
-- if (pkg->btime)
-+ if (pkg->btime) {
-+ tmpt = pkg->btime;
- strftime(timbuf, sizeof(timbuf), "%Y/%m/%d %H:%M",
-- localtime((time_t*)&pkg->btime));
-- else
-+ localtime(&tmpt));
-+ } else
- *timbuf = '\0';
-
- if ((flags & OPT_LS_UPGRADEABLE) == 0) {
---- poldek-0.18.1/shell/desc.c.orig 2002-11-07 16:43:28.000000000 +0000
-+++ poldek-0.18.1/shell/desc.c 2003-12-05 18:41:18.000000000 +0000
-@@ -665,6 +665,7 @@
- char unit = 'K';
- const char *group;
- double pkgsize;
-+ time_t tmpt;
-
-
- if ((pkgu = pkg_info(pkg)) == NULL) {
-@@ -674,10 +675,11 @@
- }
-
-
-- if (pkg->btime)
-+ if (pkg->btime) {
-+ tmpt = pkg->btime;
- strftime(timbuf, sizeof(timbuf), "%Y/%m/%d %H:%M",
-- localtime((time_t*)&pkg->btime));
-- else
-+ localtime(&tmpt));
-+ } else
- *timbuf = '\0';
-
- if (pkgu->summary) {
diff --git a/poldek-vf_append.patch b/poldek-vf_append.patch
deleted file mode 100644
index 3c36b38..0000000
--- a/poldek-vf_append.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Index: pkgset-order.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/pkgset-order.c,v
-retrieving revision 1.16.4.3
-retrieving revision 1.16.4.3.2.1
-diff -u -r1.16.4.3 -r1.16.4.3.2.1
---- pkgset-order.c 5 May 2005 19:02:25 -0000 1.16.4.3
-+++ pkgset-order.c 16 Jul 2005 08:09:28 -0000 1.16.4.3.2.1
-@@ -147,7 +147,8 @@
-
- } else {
- int i;
-- poldek_log(LOGERR, _("PreReq loop: "));
-+ if (verbose >= -1)
-+ poldek_log(LOGERR, _("PreReq loop: "));
- msg(-1, "_%s", rp->pkg->name);
- for (i=n_array_size(vs->stack)-1; i >= 0; i--) {
- struct pkg *p = n_array_nth(vs->stack, i);
-Index: vfile/vfile.c
-===================================================================
-RCS file: /cvsroot/installer/poldek/vfile/vfile.c,v
-retrieving revision 1.43.4.5
-retrieving revision 1.43.4.5.2.1
-diff -u -r1.43.4.5 -r1.43.4.5.2.1
---- vfile/vfile.c 15 May 2005 17:22:22 -0000 1.43.4.5
-+++ vfile/vfile.c 16 Jul 2005 08:10:37 -0000 1.43.4.5.2.1
-@@ -293,7 +293,7 @@
- {
- int rc = 0;
-
-- if (vfmode & VFM_RW)
-+ if ((vfmode & VFM_RW) && (vfmode & VFM_APPEND) == 0)
- vf_unlink(path);
-
- switch (vf->vf_type) {
-@@ -354,7 +354,10 @@
- free(vf->vf_iobuf);
- vf->vf_iobuf = NULL;
- }
-- fseek(vf->vf_stream, 0, SEEK_SET); /* XXX glibc BUG (?) */
-+ fseek(vf->vf_stream, 0L, SEEK_SET); /* XXX glibc BUG (?) */
-+ if (vfmode & VFM_APPEND)
-+ fseek(vf->vf_stream, 0L, SEEK_END);
-+
- } else
- vfile_err_fn("fopencookie %s: hgw error\n", CL_URL(path));
-
diff --git a/poldek.conf b/poldek.conf
index bf2cd49..abbab69 100644
--- a/poldek.conf
+++ b/poldek.conf
@@ -1,77 +1,48 @@
+# $Id$
# PLD <http://www.pld-linux.org/>
_pld_arch = %ARCH%
_pld_alt_arch = %ALT_ARCH%
-_pld_prefix = ftp://ftp.th.pld-linux.org/dists/th
+_pld_prefix = ftp://ftp.ac.pld-linux.org/dists/ac
## Some mirrors
## You can use them if you have better connection there
# CI TASK:
-#_pld_prefix = ftp://ftp.task.pld-linux.org/dists/th
+#_pld_prefix = ftp://ftp.task.pld-linux.org/dists/ac
-_th_idxtype = pndir
+_ac_idxtype = pndir
-# PLD 3.0 (Th)
+# PLD 2.0 (Ac)
[source]
-type = %{_th_idxtype}
-name = th
-path = %{_pld_prefix}/PLD/%{_pld_arch}/RPMS/
+type = %{_ac_idxtype}
+name = ac
+path = %{_pld_prefix}/PLD/%{_pld_arch}/PLD/RPMS/
[source]
-type = %{_th_idxtype}
-name = th
-path = %{_pld_prefix}/PLD/noarch/RPMS/
+type = %{_ac_idxtype}
+name = ac-updates-security
+path = %{_pld_prefix}/updates/security/%{_pld_arch}/
[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/
+type = %{_ac_idxtype}
+name = ac-updates-general
+path = %{_pld_prefix}/updates/general/%{_pld_arch}/
noauto = yes
[source]
-type = %{_th_idxtype}
-name = th-updates-general
-path = %{_pld_prefix}/updates-general/noarch/RPMS/
+type = %{_ac_idxtype}
+name = ac-supported
+path = %{_pld_prefix}/supported/%{_pld_arch}/
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/
+type = %{_ac_idxtype}
+name = ac-ready
+path = %{_pld_prefix}/ready/%{_pld_arch}/
noauto = yes
[source]
-type = %{_th_idxtype}
-name = th-ready
-path = %{_pld_prefix}/ready/noarch/RPMS/
+type = %{_ac_idxtype}
+name = ac-test
+path = %{_pld_prefix}/test/%{_pld_arch}/
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
-
diff --git a/poldek.spec b/poldek.spec
index 02e9bdb..2f7eb71 100644
--- a/poldek.spec
+++ b/poldek.spec
@@ -4,13 +4,13 @@
%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
+%define ver_db 4.2.50-1
+%define ver_rpm 4.4.1
Summary: RPM packages management helper tool
Summary(pl): Pomocnicze narzêdzie do zarz±dzania pakietami RPM
Name: poldek
Version: 0.20
-Release: 5
+Release: 6
License: GPL v2
Group: Applications/System
Source0: http://poldek.pld-linux.org/download/%{name}-%{version}.tar.bz2
@@ -18,16 +18,14 @@ Source0: http://poldek.pld-linux.org/download/%{name}-%{version}.tar.bz2
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
+Patch3: %{name}-completion.patch
+Patch4: %{name}-notimestamps.patch
+Patch5: %{name}-config.patch
+Patch6: %{name}-uninstall-multilib.patch
+Patch7: %{name}-bug-5774.patch
URL: http://poldek.pld-linux.org/
BuildRequires: autoconf
BuildRequires: automake
@@ -62,6 +60,7 @@ Requires(triggerpostun): awk
Requires(triggerpostun): sed >= 4.0
Requires: %{name}-libs = %{version}-%{release}
Requires: db >= %{ver_db}
+Requires: openssl >= 0.9.7d
Requires: rpm >= %{ver_rpm}
Requires: sed
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -80,6 +79,8 @@ shell mode of Perl's CPAN.
%{!?with_imode:This version hasn't got interactive mode.}
+#'
+
%description -l pl
poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
@@ -134,7 +135,11 @@ Biblioteki statyczne poldka.
%patch0 -p2
%patch1 -p0
%patch2 -p0
-%patch3 -p0
+%patch3 -p2
+%patch4 -p1
+%patch5 -p1
+%patch6 -p0
+%patch7 -p2
%build
%{__autopoint}
@@ -158,15 +163,18 @@ install -d $RPM_BUILD_ROOT%{_sysconfdir}
%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
-%ifarch i486 i686 ppc sparc alpha athlon
+#
+# CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
+#
+%ifarch i386 i586 i686 ppc sparc alpha athlon
%define _ftp_arch %{_target_cpu}
%else
%ifarch %{x8664}
-%define _ftp_arch x86_64
+%define _ftp_arch amd64
%define _ftp_alt_arch i686
%else
-%ifarch i586
-%define _ftp_arch i486
+%ifarch i486
+%define _ftp_arch i386
%else
%ifarch pentium2 pentium3 pentium4
%define _ftp_arch i686