On a side note, extract.pl.in as far as I can tell only is used to auto
generate the perl binary location.  Is there a modern distribution that
doesn't have perl in /usr/bin?  Would people mind if I removed the
extract.pl.in -> extract.pl configure creation?

donald

On Wed, Mar 2, 2016 at 8:27 PM, <[email protected]> wrote:

> Paul Jakma <[email protected]> wrote:
>
> > TBH, I'd rather nuke perl, and go back to AWK script for the
> > route-types. There was something I wanted to extent or fix to that
> > but... Perl.
> >
> > AWK is a lot more easier to pick up from scratch or just dive into for a
> > C programmer - the syntax is more compact, and it's C-like. It's also
> > just one binary.
>
> I agree, and rewrote the awk script ages ago to get rid of the "gensub"
> and make it run with stock awk, obviating the gawk dependency, too.
> The patch below did the job for me.
>
> Alas, I cannot check it anymore because my FreeBSD-4.7 got ridiculed
> as hopelessly outdated and quagga stopped even making it through autohell
> a long time ago.
>
>                                                 Martin Neitzel
>
>
> diff --git a/lib/memtypes.awk b/lib/memtypes.awk
> index 5429f6e..f980f77 100644
> --- a/lib/memtypes.awk
> +++ b/lib/memtypes.awk
> @@ -30,8 +30,6 @@
>  #
>
>  BEGIN {
> -       mlistregex = "memory_list_(.*)\\[\\]";
> -       mtyperegex = "^(MTYPE_[[:upper:]_[:digit:]]+).*";
>         header = "/* Auto-generated from memtypes.c by " ARGV[0] ". */\n";
>         header = header "/* Do not edit! */\n";
>         header = header "\n#ifndef _QUAGGA_MEMTYPES_H\n";
> @@ -44,13 +42,15 @@ BEGIN {
>  # catch lines beginning with 'struct memory list ' and try snag the
>  # memory_list name. Has to be 3rd field.
>  ($0 ~ /^struct memory_list /) && (NF >= 3) {
> -       mlists[lcount++] = gensub(mlistregex, "\\1", "g",$3);
> +       name=$3; sub(/^memory_list_/, "", name); sub(/ *\[\].*/, "", name)
> +       mlists[lcount++] = name
>  }
>
>  # snag the MTYPE, it must self-standing and the second field,
>  # though we do manage to tolerate the , C seperator being appended
>  ($1 !~ /^\/?\*/) && ($2 ~ /^MTYPE_/) {
> -       mtype[tcount++] = gensub(mtyperegex, "\\1", "g", $2);
> +       name=$2; sub(/,$/, "", name)
> +       mtype[tcount++] = name
>  }
>
>  END {
>
> _______________________________________________
> Quagga-dev mailing list
> [email protected]
> https://lists.quagga.net/mailman/listinfo/quagga-dev
>
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to