]>
Commit | Line | Data |
---|---|---|
1b531697 AM |
1 | =================================================================== |
2 | RCS file: /cvsroot/installer/poldek/pkgset-install.c,v | |
3 | retrieving revision 1.147 | |
4 | retrieving revision 1.148 | |
5 | diff -u -r1.147 -r1.148 | |
6 | --- installer/poldek/pkgset-install.c 2005/10/24 15:30:40 1.147 | |
7 | +++ installer/poldek/pkgset-install.c 2005/11/01 19:36:36 1.148 | |
8 | #ifdef HAVE_CONFIG_H | |
9 | @@ -1174,7 +1174,9 @@ | |
10 | memset(&successor, 0, sizeof(successor)); | |
11 | if (process_as == PROCESS_AS_ORPHAN && | |
12 | upg->ts->getop(upg->ts, POLDEK_OP_AGGREEDY)) { | |
13 | - if (pkg_drags(pkg, ps, upg) == 0) { | |
14 | + int ndrags = pkg_drags(pkg, ps, upg); | |
15 | + DBGF("%s, ndrags %d\n", pkg_id(pkg), ndrags); | |
16 | + if (ndrags == 0 || 1) { /* XXX cond temporary disabled - needs test */ | |
17 | struct pkg *p; | |
18 | int is_marked = 0, ndragged = 0, by_obsoletes = 0; | |
19 | ||
20 | @@ -1186,9 +1188,10 @@ | |
21 | successor.realpkg = p; | |
22 | successor.by_obsoletes = by_obsoletes; | |
23 | ||
24 | - /* do not follow successor if package drags something and | |
25 | - is not marked */ | |
26 | - if (p && (ndragged = pkg_drags(p, ps, upg)) > 0 && is_marked == 0) { | |
27 | + /* do not follow successor if it drags more packages than orphaned one | |
28 | + * and successor is not marked */ | |
29 | + | |
30 | + if (p && (ndragged = pkg_drags(p, ps, upg)) > ndrags && is_marked == 0) { | |
31 | DBGF("OMIT select_successor %s -> %s (%d)\n", | |
32 | pkg_id(pkg), pkg_id(p), ndragged); | |
33 | p = NULL; | |
34 | =================================================================== | |
35 | RCS file: /cvsroot/installer/poldek/vfile/misc.c,v | |
36 | retrieving revision 1.11 | |
37 | retrieving revision 1.12 | |
38 | diff -u -r1.11 -r1.12 | |
39 | --- installer/poldek/vfile/misc.c 2005/07/17 15:04:34 1.11 | |
40 | +++ installer/poldek/vfile/misc.c 2005/11/02 19:45:40 1.12 | |
41 | @@ -58,7 +58,7 @@ | |
42 | ||
43 | p = path; | |
44 | p++; | |
45 | - ndots = 0; | |
46 | + ndots = -1; | |
47 | ||
48 | while (*p) { | |
49 | switch (*p) { | |
50 | @@ -71,11 +71,12 @@ | |
51 | break; | |
52 | ||
53 | case '.': | |
54 | - ndots++; | |
55 | + if (ndots >= 0) | |
56 | + ndots++; | |
57 | break; | |
58 | ||
59 | default: | |
60 | - ndots = 0; | |
61 | + ndots = -1; | |
62 | ||
63 | if (!isalnum(*p) && strchr("-+/._@!~", *p) == NULL) { | |
64 | vf_logerr("%s:%c non alphanumeric characters not allowed\n", | |
65 | =================================================================== | |
66 | RCS file: /cvsroot/installer/poldek/vfile/extcompr.c,v | |
67 | retrieving revision 1.7 | |
68 | retrieving revision 1.8 | |
69 | diff -u -r1.7 -r1.8 | |
70 | --- installer/poldek/vfile/extcompr.c 2005/05/15 15:46:59 1.7 | |
71 | +++ installer/poldek/vfile/extcompr.c 2005/11/02 20:10:36 1.8 | |
72 | @@ -195,7 +195,7 @@ | |
73 | if (uncompr == NULL) | |
74 | return -1; | |
75 | ||
76 | - if (*vfile_verbose) | |
77 | + if (*vfile_verbose > 0) | |
78 | vf_loginfo(_("Decompressing %s...\n"), n_basenam(path)); | |
79 | return vf_do_compr(uncompr, "-d", path, destpath); | |
80 | } | |
81 | =================================================================== | |
82 | RCS file: /cvsroot/installer/poldek/cli/uninstall.c,v | |
83 | retrieving revision 1.25 | |
84 | retrieving revision 1.26 | |
85 | diff -u -r1.25 -r1.26 | |
86 | --- installer/poldek/cli/uninstall.c 2005/07/12 17:29:09 1.25 | |
87 | +++ installer/poldek/cli/uninstall.c 2005/11/05 00:14:38 1.26 | |
88 | @@ -171,6 +171,7 @@ | |
89 | ||
90 | ts->setop(ts, POLDEK_OP_GREEDY, bool); | |
91 | } | |
92 | + break; | |
93 | ||
94 | case 't': | |
95 | if (ts->getop(ts, POLDEK_OP_TEST)) | |
96 | =================================================================== | |
97 | RCS file: /cvsroot/installer/poldek/vfcompr,v | |
98 | retrieving revision 1.4 | |
99 | retrieving revision 1.6 | |
100 | diff -u -r1.4 -r1.6 | |
101 | --- installer/poldek/vfcompr 2004/07/05 19:15:10 1.4 | |
102 | +++ installer/poldek/vfcompr 2005/11/02 20:25:37 1.6 | |
103 | @@ -19,7 +22,7 @@ | |
104 | typeset src=$1 | |
105 | typeset dest=$2 | |
106 | ||
107 | - md5file="${src}-vfcompr.md5" | |
108 | + md5file="${dest}-vfcompr.md5" | |
109 | #echo "$md5file" | |
110 | if [ -f $dest -a -f "$md5file" ]; then | |
111 | #echo md5sum --check "$md5file" | |
36518e7a | 112 | =================================================================== |
113 | RCS file: /cvsroot/poldek/poldek/pkg.c,v | |
114 | retrieving revision 1.107 | |
115 | retrieving revision 1.108 | |
116 | diff -u -r1.107 -r1.108 | |
117 | --- poldek/poldek/pkg.c 2005/10/13 15:39:27 1.107 | |
118 | +++ poldek/poldek/pkg.c 2006/03/18 16:29:00 1.108 | |
119 | @@ -1,5 +1,5 @@ | |
120 | /* | |
121 | - Copyright (C) 2000 - 2004 Pawel A. Gajda <mis@k2.net.pl> | |
122 | + Copyright (C) 2000 - 2006 Pawel A. Gajda (mis@k2.net.pl) | |
123 | ||
124 | This program is free software; you can redistribute it and/or modify | |
125 | it under the terms of the GNU General Public License, version 2 as | |
126 | @@ -15,7 +15,7 @@ | |
127 | */ | |
128 | ||
129 | /* | |
130 | - $Id$ | |
131 | + $Id$ | |
132 | */ | |
133 | ||
134 | #ifdef HAVE_CONFIG_H | |
135 | @@ -694,8 +694,8 @@ | |
136 | int n; | |
137 | ||
138 | DBGF("\npkg_caps_match_req %s %s\n", pkg_snprintf_s(pkg), | |
139 | - capreq_snprintf_s(req)); | |
140 | - | |
141 | + capreq_snprintf_s(req)); | |
142 | + | |
143 | if (pkg->caps == NULL || n_array_size(pkg->caps) == 0) | |
144 | return 0; /* not match */ | |
145 | ||
146 | @@ -703,40 +703,25 @@ | |
147 | return 0; | |
148 | ||
149 | } else { | |
150 | - struct capreq *cap; | |
151 | int i; | |
152 | + for (i = n; i < n_array_size(pkg->caps); i++) { | |
153 | + struct capreq *cap = n_array_nth(pkg->caps, i); | |
154 | ||
155 | - cap = n_array_nth(pkg->caps, n); | |
156 | - if (cap_xmatch_req(cap, req, flags)) { | |
157 | - DBGF("chk%d (%s-%s-%s) -> match (flags=%d)\n", n, capreq_name(cap), | |
158 | - capreq_ver(cap), capreq_rel(cap), flags); | |
159 | - return 1; | |
160 | - } | |
161 | - n++; | |
162 | - | |
163 | - for (i = n; i<n_array_size(pkg->caps); i++) { | |
164 | - struct capreq *cap; | |
165 | - | |
166 | - cap = n_array_nth(pkg->caps, n); | |
167 | - if (strcmp(capreq_name(cap), capreq_name(req)) != 0) { | |
168 | - DBGF("chk%d %s-%s-%s -> NOT match IRET\n", i, | |
169 | - capreq_name(cap), capreq_ver(cap), | |
170 | - capreq_rel(cap)); | |
171 | + /* names not equal -> return with false; | |
172 | + eq test omitting for first cap */ | |
173 | + if (i > n && n_str_ne(capreq_name(cap), capreq_name(req))) { | |
174 | + DBGF(" cap[%d] %s -> NOT match, IRET\n", i, | |
175 | + capreq_snprintf_s(cap)); | |
176 | return 0; | |
177 | } | |
178 | - | |
179 | - | |
180 | + | |
181 | if (cap_xmatch_req(cap, req, flags)) { | |
182 | - DBGMSG("chk %s-%s-%s -> match\n", capreq_name(cap), | |
183 | - capreq_ver(cap), capreq_rel(cap)); | |
184 | + DBGF(" cap[%d] %s -> match\n", i, capreq_snprintf_s(cap)); | |
185 | return 1; | |
186 | - } else { | |
187 | - DBGMSG("chk%d %s-%s-%s -> NOT match\n", i, | |
188 | - capreq_name(cap), capreq_ver(cap), | |
189 | - capreq_rel(cap)); | |
190 | } | |
191 | + | |
192 | + DBGF(" cap[%d] %s -> NOT match\n", i, capreq_snprintf_s(cap)); | |
193 | } | |
194 | - DBGMSG("NONE\n"); | |
195 | } | |
196 | ||
197 | return 0; | |
0567ff21 ER |
198 | --- poldek/poldek/pm/pkgdb.c 2005/10/24 15:25:58 1.21 |
199 | +++ poldek/poldek/pm/pkgdb.c 2006/03/18 15:18:04 1.22 | |
200 | @@ -11,7 +11,7 @@ | |
201 | */ | |
202 | ||
203 | /* | |
204 | - $Id$ | |
205 | + $Id$ | |
206 | */ | |
207 | ||
208 | #include <stdlib.h> | |
209 | @@ -440,6 +440,9 @@ | |
210 | tn_array *unistdbpkgs, unsigned ldflags) | |
211 | { | |
212 | tn_array *dbpkgs = NULL; | |
213 | + | |
214 | + n_assert(db); | |
215 | + n_assert(cap); | |
216 | pkgdb_search(db, &dbpkgs, PMTAG_CAP, capreq_name(cap), | |
217 | unistdbpkgs, ldflags); | |
218 | return dbpkgs; | |
219 | diff -u poldek/poldek/uninstall.c poldek/poldek/uninstall.c | |
220 | --- poldek/poldek/uninstall.c 2006/03/18 15:18:04 1.38 | |
221 | +++ poldek/poldek/uninstall.c 2006/03/18 17:03:48 1.39 | |
222 | @@ -1,5 +1,5 @@ | |
223 | /* | |
224 | - Copyright (C) 2000 - 2005 Pawel A. Gajda <mis@k2.net.pl> | |
225 | + Copyright (C) 2000 - 2006 Pawel A. Gajda <mis@k2.net.pl> | |
226 | ||
227 | This program is free software; you can redistribute it and/or modify | |
228 | it under the terms of the GNU General Public License, version 2 as | |
229 | @@ -11,7 +11,7 @@ | |
230 | */ | |
231 | ||
232 | /* | |
233 | - $Id$ | |
234 | + $Id$ | |
235 | */ | |
236 | ||
237 | #include <errno.h> | |
238 | @@ -407,7 +407,7 @@ | |
239 | tn_array *dbpkgs; | |
240 | int i, nmatches = 0; | |
241 | ||
242 | - | |
243 | + n_assert(cr); | |
244 | DBGF("get_provides %s\n", capreq_snprintf_s(cr)); | |
245 | dbpkgs = pkgdb_get_provides_dbpkgs(ts->db, cr, NULL, uninst_LDFLAGS); | |
246 | ||
247 | @@ -431,7 +431,8 @@ | |
248 | } else { /* with version */ | |
249 | if (ts->getop(ts, POLDEK_OP_CAPLOOKUP)) { | |
250 | if (pkg_xmatch_req(dbpkg, cr, POLDEK_MA_PROMOTE_REQEPOCH)) | |
251 | - matched = 1; | |
252 | + matched = 1; | |
253 | + | |
254 | } else { | |
255 | if (strcmp(dbpkg->name, capreq_name(cr)) == 0) { | |
256 | DBGF("n (%s, %s) %d\n", dbpkg->name, | |
257 | @@ -457,15 +458,20 @@ | |
258 | return nmatches; | |
259 | } | |
260 | ||
261 | -static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts, const char *mask) | |
262 | +static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts, | |
263 | + const char *mask) | |
264 | { | |
265 | char *p; | |
266 | struct capreq *cr, *cr_evr; | |
267 | int resolved = 0; | |
268 | ||
269 | cr = NULL; cr_evr = NULL; | |
270 | - | |
271 | - if ((p = strchr(mask, '#')) == NULL) { | |
272 | + | |
273 | + DBGF("mask=%s\n", mask); | |
274 | + /* No EVR mask or empty EVR (last char '#') */ | |
275 | + if ((p = strchr(mask, '#')) == NULL || *(p + 1) == '\0') { | |
276 | + if (p) | |
277 | + *p = '\0'; | |
278 | capreq_new_name_a(mask, cr); | |
279 | ||
280 | } else { | |
281 | @@ -479,8 +485,10 @@ | |
282 | *p = '\0'; | |
283 | p++; | |
284 | ||
285 | - if (poldek_util_parse_evr(p, &epoch, &ver, &rel)) | |
286 | + if (poldek_util_parse_evr(p, &epoch, &ver, &rel)) { | |
287 | cr = cr_evr = capreq_new(NULL, tmp, epoch, ver, rel, REL_EQ, 0); | |
288 | + DBGF("cap=%s\n", capreq_snprintf_s(cr)); | |
289 | + } | |
290 | } | |
291 | ||
292 | if (do_resolve_package(uctx, ts, mask, cr)) | |
293 | @@ -529,7 +537,6 @@ | |
294 | int32_t e = 0; | |
295 | ||
296 | n_strdupap(mask, &tmp); | |
297 | - | |
298 | if (poldek_util_parse_nevr(tmp, &n, &e, &v, &r)) { | |
299 | if (e) | |
300 | n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r); | |
301 | @@ -538,7 +545,7 @@ | |
302 | ||
303 | msgn(2, " Trying %s\n", nmask); | |
304 | DBGF("try %s => %s (%s, %s, %s)\n", mask, nmask, n, v, r); | |
305 | - matched = resolve_package(uctx, ts, tmp); | |
306 | + matched = resolve_package(uctx, ts, nmask); | |
307 | } | |
308 | } | |
309 | } | |
310 | --- poldek/poldek/conf.c 2005/11/05 17:47:55 1.79 | |
311 | +++ poldek/poldek/conf.c 2006/03/18 15:27:47 1.80 | |
312 | @@ -1,5 +1,5 @@ | |
313 | /* | |
314 | - Copyright (C) 2000 - 2005 Pawel A. Gajda <mis@k2.net.pl> | |
315 | + Copyright (C) 2000 - 2006 Pawel A. Gajda <mis@k2.net.pl> | |
316 | ||
317 | This program is free software; you can redistribute it and/or modify | |
318 | it under the terms of the GNU General Public License, version 2 as | |
319 | @@ -137,9 +137,15 @@ | |
320 | sep = " \t,"; | |
321 | ||
322 | p = v = n_str_tokl(vstr, sep); | |
323 | - if (v == NULL) | |
324 | + | |
325 | + if (v == NULL) /* n_str_tokl error */ | |
326 | return 0; | |
327 | ||
328 | + if (*v == NULL) { /* empty option value */ | |
329 | + n_str_tokl_free(v); | |
330 | + return 1; | |
331 | + } | |
332 | + | |
333 | if (n_hash_exists(ht, name)) { | |
334 | opt = n_hash_get(ht, name); | |
335 | ||
336 | @@ -166,6 +172,7 @@ | |
337 | } | |
338 | p++; | |
339 | } | |
340 | + | |
341 | n_str_tokl_free(v); | |
342 | return 1; | |
343 | } | |
344 | --- poldek/poldek/cli/main.c 2005/11/06 19:26:27 1.54 | |
345 | +++ poldek/poldek/cli/main.c 2006/03/18 15:55:37 1.55 | |
346 | @@ -115,8 +115,8 @@ | |
347 | {"upconf", OPT_UPCONF, 0, 0, N_("Update remote configuration files (if any)"), | |
348 | OPT_GID }, | |
349 | ||
350 | -{"version", OPT_BANNER, 0, 0, N_("Display program version information and exit"), | |
351 | - OPT_GID }, | |
352 | +{"version", OPT_BANNER, 0, OPTION_HIDDEN, | |
353 | + N_("Display program version information and exit"), OPT_GID }, | |
354 | ||
355 | {"log", OPT_LOG, "FILE", 0, N_("Log program messages to FILE"), OPT_GID }, | |
356 | {"runas", OPT_RUNAS, "USER", 0, N_("Run program as user USER"), OPT_GID }, |