Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #1200870
| From | Axel Beckert <abe@debian.org> |
|---|---|
| Newsgroups | linux.debian.bugs.dist |
| Subject | Bug#1073114: unburden-home-dir: stop build-depending on pcre3 |
| Date | 2024-06-14 12:10 +0200 |
| Message-ID | <IPc2B-2RCT-1@gated-at.bofh.it> (permalink) |
| References | <IOENj-2twT-13@gated-at.bofh.it> <IPbpT-2R9S-3@gated-at.bofh.it> <IOENj-2twT-13@gated-at.bofh.it> <IPbpT-2R9S-3@gated-at.bofh.it> |
| Organization | The Debian Project |
Control: tag -1 + patch pending
Hi again
Axel Beckert wrote:
> The sole reason I use it over grep is that it supports multiline
> matches. It though seems that grep might be able to do that — albeit
> non-obviously — via "grep -Pzov", too.
Nope, even much simpler cases fail to remove just a substring from a
single line:
~ → printf 'foo\ngnarz\nbar\n' | fgrep -voz nar
~ → printf 'foo\ngnarz\nbar\n' | fgrep -ov nar
etc.
> Otherwise, I'll probably just use the original with "perl -E". It's
> just the build system trying to remove any unwanted crap (multiline
> <script> tags including their contents) from the generated HTML
> documentation.
The following change works and produces byte for byte the identical
result as "pcregrep -Mv", it's just a bit longer:
- pcregrep -Mv '<script[^>]*>[^<]*</script>|<(form|input).*?>|</form>' | \
+ perl -E 'local $$/; my $$input=<>; $$input =~ s:<script[^>]*>[^<]*</script>\n*|<(form|input).*?>|</form>\n*::gsm; print $$input;' | \
("$$" instead of "$" is needed even inside single quotes as this is
inside a Makefile where $ is a special character already.)
Regards, Axel
--
,''`. | Axel Beckert <abe@debian.org>, https://people.debian.org/~abe/
: :' : | Debian Developer, ftp.ch.debian.org Admin
`. `' | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5
`- | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE
Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Find similar
Bug#1073114: unburden-home-dir: stop build-depending on pcre3 Chris Hofstaedtler <zeha@debian.org> - 2024-06-13 00:40 +0200
Bug#1073114: unburden-home-dir: stop build-depending on pcre3 Axel Beckert <abe@debian.org> - 2024-06-14 11:30 +0200
Bug#1073114: unburden-home-dir: stop build-depending on pcre3 Axel Beckert <abe@debian.org> - 2024-06-14 12:10 +0200
csiph-web