]>
Commit | Line | Data |
---|---|---|
5e91f142 AM |
1 | Index: installer/poldek/Makefile.am |
2 | diff -u installer/poldek/Makefile.am:1.54 installer/poldek/Makefile.am:1.54.4.2 | |
3 | --- installer/poldek/Makefile.am:1.54 Thu Nov 7 17:43:25 2002 | |
4 | +++ installer/poldek/Makefile.am Fri Dec 19 02:29:31 2003 | |
5 | @@ -1,4 +1,4 @@ | |
6 | -# $Id$ | |
7 | +# $Id$ | |
8 | ||
9 | AUTOMAKE_OPTIONS = | |
10 | ACLOCAL_AMFLAGS = -I m4 | |
11 | @@ -42,6 +42,7 @@ | |
12 | pkgset-load.c pkgset-load.h \ | |
13 | pkgset.c pkgset.h \ | |
14 | pkgset-req.c pkgset-req.h \ | |
15 | + pkgset-merge.c \ | |
16 | pkgset-order.c \ | |
17 | pkgset-install.c \ | |
18 | dbdep.c dbdep.h \ | |
19 | @@ -66,11 +67,11 @@ | |
20 | ||
21 | SHELL_MOD = shell/libshell.a | |
22 | ||
23 | -poldek_DEPENDENCIES_ = libpoldek.a \ | |
24 | - sigint/libsigint.a \ | |
25 | - vfile/libvfile.a \ | |
26 | +poldek_DEPENDENCIES_ = libpoldek.a \ | |
27 | + vfile/libvfile.a \ | |
28 | vfile/vftp/libvftp.a \ | |
29 | - vfile/vhttp/libvhttp.a | |
30 | + vfile/vhttp/libvhttp.a \ | |
31 | + sigint/libsigint.a | |
32 | ||
33 | if ENABLE_INTERACTIVE_MODE | |
34 | SHELL_MOD_ = $(SHELL_MOD) | |
35 | @@ -83,11 +84,12 @@ | |
36 | LDADD_ = @INTLLIBS@ | |
37 | ||
38 | bin_PROGRAMS = poldek rpmvercmp | |
39 | -dist_bin_SCRIPTS = mkpackagedir vfjuggle vfuncompr | |
40 | +dist_bin_SCRIPTS = mkpackagedir vfjuggle vfcompr | |
41 | poldek_SOURCES = main.c | |
42 | -poldek_LDADD = libpoldek.a sigint/libsigint.a vfile/libvfile.a \ | |
43 | - vfile/vftp/libvftp.a vfile/vhttp/libvhttp.a \ | |
44 | - $(SHELL_MOD_) $(LDADD_) | |
45 | +poldek_LDADD = libpoldek.a vfile/libvfile.a \ | |
46 | + vfile/vftp/libvftp.a vfile/vhttp/libvhttp.a \ | |
47 | + sigint/libsigint.a \ | |
48 | + $(SHELL_MOD_) $(LDADD_) | |
49 | ||
50 | rpmvercmp_SOURCES = rpmvercmp.c | |
51 | rpmvercmp_LDADD = $(LDADD_) | |
52 | @@ -97,7 +99,7 @@ | |
53 | noinst_PROGRAMS = test_match | |
54 | test_match_SOURCES = test_match.c | |
55 | test_match_LDADD = $(poldek_LDADD) | |
56 | - | |
57 | +test_match_DEPENDENCIES = $(poldek_DEPENDENCIES) | |
58 | ||
59 | EXTRA_DIST = \ | |
60 | poldek.1 poldek.pod \ | |
61 | Index: installer/poldek/NEWS | |
62 | diff -u installer/poldek/NEWS:1.56 installer/poldek/NEWS:1.56.4.2 | |
63 | --- installer/poldek/NEWS:1.56 Wed Nov 27 19:56:09 2002 | |
64 | +++ installer/poldek/NEWS Sun Dec 7 22:07:32 2003 | |
65 | @@ -1,3 +1,9 @@ | |
66 | +0.18.2 (minor bugfix && improvements release; 2003/07/23) | |
67 | + | |
68 | +* support for RPM 4.2/4.3 | |
69 | +* dependency processing bugfix | |
70 | +* RPM 4.1 related fixes | |
71 | + | |
72 | 0.18.1 (major bugfix release; 2002/11/27) | |
73 | ||
74 | * ability of creation empty indexes | |
75 | @@ -13,7 +19,7 @@ | |
76 | ||
77 | 0.18 (bugfix/minor enhancements release; 2002/11/07) | |
78 | ||
79 | -* support for RPM 4.1 (with help of Artur Frysiak <wiget@pld.org.pl>) | |
80 | +* support for RPM 4.1 (with help of Artur Frysiak <wiget at pld-linux org>) | |
81 | ||
82 | * few dependency processing improvements: | |
83 | - greedy upgrades are performed instead of marking different versions | |
84 | @@ -35,9 +41,9 @@ | |
85 | * fixed available package list management in interactive mode | |
86 | ||
87 | * AM/AC stuff cleanup and adaptation to their new versions (automake 1.7 and autoconf 2.54) | |
88 | - (Artur Frysiak <wiget@pld.org.pl>) | |
89 | + (Artur Frysiak <wiget at pld-linux org>) | |
90 | ||
91 | -* Polish translation of manual page (GoTaR <gotar@pld.org.pl>) | |
92 | +* Polish translation of manual page (GoTaR <gotar at pld-linux org>) | |
93 | ||
94 | * fix: progress bar isn't refreshed so frequently (#367) | |
95 | ||
96 | @@ -55,9 +61,9 @@ | |
97 | 0.17.8 (major bugfix release; 2002/08/18) | |
98 | ||
99 | * package installation is verified with rpm database if rpm reports failure | |
100 | -* fixed obsoletes matching (Jakub Bogusz <qboosh@pld.org.pl>) | |
101 | +* fixed obsoletes matching (Jakub Bogusz <qboosh at pld-linux org>) | |
102 | * improved and fixed file based conflicts detection | |
103 | -* fixed size units display (GoTaR <gotar@poczta.onet.pl>) | |
104 | +* fixed size units display (GoTaR <gotar at poczta.onet.pl>) | |
105 | ||
106 | ||
107 | 0.17.7 (bugfix release; 2002/06/14) | |
108 | @@ -94,12 +100,12 @@ | |
109 | * improved package auto-selection among equivalents: package which marks | |
110 | less packages to install is preferred | |
111 | * vftp: fixed logging in when server doesn't ask for password | |
112 | - (Przemyslaw Frasunek <venglin@freebsd.lublin.pl>) | |
113 | + (Przemyslaw Frasunek <venglin at freebsd.lublin.pl>) | |
114 | * bugfix: root directory (--rootdir) is always passed to rpm as absolute path | |
115 | * shell: desc: file mode is displayed in human readable form | |
116 | * fixed vfjuggle: packages.dir.md* are copied to hdd too | |
117 | * few SIGSEVs killed on "search" command when APT's pkglist file | |
118 | - is used as package index (thanks to Gustavo Niemeyer <niemeyer@conectiva.com>) | |
119 | + is used as package index (thanks to Gustavo Niemeyer <niemeyer at conectiva.com>) | |
120 | ||
121 | ||
122 | 0.17.4 (bugfix/minor enhancements release; 2002/05/06) | |
123 | @@ -144,11 +150,11 @@ | |
124 | * new "--clean" and "--clean-whole" options for cache directory | |
125 | cleanup | |
126 | ||
127 | -* URLs with user and password (ftp://user:passwd@host:port/path/ syntax) | |
128 | - are supported (Andreas Piesk <a.piesk@gmx.net>) | |
129 | +* URLs with user and password (ftp://user:passwd at host:port/path/ syntax) | |
130 | + are supported (Andreas Piesk <a.piesk at gmx.net>) | |
131 | ||
132 | * new "ftp_sysuser_as_anon_passwd" option causes sending | |
133 | - login@hostname as anonymous FTP password | |
134 | + login at hostname as anonymous FTP password | |
135 | ||
136 | * new "noautoup" source option tells poldek to do not update | |
137 | source by default. | |
138 | @@ -157,11 +163,11 @@ | |
139 | ||
140 | * misc fixes to compile on SuSE | |
141 | ||
142 | -* fixed rpm 3.x support (with help of Roger Luethi <rl@hellgate.ch>) | |
143 | +* fixed rpm 3.x support (with help of Roger Luethi <rl at hellgate.ch>) | |
144 | ||
145 | * fixed and improved handling of bool configuration options, | |
146 | added on/off and enable/disable to the list of valid choices | |
147 | - (Andreas Piesk <a.piesk@gmx.net>) | |
148 | + (Andreas Piesk <a.piesk at gmx.net>) | |
149 | ||
150 | * fixed detection of file based conflicts between available packages. | |
151 | ||
152 | @@ -169,7 +175,7 @@ | |
153 | versions are handled properly | |
154 | ||
155 | * misc fixes to compile and work with glibc2.1 (with | |
156 | - help of Andreas Piesk <a.piesk@gmx.net>) | |
157 | + help of Andreas Piesk <a.piesk at gmx.net>) | |
158 | ||
159 | * installation of multiple instances of package is allowed (by poldek -i) | |
160 | ||
161 | @@ -178,24 +184,24 @@ | |
162 | - fixed handling package conflicts added by poldek | |
163 | - faster dependency checking | |
164 | ||
165 | -* German translation (Andreas Piesk <a.piesk@gmx.net>) | |
166 | +* German translation (Andreas Piesk <a.piesk at gmx.net>) | |
167 | ||
168 | * various bugs are fixed: | |
169 | - double '/' in paths handling | |
170 | - huge mem leak on --update | |
171 | - - ambiguous p_open() flags (Michal Moskal <malekith@pld.org.pl>) | |
172 | + - ambiguous p_open() flags (Michal Moskal <malekith at pld-linux org>) | |
173 | - removed [v]snprintf() (wrong) usage; trurlib's n_[v]snprintf() | |
174 | are used instead | |
175 | - - automake/autoconf fixes (Artur Frysiak <wiget@pld.org.pl>) | |
176 | - - many minor fixes (thanks to Andreas Piesk <a.piesk@gmx.net>) | |
177 | + - automake/autoconf fixes (Artur Frysiak <wiget at pld-linux org>) | |
178 | + - many minor fixes (thanks to Andreas Piesk <a.piesk at gmx.net>) | |
179 | ||
180 | 0.17.2 | |
181 | * "ported" to RedHat 7.2 (with rpm 4.0.4) | |
182 | * install-dist: --force forces installation of broken package sets | |
183 | * corrected package installation progress bar | |
184 | - (Michal Moskal <malekith@pld.org.pl>) | |
185 | + (Michal Moskal <malekith at pld-linux org>) | |
186 | * install-dist: log INST-{OK,ERR} for PLD Installer | |
187 | - (Michal Moskal <malekith@pld.org.pl>) | |
188 | + (Michal Moskal <malekith at pld-linux org>) | |
189 | * --dump* works properly | |
190 | * vftp: fixed error handling | |
191 | ||
192 | @@ -260,7 +266,7 @@ | |
193 | - uninstall: fix: don't remove pkg from install list if --test is used | |
194 | - added -h opt. to all commands | |
195 | * removed GCC's nested functions usage -- seems that it causes SIGSEVs on | |
196 | - some machines (Arkadiusz Patyk <areq@pld.org.pl>) | |
197 | + some machines (Arkadiusz Patyk <areq at pld-linux org>) | |
198 | * fix: don't include trailing whitespaces in config values | |
199 | ||
200 | 0.15.8: | |
201 | @@ -271,7 +277,7 @@ | |
202 | doesn't contain package descriptions at all | |
203 | * shell: fixed installed package list management | |
204 | * curl: fixed progress bar if total file size is unknown | |
205 | - (Michal Moskal <malekith@pld.org.pl>) | |
206 | + (Michal Moskal <malekith at pld-linux org>) | |
207 | * "mercy" mode bugfix | |
208 | ||
209 | 0.15.7: | |
210 | @@ -292,8 +298,8 @@ | |
211 | * added global config /etc/poldek.conf usage | |
212 | * fixed prereq loop detection | |
213 | * added '@' to list of valid characters in package filename | |
214 | - (Rafal Kleger-Rudomin <klakier@pld.org.pl>) | |
215 | -* vfjuggle: sed is used instead of awk (Rafal Kleger-Rudomin <klakier@pld.org.pl>) | |
216 | + (Rafal Kleger-Rudomin <klakier at pld-linux org>) | |
217 | +* vfjuggle: sed is used instead of awk (Rafal Kleger-Rudomin <klakier at pld-linux org>) | |
218 | * shell: ls: fixed packages sorting | |
219 | * minor bugfixes | |
220 | ||
221 | @@ -351,8 +357,8 @@ | |
222 | - extended "desc" and "search" commands -- almost all | |
223 | package fields could be specified | |
224 | - colorized output | |
225 | -* bugfixes (thanks to Rafal Kleger-Rudomin <klakier@pld.org.pl> and | |
226 | - Michal Moskal <malekith@pld.org.pl>) | |
227 | +* bugfixes (thanks to Rafal Kleger-Rudomin <klakier at pld-linux org> and | |
228 | + Michal Moskal <malekith at pld-linux org>) | |
229 | ||
230 | 0.14: | |
231 | ||
232 | @@ -373,10 +379,10 @@ | |
233 | * support for rpm 4.0.2 pre/post requirements | |
234 | * readline 4.2 updates | |
235 | * vfile: added curl backend (curl >= 7.7.4-pre1 is needed) | |
236 | -* added --nodesc option for index creation (Michal Moskal <malekith@pld.org.pl>) | |
237 | +* added --nodesc option for index creation (Michal Moskal <malekith at pld-linux org>) | |
238 | * rpmvercmp returns 2 instead of -1 | |
239 | * file names are stored without trailing '\0' (saves about 100 kB disk space) | |
240 | * temporary dir may be set by $TMPDIR | |
241 | * fixed checking dependencies of unistalled packages | |
242 | * shell: added "desc" command | |
243 | -* fixed a lot of bugs (with help of Michal Moskal <malekith@pld.org.pl>) | |
244 | +* fixed a lot of bugs (with help of Michal Moskal <malekith at pld-linux org>) | |
245 | Index: installer/poldek/README.merging | |
246 | diff -u /dev/null installer/poldek/README.merging:1.1.2.1 | |
247 | --- /dev/null Fri Jan 9 13:45:49 2004 | |
248 | +++ installer/poldek/README.merging Wed Apr 2 16:54:08 2003 | |
249 | @@ -0,0 +1,24 @@ | |
250 | + | |
251 | +With --merge option poldek merges two or more sources with esure | |
252 | +that result package set will not contain unsatisfied dependencies. | |
253 | +Usage: | |
254 | + | |
255 | +$ poldek --merge DST_SOURCE SRC_SOURCE... | |
256 | + | |
257 | +Examples: | |
258 | + | |
259 | +Assume you have 2 repositories, the first is "stable", the second | |
260 | +"test" one. | |
261 | + | |
262 | +$ poldek -l | |
263 | +stable /dists/ac/PLD/i686/PLD/RPMS/ | |
264 | +test /dists/ac/test/i686/RPMS/ | |
265 | + | |
266 | +To merge them do: | |
267 | + | |
268 | +$ poldek --merge -n stable -n test | grep 'merge: ' | sed 's/merge: //g' | sh | |
269 | + | |
270 | +The program produces "rm FILE" and "mv FILE" commands after 'merge: ' | |
271 | +prefix, so after filtering out the 'merge: ' prefix the commands could | |
272 | +be passed to shell. After that "$ poldek -n stable -V" should not | |
273 | +reports any unsatisfied dependencies. | |
274 | Index: installer/poldek/conf.c | |
275 | diff -u installer/poldek/conf.c:1.31 installer/poldek/conf.c:1.31.4.3 | |
276 | --- installer/poldek/conf.c:1.31 Fri Oct 18 18:19:42 2002 | |
277 | +++ installer/poldek/conf.c Tue Dec 30 19:14:07 2003 | |
278 | @@ -11,7 +11,7 @@ | |
279 | */ | |
280 | ||
281 | /* | |
282 | - $Id$ | |
283 | + $Id$ | |
284 | */ | |
285 | ||
286 | #include <ctype.h> | |
287 | @@ -79,6 +79,8 @@ | |
288 | { "particle_install", TYPE_BOOL, { 0 } }, | |
289 | { "unique_package_names", TYPE_BOOL, { 0 } }, | |
290 | { "ftp_sysuser_as_anon_passwd", TYPE_BOOL , { 0 } }, | |
291 | + { "vfile_external_compress", TYPE_BOOL, { 0 } }, | |
292 | + { "promoteepoch", TYPE_BOOL, { 0 } }, | |
293 | { NULL, 0, { 0 } }, | |
294 | }; | |
295 | ||
296 | Index: installer/poldek/configure.in | |
297 | diff -u installer/poldek/configure.in:1.76 installer/poldek/configure.in:1.76.4.5 | |
298 | --- installer/poldek/configure.in:1.76 Wed Nov 27 19:56:09 2002 | |
299 | +++ installer/poldek/configure.in Sun Dec 7 22:04:35 2003 | |
300 | @@ -1,15 +1,16 @@ | |
301 | dnl Process this file with autoconf to produce a configure script. | |
302 | -dnl $Id$ | |
303 | +dnl $Id$ | |
304 | ||
305 | -AC_INIT(poldek, 0.18.1) | |
306 | +AC_INIT(poldek, 0.18.2) | |
307 | AC_CONFIG_SRCDIR([capreq.c]) | |
308 | ||
309 | -VERSION=0.18.1 | |
310 | +VERSION=0.18.2 | |
311 | VERSION_STATUS="stable" | |
312 | VERSION_CVSTAG="v$(echo $VERSION | sed 's/\./_/g')" | |
313 | AH_TEMPLATE([ENABLE_TRACE],[]) | |
314 | AH_TEMPLATE([HAVE_RPM_4_0_4],[]) | |
315 | AH_TEMPLATE([HAVE_RPM_4_1],[]) | |
316 | +AH_TEMPLATE([HAVE_RPM_4_2],[]) | |
317 | AH_TEMPLATE([HAVE_RPM_EXTDEPS],[]) | |
318 | AH_TEMPLATE([HAVE_TM_GMTOFF],[]) | |
319 | AH_TEMPLATE([HAVE_TM___GMTOFF],[]) | |
320 | @@ -29,6 +30,11 @@ | |
321 | dnl Checks for programs. | |
322 | AC_PROG_CC() | |
323 | AC_C_INLINE | |
324 | + | |
325 | +if test "$GCC." = "yes."; then | |
326 | + CFLAGS="$CFLAGS -fno-builtin-log" | |
327 | +fi | |
328 | + | |
329 | AC_PROG_INSTALL | |
330 | AC_PROG_RANLIB | |
331 | AC_CHECK_PROG(POD2MAN, pod2man, pod2man) | |
332 | @@ -240,9 +246,10 @@ | |
333 | DBLIB="$DBLIB -ldb1" | |
334 | fi | |
335 | else | |
336 | - AC_CHECK_LIB(db-4.0, db_create, [DBLIB="-ldb-4.0"], | |
337 | + AC_CHECK_LIB(db-4.1, db_create, [DBLIB="-ldb-4.1"], | |
338 | + [AC_CHECK_LIB(db-4.0, db_create, [DBLIB="-ldb-4.0"], | |
339 | [AC_CHECK_LIB(db, db_create, [DBLIB="-ldb"],,[$LIBS])], | |
340 | - [$LIBS]) | |
341 | + [$LIBS])],, [$LIBS]) | |
342 | ||
343 | if test "${ENABLE_STATIC}." = "yes."; then | |
344 | DBLIB="$DBLIB" | |
345 | @@ -264,11 +271,11 @@ | |
346 | fi | |
347 | ||
348 | ||
349 | -AC_CHECK_LIB(rpm, rpmReadPackageInfo,[LIBS="$LIBS -lrpm $DBLIB"], | |
350 | +AC_CHECK_LIB(rpm, rpmReadPackageInfo,[LIBS="-lrpm $DBLIB $LIBS"], | |
351 | AC_CHECK_LIB(rpm, rpmReadPackageHeader, | |
352 | - [LIBS="$LIBS -lrpm -lrpmdb $DBLIB"], | |
353 | + [LIBS="-lrpm -lrpmdb $DBLIB $LIBS"], | |
354 | AC_CHECK_LIB(rpm, rpmReadPackageFile, | |
355 | - [LIBS="$LIBS -lrpm -lrpmdb $DBLIB" | |
356 | + [LIBS="-lrpm -lrpmdb -lelf $DBLIB $LIBS" | |
357 | AC_DEFINE([HAVE_RPM_4_1],1,[])], | |
358 | AC_MSG_ERROR(["rpmlib not found"]), | |
359 | [$DBLIB -lrpmdb]), | |
360 | @@ -278,14 +285,19 @@ | |
361 | AC_CHECK_FUNCS(rpmMachineScore,,[ AC_MSG_ERROR(["rpmlib not found"])]) | |
362 | AC_CHECK_FUNCS(rpmlog rpmCheckSig rpmVerifySignature) | |
363 | ||
364 | +dnl rpm 4.2? | |
365 | +AC_CHECK_FUNCS(rpmtsColor, [LIBS="$LIBS -lpthread" | |
366 | + AC_DEFINE([HAVE_RPM_4_2],1,[])]) | |
367 | +#AC_DEFINE([HAVE_RPM_4_2],1,[])) | |
368 | + | |
369 | AC_CHECK_HEADERS(db_185.h,,[ | |
370 | AC_MSG_WARN(["disabled synchronization with db file-dependencies"]) ]) | |
371 | AC_CHECK_FUNCS(__db185_open) | |
372 | ||
373 | dnl 4.0.4 has cross dependenecies(?) | |
374 | if test ${is_rpm4_0_4}. = yes. -a ${ENABLE_STATIC}. = yes. ; then | |
375 | - if ${have_beecrypt}. = yes. ; then | |
376 | - LIBS="$LIBS -lbz2 -lrpmio" | |
377 | + if test ${have_beecrypt}. = yes. ; then | |
378 | + LIBS="$LIBS -lbz2 -lrpmio -lbeecrypt -lpthread" | |
379 | fi | |
380 | LIBS="$LIBS -lbz2 -lrpmio" | |
381 | fi | |
382 | @@ -298,7 +310,7 @@ | |
383 | ||
384 | AC_CHECK_FUNCS(openpty,, | |
385 | AC_CHECK_LIB(util, openpty, | |
386 | - [AC_DEFINE([HAVE_OPENPTY],1,[defined if openpty() is avialable])] [LIBS="$LIBS -lutil"])) | |
387 | + [AC_DEFINE([HAVE_OPENPTY],1,[defined if openpty() is avialable])] [LIBS="-lutil $LIBS"])) | |
388 | ||
389 | AC_CHECK_FUNCS(rpmGetRpmlibProvides,, | |
390 | [AC_MSG_WARN("[poldek will not work fine with rpmlib\(...\) capabilities"])], | |
391 | @@ -311,6 +323,10 @@ | |
392 | )], | |
393 | [$CONF_IN_LDFLAGS]) | |
394 | ||
395 | +if test -f /etc/redhat-release; then | |
396 | + LIBS="$LIBS -ldl" # rh's crypto needs this | |
397 | +fi | |
398 | + | |
399 | ||
400 | dnl trullib 0.43.5 has n_hash_size; test if linked with system copy only | |
401 | NARRAY="<trurl/narray.h>" | |
402 | @@ -318,7 +334,7 @@ | |
403 | AC_CHECK_LIB(trurl, n_hash_size,, | |
404 | [AC_MSG_ERROR(["trurlib >= 0.43.5 not found"])], [$CONF_IN_LDFLAGS]) | |
405 | else | |
406 | - LIBS="$LIBS -ltrurl" | |
407 | + LIBS="-ltrurl $LIBS" | |
408 | AC_CONFIG_SUBDIRS(trurlib) | |
409 | NARRAY="\"$srcdir/$TRURL_DIR/include/trurl/narray.h\"" | |
410 | fi | |
411 | Index: installer/poldek/dbdep.c | |
412 | diff -u installer/poldek/dbdep.c:1.8 installer/poldek/dbdep.c:1.8.4.1 | |
413 | --- installer/poldek/dbdep.c:1.8 Thu Nov 14 20:23:24 2002 | |
414 | +++ installer/poldek/dbdep.c Tue Dec 30 19:15:27 2003 | |
415 | @@ -9,7 +9,7 @@ | |
416 | */ | |
417 | ||
418 | /* | |
419 | - $Id$ | |
420 | + $Id$ | |
421 | Module used in pkgset-install.c only | |
422 | */ | |
423 | ||
424 | @@ -34,7 +34,7 @@ | |
425 | #include "misc.h" | |
426 | #include "dbdep.h" | |
427 | ||
428 | -static db_dep_free_pkgs(struct db_dep *db_dep) | |
429 | +static void db_dep_free_pkgs(struct db_dep *db_dep) | |
430 | { | |
431 | if (db_dep->pkgs) { | |
432 | n_array_free(db_dep->pkgs); | |
433 | Index: installer/poldek/main.c | |
434 | diff -u installer/poldek/main.c:1.110 installer/poldek/main.c:1.110.4.6 | |
435 | --- installer/poldek/main.c:1.110 Tue Nov 26 17:32:15 2002 | |
436 | +++ installer/poldek/main.c Tue Dec 30 19:14:07 2003 | |
437 | @@ -11,7 +11,7 @@ | |
438 | */ | |
439 | ||
440 | /* | |
441 | - $Id$ | |
442 | + $Id$ | |
443 | */ | |
444 | ||
445 | #ifdef HAVE_CONFIG_H | |
446 | @@ -80,9 +80,9 @@ | |
447 | #define MODE_SPLIT (1 << 7) | |
448 | #define MODE_SRCLIST (1 << 8) | |
449 | #define MODE_UNINSTALL (1 << 9) | |
450 | - | |
451 | +#define MODE_MERGE (1 << 10) | |
452 | #ifdef ENABLE_INTERACTIVE_MODE | |
453 | -# define MODE_SHELL (1 << 10) | |
454 | +# define MODE_SHELL (1 << 11) | |
455 | #endif | |
456 | ||
457 | #define MODE_IS_NOSCORE (MODE_VERIFY | MODE_MKIDX | MODE_SPLIT | MODE_SRCLIST) | |
458 | @@ -171,6 +171,7 @@ | |
459 | tn_hash *htcnf = NULL; /* config file values */ | |
460 | ||
461 | #define OPT_VERIFY_MERCY 'm' | |
462 | +#define OPT_VERIFY_PROMOTEPOCH 901 | |
463 | #define OPT_VERIFY_DEPS 'V' | |
464 | #define OPT_VERIFY_CNFLS 902 | |
465 | #define OPT_VERIFY_FILECNFLS 903 | |
466 | @@ -242,6 +243,7 @@ | |
467 | #define OPT_ASK 2006 | |
468 | #define OPT_NOASK 2007 | |
469 | ||
470 | +#define OPT_MERGE 2101 | |
471 | #define OPT_SW_V016 (1 << 0) | |
472 | #define OPT_SW_NOASK (1 << 1) | |
473 | #define OPT_SW_NOCONF (1 << 2) | |
474 | @@ -298,6 +300,10 @@ | |
475 | N_("Verify dependencies, conflicts and file conflicts"), 50 }, | |
476 | {"mercy", OPT_VERIFY_MERCY, 0, 0, | |
477 | N_("Be tolerant for bugs which RPM tolerates"), 50 }, | |
478 | + | |
479 | +{"promoteepoch", OPT_VERIFY_PROMOTEPOCH, 0, 0, | |
480 | + N_("Promote non-existent requiremet's epoch to package's one"), 50 }, | |
481 | + | |
482 | ||
483 | ||
484 | {0,0,0,0, N_("Index creation:"), 60}, | |
485 | @@ -415,7 +421,14 @@ | |
486 | N_("Take package priorities from FILE"), 71 }, | |
487 | ||
488 | {"split-out", OPT_SPLITOUTPATH, "PREFIX", 0, | |
489 | - N_("Write chunks to PREFIX.XX, default PREFIX is packages.chunk"), 90 }, | |
490 | + N_("Write chunks to PREFIX.XX, default PREFIX is packages.chunk"), 90 }, | |
491 | + | |
492 | +#if 0 //nfy | |
493 | +{0,0,0,0, N_("Merging:"), 100}, | |
494 | +#endif | |
495 | +{"merge", OPT_MERGE, 0, OPTION_HIDDEN, | |
496 | + N_("Merging given sources, the first one is treated as \"destination\", " | |
497 | + "the others as \"source\" ones"), 100 }, | |
498 | ||
499 | {0,0,0,0, N_("Other:"), 500}, | |
500 | {"cachedir", OPT_SOURCECACHE, "DIR", 0, | |
501 | @@ -690,14 +703,20 @@ | |
502 | argsp->idx_path = prepare_path(arg); | |
503 | argsp->idx_type = INDEXTYPE_TXTZ; | |
504 | break; | |
505 | + | |
506 | + case OPT_MERGE: | |
507 | + check_mjrmode(argsp); | |
508 | + argsp->mjrmode = MODE_MERGE; | |
509 | + //argsp->psflags |= PSVERIFY_DEPS; | |
510 | + break; | |
511 | ||
512 | case OPT_NODESC: | |
513 | - argsp->pkgdir_creat_flags |= PKGDIR_CREAT_NODESC; | |
514 | - break; | |
515 | + argsp->pkgdir_creat_flags |= PKGDIR_CREAT_NODESC; | |
516 | + break; | |
517 | ||
518 | case OPT_NODIFF: | |
519 | - argsp->pkgdir_nodiff = 1; | |
520 | - break; | |
521 | + argsp->pkgdir_nodiff = 1; | |
522 | + break; | |
523 | ||
524 | case OPT_UNINSTALL: | |
525 | check_mjrmode(argsp); | |
526 | @@ -1217,7 +1236,6 @@ | |
527 | argp_parse(&argp, argc, argv, 0, 0, &args); | |
528 | ||
529 | pkgdir_v016compat = (args.switches & OPT_SW_V016); | |
530 | - | |
531 | ||
532 | if ((args.switches & OPT_SW_NOCONF) && args.conf_path) { | |
533 | logn(LOGERR, _("--noconf and --conf are exclusive, aren't they?")); | |
534 | @@ -1287,7 +1305,12 @@ | |
535 | args.has_pkgdef = n_array_size(args.pkgdef_sets) + | |
536 | n_array_size(args.pkgdef_defs) + | |
537 | n_array_size(args.pkgdef_files); | |
538 | - | |
539 | + | |
540 | + if (conf_get_bool(htcnf, "vfile_external_compress", 0)) | |
541 | + pkgdir_redhat9_zlib_in_rpm_workaround = 1; | |
542 | + | |
543 | + if (conf_get_bool(htcnf, "promoteepoch", 0)) | |
544 | + poldek_conf_promote_epoch = 1; | |
545 | ||
546 | if (conf_get_bool(htcnf, "use_sudo", 0)) | |
547 | args.inst.flags |= INSTS_USESUDO; | |
548 | @@ -1430,6 +1453,52 @@ | |
549 | } | |
550 | } | |
551 | ||
552 | +static int do_merge(tn_array *sources, unsigned psflags) | |
553 | +{ | |
554 | + struct pkgset *ps_src, *ps_dst; | |
555 | + struct source *src; | |
556 | + tn_array *dst_sources; | |
557 | + int rc = 1; | |
558 | + | |
559 | + n_assert(n_array_size(sources) > 1); | |
560 | + n_array_sort_ex(sources, (tn_fn_cmp)source_cmp_pri_name); | |
561 | + dst_sources = n_array_clone(sources); | |
562 | + | |
563 | + n_array_push(dst_sources, n_array_shift(args.sources)); | |
564 | + | |
565 | + ps_src = pkgset_new(psflags); | |
566 | + ps_dst = pkgset_new(psflags); | |
567 | + | |
568 | + msgn(1, "Loading \"destination\" source..."); | |
569 | + if (!pkgset_load(ps_dst, 0, dst_sources)) | |
570 | + logn(LOGWARN, _("%s: no packages loaded"), | |
571 | + source_idstr((struct source*)n_array_nth(dst_sources, 0))); | |
572 | + | |
573 | + if (!pkgset_setup(ps_dst, 0)) | |
574 | + logn(LOGWARN, "%s: source is not clean", | |
575 | + source_idstr((struct source*)n_array_nth(dst_sources, 0))); | |
576 | + | |
577 | + msgn(1, "Loading \"source\" sources..."); | |
578 | + if (!pkgset_load(ps_src, 0, args.sources)) { | |
579 | + logn(LOGERR, _("%s: no packages loaded"), | |
580 | + source_idstr((struct source*)n_array_nth(args.sources, 0))); | |
581 | + rc = 0; | |
582 | + } | |
583 | + | |
584 | + if (rc) { | |
585 | + pkgset_setup(ps_src, 0); | |
586 | + msgn(1, "Merging..."); | |
587 | + pkgset_merge(ps_dst, ps_src, psflags); | |
588 | + } | |
589 | + | |
590 | + pkgset_free(ps_src); | |
591 | + pkgset_free(ps_dst); | |
592 | + | |
593 | + n_array_unshift(args.sources, n_array_shift(dst_sources)); | |
594 | + n_array_free(dst_sources); | |
595 | + return rc; | |
596 | +} | |
597 | + | |
598 | static struct pkgset *load_pkgset(int ldflags) | |
599 | { | |
600 | struct pkgset *ps; | |
601 | @@ -1658,6 +1727,19 @@ | |
602 | rc = prepare_given_packages(); | |
603 | break; | |
604 | ||
605 | + case MODE_MERGE: | |
606 | + if (verbose >= 0) | |
607 | + verbose += 1; | |
608 | + | |
609 | + n_assert(args.sources); | |
610 | + | |
611 | + if (n_array_size(args.sources) < 2) { | |
612 | + logn(LOGERR, _("merging needs at least 2 sources")); | |
613 | + exit(EXIT_FAILURE); | |
614 | + } | |
615 | + | |
616 | + break; | |
617 | + | |
618 | case MODE_MKIDX: | |
619 | if (verbose >= 0) | |
620 | verbose += 1; | |
621 | @@ -1867,6 +1949,11 @@ | |
622 | if (args.mjrmode == MODE_UNINSTALL) { | |
623 | if ((rc = usrpkgset_size(args.ups))) | |
624 | rc = uninstall(args.ups, &args.inst); | |
625 | + goto l_end; | |
626 | + } | |
627 | + | |
628 | + if (args.mjrmode == MODE_MERGE) { | |
629 | + rc = do_merge(args.sources, args.psflags); | |
630 | goto l_end; | |
631 | } | |
632 | ||
633 | Index: installer/poldek/make.sh | |
634 | diff -u /dev/null installer/poldek/make.sh:1.4.2.2 | |
635 | --- /dev/null Fri Jan 9 13:45:49 2004 | |
636 | +++ installer/poldek/make.sh Fri Dec 19 02:29:31 2003 | |
637 | @@ -0,0 +1,4 @@ | |
638 | +#!/bin/sh | |
639 | + | |
640 | +cd $(dirname $0) || exit 1 | |
641 | +make CFLAGS="-fno-builtin-log -O0 -g -Wall -W -pipe" $@ | |
642 | Index: installer/poldek/pkg.c | |
643 | diff -u installer/poldek/pkg.c:1.51 installer/poldek/pkg.c:1.51.4.2 | |
644 | --- installer/poldek/pkg.c:1.51 Fri Oct 18 18:19:42 2002 | |
645 | +++ installer/poldek/pkg.c Tue Dec 30 19:19:52 2003 | |
646 | @@ -7,7 +7,7 @@ | |
647 | */ | |
648 | ||
649 | /* | |
650 | - $Id$ | |
651 | + $Id$ | |
652 | */ | |
653 | #ifdef HAVE_CONFIG_H | |
654 | # include "config.h" | |
655 | @@ -32,6 +32,8 @@ | |
656 | #include "pkgdir.h" | |
657 | #include "pkgroup.h" | |
658 | ||
659 | +int poldek_conf_promote_epoch = 0; | |
660 | + | |
661 | static void *(*pkg_alloc_fn)(size_t) = n_malloc; | |
662 | static void (*pkg_free_fn)(void*) = n_free; | |
663 | ||
664 | @@ -47,11 +49,13 @@ | |
665 | struct pkg *pkg_new(const char *name, int32_t epoch, | |
666 | const char *version, const char *release, | |
667 | const char *arch, const char *os, | |
668 | + const char *fn, | |
669 | uint32_t size, uint32_t fsize, | |
670 | uint32_t btime) | |
671 | { | |
672 | struct pkg *pkg; | |
673 | - int name_len = 0, version_len = 0, release_len = 0, arch_len = 0, os_len = 0; | |
674 | + int name_len = 0, version_len = 0, release_len = 0, | |
675 | + arch_len = 0, os_len = 0, fn_len = 0; | |
676 | char *buf; | |
677 | int len; | |
678 | ||
679 | @@ -80,6 +84,11 @@ | |
680 | os_len = strlen(os); | |
681 | len += os_len + 1; | |
682 | } | |
683 | + | |
684 | + if (fn) { | |
685 | + fn_len = strlen(fn); | |
686 | + len += fn_len + 1; | |
687 | + } | |
688 | ||
689 | pkg = pkg_alloc_fn(sizeof(*pkg) + len); | |
690 | memset(pkg, 0, sizeof(*pkg)); | |
691 | @@ -122,6 +131,14 @@ | |
692 | buf += os_len; | |
693 | *buf++ = '\0'; | |
694 | } | |
695 | + | |
696 | + pkg->fn = NULL; | |
697 | + if (fn) { | |
698 | + pkg->fn = buf; | |
699 | + memcpy(buf, fn, fn_len); | |
700 | + buf += fn_len; | |
701 | + *buf++ = '\0'; | |
702 | + } | |
703 | ||
704 | pkg->reqs = NULL; | |
705 | pkg->caps = NULL; | |
706 | @@ -253,10 +270,11 @@ | |
707 | ||
708 | if (!headerGetEntry(h, RPMTAG_BUILDTIME, &type, (void *)&btime, NULL)) | |
709 | btime = NULL; | |
710 | - | |
711 | - pkg = pkg_new(name, epoch ? *epoch : 0, version, release, arch, os, | |
712 | + | |
713 | + pkg = pkg_new(name, epoch ? *epoch : 0, version, release, arch, os, | |
714 | + fname ? n_basenam(fname) : NULL, | |
715 | size ? *size : 0, fsize, btime ? *btime : 0); | |
716 | - | |
717 | + | |
718 | if (pkg == NULL) | |
719 | return NULL; | |
720 | ||
721 | @@ -698,7 +716,27 @@ | |
722 | ||
723 | if ((strcmp(capreq_name(cap), capreq_name(req))) != 0) | |
724 | return 0; | |
725 | - | |
726 | + | |
727 | + if (capreq_has_epoch(cap)) { | |
728 | + if (!capreq_has_epoch(req) && poldek_conf_promote_epoch) { | |
729 | + if (verbose > 1) | |
730 | + logn(LOGWARN, "req '%s' needs an epoch (assuming same epoch as %s)\n", | |
731 | + capreq_snprintf_s(req), capreq_snprintf_s0(cap)); | |
732 | + cmprc = 0; | |
733 | + | |
734 | + } else { | |
735 | + cmprc = capreq_epoch(cap) - capreq_epoch(req); | |
736 | + if (cmprc != 0) | |
737 | + return rel_match(cmprc, req); | |
738 | + } | |
739 | + evr = 1; | |
740 | + | |
741 | + } else if (capreq_epoch(req) > 0) { /* always promote cap's epoch */ | |
742 | + cmprc = 0; | |
743 | + evr = 1; | |
744 | + } | |
745 | + | |
746 | +#if 0 | |
747 | if (capreq_has_epoch(req)) { | |
748 | if (!capreq_has_epoch(cap)) | |
749 | return strict == 0; | |
750 | @@ -708,7 +746,8 @@ | |
751 | return rel_match(cmprc, req); | |
752 | evr = 1; | |
753 | } | |
754 | - | |
755 | +#endif | |
756 | + | |
757 | if (capreq_has_ver(req)) { | |
758 | if (!capreq_has_ver(cap)) | |
759 | return strict == 0; | |
760 | @@ -742,14 +781,22 @@ | |
761 | ||
762 | if (!capreq_versioned(req)) | |
763 | return 1; | |
764 | - | |
765 | - if (capreq_has_epoch(req) && pkg->epoch) { | |
766 | - cmprc = pkg->epoch - capreq_epoch(req); | |
767 | - if (cmprc != 0) | |
768 | - return rel_match(cmprc, req); | |
769 | + | |
770 | + if (pkg->epoch) { | |
771 | + if (!capreq_has_epoch(req) && poldek_conf_promote_epoch) { | |
772 | + if (verbose > 1) | |
773 | + logn(LOGWARN, "req '%s' needs an epoch (assuming same epoch as %s)\n", | |
774 | + capreq_snprintf_s(req), pkg_snprintf_s(pkg)); | |
775 | + cmprc = 0; | |
776 | + | |
777 | + } else { | |
778 | + cmprc = pkg->epoch - capreq_epoch(req); | |
779 | + if (cmprc != 0) | |
780 | + return rel_match(cmprc, req); | |
781 | + } | |
782 | evr = 1; | |
783 | ||
784 | - } else if (capreq_epoch(req) > 0) { | |
785 | + } else if (capreq_epoch(req) > 0) { /* always promote package's epoch */ | |
786 | cmprc = 0; | |
787 | evr = 1; | |
788 | } | |
789 | @@ -1198,6 +1245,19 @@ | |
790 | { | |
791 | static char str[256]; | |
792 | snprintf(str, sizeof(str), "%s-%s-%s", pkg->name, pkg->ver, pkg->rel); | |
793 | + return str; | |
794 | +} | |
795 | + | |
796 | + | |
797 | +char *pkg_snprintf_epoch_s(const struct pkg *pkg) | |
798 | +{ | |
799 | + static char str[256]; | |
800 | + char es[16] = {0}; | |
801 | + | |
802 | + if (pkg->epoch) | |
803 | + snprintf(es, sizeof(es), "%d:", pkg->epoch); | |
804 | + | |
805 | + snprintf(str, sizeof(str), "%s-%s%s-%s", pkg->name, es, pkg->ver, pkg->rel); | |
806 | return str; | |
807 | } | |
808 | ||
809 | Index: installer/poldek/pkg.h | |
810 | diff -u installer/poldek/pkg.h:1.37 installer/poldek/pkg.h:1.37.4.2 | |
811 | --- installer/poldek/pkg.h:1.37 Fri Oct 18 18:19:42 2002 | |
812 | +++ installer/poldek/pkg.h Tue Dec 30 19:19:52 2003 | |
813 | @@ -1,4 +1,4 @@ | |
814 | -/* $Id$ */ | |
815 | +/* $Id$ */ | |
816 | #ifndef POLDEK_PKG_H | |
817 | #define POLDEK_PKG_H | |
818 | ||
819 | @@ -106,6 +106,7 @@ | |
820 | char *rel; | |
821 | char *arch; | |
822 | char *os; | |
823 | + char *fn; | |
824 | ||
825 | tn_array *caps; /* capabilities */ | |
826 | tn_array *reqs; /* requirements */ | |
827 | @@ -143,6 +144,7 @@ | |
828 | struct pkg *pkg_new(const char *name, int32_t epoch, | |
829 | const char *version, const char *release, | |
830 | const char *arch, const char *os, | |
831 | + const char *fn, | |
832 | uint32_t size, uint32_t fsize, | |
833 | uint32_t btime); | |
834 | ||
835 | @@ -199,6 +201,10 @@ | |
836 | ||
837 | int pkg_eq_capreq(const struct pkg *pkg, const struct capreq *cr); | |
838 | ||
839 | + | |
840 | + | |
841 | +extern int poldek_conf_promote_epoch; /* be compatibile with rpm < 4.2.1 */ | |
842 | + | |
843 | /* look up into package caps only */ | |
844 | int pkg_caps_match_req(const struct pkg *pkg, const struct capreq *req, | |
845 | int strict); | |
846 | @@ -239,6 +245,9 @@ | |
847 | char *pkg_snprintf_s(const struct pkg *pkg); | |
848 | char *pkg_snprintf_s0(const struct pkg *pkg); | |
849 | char *pkg_snprintf_s1(const struct pkg *pkg); | |
850 | + | |
851 | + | |
852 | +char *pkg_snprintf_epoch_s(const struct pkg *pkg); | |
853 | ||
854 | /* load and returns not loaded file list (l: tag in package index) */ | |
855 | tn_array *pkg_other_fl(const struct pkg *pkg); | |
856 | Index: installer/poldek/pkgdir.c | |
857 | diff -u installer/poldek/pkgdir.c:1.39 installer/poldek/pkgdir.c:1.39.4.3 | |
858 | --- installer/poldek/pkgdir.c:1.39 Tue Nov 26 17:32:16 2002 | |
859 | +++ installer/poldek/pkgdir.c Tue Dec 30 19:19:52 2003 | |
860 | @@ -11,7 +11,7 @@ | |
861 | */ | |
862 | ||
863 | /* | |
864 | - $Id$ | |
865 | + $Id$ | |
866 | */ | |
867 | ||
868 | #ifdef HAVE_CONFIG_H | |
869 | @@ -54,6 +54,7 @@ | |
870 | #include "pkgroup.h" | |
871 | ||
872 | int pkgdir_v016compat = 0; /* public */ | |
873 | +int pkgdir_redhat9_zlib_in_rpm_workaround = 0; | |
874 | ||
875 | #define PKGT_HAS_NAME (1 << 0) | |
876 | #define PKGT_HAS_EVR (1 << 1) | |
877 | @@ -179,9 +180,12 @@ | |
878 | static | |
879 | int do_open_idx(struct idx_s *idx, char *path, int path_len, int vfmode) | |
880 | { | |
881 | + if (pkgdir_redhat9_zlib_in_rpm_workaround) | |
882 | + vfmode |= VFM_UNCOMPR; | |
883 | + | |
884 | if ((idx->pdg = pdigest_new(path, vfmode, pkgdir_v016compat))) { | |
885 | if ((idx->vf = vfile_open(path, VFT_STDIO, vfmode)) == NULL) { | |
886 | - if (path_len && strcmp(&path[path_len - 3], ".gz") == 0) { | |
887 | + if (path_len > 3 && strcmp(&path[path_len - 3], ".gz") == 0) { | |
888 | path[path_len - 3] = '\0'; /* trim *.gz */ | |
889 | idx->vf = vfile_open(path, VFT_STDIO, vfmode); | |
890 | } | |
891 | @@ -1219,9 +1223,9 @@ | |
892 | break; | |
893 | ||
894 | default: | |
895 | - logn(LOGERR, "%s:%ld: unknown tag '%c'", pkgdir->path, offs, *line); | |
896 | - nerr++; | |
897 | - goto l_end; | |
898 | + logn(LOGWARN, "%s:%ld: unknown tag '%c' (skipped)", | |
899 | + pkgdir->path, offs, *line); | |
900 | + break; | |
901 | } | |
902 | } | |
903 | ||
904 | @@ -1389,7 +1393,7 @@ | |
905 | return NULL; | |
906 | } | |
907 | ||
908 | - pkg = pkg_new(pkgt->name, epoch, version, release, arch, os, | |
909 | + pkg = pkg_new(pkgt->name, epoch, version, release, arch, os, NULL, | |
910 | pkgt->size, pkgt->fsize, pkgt->btime); | |
911 | pkg->groupid = pkgt->groupid; | |
912 | ||
913 | @@ -1457,7 +1461,7 @@ | |
914 | int32_t epoch = 0; | |
915 | ||
916 | if (*p && parse_nevr(p, &name, &epoch, &ver, &rel)) { | |
917 | - struct pkg *pkg = pkg_new(name, epoch, ver, rel, NULL, NULL, | |
918 | + struct pkg *pkg = pkg_new(name, epoch, ver, rel, NULL, NULL, NULL, | |
919 | 0, 0, 0); | |
920 | n_array_push(pkgs, pkg); | |
921 | } | |
922 | Index: installer/poldek/pkgdir.h | |
923 | diff -u installer/poldek/pkgdir.h:1.22 installer/poldek/pkgdir.h:1.22.6.1 | |
924 | --- installer/poldek/pkgdir.h:1.22 Sat Aug 24 09:59:11 2002 | |
925 | +++ installer/poldek/pkgdir.h Sun Dec 7 22:01:53 2003 | |
926 | @@ -1,4 +1,4 @@ | |
927 | -/* $Id$ */ | |
928 | +/* $Id$ */ | |
929 | #ifndef POLDEK_PKGDIR_H | |
930 | #define POLDEK_PKGDIR_H | |
931 | ||
932 | @@ -41,6 +41,7 @@ | |
933 | }; | |
934 | ||
935 | extern int pkgdir_v016compat; | |
936 | +extern int pkgdir_redhat9_zlib_in_rpm_workaround; | |
937 | ||
938 | struct pkgdir { | |
939 | char *name; | |
940 | Index: installer/poldek/pkgdir_save.c | |
941 | diff -u installer/poldek/pkgdir_save.c:1.8 installer/poldek/pkgdir_save.c:1.8.6.1 | |
942 | --- installer/poldek/pkgdir_save.c:1.8 Mon Jun 10 19:56:34 2002 | |
943 | +++ installer/poldek/pkgdir_save.c Fri Dec 19 02:29:31 2003 | |
944 | @@ -7,7 +7,7 @@ | |
945 | */ | |
946 | ||
947 | /* | |
948 | - $Id$ | |
949 | + $Id$ | |
950 | */ | |
951 | ||
952 | #ifdef HAVE_CONFIG_H | |
953 | @@ -248,8 +248,12 @@ | |
954 | char suffix[64] = "", tocsuffix[64] = ".toc", | |
955 | difftoc_suffix[PATH_MAX] = ""; | |
956 | const char *orig_pathname; | |
957 | - int i, with_toc = 1; | |
958 | + int i, with_toc = 1, vfmode; | |
959 | ||
960 | + | |
961 | + vfmode = VFM_RW; | |
962 | + if (pkgdir_redhat9_zlib_in_rpm_workaround) | |
963 | + vfmode |= VFM_UNCOMPR; | |
964 | ||
965 | if ((flags & PKGDIR_CREAT_asCACHE) == 0 && | |
966 | (pkgdir->flags & (PKGDIR_DIFF | PKGDIR_UNIQED)) == 0) { | |
967 | @@ -313,14 +317,14 @@ | |
968 | msgn_f(1, _("Writing %s..."), path); | |
969 | ||
970 | if (with_toc) { | |
971 | - if ((vf_toc = vfile_open(tocpath, VFT_STDIO, VFM_RW)) == NULL) | |
972 | + if ((vf_toc = vfile_open(tocpath, VFT_STDIO, vfmode)) == NULL) | |
973 | return 0; | |
974 | put_fheader(vf_toc->vf_stream, pdir_poldeksindex_toc, pkgdir); | |
975 | } | |
976 | ||
977 | do_unlink(path); | |
978 | ||
979 | - if ((vf = vfile_open(path, VFT_STDIO, VFM_RW)) == NULL) { | |
980 | + if ((vf = vfile_open(path, VFT_STDIO, vfmode)) == NULL) { | |
981 | if (vf_toc) | |
982 | vfile_close(vf_toc); | |
983 | return 0; | |
984 | @@ -397,8 +401,10 @@ | |
985 | return 0; | |
986 | } | |
987 | ||
988 | - if ((vf = vfile_open(difftoc_path, VFT_STDIO, VFM_APPEND)) == NULL) | |
989 | + if ((vf = vfile_open(difftoc_path, VFT_STDIO, | |
990 | + vfmode | VFM_APPEND)) == NULL) | |
991 | return 0; | |
992 | + | |
993 | fprintf(vf->vf_stream, "%s %lu %s %lu\n", | |
994 | n_basenam(path), pkgdir->ts, pkgdir->mdd_orig, pkgdir->ts_orig); | |
995 | vfile_close(vf); | |
996 | Index: installer/poldek/pkgroup.c | |
997 | diff -u installer/poldek/pkgroup.c:1.10 installer/poldek/pkgroup.c:1.10.6.1 | |
998 | --- installer/poldek/pkgroup.c:1.10 Thu Apr 25 18:34:11 2002 | |
999 | +++ installer/poldek/pkgroup.c Fri Dec 19 02:19:25 2003 | |
1000 | @@ -7,7 +7,7 @@ | |
1001 | */ | |
1002 | ||
1003 | /* | |
1004 | - $Id$ | |
1005 | + $Id$ | |
1006 | */ | |
1007 | #ifdef HAVE_CONFIG_H | |
1008 | # include "config.h" | |
1009 | @@ -246,7 +246,7 @@ | |
1010 | if (fread(&nid, sizeof(nid), 1, stream) != 1) | |
1011 | return 0; | |
1012 | ||
1013 | - if (fread(&nlen, sizeof(nlen), 1, stream) != 1 || nlen > sizeof(name)) | |
1014 | + if (fread(&nlen, sizeof(nlen), 1, stream) != 1) | |
1015 | return 0; | |
1016 | ||
1017 | if (fread(name, nlen, 1, stream) != 1) | |
1018 | Index: installer/poldek/pkgset-install.c | |
1019 | diff -u installer/poldek/pkgset-install.c:1.82 installer/poldek/pkgset-install.c:1.82.4.2 | |
1020 | --- installer/poldek/pkgset-install.c:1.82 Sat Nov 16 01:23:22 2002 | |
1021 | +++ installer/poldek/pkgset-install.c Tue Dec 30 19:19:52 2003 | |
1022 | @@ -11,7 +11,7 @@ | |
1023 | */ | |
1024 | ||
1025 | /* | |
1026 | - $Id$ | |
1027 | + $Id$ | |
1028 | */ | |
1029 | ||
1030 | #ifdef HAVE_CONFIG_H | |
1031 | @@ -224,11 +224,11 @@ | |
1032 | ||
1033 | if (p != pkg && pkg_is_marked(p)) { | |
1034 | if (req == NULL || pkg_statisfies_req(p, req, 0)) { | |
1035 | - DBGF("%s -> yes, %s\n", pkg_snprintf_s0(pkg), pkg_snprintf_s1(p)); | |
1036 | - return 1; | |
1037 | + DBGF("%s -> yes, %s\n", pkg_snprintf_s0(pkg), pkg_snprintf_s1(p)); | |
1038 | + return 1; | |
1039 | + } | |
1040 | } | |
1041 | } | |
1042 | - } | |
1043 | ||
1044 | return 0; | |
1045 | } | |
1046 | @@ -303,7 +303,7 @@ | |
1047 | struct pkg **candidates, int npkgs, | |
1048 | struct pkgset *ps, struct upgrade_s *upg) | |
1049 | { | |
1050 | - int *ncnfls, i, j, i_min, cnfl_min; | |
1051 | + int *ncnfls, i, j, i_best, cnfl_min; | |
1052 | int i_ver_eq = -1, i_evr_eq = -1; | |
1053 | ||
1054 | DBGF("%s (%d)\n", pkg_snprintf_s(marker), npkgs); | |
1055 | @@ -345,38 +345,44 @@ | |
1056 | return i_ver_eq; | |
1057 | ||
1058 | cnfl_min = INT_MAX; | |
1059 | - i_min = -1; | |
1060 | + i_best = -1; | |
1061 | for (i=0; i < npkgs; i++) { | |
1062 | DBGF("%d. %s %d\n", i, pkg_snprintf_s(candidates[i]), ncnfls[i]); | |
1063 | if (cnfl_min > ncnfls[i]) { | |
1064 | cnfl_min = ncnfls[i]; | |
1065 | - i_min = i; | |
1066 | + i_best = i; | |
1067 | } | |
1068 | } | |
1069 | ||
1070 | - DBGF("[after cnfls] i_min = %d\n", i_min); | |
1071 | + DBGF("[after cnfls] i_best = %d\n", i_best); | |
1072 | if (cnfl_min == 0) { | |
1073 | int n = INT_MAX, *nmarks; | |
1074 | ||
1075 | nmarks = alloca(npkgs * sizeof(*nmarks)); | |
1076 | ||
1077 | for (i=0; i < npkgs; i++) { | |
1078 | + if (other_version_marked(candidates[i], ps->pkgs, NULL)) { | |
1079 | + DBGF("%d. %s other version is already marked, skipped\n", | |
1080 | + i, pkg_snprintf_s(candidates[i])); | |
1081 | + continue; | |
1082 | + } | |
1083 | + | |
1084 | nmarks[i] = pkg_drags(candidates[i], ps, upg); | |
1085 | - DBGF("%d %s -> %d\n", i, pkg_snprintf_s(candidates[i]), nmarks[i]); | |
1086 | - if (n > nmarks[i]) { | |
1087 | + DBGF("%d. %s -> %d\n", i, pkg_snprintf_s(candidates[i]), nmarks[i]); | |
1088 | + if (n > nmarks[i]) | |
1089 | n = nmarks[i]; | |
1090 | - } | |
1091 | - | |
1092 | + | |
1093 | if (n == 0 && ncnfls[i] == 0) { | |
1094 | - i_min = i; | |
1095 | + i_best = i; | |
1096 | break; | |
1097 | } | |
1098 | } | |
1099 | } | |
1100 | ||
1101 | - if (i_min == -1) | |
1102 | - i_min = 0; | |
1103 | - return i_min; | |
1104 | + if (i_best == -1) | |
1105 | + i_best = 0; | |
1106 | + DBGF("RET %d. %s\n", i_best, pkg_snprintf_s(candidates[i])); | |
1107 | + return i_best; | |
1108 | } | |
1109 | ||
1110 | #define FINDREQ_BESTSEL 0 | |
1111 | @@ -1009,7 +1015,7 @@ | |
1112 | capreq_snprintf(reqname, 256, req); | |
1113 | } | |
1114 | ||
1115 | - DBGF("req %s\n", capreq_snprintf_s(req)); | |
1116 | + DBGF("%s: REQ %s\n", pkg_snprintf_s(pkg), capreq_snprintf_s(req)); | |
1117 | ||
1118 | if ((upg->inst->flags & INSTS_EQPKG_ASKUSER) && upg->inst->askpkg_fn) | |
1119 | tomark_candidates_ptr = &tomark_candidates; | |
1120 | @@ -1022,7 +1028,8 @@ | |
1121 | goto l_end_loop; | |
1122 | } | |
1123 | } | |
1124 | - | |
1125 | + DBGF("%s: TOMARK %s\n", pkg_snprintf_s1(pkg), | |
1126 | + tomark ? pkg_snprintf_s0(tomark) : "NULL"); | |
1127 | /* don't check foreign dependencies */ | |
1128 | if (process_as == PROCESS_AS_ORPHAN) { | |
1129 | #if 0 /* buggy, TODO - unmark foreign on adding to uninst_set */ | |
1130 | @@ -1854,7 +1861,8 @@ | |
1131 | if (is_installed == 0) | |
1132 | n_array_push(iinf->uninstalled_pkgs, | |
1133 | pkg_new(pkg->name, pkg->epoch, pkg->ver, pkg->rel, | |
1134 | - pkg->arch, pkg->os, pkg->size, pkg->fsize, | |
1135 | + pkg->arch, pkg->os, NULL, | |
1136 | + pkg->size, pkg->fsize, | |
1137 | pkg->btime)); | |
1138 | } | |
1139 | ||
1140 | Index: installer/poldek/pkgset-merge.c | |
1141 | diff -u /dev/null installer/poldek/pkgset-merge.c:1.1.2.1 | |
1142 | --- /dev/null Fri Jan 9 13:45:49 2004 | |
1143 | +++ installer/poldek/pkgset-merge.c Wed Apr 2 16:54:08 2003 | |
1144 | @@ -0,0 +1,153 @@ | |
1145 | +/* | |
1146 | + Copyright (C) 2000 Pawel A. Gajda (mis@k2.net.pl) | |
1147 | + | |
1148 | + This program is free software; you can redistribute it and/or modify | |
1149 | + it under the terms of the GNU General Public License published by | |
1150 | + the Free Software Foundation (see file COPYING for details). | |
1151 | +*/ | |
1152 | + | |
1153 | +/* | |
1154 | + $Id$ | |
1155 | +*/ | |
1156 | + | |
1157 | +#include <limits.h> | |
1158 | +#include <stdint.h> | |
1159 | +#include <string.h> | |
1160 | +#include <errno.h> | |
1161 | + | |
1162 | +#include <rpm/rpmlib.h> | |
1163 | +#include <trurl/nassert.h> | |
1164 | +#include <trurl/narray.h> | |
1165 | +#include <trurl/nhash.h> | |
1166 | + | |
1167 | +#include "i18n.h" | |
1168 | +#include "log.h" | |
1169 | +#include "pkg.h" | |
1170 | +#include "pkgset.h" | |
1171 | +#include "misc.h" | |
1172 | + | |
1173 | +static | |
1174 | +int find_replacement(struct pkgset *ps, struct pkg *pkg, struct pkg **rpkg) | |
1175 | +{ | |
1176 | + const struct capreq_idx_ent *ent; | |
1177 | + struct pkg *bypkg = NULL; | |
1178 | + | |
1179 | + | |
1180 | + *rpkg = NULL; | |
1181 | + | |
1182 | + if ((bypkg = pkgset_lookup_pkgn(ps, pkg->name)) && | |
1183 | + pkg_cmp_name_evr(bypkg, pkg) > 0) { | |
1184 | + | |
1185 | + *rpkg = bypkg; | |
1186 | + | |
1187 | + } else if ((ent = capreq_idx_lookup(&ps->obs_idx, pkg->name))) { | |
1188 | + int i; | |
1189 | + | |
1190 | + for (i=0; i < ent->items; i++) { | |
1191 | + if (pkg_caps_obsoletes_pkg_caps(ent->pkgs[i], pkg) && | |
1192 | + pkg_cmp_name_evr(ent->pkgs[i], pkg) > 0) { | |
1193 | + | |
1194 | + *rpkg = ent->pkgs[i]; | |
1195 | + break; | |
1196 | + } | |
1197 | + } | |
1198 | + } | |
1199 | + | |
1200 | + if (*rpkg && strcmp((*rpkg)->name, pkg->name) != 0 && | |
1201 | + (*rpkg)->caps && pkg->caps) { | |
1202 | + | |
1203 | + int i; | |
1204 | + for (i=0; i < n_array_size((*rpkg)->caps); i++) { | |
1205 | + struct capreq *cap = n_array_nth((*rpkg)->caps, i); | |
1206 | + | |
1207 | + if (strcmp(capreq_name(cap), (*rpkg)->name) == 0) | |
1208 | + continue; | |
1209 | + | |
1210 | + if (capreq_arr_find(pkg->caps, capreq_name(cap))) { | |
1211 | + msg(2, "%s is NOT obsoleted by %s (same %s)\n", pkg_snprintf_s(pkg), | |
1212 | + pkg_snprintf_s0(*rpkg), capreq_name(cap)); | |
1213 | + *rpkg = NULL; | |
1214 | + break; | |
1215 | + } | |
1216 | + } | |
1217 | + } | |
1218 | + | |
1219 | + return (*rpkg != NULL); | |
1220 | +} | |
1221 | + | |
1222 | +void pkgset_merge(struct pkgset *ps_dst, struct pkgset *ps_src, | |
1223 | + unsigned psflags) /* TODO: psflags should be extractable | |
1224 | + from existing ps */ | |
1225 | +{ | |
1226 | + struct pkg *pkg, *rpkg; | |
1227 | + tn_array *rm_pkgs, *pkgs; | |
1228 | + struct pkgset *ps; | |
1229 | + struct pkgdir *pkgdir; | |
1230 | + int i; | |
1231 | + | |
1232 | + n_assert(n_array_size(ps_dst->pkgdirs) == 1); | |
1233 | + | |
1234 | + rm_pkgs = pkgs_array_new(1024); | |
1235 | + pkgs = pkgs_array_new(n_array_size(ps_dst->pkgdirs)); | |
1236 | + | |
1237 | + for (i=0; i < n_array_size(ps_src->pkgs); i++) { | |
1238 | + pkg = n_array_nth(ps_src->pkgs, i); | |
1239 | + pkg_clr_badreqs(pkg); | |
1240 | + n_array_push(pkgs, pkg_link(pkg)); | |
1241 | + } | |
1242 | + | |
1243 | + for (i=0; i < n_array_size(ps_dst->pkgs); i++) { | |
1244 | + pkg = n_array_nth(ps_dst->pkgs, i); | |
1245 | + pkg_clr_badreqs(pkg); | |
1246 | + | |
1247 | + if (!find_replacement(ps_src, pkg, &rpkg)) { | |
1248 | + n_array_push(pkgs, pkg_link(pkg)); | |
1249 | + | |
1250 | + } else { | |
1251 | + n_array_push(rm_pkgs, pkg_link(pkg)); | |
1252 | + n_array_push(rm_pkgs, pkg_link(rpkg)); | |
1253 | + msg(2, "%s is obsoleted by %s\n", pkg_snprintf_s(pkg), | |
1254 | + pkg_snprintf_s0(rpkg)); | |
1255 | + } | |
1256 | + } | |
1257 | + | |
1258 | + ps = pkgset_new(psflags | PSVERIFY_DEPS); | |
1259 | + ps->pkgs = n_ref(pkgs); | |
1260 | + pkgset_setup(ps, NULL); | |
1261 | + | |
1262 | + pkgdir = n_array_nth(ps_dst->pkgdirs, 0); | |
1263 | + for (i=0; i<n_array_size(ps->pkgs); i++) { | |
1264 | + pkg = n_array_nth(ps->pkgs, i); | |
1265 | + if (pkg_has_badreqs(pkg)) { | |
1266 | + if (pkg->pkgdir != pkgdir) { | |
1267 | + logn(LOGWARN, "%s: could not be moved\n", pkg_filename_s(pkg)); | |
1268 | + | |
1269 | + } else { | |
1270 | + logn(LOGWARN, "%s: will be REMOVED from destination\n", | |
1271 | + pkg_filename_s(pkg)); | |
1272 | + printf("merge: rm %s\n", pkg_path_s(pkg)); | |
1273 | + } | |
1274 | + } else if (pkg->pkgdir != pkgdir) | |
1275 | + printf("merge: mv %s %s\n", pkg_path_s(pkg), pkgdir->path); | |
1276 | + } | |
1277 | + | |
1278 | + while (n_array_size(rm_pkgs)) { | |
1279 | + pkg = n_array_shift(rm_pkgs); | |
1280 | + rpkg = n_array_shift(rm_pkgs); | |
1281 | + | |
1282 | + if (pkg_has_badreqs(rpkg)) { | |
1283 | + logn(LOGWARN, "%s: could not be moved\n", pkg_path_s(pkg)); | |
1284 | + | |
1285 | + } else { | |
1286 | + printf("merge: rm %s\n", pkg_path_s(pkg)); | |
1287 | + } | |
1288 | + | |
1289 | + | |
1290 | + pkg_free(pkg); | |
1291 | + pkg_free(rpkg); | |
1292 | + } | |
1293 | + | |
1294 | + n_array_free(pkgs); | |
1295 | + pkgset_free(ps); | |
1296 | +} | |
1297 | + | |
1298 | Index: installer/poldek/pkgset-req.c | |
1299 | diff -u installer/poldek/pkgset-req.c:1.23 installer/poldek/pkgset-req.c:1.23.4.1 | |
1300 | --- installer/poldek/pkgset-req.c:1.23 Thu Nov 7 17:43:26 2002 | |
1301 | +++ installer/poldek/pkgset-req.c Wed Jul 23 18:15:11 2003 | |
1302 | @@ -7,7 +7,7 @@ | |
1303 | */ | |
1304 | ||
1305 | /* | |
1306 | - $Id$ | |
1307 | + $Id$ | |
1308 | */ | |
1309 | ||
1310 | #include <limits.h> | |
1311 | @@ -186,7 +186,7 @@ | |
1312 | static int add_reqpkg(struct pkg *pkg, struct capreq *req, struct pkg *dpkg) | |
1313 | { | |
1314 | struct reqpkg *rpkg; | |
1315 | - struct reqpkg tmp_rpkg = {NULL, 0, {NULL}}; | |
1316 | + struct reqpkg tmp_rpkg = {NULL, 0}; | |
1317 | ||
1318 | tmp_rpkg.pkg = dpkg; | |
1319 | rpkg = n_array_bsearch(pkg->reqpkgs, &tmp_rpkg); | |
1320 | @@ -368,7 +368,7 @@ | |
1321 | int isneq; | |
1322 | uint8_t flags; | |
1323 | struct reqpkg *rpkg; | |
1324 | - struct reqpkg tmp_rpkg = {NULL, 0, {NULL}}; | |
1325 | + struct reqpkg tmp_rpkg = {NULL, 0}; | |
1326 | ||
1327 | flags = 0; | |
1328 | flags |= capreq_is_prereq(req) ? REQPKG_PREREQ : 0; | |
1329 | Index: installer/poldek/pkgset.h | |
1330 | diff -u installer/poldek/pkgset.h:1.37 installer/poldek/pkgset.h:1.37.4.1 | |
1331 | --- installer/poldek/pkgset.h:1.37 Thu Nov 14 19:21:42 2002 | |
1332 | +++ installer/poldek/pkgset.h Wed Apr 2 16:54:08 2003 | |
1333 | @@ -1,4 +1,4 @@ | |
1334 | -/* $Id$ */ | |
1335 | +/* $Id$ */ | |
1336 | #ifndef POLDEK_PKGSET_H | |
1337 | #define POLDEK_PKGSET_H | |
1338 | ||
1339 | @@ -120,6 +120,10 @@ | |
1340 | void pkgset_free(struct pkgset *ps); | |
1341 | ||
1342 | int pkgset_setup(struct pkgset *ps, const char *pri_fpath); | |
1343 | + | |
1344 | +/* --merge */ | |
1345 | +void pkgset_merge(struct pkgset *ps_dst, struct pkgset *ps_src, | |
1346 | + unsigned psflags); | |
1347 | ||
1348 | /* returns sorted list of packages, free it by n_array_free() */ | |
1349 | tn_array *pkgset_getpkgs(const struct pkgset *ps); | |
1350 | Index: installer/poldek/poldek.spec.in | |
1351 | diff -u installer/poldek/poldek.spec.in:1.20 installer/poldek/poldek.spec.in:1.20.4.1 | |
1352 | --- installer/poldek/poldek.spec.in:1.20 Thu Nov 7 18:41:07 2002 | |
1353 | +++ installer/poldek/poldek.spec.in Wed Jul 23 19:04:16 2003 | |
1354 | @@ -1,4 +1,4 @@ | |
1355 | -# $Revision$, $Date$ | |
1356 | +# $Revision$, $Date$ | |
1357 | # | |
1358 | # spec is based on PLD's poldek.spec available at <http://cvs.pld.org.pl/SPECS/> | |
1359 | # | |
1360 | @@ -14,16 +14,16 @@ | |
1361 | Group: Applications/System | |
1362 | Source0: http://team.pld.org.pl/~mis/poldek/download/%{name}-%{version}.tar.bz2 | |
1363 | URL: http://team.pld.org.pl/~mis/poldek/ | |
1364 | -Requires: /bin/rpm | |
1365 | +#Requires: /bin/rpm | |
1366 | BuildRequires: bzip2-devel | |
1367 | -BuildRequires: db3-devel >= 3.1.14-2 | |
1368 | +#BuildRequires: db3-devel >= 3.1.14-2 | |
1369 | #BuildRequires: curl-devel >= 7.8 | |
1370 | BuildRequires: rpm-devel >= 4.0 | |
1371 | #BuildRequires: popt-static | |
1372 | BuildRequires: openssl-devel | |
1373 | BuildRequires: readline-devel | |
1374 | BuildRequires: zlib-devel | |
1375 | -BuildRequires: /usr/bin/pod2man | |
1376 | +#BuildRequires: /usr/bin/pod2man | |
1377 | BuildRequires: pcre-devel | |
1378 | %{?_with_static:BuildRequires: bzip2-static} | |
1379 | %{?_with_static:BuildRequires: curl-static} | |
1380 | @@ -78,6 +78,9 @@ | |
1381 | All persons listed below can be reached at <cvs_login>@pld.org.pl | |
1382 | ||
1383 | $Log$ | |
1384 | +Revision 1.20.4.1 2003/07/23 17:04:16 mis | |
1385 | +- removed unneeded dependencies | |
1386 | + | |
1387 | Revision 1.20 2002/11/07 17:41:07 mis | |
1388 | - used tar.bz2 source | |
1389 | ||
1390 | Index: installer/poldek/rpm.c | |
1391 | diff -u installer/poldek/rpm.c:1.41 installer/poldek/rpm.c:1.41.4.1 | |
1392 | --- installer/poldek/rpm.c:1.41 Fri Nov 22 18:07:26 2002 | |
1393 | +++ installer/poldek/rpm.c Sun Dec 7 21:58:15 2003 | |
1394 | @@ -11,7 +11,7 @@ | |
1395 | */ | |
1396 | ||
1397 | /* | |
1398 | - $Id$ | |
1399 | + $Id$ | |
1400 | */ | |
1401 | ||
1402 | #ifdef HAVE_CONFIG_H | |
1403 | @@ -188,10 +188,10 @@ | |
1404 | while((dbrec = rpmdb_it_get(&it)) != NULL) { | |
1405 | if (dbpkg_array_has(unistdbpkgs, dbrec->recno) || | |
1406 | dbpkg_array_has(cnfldbpkgs, dbrec->recno)) | |
1407 | - continue; | |
1408 | + continue; | |
1409 | ||
1410 | n_array_push(cnfldbpkgs, dbpkg_new(dbrec->recno, dbrec->h, ldflags)); | |
1411 | - break; | |
1412 | + break; | |
1413 | } | |
1414 | rpmdb_it_destroy(&it); | |
1415 | ||
1416 | @@ -215,12 +215,12 @@ | |
1417 | rpmdb_it_init(db, &it, RPMITER_NAME, capreq_name(req)); | |
1418 | while ((dbrec = rpmdb_it_get(&it)) != NULL) { | |
1419 | if (dbpkg_array_has(unistdbpkgs, dbrec->recno)) | |
1420 | - continue; | |
1421 | + continue; | |
1422 | ||
1423 | if (header_evr_match_req(dbrec->h, req)) { | |
1424 | - rc = 1; | |
1425 | - break; | |
1426 | - } | |
1427 | + rc = 1; | |
1428 | + break; | |
1429 | + } | |
1430 | } | |
1431 | rpmdb_it_destroy(&it); | |
1432 | ||
1433 | @@ -237,9 +237,9 @@ | |
1434 | rpmdb_it_init(db, &it, RPMITER_FILE, capreq_name(req)); | |
1435 | while ((dbrec = rpmdb_it_get(&it)) != NULL) { | |
1436 | if (dbpkg_array_has(unistdbpkgs, dbrec->recno)) | |
1437 | - continue; | |
1438 | - finded = 1; | |
1439 | - break; | |
1440 | + continue; | |
1441 | + finded = 1; | |
1442 | + break; | |
1443 | } | |
1444 | rpmdb_it_destroy(&it); | |
1445 | return finded; | |
1446 | @@ -288,11 +288,10 @@ | |
1447 | pkg.epoch = 0; | |
1448 | ||
1449 | if (pkg_evr_match_req(&pkg, req)) { | |
1450 | - DBGF("%s[%d] match %s!\n", pkg_snprintf_s(&pkg), pkg.epoch, capreq_snprintf_s0(req)); | |
1451 | + DBGF("%s[%d] match %s!\n", pkg_snprintf_s(&pkg), pkg.epoch, | |
1452 | + capreq_snprintf_s0(req)); | |
1453 | return 1; | |
1454 | } | |
1455 | - | |
1456 | - | |
1457 | ||
1458 | return 0; | |
1459 | } | |
1460 | @@ -376,7 +375,7 @@ | |
1461 | rpmdbMatchIterator mi; | |
1462 | mi = rpmdbInitIterator(db, RPMDBI_PACKAGES, NULL, 0); | |
1463 | while ((h = rpmdbNextIterator(mi)) != NULL) { | |
1464 | - unsigned int recno = rpmdbGetIteratorOffset(mi); | |
1465 | + unsigned int recno = rpmdbGetIteratorOffset(mi); | |
1466 | #ifdef HAVE_RPM_4_1 /* omit pubkeys */ | |
1467 | if (headerIsEntry(h, RPMTAG_PUBKEYS)) | |
1468 | continue; | |
1469 | @@ -385,7 +384,7 @@ | |
1470 | return 0; | |
1471 | ||
1472 | mapfn(recno, h, arg); | |
1473 | - n++; | |
1474 | + n++; | |
1475 | } | |
1476 | rpmdbFreeIterator(mi); | |
1477 | #else /* !HAVE_RPM_4_0 */ | |
1478 | @@ -526,17 +525,25 @@ | |
1479 | struct rpmdb_it it; | |
1480 | const struct dbrec *dbrec; | |
1481 | ||
1482 | + | |
1483 | rpmdb_it_init(db, &it, RPMITER_NAME, pkg->name); | |
1484 | count = rpmdb_it_get_count(&it); | |
1485 | if (count > 0 && (cmprc || dbrecp)) { | |
1486 | dbrec = rpmdb_it_get(&it); | |
1487 | - | |
1488 | - if (cmprc) | |
1489 | - *cmprc = -hdr_pkg_cmp_evr(dbrec->h, pkg); | |
1490 | - | |
1491 | - if (dbrecp) { | |
1492 | - dbrecp->recno = dbrec->recno; | |
1493 | - dbrecp->h = headerLink(dbrec->h); | |
1494 | + | |
1495 | + if (dbrec == NULL) { | |
1496 | + log(LOGWARN, _("%s: rpm iterator returns NULL" | |
1497 | + " (corrupted RPM database?). Ignored"), pkg->name); | |
1498 | + count = 0; /* assume that package isn't installed */ | |
1499 | + | |
1500 | + } else { | |
1501 | + if (cmprc) | |
1502 | + *cmprc = -hdr_pkg_cmp_evr(dbrec->h, pkg); | |
1503 | + | |
1504 | + if (dbrecp) { | |
1505 | + dbrecp->recno = dbrec->recno; | |
1506 | + dbrecp->h = headerLink(dbrec->h); | |
1507 | + } | |
1508 | } | |
1509 | } | |
1510 | ||
1511 | Index: installer/poldek/rpm_signature.c | |
1512 | diff -u installer/poldek/rpm_signature.c:1.4 installer/poldek/rpm_signature.c:1.4.4.2 | |
1513 | --- installer/poldek/rpm_signature.c:1.4 Fri Oct 18 12:34:03 2002 | |
1514 | +++ installer/poldek/rpm_signature.c Wed Jul 16 12:49:28 2003 | |
1515 | @@ -11,7 +11,7 @@ | |
1516 | */ | |
1517 | ||
1518 | /* | |
1519 | - $Id$ | |
1520 | + $Id$ | |
1521 | */ | |
1522 | ||
1523 | #ifdef HAVE_CONFIG_H | |
1524 | @@ -56,8 +56,10 @@ | |
1525 | ||
1526 | static int rpm_read_signature(FD_t fd, Header *sighp, int sig_type) | |
1527 | { | |
1528 | -#ifdef HAVE_RPM_4_1 | |
1529 | - return rpmReadSignature(fd, sighp, sig_type) == 0; | |
1530 | +#ifdef HAVE_RPM_4_2 | |
1531 | + return rpmReadSignature(fd, sighp, sig_type, NULL) == 0; | |
1532 | +#elif HAVE_RPM_4_1 | |
1533 | + return rpmReadSignature(fd, sighp, sig_type, NULL) == 0; | |
1534 | #elif HAVE_RPM_4_0 | |
1535 | return rpmReadSignature(fd, sighp, sig_type, NULL) == 0; | |
1536 | #endif | |
1537 | Index: installer/poldek/rpmadds.c | |
1538 | diff -u installer/poldek/rpmadds.c:1.8 installer/poldek/rpmadds.c:1.8.4.1 | |
1539 | --- installer/poldek/rpmadds.c:1.8 Thu Nov 7 17:43:26 2002 | |
1540 | +++ installer/poldek/rpmadds.c Tue Apr 15 19:03:02 2003 | |
1541 | @@ -11,7 +11,7 @@ | |
1542 | */ | |
1543 | ||
1544 | /* | |
1545 | - $Id$ | |
1546 | + $Id$ | |
1547 | */ | |
1548 | ||
1549 | #ifdef HAVE_CONFIG_H | |
1550 | @@ -34,15 +34,17 @@ | |
1551 | #include "misc.h" | |
1552 | #include "log.h" | |
1553 | ||
1554 | - | |
1555 | int rpm_headerReadFD(FD_t fdt, Header *hdr, const char *path) | |
1556 | { | |
1557 | int rc = 0; | |
1558 | ||
1559 | -#ifdef HAVE_RPM_4_1 | |
1560 | +#ifndef HAVE_RPM_4_1 | |
1561 | + rc = rpmReadPackageHeader(fdt, hdr, NULL, NULL, NULL); | |
1562 | +#else | |
1563 | rpmRC rpmrc; | |
1564 | rpmts ts = rpmtsCreate(); | |
1565 | ||
1566 | + rpmtsSetVSFlags(ts, RPMVSF_NODSA | RPMVSF_NORSA | RPMVSF_NOMD5); | |
1567 | rpmrc = rpmReadPackageFile(ts, fdt, path, hdr); | |
1568 | switch (rpmrc) { | |
1569 | case RPMRC_NOTTRUSTED: | |
1570 | @@ -54,18 +56,12 @@ | |
1571 | default: | |
1572 | rc = 1; | |
1573 | } | |
1574 | - | |
1575 | -#else | |
1576 | - rc = rpmReadPackageHeader(fdt, hdr, NULL, NULL, NULL); | |
1577 | + rpmtsFree(ts); | |
1578 | #endif | |
1579 | - | |
1580 | + | |
1581 | if (rc != 0) | |
1582 | logn(LOGERR, _("%s: read header failed"), path); | |
1583 | ||
1584 | -#ifdef HAVE_RPM_4_1 | |
1585 | - rpmtsFree(ts); | |
1586 | -#endif | |
1587 | - | |
1588 | return rc == 0; | |
1589 | } | |
1590 | ||
1591 | Index: installer/poldek/rpmvercmp.c | |
1592 | diff -u installer/poldek/rpmvercmp.c:1.5 installer/poldek/rpmvercmp.c:1.5.6.1 | |
1593 | --- installer/poldek/rpmvercmp.c:1.5 Mon May 13 22:27:17 2002 | |
1594 | +++ installer/poldek/rpmvercmp.c Tue Dec 30 19:15:08 2003 | |
1595 | @@ -1,4 +1,5 @@ | |
1596 | #include <stdio.h> | |
1597 | +#include <string.h> | |
1598 | #include <stdlib.h> | |
1599 | #include <rpm/rpmlib.h> | |
1600 | ||
1601 | Index: installer/poldek/test_match.c | |
1602 | diff -u installer/poldek/test_match.c:1.8 installer/poldek/test_match.c:1.8.4.1 | |
1603 | --- installer/poldek/test_match.c:1.8 Thu Nov 7 17:43:26 2002 | |
1604 | +++ installer/poldek/test_match.c Fri Dec 19 02:29:31 2003 | |
1605 | @@ -7,7 +7,7 @@ | |
1606 | */ | |
1607 | ||
1608 | /* | |
1609 | - $Id$ | |
1610 | + $Id$ | |
1611 | */ | |
1612 | #include <stdio.h> | |
1613 | #include <stdlib.h> | |
1614 | @@ -26,7 +26,7 @@ | |
1615 | #include "misc.h" | |
1616 | #include "rpm.h" | |
1617 | ||
1618 | -int test_match(int argc, char *argv[]) | |
1619 | +int old_test_match(int argc, char *argv[]) | |
1620 | { | |
1621 | struct pkg *pkg; | |
1622 | struct capreq *req; | |
1623 | @@ -54,7 +54,7 @@ | |
1624 | int rc1, rc2; | |
1625 | char evr[255]; | |
1626 | ||
1627 | - snprintf(evr, sizeof(evr), "1:1.1"); | |
1628 | + snprintf(evr, sizeof(evr), "0:1.1"); | |
1629 | req = capreq_new_evr("poldek", n_strdup(evr), rels[k++], 0); | |
1630 | ||
1631 | rc1 = pkg_match_req(pkg, req, 1) ? 1:0; | |
1632 | @@ -73,49 +73,54 @@ | |
1633 | return 0; | |
1634 | } | |
1635 | ||
1636 | -int test_match_(int epoch, char *ver, char *rel, char *evr, int relation) | |
1637 | + | |
1638 | +int test_match(int epoch, char *ver, char *rel, char *evr, int relation) | |
1639 | { | |
1640 | struct pkg *pkg; | |
1641 | - struct capreq *req; | |
1642 | - int rc1; | |
1643 | + struct capreq *req, *cap; | |
1644 | + int rc; | |
1645 | ||
1646 | pkg = pkg_new("poldek", epoch, ver, rel, NULL, NULL, 0, 0, 0); | |
1647 | + cap = capreq_new("poldek", epoch, ver, rel, REL_EQ, 0); | |
1648 | ||
1649 | req = capreq_new_evr("poldek", n_strdup(evr), relation, 0); | |
1650 | ||
1651 | - rc1 = pkg_match_req(pkg, req, 1) ? 1:0; | |
1652 | - printf("P %s[%d] match %s ? %s\n", pkg_snprintf_s(pkg), | |
1653 | - pkg->epoch, capreq_snprintf_s(req), | |
1654 | - rc1 ? "YES" : "NO"); | |
1655 | + rc = pkg_match_req(pkg, req, 1) ? 1:0; | |
1656 | + printf("pkg %s match req %s ? %s\n", pkg_snprintf_epoch_s(pkg), | |
1657 | + capreq_snprintf_s(req), rc ? "YES" : "NO"); | |
1658 | + | |
1659 | + rc = cap_match_req(cap, req, 1) ? 1:0; | |
1660 | + printf("cap %s match req %s ? %s\n", capreq_snprintf_s0(cap), | |
1661 | + capreq_snprintf_s(req), rc ? "YES" : "NO"); | |
1662 | ||
1663 | return 1; | |
1664 | } | |
1665 | ||
1666 | ||
1667 | -int test_match2(void) | |
1668 | +int dotest(void) | |
1669 | { | |
1670 | printf("\n"); | |
1671 | - test_match_(0, "1.2", "1", "0:1.1", REL_GT); | |
1672 | - test_match_(3, "1.2", "1", "0:1.1", REL_GT); | |
1673 | - test_match_(0, "1.2", "1", "3:1.1", REL_GT); | |
1674 | + test_match(1, "5.8.2", "2", "0:5.00403", REL_GT); | |
1675 | + test_match(3, "1.2", "1", "0:1.1", REL_GT); | |
1676 | + test_match(0, "1.2", "1", "3:1.1", REL_GT); | |
1677 | printf("\n"); | |
1678 | - test_match_(0, "1.2", "1", "1:1.1", REL_GT); | |
1679 | - test_match_(1, "1.2", "1", "0:1.1", REL_GT); | |
1680 | + test_match(0, "1.2", "1", "1:1.1", REL_GT); | |
1681 | + test_match(1, "1.2", "1", "0:1.1", REL_GT); | |
1682 | ||
1683 | printf("\n"); | |
1684 | - test_match_(0, "1.2", "1", "0:1.2", REL_EQ); | |
1685 | - test_match_(3, "1.2", "1", "0:1.2", REL_EQ); | |
1686 | - test_match_(0, "1.2", "1", "3:1.2", REL_EQ); | |
1687 | + test_match(0, "1.2", "1", "0:1.2", REL_EQ); | |
1688 | + test_match(3, "1.2", "1", "0:1.2", REL_EQ); | |
1689 | + test_match(0, "1.2", "1", "3:1.2", REL_EQ); | |
1690 | printf("\n"); | |
1691 | - test_match_(0, "1.2", "1", "1:1.2", REL_EQ); | |
1692 | - test_match_(1, "1.2", "1", "0:1.2", REL_EQ); | |
1693 | + test_match(0, "1.2", "1", "1:1.2", REL_EQ); | |
1694 | + test_match(1, "1.2", "1", "0:1.2", REL_EQ); | |
1695 | ||
1696 | printf("\n"); | |
1697 | - test_match_(0, "1.2", "1", "1:2.2", REL_EQ | REL_GT); | |
1698 | - test_match_(1, "1.2", "1", "1:1.2", REL_EQ | REL_GT); | |
1699 | - test_match_(1, "1.2", "1", "2:1.2", REL_EQ | REL_GT); | |
1700 | - test_match_(2, "1.2", "1", "2:1.2", REL_EQ | REL_GT); | |
1701 | - test_match_(3, "1.2", "1", "2:1.2", REL_EQ | REL_GT); | |
1702 | + test_match(0, "1.2", "1", "1:2.2", REL_EQ | REL_GT); | |
1703 | + test_match(1, "1.2", "1", "1:1.2", REL_EQ | REL_GT); | |
1704 | + test_match(1, "1.2", "1", "2:1.2", REL_EQ | REL_GT); | |
1705 | + test_match(2, "1.2", "1", "2:1.2", REL_EQ | REL_GT); | |
1706 | + test_match(3, "1.2", "1", "2:1.2", REL_EQ | REL_GT); | |
1707 | return 0; | |
1708 | } | |
1709 | ||
1710 | @@ -136,8 +141,12 @@ | |
1711 | int main(int argc, char *argv[]) | |
1712 | { | |
1713 | rpmdb db; | |
1714 | - //test_expand_env(argc, argv); | |
1715 | - //test_match2(); | |
1716 | + log_init(NULL, stdout, ""); | |
1717 | + | |
1718 | + if (argc > 1 && strcmp(argv[1], "--promote") == 0) | |
1719 | + poldek_conf_promote_epoch = 1; | |
1720 | + dotest(); | |
1721 | + exit(0); | |
1722 | log_init(NULL, stdout, "aa"); | |
1723 | rpm_initlib(NULL); | |
1724 | db = rpm_opendb("/var/lib/rpm", "/", O_RDONLY); | |
1725 | Index: installer/poldek/usrset.c | |
1726 | diff -u installer/poldek/usrset.c:1.12 installer/poldek/usrset.c:1.12.6.1 | |
1727 | --- installer/poldek/usrset.c:1.12 Thu Apr 25 18:34:12 2002 | |
1728 | +++ installer/poldek/usrset.c Tue Dec 30 19:19:52 2003 | |
1729 | @@ -7,7 +7,7 @@ | |
1730 | */ | |
1731 | ||
1732 | /* | |
1733 | - $Id$ | |
1734 | + $Id$ | |
1735 | */ | |
1736 | ||
1737 | #include <ctype.h> | |
1738 | @@ -184,7 +184,7 @@ | |
1739 | if (release == NULL) | |
1740 | release = ""; | |
1741 | ||
1742 | - pdef->pkg = pkg_new(name, epoch, version, release, NULL, NULL, | |
1743 | + pdef->pkg = pkg_new(name, epoch, version, release, NULL, NULL, NULL, | |
1744 | 0, 0, 0); | |
1745 | } | |
1746 | ||
1747 | Index: installer/poldek/vfcompr | |
1748 | diff -u /dev/null installer/poldek/vfcompr:1.1.2.1 | |
1749 | --- /dev/null Fri Jan 9 13:45:49 2004 | |
1750 | +++ installer/poldek/vfcompr Fri Dec 19 02:29:31 2003 | |
1751 | @@ -0,0 +1,77 @@ | |
1752 | +#! /bin/sh | |
1753 | +# $Id$ | |
1754 | + | |
1755 | +PATH="/bin:/sbin:/usr/bin:/usr/sbin" | |
1756 | + | |
1757 | +compr() { | |
1758 | + typeset src=$1 | |
1759 | + typeset dest=$2 | |
1760 | + | |
1761 | + cmd="bzip2 --stdout ${src}" | |
1762 | + if echo ${dest} | egrep ".gz" >/dev/null; then | |
1763 | + cmd="gzip -9nf --stdout ${src}" | |
1764 | + fi | |
1765 | + echo "$cmd > $dest" | |
1766 | + $cmd > $dest && rm -f $src | |
1767 | +} | |
1768 | + | |
1769 | +uncompr() { | |
1770 | + typeset src=$1 | |
1771 | + typeset dest=$2 | |
1772 | + | |
1773 | + cmd="bunzip2 --keep --stdout ${src}" | |
1774 | + if echo ${src} | egrep ".gz" >/dev/null; then | |
1775 | + cmd="gunzip --stdout ${src}" | |
1776 | + fi | |
1777 | + echo "$cmd > $dest" | |
1778 | + #echo -e "$cmd\n -> ${dest}" | |
1779 | + $cmd > ${dest} | |
1780 | +} | |
1781 | + | |
1782 | +usage() { | |
1783 | + echo "usage: `basename $0` FILE DESTFILE[.gz][.bz2]" | |
1784 | + echo " `basename $0` -d FILE DESTFILE[.gz][.bz2]" | |
1785 | +} | |
1786 | + | |
1787 | +if [ "$#" -lt 2 ]; then | |
1788 | + usage | |
1789 | + exit 0 | |
1790 | +fi | |
1791 | + | |
1792 | +un=$1 | |
1793 | +if [ "$un" == "-d" ]; then | |
1794 | + src=$2 | |
1795 | + if [ "$#" -lt 3 ]; then | |
1796 | + usage | |
1797 | + exit 1 | |
1798 | + fi | |
1799 | + dest=$3 | |
1800 | +else | |
1801 | + src=$1 | |
1802 | + dest=$2 | |
1803 | + un="" | |
1804 | +fi | |
1805 | + | |
1806 | + | |
1807 | +#if [ ! -r $src -o ! -f $src ]; then | |
1808 | +# echo "$src: no such file" | |
1809 | +# exit 1 | |
1810 | +#fi | |
1811 | + | |
1812 | +if [ -r $dest ]; then | |
1813 | + echo "$dest: file exists" | |
1814 | + exit 1 | |
1815 | +fi | |
1816 | + | |
1817 | + | |
1818 | +if [ $dest == $src ]; then | |
1819 | + echo "dest and src are the same" | |
1820 | + exit 1 | |
1821 | +fi | |
1822 | + | |
1823 | +if [ -z "$un" ]; then | |
1824 | + compr $src $dest | |
1825 | +else | |
1826 | + uncompr $src $dest | |
1827 | +fi | |
1828 | + | |
1829 | Index: installer/poldek/vfuncompr | |
1830 | diff -u installer/poldek/vfuncompr:1.1 installer/poldek/vfuncompr:removed | |
1831 | --- installer/poldek/vfuncompr:1.1 Mon Apr 8 03:14:41 2002 | |
1832 | +++ installer/poldek/vfuncompr Fri Jan 9 13:45:49 2004 | |
1833 | @@ -1,38 +0,0 @@ | |
1834 | -#! /bin/sh | |
1835 | -# $Id$ | |
1836 | - | |
1837 | -PATH="/bin:/sbin:/usr/bin:/usr/sbin" | |
1838 | - | |
1839 | -if [ "$#" != "2" ]; then | |
1840 | - echo "usage: `basename $0` FILE[.gz][.bz2] DESTFILE" | |
1841 | - exit 1 | |
1842 | -fi | |
1843 | - | |
1844 | -src=$1 | |
1845 | -dest=$2 | |
1846 | - | |
1847 | -cmd="bunzip2 --keep --stdout ${src}" | |
1848 | -if echo ${src} | egrep ".gz" >/dev/null; then | |
1849 | - cmd="gunzip --stdout ${src}" | |
1850 | -fi | |
1851 | - | |
1852 | -if [ ! -r $src -o ! -f $src ]; then | |
1853 | - echo "$src: no such file" | |
1854 | - exit 1 | |
1855 | -fi | |
1856 | - | |
1857 | -if [ -r $dest ]; then | |
1858 | - echo "$dest: file exists" | |
1859 | - exit 1 | |
1860 | -fi | |
1861 | - | |
1862 | -if [ $dest == $src ]; then | |
1863 | - echo "dest and src are the same" | |
1864 | - exit 1 | |
1865 | -fi | |
1866 | - | |
1867 | - | |
1868 | -echo -e "$cmd\n -> ${dest}" | |
1869 | -$cmd > ${dest} | |
1870 | - | |
1871 | - | |
1872 | Index: installer/poldek/conf/rh.src | |
1873 | diff -u installer/poldek/conf/rh.src:1.4 installer/poldek/conf/rh.src:1.4.6.1 | |
1874 | --- installer/poldek/conf/rh.src:1.4 Mon Jun 3 17:27:04 2002 | |
1875 | +++ installer/poldek/conf/rh.src Thu Sep 18 01:43:01 2003 | |
1876 | @@ -1,21 +1,21 @@ | |
1877 | -# $Id$ | |
1878 | +# $Id$ | |
1879 | ||
1880 | +# RedHat 9 | |
1881 | +source1 = rh,noautoup,type=hdrl,pri=-1 \ | |
1882 | + ftp://ftp.uninett.no/pub/linux/apt/redhat/9/en/i386/redhat/base/pkglist.os.bz2 | |
1883 | ||
1884 | -# RedHat 7.3; package info is taken from hdlist file | |
1885 | -source1 = rh,noautoup,type=hdrl \ | |
1886 | - ftp://ftp.redhat.com/pub/redhat/redhat-7.3-en/os/i386/RedHat/base/hdlist | |
1887 | +prefix1 = ftp://ftp.uninett.no/pub/linux/apt/redhat/9/en/i386/redhat/RPMS.os | |
1888 | ||
1889 | -prefix1 = ftp://ftp.redhat.com/pub/redhat/redhat-7.3-en/os/i386/RedHat/RPMS/ | |
1890 | +source2 = rh-up,noautoup,type=hdrl,pri=-1 \ | |
1891 | + ftp://ftp.uninett.no/pub/linux/apt/redhat/9/en/i386/redhat/base/pkglist.updates-os.bz2 | |
1892 | ||
1893 | +prefix2 = ftp://ftp.uninett.no/pub/linux/apt/redhat/9/en/i386/redhat/RPMS.updates-os | |
1894 | ||
1895 | -# RedHat 7.2; package info is taken from hdlist file | |
1896 | -source2 = rh7.2,noautoup,type=hdrl \ | |
1897 | - ftp://ftp.redhat.com/pub/redhat/redhat-7.2-en/os/i386/RedHat/base/hdlist | |
1898 | ||
1899 | -prefix2 = ftp://ftp.redhat.com/pub/redhat/redhat-7.2-en/os/i386/RedHat/RPMS/ | |
1900 | ||
1901 | -# RedHat 6.2 | |
1902 | -source3 = rh6.2,noautoup,noauto,type=hdrl \ | |
1903 | - ftp://ftp.redhat.com/pub/redhat/redhat-6.2-en/os/i386/RedHat/base/hdlist | |
1904 | +# RedHat 8 | |
1905 | +source8 = rh8,noautoup,noauto,type=hdrl \ | |
1906 | + ftp://ftp.uninett.no/pub/linux/apt/redhat/8.0/en/i386/redhat/base/pkglist.os.bz2 | |
1907 | + | |
1908 | +prefix8 = ftp://ftp.uninett.no/pub/linux/apt/redhat/8.0/en/i386/redhat/RPMS.os | |
1909 | ||
1910 | -prefix3 = ftp://ftp.redhat.com/pub/redhat/redhat-6.2-en/os/i386/RedHat/RPMS/ | |
1911 | Index: installer/poldek/shell/desc.c | |
1912 | diff -u installer/poldek/shell/desc.c:1.18 installer/poldek/shell/desc.c:1.18.4.1 | |
1913 | --- installer/poldek/shell/desc.c:1.18 Thu Nov 7 17:43:28 2002 | |
1914 | +++ installer/poldek/shell/desc.c Sun Dec 7 22:30:46 2003 | |
1915 | @@ -7,7 +7,7 @@ | |
1916 | */ | |
1917 | ||
1918 | /* | |
1919 | - $Id$ | |
1920 | + $Id$ | |
1921 | */ | |
1922 | ||
1923 | #include <time.h> | |
1924 | @@ -665,6 +665,7 @@ | |
1925 | char unit = 'K'; | |
1926 | const char *group; | |
1927 | double pkgsize; | |
1928 | + time_t tmpt; | |
1929 | ||
1930 | ||
1931 | if ((pkgu = pkg_info(pkg)) == NULL) { | |
1932 | @@ -674,10 +675,11 @@ | |
1933 | } | |
1934 | ||
1935 | ||
1936 | - if (pkg->btime) | |
1937 | + if (pkg->btime) { | |
1938 | + tmpt = pkg->btime; | |
1939 | strftime(timbuf, sizeof(timbuf), "%Y/%m/%d %H:%M", | |
1940 | - localtime((time_t*)&pkg->btime)); | |
1941 | - else | |
1942 | + localtime(&tmpt)); | |
1943 | + } else | |
1944 | *timbuf = '\0'; | |
1945 | ||
1946 | if (pkgu->summary) { | |
1947 | Index: installer/poldek/shell/ls.c | |
1948 | diff -u installer/poldek/shell/ls.c:1.20 installer/poldek/shell/ls.c:1.20.4.1 | |
1949 | --- installer/poldek/shell/ls.c:1.20 Thu Nov 7 17:43:28 2002 | |
1950 | +++ installer/poldek/shell/ls.c Sun Dec 7 22:30:46 2003 | |
1951 | @@ -7,7 +7,7 @@ | |
1952 | */ | |
1953 | ||
1954 | /* | |
1955 | - $Id$ | |
1956 | + $Id$ | |
1957 | */ | |
1958 | ||
1959 | #include <string.h> | |
1960 | @@ -393,6 +393,7 @@ | |
1961 | char sizbuf[30]; | |
1962 | char unit = 'K'; | |
1963 | double pkgsize = pkg->size/1024; | |
1964 | + time_t tmpt; | |
1965 | ||
1966 | if (pkgsize >= 1024) { | |
1967 | pkgsize /= 1024; | |
1968 | @@ -401,10 +402,11 @@ | |
1969 | ||
1970 | snprintf(sizbuf, sizeof(sizbuf), "%.1f %cB", pkgsize, unit); | |
1971 | ||
1972 | - if (pkg->btime) | |
1973 | + if (pkg->btime) { | |
1974 | + tmpt = pkg->btime; | |
1975 | strftime(timbuf, sizeof(timbuf), "%Y/%m/%d %H:%M", | |
1976 | - localtime((time_t*)&pkg->btime)); | |
1977 | - else | |
1978 | + localtime(&tmpt)); | |
1979 | + } else | |
1980 | *timbuf = '\0'; | |
1981 | ||
1982 | if ((flags & OPT_LS_UPGRADEABLE) == 0) { | |
1983 | Index: installer/poldek/vfile/uncompr.c | |
1984 | diff -u installer/poldek/vfile/uncompr.c:1.2 installer/poldek/vfile/uncompr.c:1.2.6.1 | |
1985 | --- installer/poldek/vfile/uncompr.c:1.2 Wed Apr 17 00:33:40 2002 | |
1986 | +++ installer/poldek/vfile/uncompr.c Fri Dec 19 02:16:56 2003 | |
1987 | @@ -10,7 +10,7 @@ | |
1988 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
1989 | */ | |
1990 | ||
1991 | -/* $Id$ */ | |
1992 | +/* $Id$ */ | |
1993 | ||
1994 | #include <ctype.h> | |
1995 | #include <errno.h> | |
1996 | @@ -44,8 +44,8 @@ | |
1997 | }; | |
1998 | ||
1999 | struct uncompr uncompr_tab[] = { | |
2000 | - { COMPRESST_BZIP2, "/usr/bin/vfuncompr", "bz2" }, | |
2001 | - { COMPRESST_GZIP, "/usr/bin/vfuncompr", "gz" }, | |
2002 | + { COMPRESST_BZIP2, "/usr/bin/vfcompr", "bz2" }, | |
2003 | + { COMPRESST_GZIP, "/usr/bin/vfcompr", "gz" }, | |
2004 | { 0, NULL, NULL } | |
2005 | }; | |
2006 | ||
2007 | @@ -101,7 +101,8 @@ | |
2008 | ||
2009 | ||
2010 | static | |
2011 | -int vf_do_uncompr(struct uncompr *uncompr, const char *src, const char *dst) | |
2012 | +int vf_do_compr(struct uncompr *uncompr, const char *param, | |
2013 | + const char *src, const char *dst) | |
2014 | { | |
2015 | char **argv; | |
2016 | struct p_open_st pst; | |
2017 | @@ -112,16 +113,15 @@ | |
2018 | argv = alloca(sizeof(*argv) * 10); | |
2019 | n = 0; | |
2020 | argv[n++] = uncompr->cmd; | |
2021 | + if (param) | |
2022 | + argv[n++] = (char*)param; | |
2023 | + | |
2024 | argv[n++] = (char*)src; | |
2025 | argv[n++] = (char*)dst; | |
2026 | argv[n++] = NULL; | |
2027 | ||
2028 | - if (*vfile_verbose) | |
2029 | - vfile_msg_fn(_("Uncompressing %s...\n"), n_basenam(src)); | |
2030 | - | |
2031 | p_st_init(&pst); | |
2032 | ||
2033 | - | |
2034 | verbose = *vfile_verbose; | |
2035 | if (p_open(&pst, p_open_flags, uncompr->cmd, argv) == NULL) { | |
2036 | vfile_err_fn("p_open: %s\n", pst.errmsg); | |
2037 | @@ -185,8 +185,36 @@ | |
2038 | return -1; | |
2039 | ||
2040 | vf_localunlink(destpath); | |
2041 | + if (*vfile_verbose) | |
2042 | + vfile_msg_fn(_("Uncompressing %s...\n"), n_basenam(path)); | |
2043 | + return vf_do_compr(uncompr, "-d", path, destpath); | |
2044 | +} | |
2045 | + | |
2046 | + | |
2047 | +int vf_compr_do(const char *path, const char *ext) | |
2048 | +{ | |
2049 | + struct uncompr *uncompr; | |
2050 | + char destpath[PATH_MAX]; | |
2051 | + int i; | |
2052 | + | |
2053 | ||
2054 | - return vf_do_uncompr(uncompr, path, destpath); | |
2055 | + uncompr = NULL; | |
2056 | + i = 0; | |
2057 | + while (uncompr_tab[i].type > 0) { | |
2058 | + if (strcmp(ext, uncompr_tab[i].ext) == 0) | |
2059 | + uncompr = &uncompr_tab[i]; | |
2060 | + i++; | |
2061 | + } | |
2062 | + | |
2063 | + | |
2064 | + if (uncompr == NULL) | |
2065 | + return -1; | |
2066 | + | |
2067 | + snprintf(destpath, sizeof(destpath), "%s.%s", path, ext); | |
2068 | + unlink(destpath); | |
2069 | + if (*vfile_verbose) | |
2070 | + vfile_msg_fn(_("Compressing %s...\n"), n_basenam(path)); | |
2071 | + return vf_do_compr(uncompr, NULL, path, destpath); | |
2072 | } | |
2073 | ||
2074 | ||
2075 | Index: installer/poldek/vfile/vfile.c | |
2076 | diff -u installer/poldek/vfile/vfile.c:1.43 installer/poldek/vfile/vfile.c:1.43.4.2 | |
2077 | --- installer/poldek/vfile/vfile.c:1.43 Tue Oct 29 17:55:56 2002 | |
2078 | +++ installer/poldek/vfile/vfile.c Mon Dec 29 21:11:14 2003 | |
2079 | @@ -11,7 +11,7 @@ | |
2080 | */ | |
2081 | ||
2082 | /* | |
2083 | - $Id$ | |
2084 | + $Id$ | |
2085 | */ | |
2086 | #ifdef HAVE_CONFIG_H | |
2087 | # include "config.h" | |
2088 | @@ -491,8 +491,19 @@ | |
2089 | rpath = path; | |
2090 | ||
2091 | if (vfmode & VFM_UNCOMPR) { | |
2092 | - if ((rpath = vfuncompr(path, buf, sizeof(buf))) == NULL) | |
2093 | - return 0; | |
2094 | + if (vfmode & VFM_RW) { | |
2095 | + if (vf_uncompr_able(path)) { | |
2096 | + char *p; | |
2097 | + n_snprintf(buf, sizeof(buf), path); | |
2098 | + p = strrchr(buf, '.'); | |
2099 | + n_assert(p); | |
2100 | + *p = '\0'; | |
2101 | + rpath = buf; | |
2102 | + } | |
2103 | + } else { | |
2104 | + if ((rpath = vfuncompr(path, buf, sizeof(buf))) == NULL) | |
2105 | + return 0; | |
2106 | + } | |
2107 | } | |
2108 | ||
2109 | if (openvf(&vf, rpath, vfmode)) | |
2110 | @@ -646,6 +657,18 @@ | |
2111 | n_assert(0); | |
2112 | } | |
2113 | ||
2114 | + if (vf->vf_path && (vf->vf_mode & VFM_UNCOMPR) && (vf->vf_mode & VFM_RW)) { | |
2115 | + if (vf_uncompr_able(vf->vf_path)) { | |
2116 | + char src[PATH_MAX], *p; | |
2117 | + snprintf(src, sizeof(src), vf->vf_path); | |
2118 | + p = strrchr(src, '.'); | |
2119 | + n_assert(p); | |
2120 | + *p = '\0'; | |
2121 | + vf_compr_do(src, "gz"); | |
2122 | + } | |
2123 | + | |
2124 | + } | |
2125 | + | |
2126 | if (vf->vf_path) { | |
2127 | free(vf->vf_path); | |
2128 | vf->vf_path = NULL; | |
2129 | Index: installer/poldek/vfile/vfile.h | |
2130 | diff -u installer/poldek/vfile/vfile.h:1.29 installer/poldek/vfile/vfile.h:1.29.4.1 | |
2131 | --- installer/poldek/vfile/vfile.h:1.29 Thu Nov 7 17:43:29 2002 | |
2132 | +++ installer/poldek/vfile/vfile.h Fri Dec 19 02:16:56 2003 | |
2133 | @@ -10,7 +10,7 @@ | |
2134 | 59 Place - Suite 330, Boston, MA 02111-1307, USA. | |
2135 | */ | |
2136 | ||
2137 | -/* $Id$ */ | |
2138 | +/* $Id$ */ | |
2139 | ||
2140 | #ifndef POLDEK_VFILE_H | |
2141 | #define POLDEK_VFILE_H | |
2142 | @@ -195,6 +195,7 @@ | |
2143 | ||
2144 | ||
2145 | int vf_uncompr_able(const char *path); | |
2146 | +int vf_compr_do(const char *path, const char *ext); | |
2147 | int vf_uncompr_do(const char *path, const char *destpath); | |
2148 | ||
2149 | void vf_sigint_cb(void); |