~vibhavp/ubuntu/raring/dahdi-tools/merge-from-debian

« back to all changes in this revision

Viewing changes to menuselect/menuselect.c

  • Committer: Vibhav Pant
  • Date: 2012-12-26 17:23:16 UTC
  • mfrom: (2.1.6 sid)
  • Revision ID: vibhavp@gmail.com-20121226172316-o2jojsfcnr0aqrme
* Merge from Debian unstable. Remaining changes:
  - Bug Fix: If linux-headers are not installed, don't block, and print
    information for the user.
  - added debian/dahdi.postinst
  - added --error-handler=init_failed to debian/rules
  - debian/control: Added gawk as dependency for dkms build (LP: #493304)
  - Changes from Debian:
    - debian/control: Change Maintainer
    - debian/control: Removed Uploaders field.
    - debian/control: Removed Debian Vcs-Svn entry and replaced with
      ubuntu-voip Vcs-Bzr, to reflect divergence in packages.
    - debian/control: Package dahdi Depends on dahdi-dkms | dahdi-source 

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
/*! \brief Free a member structure and all of its members */
192
192
static void free_member(struct member *mem)
193
193
{
194
 
        struct depend *dep;
195
 
        struct conflict *cnf;
196
 
        struct use *use;
 
194
        struct reference *dep;
 
195
        struct reference *cnf;
 
196
        struct reference *use;
197
197
 
198
198
        while ((dep = AST_LIST_REMOVE_HEAD(&mem->deps, list)))
199
199
                free(dep);
210
210
        FILE *f;
211
211
        struct tree *tree;
212
212
        struct member *mem;
213
 
        struct depend *dep;
214
 
        struct conflict *cnf;
215
 
        struct use *use;
 
213
        struct reference *dep;
 
214
        struct reference *cnf;
 
215
        struct reference *use;
216
216
        mxml_node_t *cur;
217
217
        mxml_node_t *cur2;
218
218
        mxml_node_t *cur3;
291
291
                                mem->was_enabled = mem->enabled = 1;
292
292
                                print_debug("Enabling %s because the category does not have positive output\n", mem->name);
293
293
                        }
 
294
 
294
295
                        cur3 = mxmlFindElement(cur2, cur2, "defaultenabled", NULL, NULL, MXML_DESCEND);
295
 
                        if (cur3 && cur3->child)
 
296
                        if (cur3 && cur3->child) {
296
297
                                mem->defaultenabled = cur3->child->value.opaque;
297
 
                        
 
298
                        }
 
299
 
 
300
                        cur3 = mxmlFindElement(cur2, cur2, "support_level", NULL, NULL, MXML_DESCEND);
 
301
                        if (cur3 && cur3->child) {
 
302
                                mem->support_level = cur3->child->value.opaque;
 
303
                        }
 
304
 
 
305
                        cur3 = mxmlFindElement(cur2, cur2, "replacement", NULL, NULL, MXML_DESCEND);
 
306
                        if (cur3 && cur3->child) {
 
307
                                mem->replacement = cur3->child->value.opaque;
 
308
                        }
 
309
 
298
310
                        for (cur3 = mxmlFindElement(cur2, cur2, "depend", NULL, NULL, MXML_DESCEND_FIRST);
299
311
                             cur3 && cur3->child;
300
312
                             cur3 = mxmlFindElement(cur3, cur2, "depend", NULL, NULL, MXML_NO_DESCEND))
345
357
                             cur3 && cur3->child;
346
358
                             cur3 = mxmlFindElement(cur3, cur2, "use", NULL, NULL, MXML_NO_DESCEND))
347
359
                        {
348
 
#if !defined(HAVE_ATTRIBUTE_weak_import) && !defined(HAVE_ATTRIBUTE_weakref)
349
 
                                /* If the compiler won't support the functionality required for "use", then "use" -> "depend" */
350
 
                                if (!(dep = calloc(1, sizeof(*dep)))) {
351
 
                                        free_member(mem);
352
 
                                        return -1;
353
 
                                }
354
 
                                if ((tmp = mxmlElementGetAttr(cur3, "name"))) {
355
 
                                        if (!strlen_zero(tmp)) {
356
 
                                                dep->name = tmp;
357
 
                                        }
358
 
                                }
359
 
                                if (!strlen_zero(cur3->child->value.opaque)) {
360
 
                                        dep->displayname = cur3->child->value.opaque;
361
 
                                        if (!dep->name) {
362
 
                                                dep->name = dep->displayname;
363
 
                                        }
364
 
                                        AST_LIST_INSERT_TAIL(&mem->deps, dep, list);
365
 
                                } else {
366
 
                                        free(dep);
367
 
                                }
368
 
#else
369
360
                                if (!(use = calloc(1, sizeof(*use)))) {
370
361
                                        free_member(mem);
371
362
                                        return -1;
381
372
                                                use->name = use->displayname;
382
373
                                        }
383
374
                                        AST_LIST_INSERT_TAIL(&mem->uses, use, list);
384
 
                                } else
 
375
                                } else {
385
376
                                        free(use);
386
 
#endif
 
377
                                }
387
378
                        }
388
379
 
389
380
                        if (add_member(mem, cat))
404
395
        unsigned int result = 0;
405
396
        struct category *cat;
406
397
        struct member *mem;
407
 
        struct depend *dep;
 
398
        struct reference *dep;
408
399
        struct dep_file *dep_file;
409
400
        unsigned int changed, old_failure;
410
401
 
491
482
        unsigned int result = 0;
