packages.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. /*
  2. * dpkg - main program for package management
  3. * packages.c - common to actions that process packages
  4. *
  5. * Copyright © 1994,1995 Ian Jackson <ian@chiark.greenend.org.uk>
  6. *
  7. * This is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include <config.h>
  21. #include <compat.h>
  22. #include <sys/types.h>
  23. #include <sys/stat.h>
  24. #include <assert.h>
  25. #include <ctype.h>
  26. #include <string.h>
  27. #include <fcntl.h>
  28. #include <dirent.h>
  29. #include <unistd.h>
  30. #include <stdlib.h>
  31. #include <stdio.h>
  32. #include <dpkg/i18n.h>
  33. #include <dpkg/dpkg.h>
  34. #include <dpkg/dpkg-db.h>
  35. #include <dpkg/pkg-list.h>
  36. #include <dpkg/pkg-queue.h>
  37. #include <dpkg/myopt.h>
  38. #include "filesdb.h"
  39. #include "main.h"
  40. static struct pkginfo *progress_bytrigproc;
  41. static struct pkg_queue queue = PKG_QUEUE_INIT;
  42. int sincenothing = 0, dependtry = 0;
  43. void
  44. add_to_queue(struct pkginfo *pkg)
  45. {
  46. pkg_queue_push(&queue, pkg);
  47. }
  48. static void
  49. enqueue_pending(void)
  50. {
  51. struct pkgiterator *it;
  52. struct pkginfo *pkg;
  53. it = pkg_db_iter_new();
  54. while ((pkg = pkg_db_iter_next(it)) != NULL) {
  55. switch (cipaction->arg) {
  56. case act_configure:
  57. if (!(pkg->status == stat_unpacked ||
  58. pkg->status == stat_halfconfigured ||
  59. pkg->trigpend_head))
  60. continue;
  61. if (pkg->want != want_install)
  62. continue;
  63. break;
  64. case act_triggers:
  65. if (!pkg->trigpend_head)
  66. continue;
  67. if (pkg->want != want_install)
  68. continue;
  69. break;
  70. case act_remove:
  71. case act_purge:
  72. if (pkg->want != want_purge) {
  73. if (pkg->want != want_deinstall)
  74. continue;
  75. if (pkg->status == stat_configfiles)
  76. continue;
  77. }
  78. if (pkg->status == stat_notinstalled)
  79. continue;
  80. break;
  81. default:
  82. internerr("unknown action '%d'", cipaction->arg);
  83. }
  84. add_to_queue(pkg);
  85. }
  86. pkg_db_iter_free(it);
  87. }
  88. static void
  89. enqueue_specified(const char *const *argv)
  90. {
  91. const char *thisarg;
  92. while ((thisarg = *argv++) != NULL) {
  93. struct pkginfo *pkg;
  94. pkg = pkg_db_find(thisarg);
  95. if (pkg->status == stat_notinstalled) {
  96. size_t l = strlen(pkg->name);
  97. const char *extension = pkg->name + l - sizeof(DEBEXT) + 1;
  98. if (l >= sizeof(DEBEXT) && strcmp(extension, DEBEXT) == 0)
  99. badusage(_("you must specify packages by their own names,"
  100. " not by quoting the names of the files they come in"));
  101. }
  102. add_to_queue(pkg);
  103. }
  104. }
  105. void
  106. packages(const char *const *argv)
  107. {
  108. trigproc_install_hooks();
  109. modstatdb_init(admindir,
  110. f_noact ? msdbrw_readonly
  111. : fc_nonroot ? msdbrw_write
  112. : msdbrw_needsuperuser);
  113. checkpath();
  114. log_message("startup packages %s", cipaction->olong);
  115. if (f_pending) {
  116. if (*argv)
  117. badusage(_("--%s --pending does not take any non-option arguments"),cipaction->olong);
  118. enqueue_pending();
  119. } else {
  120. if (!*argv)
  121. badusage(_("--%s needs at least one package name argument"), cipaction->olong);
  122. enqueue_specified(argv);
  123. }
  124. ensure_diversions();
  125. process_queue();
  126. trigproc_run_deferred();
  127. modstatdb_shutdown();
  128. }
  129. void process_queue(void) {
  130. struct pkg_list *rundown;
  131. struct pkginfo *volatile pkg;
  132. volatile enum action action_todo;
  133. jmp_buf ejbuf;
  134. enum istobes istobe= itb_normal;
  135. if (abort_processing)
  136. return;
  137. clear_istobes();
  138. switch (cipaction->arg) {
  139. case act_triggers:
  140. case act_configure: case act_install: istobe= itb_installnew; break;
  141. case act_remove: case act_purge: istobe= itb_remove; break;
  142. default:
  143. internerr("unknown action '%d'", cipaction->arg);
  144. }
  145. for (rundown = queue.head; rundown; rundown = rundown->next) {
  146. ensure_package_clientdata(rundown->pkg);
  147. if (rundown->pkg->clientdata->istobe == istobe) {
  148. /* Erase the queue entry - this is a second copy! */
  149. switch (cipaction->arg) {
  150. case act_triggers:
  151. case act_configure: case act_remove: case act_purge:
  152. printf(_("Package %s listed more than once, only processing once.\n"),
  153. rundown->pkg->name);
  154. break;
  155. case act_install:
  156. printf(_("More than one copy of package %s has been unpacked\n"
  157. " in this run ! Only configuring it once.\n"),
  158. rundown->pkg->name);
  159. break;
  160. default:
  161. internerr("unknown action '%d'", cipaction->arg);
  162. }
  163. rundown->pkg = NULL;
  164. } else {
  165. rundown->pkg->clientdata->istobe= istobe;
  166. }
  167. }
  168. while (!pkg_queue_is_empty(&queue)) {
  169. pkg = pkg_queue_pop(&queue);
  170. if (!pkg)
  171. continue; /* Duplicate, which we removed earlier. */
  172. action_todo = cipaction->arg;
  173. if (sincenothing++ > queue.length * 2 + 2) {
  174. if (progress_bytrigproc && progress_bytrigproc->trigpend_head) {
  175. add_to_queue(pkg);
  176. pkg = progress_bytrigproc;
  177. action_todo = act_configure;
  178. } else {
  179. dependtry++;
  180. sincenothing = 0;
  181. assert(dependtry <= 4);
  182. }
  183. }
  184. assert(pkg->status <= stat_installed);
  185. if (setjmp(ejbuf)) {
  186. /* Give up on it from the point of view of other packages, i.e. reset
  187. * istobe. */
  188. pkg->clientdata->istobe= itb_normal;
  189. pop_error_context(ehflag_bombout);
  190. if (abort_processing)
  191. return;
  192. continue;
  193. }
  194. push_error_context_jump(&ejbuf, print_error_perpackage, pkg->name);
  195. switch (action_todo) {
  196. case act_triggers:
  197. if (!pkg->trigpend_head)
  198. ohshit(_("package %.250s is not ready for trigger processing\n"
  199. " (current status `%.250s' with no pending triggers)"),
  200. pkg->name, statusinfos[pkg->status].name);
  201. /* Fall through. */
  202. case act_install:
  203. /* Don't try to configure pkgs that we've just disappeared. */
  204. if (pkg->status == stat_notinstalled)
  205. break;
  206. /* Fall through. */
  207. case act_configure:
  208. /* Do whatever is most needed. */
  209. if (pkg->trigpend_head)
  210. trigproc(pkg);
  211. else
  212. deferred_configure(pkg);
  213. break;
  214. case act_remove: case act_purge:
  215. deferred_remove(pkg);
  216. break;
  217. default:
  218. internerr("unknown action '%d'", cipaction->arg);
  219. }
  220. m_output(stdout, _("<standard output>"));
  221. m_output(stderr, _("<standard error>"));
  222. pop_error_context(ehflag_normaltidy);
  223. }
  224. assert(!queue.length);
  225. }
  226. /*** Dependency processing - common to --configure and --remove. ***/
  227. /*
  228. * The algorithm for deciding what to configure or remove first is as
  229. * follows:
  230. *
  231. * Loop through all packages doing a ‘try 1’ until we've been round and
  232. * nothing has been done, then do ‘try 2’ and ‘try 3’ likewise.
  233. *
  234. * When configuring, in each try we check to see whether all
  235. * dependencies of this package are done. If so we do it. If some of
  236. * the dependencies aren't done yet but will be later we defer the
  237. * package, otherwise it is an error.
  238. *
  239. * When removing, in each try we check to see whether there are any
  240. * packages that would have dependencies missing if we removed this
  241. * one. If not we remove it now. If some of these packages are
  242. * themselves scheduled for removal we defer the package until they
  243. * have been done.
  244. *
  245. * The criteria for satisfying a dependency vary with the various
  246. * tries. In try 1 we treat the dependencies as absolute. In try 2 we
  247. * check break any cycles in the dependency graph involving the package
  248. * we are trying to process before trying to process the package
  249. * normally. In try 3 (which should only be reached if
  250. * --force-depends-version is set) we ignore version number clauses in
  251. * Depends lines. In try 4 (only reached if --force-depends is set) we
  252. * say "ok" regardless.
  253. *
  254. * If we are configuring and one of the packages we depend on is
  255. * awaiting configuration but wasn't specified in the argument list we
  256. * will add it to the argument list if --configure-any is specified.
  257. * In this case we note this as having "done something" so that we
  258. * don't needlessly escalate to higher levels of dependency checking
  259. * and breaking.
  260. */
  261. enum found_status {
  262. found_none = 0,
  263. found_defer = 1,
  264. found_forced = 2,
  265. found_ok = 3,
  266. };
  267. /*
  268. * Return values:
  269. * 0: cannot be satisfied.
  270. * 1: defer: may be satisfied later, when other packages are better or
  271. * at higher dependtry due to --force
  272. * will set *fixbytrig to package whose trigger processing would help
  273. * if applicable (and leave it alone otherwise).
  274. * 2: not satisfied but forcing
  275. * (*interestingwarnings >= 0 on exit? caller is to print oemsgs).
  276. * 3: satisfied now.
  277. */
  278. static enum found_status
  279. deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
  280. struct pkginfo *removing, struct pkginfo *providing,
  281. struct pkginfo **fixbytrig,
  282. bool *matched, struct deppossi *checkversion,
  283. int *interestingwarnings, struct varbuf *oemsgs)
  284. {
  285. enum found_status thisf;
  286. if (ignore_depends(possdependee)) {
  287. debug(dbg_depcondetail," ignoring depended package so ok and found");
  288. return found_ok;
  289. }
  290. thisf = found_none;
  291. if (possdependee == removing) {
  292. if (providing) {
  293. varbufprintf(oemsgs,
  294. _(" Package %s which provides %s is to be removed.\n"),
  295. possdependee->name, providing->name);
  296. } else {
  297. varbufprintf(oemsgs, _(" Package %s is to be removed.\n"),
  298. possdependee->name);
  299. }
  300. *matched = true;
  301. if (fc_depends)
  302. thisf = (dependtry >= 4) ? found_forced : found_defer;
  303. debug(dbg_depcondetail," removing possdependee, returning %d",thisf);
  304. return thisf;
  305. }
  306. switch (possdependee->status) {
  307. case stat_unpacked:
  308. case stat_halfconfigured:
  309. case stat_triggersawaited:
  310. case stat_triggerspending:
  311. case stat_installed:
  312. if (checkversion && !versionsatisfied(&possdependee->installed,checkversion)) {
  313. varbufprintf(oemsgs, _(" Version of %s on system is %s.\n"),
  314. possdependee->name,
  315. versiondescribe(&possdependee->installed.version,
  316. vdew_nonambig));
  317. assert(checkversion->verrel != dvr_none);
  318. if (fc_depends || fc_dependsversion)
  319. thisf = (dependtry >= 3) ? found_forced : found_defer;
  320. debug(dbg_depcondetail," bad version, returning %d",thisf);
  321. (*interestingwarnings)++;
  322. return thisf;
  323. }
  324. if (possdependee->status == stat_installed ||
  325. possdependee->status == stat_triggerspending) {
  326. debug(dbg_depcondetail," is installed, ok and found");
  327. return found_ok;
  328. }
  329. if (possdependee->status == stat_triggersawaited) {
  330. assert(possdependee->trigaw.head);
  331. if (removing || !(f_triggers ||
  332. possdependee->clientdata->istobe == itb_installnew)) {
  333. if (providing) {
  334. varbufprintf(oemsgs,
  335. _(" Package %s which provides %s awaits trigger processing.\n"),
  336. possdependee->name, providing->name);
  337. } else {
  338. varbufprintf(oemsgs,
  339. _(" Package %s awaits trigger processing.\n"),
  340. possdependee->name);
  341. }
  342. debug(dbg_depcondetail, " triggers-awaited, no fixbytrig");
  343. goto unsuitable;
  344. }
  345. /* We don't check the status of trigaw.head->pend here, just in case
  346. * we get into the pathological situation where Triggers-Awaited but
  347. * the named package doesn't actually have any pending triggers. In
  348. * that case we queue the non-pending package for trigger processing
  349. * anyway, and that trigger processing will be a noop except for
  350. * sorting out all of the packages which name it in Triggers-Awaited.
  351. *
  352. * (This situation can only arise if modstatdb_note success in
  353. * clearing the triggers-pending status of the pending package
  354. * but then fails to go on to update the awaiters.) */
  355. *fixbytrig = possdependee->trigaw.head->pend;
  356. debug(dbg_depcondetail,
  357. " triggers-awaited, fixbytrig '%s', defer",
  358. (*fixbytrig)->name);
  359. return found_defer;
  360. }
  361. if (possdependee->clientdata &&
  362. possdependee->clientdata->istobe == itb_installnew) {
  363. debug(dbg_depcondetail," unpacked/halfconfigured, defer");
  364. return found_defer;
  365. } else if (!removing && fc_configureany &&
  366. !skip_due_to_hold(possdependee) &&
  367. !(possdependee->status == stat_halfconfigured)) {
  368. fprintf(stderr,
  369. _("dpkg: also configuring `%s' (required by `%s')\n"),
  370. possdependee->name, requiredby->name);
  371. add_to_queue(possdependee);
  372. sincenothing = 0;
  373. return found_defer;
  374. } else {
  375. if (providing) {
  376. varbufprintf(oemsgs,
  377. _(" Package %s which provides %s is not configured yet.\n"),
  378. possdependee->name, providing->name);
  379. } else {
  380. varbufprintf(oemsgs, _(" Package %s is not configured yet.\n"),
  381. possdependee->name);
  382. }
  383. debug(dbg_depcondetail, " not configured/able");
  384. goto unsuitable;
  385. }
  386. default:
  387. if (providing) {
  388. varbufprintf(oemsgs,
  389. _(" Package %s which provides %s is not installed.\n"),
  390. possdependee->name, providing->name);
  391. } else {
  392. varbufprintf(oemsgs, _(" Package %s is not installed.\n"),
  393. possdependee->name);
  394. }
  395. debug(dbg_depcondetail, " not installed");
  396. goto unsuitable;
  397. }
  398. unsuitable:
  399. if (fc_depends)
  400. thisf = (dependtry >= 4) ? found_forced : found_defer;
  401. debug(dbg_depcondetail, " returning %d", thisf);
  402. (*interestingwarnings)++;
  403. return thisf;
  404. }
  405. static void
  406. breaks_check_one(struct varbuf *aemsgs, enum dep_check *ok,
  407. struct deppossi *breaks, struct pkginfo *broken,
  408. struct pkginfo *breaker, struct pkginfo *virtbroken)
  409. {
  410. struct varbuf depmsg = VARBUF_INIT;
  411. debug(dbg_depcondetail, " checking breaker %s virtbroken %s",
  412. breaker->name, virtbroken ? virtbroken->name : "<none>");
  413. if (breaker->status == stat_notinstalled ||
  414. breaker->status == stat_configfiles) return;
  415. if (broken == breaker) return;
  416. if (!versionsatisfied(&broken->installed, breaks)) return;
  417. if (ignore_depends(breaker)) return;
  418. if (virtbroken && ignore_depends(virtbroken)) return;
  419. varbufdependency(&depmsg, breaks->up);
  420. varbufaddc(&depmsg, 0);
  421. varbufprintf(aemsgs, _(" %s (%s) breaks %s and is %s.\n"),
  422. breaker->name,
  423. versiondescribe(&breaker->installed.version, vdew_nonambig),
  424. depmsg.buf,
  425. gettext(statusstrings[breaker->status]));
  426. varbuf_destroy(&depmsg);
  427. if (virtbroken) {
  428. varbufprintf(aemsgs, _(" %s (%s) provides %s.\n"),
  429. broken->name,
  430. versiondescribe(&broken->installed.version, vdew_nonambig),
  431. virtbroken->name);
  432. } else if (breaks->verrel != dvr_none) {
  433. varbufprintf(aemsgs, _(" Version of %s to be configured is %s.\n"),
  434. broken->name,
  435. versiondescribe(&broken->installed.version, vdew_nonambig));
  436. if (fc_dependsversion) return;
  437. }
  438. if (force_breaks(breaks)) return;
  439. *ok = dep_check_halt;
  440. }
  441. static void
  442. breaks_check_target(struct varbuf *aemsgs, enum dep_check *ok,
  443. struct pkginfo *broken, struct pkginfo *target,
  444. struct pkginfo *virtbroken)
  445. {
  446. struct deppossi *possi;
  447. for (possi = target->installed.depended; possi; possi = possi->rev_next) {
  448. if (possi->up->type != dep_breaks) continue;
  449. if (virtbroken && possi->verrel != dvr_none) continue;
  450. breaks_check_one(aemsgs, ok, possi, broken, possi->up->up, virtbroken);
  451. }
  452. }
  453. enum dep_check
  454. breakses_ok(struct pkginfo *pkg, struct varbuf *aemsgs)
  455. {
  456. struct dependency *dep;
  457. struct pkginfo *virtbroken;
  458. enum dep_check ok = dep_check_ok;
  459. debug(dbg_depcon, " checking Breaks");
  460. breaks_check_target(aemsgs, &ok, pkg, pkg, NULL);
  461. for (dep= pkg->installed.depends; dep; dep= dep->next) {
  462. if (dep->type != dep_provides) continue;
  463. virtbroken= dep->list->ed;
  464. debug(dbg_depcondetail, " checking virtbroken %s", virtbroken->name);
  465. breaks_check_target(aemsgs, &ok, pkg, virtbroken, virtbroken);
  466. }
  467. return ok;
  468. }
  469. /*
  470. * Checks [Pre]-Depends only.
  471. */
  472. enum dep_check
  473. dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
  474. struct varbuf *aemsgs)
  475. {
  476. /* Valid values: 2 = ok, 1 = defer, 0 = halt. */
  477. enum dep_check ok;
  478. /* Valid values: 0 = none, 1 = defer, 2 = withwarning, 3 = ok. */
  479. enum found_status found, thisf;
  480. int interestingwarnings;
  481. bool matched, anycannotfixbytrig;
  482. struct varbuf oemsgs = VARBUF_INIT;
  483. struct dependency *dep;
  484. struct deppossi *possi, *provider;
  485. struct pkginfo *possfixbytrig, *canfixbytrig;
  486. interestingwarnings= 0;
  487. ok = dep_check_ok;
  488. debug(dbg_depcon,"checking dependencies of %s (- %s)",
  489. pkg->name, removing ? removing->name : "<none>");
  490. anycannotfixbytrig = false;
  491. canfixbytrig = NULL;
  492. for (dep= pkg->installed.depends; dep; dep= dep->next) {
  493. if (dep->type != dep_depends && dep->type != dep_predepends) continue;
  494. debug(dbg_depcondetail," checking group ...");
  495. matched = false;
  496. varbufreset(&oemsgs);
  497. found = found_none;
  498. possfixbytrig = NULL;
  499. for (possi = dep->list; found != found_ok && possi; possi = possi->next) {
  500. debug(dbg_depcondetail," checking possibility -> %s",possi->ed->name);
  501. if (possi->cyclebreak) {
  502. debug(dbg_depcondetail," break cycle so ok and found");
  503. found = found_ok;
  504. break;
  505. }
  506. thisf = deppossi_ok_found(possi->ed, pkg, removing, NULL,
  507. &possfixbytrig,
  508. &matched,possi,&interestingwarnings,&oemsgs);
  509. if (thisf > found) found= thisf;
  510. if (found != found_ok && possi->verrel == dvr_none) {
  511. for (provider = possi->ed->installed.depended;
  512. found != found_ok && provider;
  513. provider = provider->rev_next) {
  514. if (provider->up->type != dep_provides)
  515. continue;
  516. debug(dbg_depcondetail, " checking provider %s",
  517. provider->up->up->name);
  518. thisf = deppossi_ok_found(provider->up->up, pkg, removing, possi->ed,
  519. &possfixbytrig, &matched, NULL,
  520. &interestingwarnings, &oemsgs);
  521. if (thisf > found)
  522. found = thisf;
  523. }
  524. }
  525. debug(dbg_depcondetail," found %d",found);
  526. if (thisf > found) found= thisf;
  527. }
  528. debug(dbg_depcondetail, " found %d matched %d possfixbytrig %s",
  529. found, matched, possfixbytrig ? possfixbytrig->name : "-");
  530. if (removing && !matched) continue;
  531. switch (found) {
  532. case found_none:
  533. anycannotfixbytrig = true;
  534. ok = dep_check_halt;
  535. case found_forced:
  536. varbufaddstr(aemsgs, " ");
  537. varbufaddstr(aemsgs, pkg->name);
  538. varbufaddstr(aemsgs, _(" depends on "));
  539. varbufdependency(aemsgs, dep);
  540. if (interestingwarnings) {
  541. /* Don't print the line about the package to be removed if
  542. * that's the only line. */
  543. varbufaddstr(aemsgs, _("; however:\n"));
  544. varbufaddc(&oemsgs, 0);
  545. varbufaddstr(aemsgs, oemsgs.buf);
  546. } else {
  547. varbufaddstr(aemsgs, ".\n");
  548. }
  549. break;
  550. case found_defer:
  551. if (possfixbytrig)
  552. canfixbytrig = possfixbytrig;
  553. else
  554. anycannotfixbytrig = true;
  555. if (ok > dep_check_defer)
  556. ok = dep_check_defer;
  557. break;
  558. case found_ok:
  559. break;
  560. default:
  561. internerr("unknown value for found '%d'", found);
  562. }
  563. }
  564. if (ok == dep_check_halt &&
  565. (pkg->clientdata && pkg->clientdata->istobe == itb_remove))
  566. ok = dep_check_defer;
  567. if (!anycannotfixbytrig && canfixbytrig)
  568. progress_bytrigproc = canfixbytrig;
  569. varbuf_destroy(&oemsgs);
  570. debug(dbg_depcon,"ok %d msgs >>%.*s<<", ok, (int)aemsgs->used, aemsgs->buf);
  571. return ok;
  572. }