~ubuntu-branches/ubuntu/oneiric/squid3/oneiric-security

« back to all changes in this revision

Viewing changes to src/cf_gen.cc

  • Committer: Bazaar Package Importer
  • Author(s): Mahyuddin Susanto
  • Date: 2011-02-15 18:46:13 UTC
  • mfrom: (21.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110215184613-1u3dh5sz4i055flk
Tags: 3.1.10-1ubuntu1
* Merge from debian unstable. (LP: #719283)  Remaining changes:
  - debian/patches/18-fix-ftbfs-binutils-gold.dpatch: Add library linker into
    LIBS instead to LDFLAGS to fixing FTBFS binutils-gold.
* Drop Ubuntu configuration for ufw which landed in Debian and sync it: 
  - debian/squid3.ufw.profile.

Show diffs side-by-side

added added

removed removed

Lines of Context:
551
551
        if (!strcmp(entry->name, "comment"))
552
552
            continue;
553
553
 
 
554
        if (!strcmp(entry->type, "obsolete"))
 
555
            continue;
 
556
 
554
557
        if (entry->loc == NULL) {
555
558
            fprintf(stderr, "NO LOCATION FOR %s\n", entry->name);
556
559
            rc |= 1;
557
560
            continue;
558
561
        }
559
562
 
560
 
        if (entry->default_value == NULL) {
 
563
        if (entry->default_value == NULL && entry->default_if_none == NULL) {
561
564
            fprintf(stderr, "NO DEFAULT FOR %s\n", entry->name);
562
565
            rc |= 1;
563
566
            continue;
564
567
        }
565
568
 
566
 
        assert(entry->default_value);
567
 
 
568
 
        if (entry->ifdef)
569
 
            fprintf(fp, "#if %s\n", entry->ifdef);
570
 
 
571
 
        if (strcmp(entry->default_value, "none") == 0) {
 
569
        if (entry->default_value == NULL || strcmp(entry->default_value, "none") == 0) {
572
570
            fprintf(fp, "\t/* No default for %s */\n", entry->name);
573
571
        } else {
 
572
            if (entry->ifdef)
 
573
                fprintf(fp, "#if %s\n", entry->ifdef);
 
574
 
574
575
            fprintf(fp, "\tdefault_line(\"%s %s\");\n",
575
576
                    entry->name,
576
577
                    entry->default_value);
 
578
 
 
579
            if (entry->ifdef)
 
580
                fprintf(fp, "#endif\n");
577
581
        }
578
 
 
579
 
        if (entry->ifdef)
580
 
            fprintf(fp, "#endif\n");
581
582
    }
582
583
 
583
584
    fprintf(fp, "\tcfg_filename = NULL;\n");
598
599
 
599
600
    for (entry = head; entry != NULL; entry = entry->next) {
600
601
        assert(entry->name);
601
 
        assert(entry->loc);
 
602
 
 
603
        if (!entry->loc)
 
604
            continue;
602
605
 
603
606
        if (entry->default_if_none == NULL)
604
607
            continue;
633
636
{
634
637
    fprintf(fp, "\tif (!strcmp(token, \"%s\")) {\n", name);
635
638
 
636
 
    if (strcmp(entry->loc, "none") == 0) {
 
639
    if (strcmp(entry->type,"obsolete") == 0) {
 
640
        fprintf(fp, "\t\tdebugs(0, DBG_CRITICAL, \"ERROR: Directive '%s' is obsolete.\");\n", name);
 
641
        for (Line *line = entry->doc; line != NULL; line = line->next) {
 
642
            // offset line to strip initial whitespace tab byte
 
643
            fprintf(fp, "\t\tdebugs(0, opt_parse_cfg_only?0:1, \"%s : %s\");\n", name, &line->data[1]);
 
644
        }
 
645
        fprintf(fp, "\t\tparse_obsolete(token);\n");
 
646
    } else if (!entry->loc || strcmp(entry->loc, "none") == 0) {
637
647
        fprintf(fp,
638
648
                "\t\tparse_%s();\n",
639
649
                entry->type
663
673
 
664
674
    EntryAlias *alias = entry->alias;
665
675
 
666
 
    assert (entry->loc);
667
 
 
668
676
    bool more;
669
677
 
670
678
    do {
715
723
           );
716
724
 
717
725
    for (entry = head; entry != NULL; entry = entry->next) {
718
 
        assert(entry->loc);
719
726
 
720
 
        if (strcmp(entry->loc, "none") == 0)
 
727
        if (!entry->loc || strcmp(entry->loc, "none") == 0)
721
728
            continue;
722
729
 
723
730
        if (strcmp(entry->name, "comment") == 0)
749
756
           );
750
757
 
751
758
    for (entry = head; entry != NULL; entry = entry->next) {
752
 
        assert(entry->loc);
753
 
 
754
 
        if (strcmp(entry->loc, "none") == 0)
 
759
        if (!entry->loc || strcmp(entry->loc, "none") == 0)
755
760
            continue;
756
761
 
757
762
        if (strcmp(entry->name, "comment") == 0)
812
817
 
813
818
        if (!strcmp(entry->name, "comment"))
814
819
            (void) 0;
 
820
        else if (!strcmp(entry->name, "obsolete"))
 
821
            (void) 0;
815
822
        else if (verbose_output) {
816
823
            fprintf(fp, "#  TAG: %s", entry->name);
817
824