1 /* pkg_depends.c - the opkg package management system
5 Copyright (C) 2002 Compaq Computer Corporation
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2, or (at
10 your option) any later version.
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
23 #include "opkg_utils.h"
25 #include "opkg_message.h"
26 #include "pkg_parse.h"
27 #include "hash_table.h"
28 #include "libbb/libbb.h"
30 static int parseDepends(compound_depend_t *compound_depend, char * depend_str);
31 static depend_t * depend_init(void);
32 static char ** add_unresolved_dep(pkg_t * pkg, char ** the_lost, int ref_ndx);
33 static char ** merge_unresolved(char ** oldstuff, char ** newstuff);
34 static int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg);
36 static int pkg_installed_and_constraint_satisfied(pkg_t *pkg, void *cdata)
38 depend_t *depend = (depend_t *)cdata;
39 if ((pkg->state_status == SS_INSTALLED || pkg->state_status == SS_UNPACKED) && version_constraints_satisfied(depend, pkg))
45 static int pkg_constraint_satisfied(pkg_t *pkg, void *cdata)
47 depend_t *depend = (depend_t *)cdata;
48 if (version_constraints_satisfied(depend, pkg))
54 /* returns ndependences or negative error value */
56 pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
59 pkg_t * satisfier_entry_pkg;
63 abstract_pkg_t * ab_pkg;
66 * this is a setup to check for redundant/cyclic dependency checks,
67 * which are marked at the abstract_pkg level
69 if (!(ab_pkg = pkg->parent)) {
70 opkg_msg(ERROR, "Internal error, with pkg %s.\n", pkg->name);
74 if (ab_pkg->dependencies_checked) { /* avoid duplicate or cyclic checks */
78 ab_pkg->dependencies_checked = 1; /* mark it for subsequent visits */
82 count = pkg->pre_depends_count + pkg->depends_count + pkg->recommends_count + pkg->suggests_count;
90 /* foreach dependency */
91 for (i = 0; i < count; i++) {
92 compound_depend_t * compound_depend = &pkg->depends[i];
93 depend_t ** possible_satisfiers = compound_depend->possibilities;;
95 satisfier_entry_pkg = NULL;
97 if (compound_depend->type == GREEDY_DEPEND) {
98 /* foreach possible satisfier */
99 for (j = 0; j < compound_depend->possibility_count; j++) {
100 /* foreach provided_by, which includes the abstract_pkg itself */
101 abstract_pkg_t *abpkg = possible_satisfiers[j]->pkg;
102 abstract_pkg_vec_t *ab_provider_vec = abpkg->provided_by;
103 int nposs = ab_provider_vec->len;
104 abstract_pkg_t **ab_providers = ab_provider_vec->pkgs;
106 for (l = 0; l < nposs; l++) {
107 pkg_vec_t *test_vec = ab_providers[l]->pkgs;
108 /* if no depends on this one, try the first package that Provides this one */
109 if (!test_vec){ /* no pkg_vec hooked up to the abstract_pkg! (need another feed?) */
113 /* cruise this possiblity's pkg_vec looking for an installed version */
114 for (k = 0; k < test_vec->len; k++) {
115 pkg_t *pkg_scout = test_vec->pkgs[k];
116 /* not installed, and not already known about? */
117 if ((pkg_scout->state_want != SW_INSTALL)
118 && !pkg_scout->parent->dependencies_checked
119 && !is_pkg_in_pkg_vec(unsatisfied, pkg_scout)) {
120 char ** newstuff = NULL;
122 pkg_vec_t *tmp_vec = pkg_vec_alloc ();
123 /* check for not-already-installed dependencies */
124 rc = pkg_hash_fetch_unsatisfied_dependencies(pkg_scout,
127 if (newstuff == NULL) {
130 for (m = 0; m < rc; m++) {
131 pkg_t *p = tmp_vec->pkgs[m];
132 if (p->state_want == SW_INSTALL)
135 "Not installing %s due"
136 " to requirement for %s.\n",
142 pkg_vec_free (tmp_vec);
144 /* mark this one for installation */
146 "Adding satisfier for greedy"
149 pkg_vec_insert(unsatisfied, pkg_scout);
153 "Not installing %s due to "
166 /* foreach possible satisfier, look for installed package */
167 for (j = 0; j < compound_depend->possibility_count; j++) {
168 /* foreach provided_by, which includes the abstract_pkg itself */
169 depend_t *dependence_to_satisfy = possible_satisfiers[j];
170 abstract_pkg_t *satisfying_apkg = possible_satisfiers[j]->pkg;
171 pkg_t *satisfying_pkg =
172 pkg_hash_fetch_best_installation_candidate(satisfying_apkg,
173 pkg_installed_and_constraint_satisfied,
174 dependence_to_satisfy, 1);
175 /* Being that I can't test constraing in pkg_hash, I will test it here */
176 if (satisfying_pkg != NULL) {
177 if (!pkg_installed_and_constraint_satisfied ( satisfying_pkg,dependence_to_satisfy)) {
178 satisfying_pkg = NULL;
181 opkg_msg(DEBUG, "satisfying_pkg=%p\n", satisfying_pkg);
182 if (satisfying_pkg != NULL) {
188 /* if nothing installed matches, then look for uninstalled satisfier */
190 /* foreach possible satisfier, look for installed package */
191 for (j = 0; j < compound_depend->possibility_count; j++) {
192 /* foreach provided_by, which includes the abstract_pkg itself */
193 depend_t *dependence_to_satisfy = possible_satisfiers[j];
194 abstract_pkg_t *satisfying_apkg = possible_satisfiers[j]->pkg;
195 pkg_t *satisfying_pkg =
196 pkg_hash_fetch_best_installation_candidate(satisfying_apkg,
197 pkg_constraint_satisfied,
198 dependence_to_satisfy, 1);
199 /* Being that I can't test constraing in pkg_hash, I will test it here too */
200 if (satisfying_pkg != NULL) {
201 if (!pkg_constraint_satisfied ( satisfying_pkg,dependence_to_satisfy)) {
202 satisfying_pkg = NULL;
206 /* user request overrides package recommendation */
207 if (satisfying_pkg != NULL
208 && (compound_depend->type == RECOMMEND || compound_depend->type == SUGGEST)
209 && (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE)) {
210 opkg_msg(NOTICE, "%s: ignoring recommendation for "
211 "%s at user request\n",
212 pkg->name, satisfying_pkg->name);
216 opkg_msg(DEBUG, "satisfying_pkg=%p\n", satisfying_pkg);
217 if (satisfying_pkg != NULL) {
218 satisfier_entry_pkg = satisfying_pkg;
224 /* we didn't find one, add something to the unsatisfied vector */
226 if (!satisfier_entry_pkg) {
227 /* failure to meet recommendations is not an error */
228 if (compound_depend->type != RECOMMEND && compound_depend->type != SUGGEST)
229 the_lost = add_unresolved_dep(pkg, the_lost, i);
232 "%s: unsatisfied recommendation for %s\n",
234 compound_depend->possibilities[0]->pkg->name);
237 if (compound_depend->type == SUGGEST) {
238 /* just mention it politely */
239 opkg_msg(NOTICE, "package %s suggests installing %s\n",
240 pkg->name, satisfier_entry_pkg->name);
242 char ** newstuff = NULL;
244 if (satisfier_entry_pkg != pkg &&
245 !is_pkg_in_pkg_vec(unsatisfied, satisfier_entry_pkg)) {
246 pkg_vec_insert(unsatisfied, satisfier_entry_pkg);
247 pkg_hash_fetch_unsatisfied_dependencies(satisfier_entry_pkg,
250 the_lost = merge_unresolved(the_lost, newstuff);
258 *unresolved = the_lost;
260 return unsatisfied->len;
263 /*checking for conflicts !in replaces
264 If a packages conflicts with another but is also replacing it, I should not consider it a
266 returns 0 if conflicts <> replaces or 1 if conflicts == replaces
269 is_pkg_a_replaces(pkg_t *pkg_scout,pkg_t *pkg)
272 int replaces_count = pkg->replaces_count;
273 abstract_pkg_t **replaces;
275 if (pkg->replaces_count==0) // No replaces, it's surely a conflict
278 replaces = pkg->replaces;
280 for (i = 0; i < replaces_count; i++) {
281 if (strcmp(pkg_scout->name,pkg->replaces[i]->name)==0) { // Found
282 opkg_msg(DEBUG2, "Seems I've found a replace %s %s\n",
283 pkg_scout->name, pkg->replaces[i]->name);
292 pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg)
294 pkg_vec_t * installed_conflicts, * test_vec;
295 compound_depend_t * conflicts;
296 depend_t ** possible_satisfiers;
297 depend_t * possible_satisfier;
300 abstract_pkg_t * ab_pkg;
305 * this is a setup to check for redundant/cyclic dependency checks,
306 * which are marked at the abstract_pkg level
308 if(!(ab_pkg = pkg->parent)){
309 opkg_msg(ERROR, "Internal error: %s not in hash table\n", pkg->name);
310 return (pkg_vec_t *)NULL;
313 conflicts = pkg->conflicts;
315 return (pkg_vec_t *)NULL;
317 installed_conflicts = pkg_vec_alloc();
319 count = pkg->conflicts_count;
323 /* foreach conflict */
324 for(i = 0; i < pkg->conflicts_count; i++){
326 possible_satisfiers = conflicts->possibilities;
328 /* foreach possible satisfier */
329 for(j = 0; j < conflicts->possibility_count; j++){
330 possible_satisfier = possible_satisfiers[j];
331 if (!possible_satisfier)
332 opkg_msg(ERROR, "Internal error: possible_satisfier=NULL\n");
333 if (!possible_satisfier->pkg)
334 opkg_msg(ERROR, "Internal error: possible_satisfier->pkg=NULL\n");
335 test_vec = possible_satisfier->pkg->pkgs;
337 /* pkg_vec found, it is an actual package conflict
338 * cruise this possiblity's pkg_vec looking for an installed version */
339 pkg_scouts = test_vec->pkgs;
340 for(k = 0; k < test_vec->len; k++){
341 pkg_scout = pkg_scouts[k];
343 opkg_msg(ERROR, "Internal error: pkg_scout=NULL\n");
346 if ((pkg_scout->state_status == SS_INSTALLED || pkg_scout->state_want == SW_INSTALL) &&
347 version_constraints_satisfied(possible_satisfier, pkg_scout) && !is_pkg_a_replaces(pkg_scout,pkg)){
348 if (!is_pkg_in_pkg_vec(installed_conflicts, pkg_scout)){
349 pkg_vec_insert(installed_conflicts, pkg_scout);
358 if (installed_conflicts->len)
359 return installed_conflicts;
360 pkg_vec_free(installed_conflicts);
361 return (pkg_vec_t *)NULL;
364 int version_constraints_satisfied(depend_t * depends, pkg_t * pkg)
369 if(depends->constraint == NONE)
374 parse_version(temp, depends->version);
376 comparison = pkg_compare_versions(pkg, temp);
378 free (temp->version);
381 if((depends->constraint == EARLIER) &&
384 else if((depends->constraint == LATER) &&
387 else if(comparison == 0)
389 else if((depends->constraint == LATER_EQUAL) &&
392 else if((depends->constraint == EARLIER_EQUAL) &&
399 int pkg_dependence_satisfiable(depend_t *depend)
401 abstract_pkg_t *apkg = depend->pkg;
402 abstract_pkg_vec_t *provider_apkgs = apkg->provided_by;
403 int n_providers = provider_apkgs->len;
404 abstract_pkg_t **apkgs = provider_apkgs->pkgs;
410 for (i = 0; i < n_providers; i++) {
411 abstract_pkg_t *papkg = apkgs[i];
412 pkg_vec = papkg->pkgs;
414 n_pkgs = pkg_vec->len;
415 for (j = 0; j < n_pkgs; j++) {
416 pkg_t *pkg = pkg_vec->pkgs[j];
417 if (version_constraints_satisfied(depend, pkg)) {
426 int pkg_dependence_satisfied(depend_t *depend)
428 abstract_pkg_t *apkg = depend->pkg;
429 abstract_pkg_vec_t *provider_apkgs = apkg->provided_by;
430 int n_providers = provider_apkgs->len;
431 abstract_pkg_t **apkgs = provider_apkgs->pkgs;
436 for (i = 0; i < n_providers; i++) {
437 abstract_pkg_t *papkg = apkgs[i];
438 pkg_vec_t *pkg_vec = papkg->pkgs;
440 n_pkgs = pkg_vec->len;
441 for (j = 0; j < n_pkgs; j++) {
442 pkg_t *pkg = pkg_vec->pkgs[j];
443 if (version_constraints_satisfied(depend, pkg)) {
444 if (pkg->state_status == SS_INSTALLED || pkg->state_status == SS_UNPACKED)
453 static int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg)
456 pkg_t ** pkgs = vec->pkgs;
458 for(i = 0; i < vec->len; i++)
459 if((strcmp(pkg->name, (*(pkgs + i))->name) == 0)
460 && (pkg_compare_versions(pkg, *(pkgs + i)) == 0)
461 && (strcmp(pkg->architecture, (*(pkgs + i))->architecture) == 0))
467 * pkg_replaces returns 1 if pkg->replaces contains one of replacee's provides and 0
470 int pkg_replaces(pkg_t *pkg, pkg_t *replacee)
472 abstract_pkg_t **replaces = pkg->replaces;
473 int replaces_count = pkg->replaces_count;
474 int replacee_provides_count = replacee->provides_count;
476 for (i = 0; i < replaces_count; i++) {
477 abstract_pkg_t *abstract_replacee = replaces[i];
478 for (j = 0; j < replacee_provides_count; j++) {
479 if (replacee->provides[j] == abstract_replacee)
488 * pkg_conflicts_abstract returns 1 if pkg->conflicts contains conflictee and 0
491 int pkg_conflicts_abstract(pkg_t *pkg, abstract_pkg_t *conflictee)
493 compound_depend_t *conflicts = pkg->conflicts;
494 int conflicts_count = pkg->conflicts_count;
496 for (i = 0; i < conflicts_count; i++) {
497 int possibility_count = conflicts[i].possibility_count;
498 struct depend **possibilities = conflicts[i].possibilities;
499 for (j = 0; j < possibility_count; j++) {
500 if (possibilities[j]->pkg == conflictee) {
509 * pkg_conflicts returns 1 if pkg->conflicts contains one of
510 * conflictee's provides and 0 otherwise.
512 int pkg_conflicts(pkg_t *pkg, pkg_t *conflictee)
514 compound_depend_t *conflicts = pkg->conflicts;
515 int conflicts_count = pkg->conflicts_count;
516 abstract_pkg_t **conflictee_provides = conflictee->provides;
517 int conflictee_provides_count = conflictee->provides_count;
519 int possibility_count;
520 struct depend **possibilities;
521 abstract_pkg_t *possibility ;
523 for (i = 0; i < conflicts_count; i++) {
524 possibility_count = conflicts[i].possibility_count;
525 possibilities = conflicts[i].possibilities;
526 for (j = 0; j < possibility_count; j++) {
527 possibility = possibilities[j]->pkg;
528 for (k = 0; k < conflictee_provides_count; k++) {
529 if (possibility == conflictee_provides[k]) {
538 static char ** merge_unresolved(char ** oldstuff, char ** newstuff)
540 int oldlen = 0, newlen = 0;
547 while(oldstuff && oldstuff[oldlen]) oldlen++;
548 while(newstuff && newstuff[newlen]) newlen++;
550 result = xrealloc(oldstuff, sizeof(char *) * (oldlen + newlen + 1));
552 for(i = oldlen, j = 0; i < (oldlen + newlen); i++, j++)
553 *(result + i) = *(newstuff + j);
555 *(result + i) = NULL;
561 * a kinda kludgy way to back out depends str from two different arrays (reg'l'r 'n pre)
562 * this is null terminated, no count is carried around
564 char ** add_unresolved_dep(pkg_t * pkg, char ** the_lost, int ref_ndx)
570 while(the_lost && the_lost[count]) count++;
572 count++; /* need one to hold the null */
573 resized = xrealloc(the_lost, sizeof(char *) * (count + 1));
574 resized[count - 1] = pkg_depend_str(pkg, ref_ndx);
575 resized[count] = NULL;
580 void buildProvides(abstract_pkg_t * ab_pkg, pkg_t * pkg)
584 /* every pkg provides itself */
585 pkg->provides_count++;
586 abstract_pkg_vec_insert(ab_pkg->provided_by, ab_pkg);
587 pkg->provides = xcalloc(pkg->provides_count, sizeof(abstract_pkg_t *));
588 pkg->provides[0] = ab_pkg;
590 for (i=1; i<pkg->provides_count; i++) {
591 abstract_pkg_t *provided_abpkg = ensure_abstract_pkg_by_name(
592 pkg->provides_str[i-1]);
593 free(pkg->provides_str[i-1]);
595 pkg->provides[i] = provided_abpkg;
597 abstract_pkg_vec_insert(provided_abpkg->provided_by, ab_pkg);
599 if (pkg->provides_str)
600 free(pkg->provides_str);
603 void buildConflicts(pkg_t * pkg)
606 compound_depend_t * conflicts;
608 if (!pkg->conflicts_count)
611 conflicts = pkg->conflicts = xcalloc(pkg->conflicts_count, sizeof(compound_depend_t));
612 for (i = 0; i < pkg->conflicts_count; i++) {
613 conflicts->type = CONFLICTS;
614 parseDepends(conflicts, pkg->conflicts_str[i]);
615 free(pkg->conflicts_str[i]);
618 if (pkg->conflicts_str)
619 free(pkg->conflicts_str);
622 void buildReplaces(abstract_pkg_t * ab_pkg, pkg_t * pkg)
626 if (!pkg->replaces_count)
629 pkg->replaces = xcalloc(pkg->replaces_count, sizeof(abstract_pkg_t *));
631 for(i = 0; i < pkg->replaces_count; i++){
632 abstract_pkg_t *old_abpkg = ensure_abstract_pkg_by_name(pkg->replaces_str[i]);
634 pkg->replaces[i] = old_abpkg;
635 free(pkg->replaces_str[i]);
637 if (!old_abpkg->replaced_by)
638 old_abpkg->replaced_by = abstract_pkg_vec_alloc();
639 /* if a package pkg both replaces and conflicts old_abpkg,
640 * then add it to the replaced_by vector so that old_abpkg
641 * will be upgraded to ab_pkg automatically */
642 if (pkg_conflicts_abstract(pkg, old_abpkg))
643 abstract_pkg_vec_insert(old_abpkg->replaced_by, ab_pkg);
646 if (pkg->replaces_str)
647 free(pkg->replaces_str);
650 void buildDepends(pkg_t * pkg)
654 compound_depend_t * depends;
656 if(!(count = pkg->pre_depends_count + pkg->depends_count + pkg->recommends_count + pkg->suggests_count))
659 depends = pkg->depends = xcalloc(count, sizeof(compound_depend_t));
661 for(i = 0; i < pkg->pre_depends_count; i++){
662 parseDepends(depends, pkg->pre_depends_str[i]);
663 free(pkg->pre_depends_str[i]);
664 depends->type = PREDEPEND;
667 if (pkg->pre_depends_str)
668 free(pkg->pre_depends_str);
670 for(i = 0; i < pkg->depends_count; i++){
671 parseDepends(depends, pkg->depends_str[i]);
672 free(pkg->depends_str[i]);
675 if (pkg->depends_str)
676 free(pkg->depends_str);
678 for(i = 0; i < pkg->recommends_count; i++){
679 parseDepends(depends, pkg->recommends_str[i]);
680 free(pkg->recommends_str[i]);
681 depends->type = RECOMMEND;
684 if(pkg->recommends_str)
685 free(pkg->recommends_str);
687 for(i = 0; i < pkg->suggests_count; i++){
688 parseDepends(depends, pkg->suggests_str[i]);
689 free(pkg->suggests_str[i]);
690 depends->type = SUGGEST;
693 if(pkg->suggests_str)
694 free(pkg->suggests_str);
698 constraint_to_str(enum version_constraint c)
719 * Returns a printable string for pkg's dependency at the specified idx. The
720 * resultant string must be passed to free() by the caller.
723 pkg_depend_str(pkg_t *pkg, int idx)
728 compound_depend_t *cdep;
732 cdep = &pkg->depends[idx];
734 /* calculate string length */
735 for (i=0; i<cdep->possibility_count; i++) {
736 dep = cdep->possibilities[i];
739 len += 3; /* space, pipe, space */
741 len += strlen(dep->pkg->name);
744 len += 2; /* space, left parenthesis */
745 len += 3; /* constraint string (<=, >=, etc), space */
746 len += strlen(dep->version);
747 len += 1; /* right parenthesis */
751 str = xmalloc(len + 1); /* +1 for the NULL terminator */
754 for (i=0; i<cdep->possibility_count; i++) {
755 dep = cdep->possibilities[i];
758 strncat(str, " | ", len);
760 strncat(str, dep->pkg->name, len);
763 strncat(str, " (", len);
764 strncat(str, constraint_to_str(dep->constraint), len);
765 strncat(str, dep->version, len);
766 strncat(str, ")", len);
774 * WARNING: This function assumes pre_depends and depends are at the
775 * start of the pkg->depends array.
777 void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg)
779 compound_depend_t * depends;
780 int count, othercount;
782 abstract_pkg_t * ab_depend;
783 abstract_pkg_t ** temp;
785 count = pkg->pre_depends_count + pkg->depends_count;
786 depends = pkg->depends;
788 for (i = 0; i < count; i++) {
789 for (j = 0; j < depends->possibility_count; j++){
790 ab_depend = depends->possibilities[j]->pkg;
791 if(!ab_depend->depended_upon_by)
792 ab_depend->depended_upon_by = xcalloc(1, sizeof(abstract_pkg_t *));
794 temp = ab_depend->depended_upon_by;
802 ab_depend->depended_upon_by = xrealloc(ab_depend->depended_upon_by,
803 (othercount + 1) * sizeof(abstract_pkg_t *));
804 /* the array may have moved */
805 temp = ab_depend->depended_upon_by + othercount;
812 static depend_t * depend_init(void)
814 depend_t * d = xcalloc(1, sizeof(depend_t));
815 d->constraint = NONE;
822 static int parseDepends(compound_depend_t *compound_depend,
825 char * pkg_name, buffer[2048];
826 unsigned int num_of_ors = 0;
829 depend_t ** possibilities;
831 /* first count the number of ored possibilities for satisfying dependency */
837 compound_depend->type = DEPEND;
839 compound_depend->possibility_count = num_of_ors + 1;
840 possibilities = xcalloc((num_of_ors + 1), sizeof(depend_t *) );
841 compound_depend->possibilities = possibilities;
844 for(i = 0; i < num_of_ors + 1; i++){
845 possibilities[i] = depend_init();
846 /* gobble up just the name first */
855 pkg_name = trim_xstrdup(buffer);
857 /* now look at possible version info */
859 /* skip to next chars */
861 while(*src && isspace(*src)) src++;
863 /* extract constraint and version */
866 if(!strncmp(src, "<<", 2)){
867 possibilities[i]->constraint = EARLIER;
870 else if(!strncmp(src, "<=", 2)){
871 possibilities[i]->constraint = EARLIER_EQUAL;
874 else if(!strncmp(src, ">=", 2)){
875 possibilities[i]->constraint = LATER_EQUAL;
878 else if(!strncmp(src, ">>", 2)){
879 possibilities[i]->constraint = LATER;
882 else if(!strncmp(src, "=", 1)){
883 possibilities[i]->constraint = EQUAL;
886 /* should these be here to support deprecated designations; dpkg does */
887 else if(!strncmp(src, "<", 1)){
888 possibilities[i]->constraint = EARLIER_EQUAL;
891 else if(!strncmp(src, ">", 1)){
892 possibilities[i]->constraint = LATER_EQUAL;
896 /* now we have any constraint, pass space to version string */
897 while(isspace(*src)) src++;
899 /* this would be the version string */
901 while(*src && *src != ')')
905 possibilities[i]->version = trim_xstrdup(buffer);
907 /* hook up the dependency to its abstract pkg */
908 possibilities[i]->pkg = ensure_abstract_pkg_by_name(pkg_name);
912 /* now get past the ) and any possible | chars */
920 compound_depend->type = GREEDY_DEPEND;