Update of bug #67939 (group groff):
Summary: [PATCH] [hdtbl] test: get the number of created
pages directly from the PostScript file => [hdtbl] test: get the number of
created pages directly from the PostScript file
_______________________________________________________
Follow-up Comment #1:
[comment #0 original submission:]
> + res=$(sed -n -e '/^%%Pages: [0-9]\+/ {s/^%%Pages: //p;q}' $1)
Even if this change is conceptually a good idea (I can see arguments both for
and against), the sed command above isn't valid syntax.
$ echo 'Hello world!' | groff | sed -n -e '/^%%Pages: [0-9]\+/ {s/^%%Pages:
p;q}'
sed: 1: "/^%%Pages: [0-9]\+/ {s/ ...": unterminated substitute pattern
I get the same complaint (though different error text) in FreeBSD sed and GNU
sed.
Anyway, sed seems overly complicated (and riddled with portability land mines)
to accomplish what you're trying to do.
$ echo 'Hello world!' | groff | grep '^%%Pages: ' | cut -d\ -f2
1
> -check_number_pages "$builddir"/contrib/hdtbl/examples/fonts_n.ps 46
> -check_number_pages "$builddir"/contrib/hdtbl/examples/fonts_x.ps 46
> +nr_files=$(ls $fontdir | grep -c '^[[:upper:]-]\+$')
> +check_number_pages "$builddir"/contrib/hdtbl/examples/fonts_n.ps $nr_files
> +check_number_pages "$builddir"/contrib/hdtbl/examples/fonts_x.ps $nr_files
This change may be worthwhile (I'm always skeptical of bare numbers of unclear
origin in code), but it has nothing to do with the stated purpose of this
ticket and should be a separate patch.
So the submitted patch is not valid, but its core ideas might be worth
addressing. I leave that decision to actual developers.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67939>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