492
483
        struct category *cat;
493
484
        struct member *mem;
494
 
        struct conflict *cnf;
 
485
        struct reference *cnf;
495
486
        struct dep_file *dep_file;
496
487
        unsigned int changed, old_failure;
497
488
 
661
652
{
662
653
        struct category *cat, *cat2;
663
654
        struct member *mem, *mem2;
664
 
        struct depend *dep;
665
 
        struct conflict *cnf;
666
 
        struct use *use;
 
655
        struct reference *dep;
 
656
        struct reference *cnf;
 
657
        struct reference *use;
667
658
 
 
659
        /* Traverse through each module's dependency list and determine whether each is another module */
668
660
        AST_LIST_TRAVERSE(&categories, cat, list) {
669
661
                AST_LIST_TRAVERSE(&cat->members, mem, list) {
670
662
                        AST_LIST_TRAVERSE(&mem->deps, dep, list) {
693
685
                }
694
686
        }
695
687
 
 
688
        /* Traverse through each module's use list and determine whether each is another module */
696
689
        AST_LIST_TRAVERSE(&categories, cat, list) {
697
690
                AST_LIST_TRAVERSE(&cat->members, mem, list) {
698
691
                        AST_LIST_TRAVERSE(&mem->uses, use, list) {
721
714
                }
722
715
        }
723
716
 
 
717
        /* If weak linking is not supported, move module uses which are other modules to the dependency list */
 
718
#if !defined(HAVE_ATTRIBUTE_weak_import) && !defined(HAVE_ATTRIBUTE_weakref) && !defined(HAVE_ATTRIBUTE_weak)
 
719
        AST_LIST_TRAVERSE(&categories, cat, list) {
 
720
                AST_LIST_TRAVERSE(&cat->members, mem, list) {
 
721
                        AST_LIST_TRAVERSE_SAFE_BEGIN(&mem->uses, use, list) {
 
722
                                if (use->member) {
 
723
                                        AST_LIST_REMOVE_CURRENT(&mem->uses, list);
 
724
                                        AST_LIST_INSERT_TAIL(&mem->deps, use, list);
 
725
                                }
 
726
                        }
 
727
                        AST_LIST_TRAVERSE_SAFE_END;
 
728
                }
 
729
        }
 
730
#endif
 
731
 
 
732
        /* Traverse through each category marked as exclusive and mark every member as conflicting with every other member */
724
733
        AST_LIST_TRAVERSE(&categories, cat, list) {
725
734
                if (!cat->exclusive)
726
735
                        continue;
740
749
                }
741
750
        }
742
751
 
 
752
        /* Traverse through each category and determine whether named conflicts for each module are other modules */
743
753
        AST_LIST_TRAVERSE(&categories, cat, list) {
744
754
                AST_LIST_TRAVERSE(&cat->members, mem, list) {
745
755
                        AST_LIST_TRAVERSE(&mem->conflicts, cnf, list) {
825
835
 
826
836
unsigned int enable_member(struct member *mem)
827
837
{
828
 
        struct depend *dep;
 
838
        struct reference *dep;
829
839
        unsigned int can_enable = 1;
830
840
 
831
841
        AST_LIST_TRAVERSE(&mem->deps, dep, list) {
1062
1072
        FILE *f;
1063
1073
        struct category *cat;
1064
1074
        struct member *mem;
1065
 
        struct depend *dep;
1066
 
        struct use *use;
 
1075
        struct reference *dep;
 
1076
        struct reference *use;
1067
1077
        struct dep_file *dep_file;
1068
1078
 
1069
1079
        if (!(f = fopen(output_makedeps, "w"))) {
1148
1158
        FILE *f;
1149
1159
        struct category *cat;
1150
1160
        struct member *mem;
1151
 
        struct depend *dep;
1152
 
        struct use *use;
 
1161
        struct reference *dep;
 
1162
        struct reference *use;
1153
1163
 
1154
1164
        if (!(f = fopen(output_makeopts, "w"))) {
1155
1165
                fprintf(stderr, "Unable to open build configuration file (%s) for writing!\n", output_makeopts);
1284
1294
#ifdef MENUSELECT_DEBUG
1285
1295
        struct category *cat;
1286
1296
        struct member *mem;
1287
 
        struct depend *dep;
1288
 
        struct conflict *cnf;
 
1297
        struct reference *dep;
 
1298
        struct reference *cnf;
1289
1299
 
1290
1300
        AST_LIST_TRAVERSE(&categories, cat, list) {
1291
1301
                fprintf(stderr, "Category: '%s'\n", cat->name);
1312
1322
{
1313
1323
        struct category *cat;
1314
1324
        struct member *mem;
1315
 
        struct depend *dep;
1316
 
        struct conflict *cnf;
1317
 
        struct use *use;
 
1325
        struct reference *dep;
 
1326
        struct reference *cnf;
 
1327
        struct reference *use;
1318
1328
 
1319
1329
        while ((cat = AST_LIST_REMOVE_HEAD(&categories, list))) {
1320
1330
                while ((mem = AST_LIST_REMOVE_HEAD(&cat->members, list))) {
1404
1414
        unsigned int insane = 0;
1405
1415
        struct category *cat;
1406
1416
        struct member *mem;
1407
 
        struct depend *dep;
1408
 
        struct use *use;
 
1417
        struct reference *dep;
 
1418
        struct reference *use;
1409
1419
        struct dep_file *dep_file;
1410
1420
        unsigned int dep_header_printed;
1411
1421
        unsigned int group_header_printed;