[Pkg-libvirt-commits] [libguestfs] 14/26: podwrapper: Give an error if an --insert or --verbatim pattern is not found in the input.

Hilko Bengen bengen at moszumanska.debian.org
Thu Mar 20 23:06:10 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag upstream/1.25.46
in repository libguestfs.

commit d4129988c19a49c916c7b5f8ebb66e3e5761c145
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Tue Mar 18 12:43:34 2014 +0000

    podwrapper: Give an error if an --insert or --verbatim pattern is not found in the input.
---
 podwrapper.pl.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/podwrapper.pl.in b/podwrapper.pl.in
index 61d5e12..74432ad 100755
--- a/podwrapper.pl.in
+++ b/podwrapper.pl.in
@@ -274,7 +274,10 @@ foreach (@inserts) {
     my @a = split /:/, $_, 2;
     die "$progname: $input: no colon in parameter of --insert\n" unless @a >= 2;
     my $replacement = read_whole_file ($a[0]);
+    my $oldcontent = $content;
     $content =~ s/$a[1]/$replacement/ge;
+    die "$progname: $input: could not find pattern '$a[1]' in input file\n"
+        if $content eq $oldcontent;
 }
 
 # Perform @verbatims.
@@ -282,7 +285,10 @@ foreach (@verbatims) {
     my @a = split /:/, $_, 2;
     die "$progname: $input: no colon in parameter of --verbatim\n" unless @a >= 2;
     my $replacement = read_verbatim_file ($a[0]);
+    my $oldcontent = $content;
     $content =~ s/$a[1]/$replacement/ge;
+    die "$progname: $input: could not find pattern '$a[1]' in input file\n"
+        if $content eq $oldcontent;
 }
 
 if ($strict_checks) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list