[Libosinfo] [PATCH osinfo-db v2] Abort on XML errors

Daniel P. Berrange berrange at redhat.com
Wed Nov 9 08:48:14 UTC 2016


On Tue, Nov 08, 2016 at 07:19:14PM +0100, Guido Günther wrote:
> While we abort on XML errors the first time the output XML already gets
> written so a subsequent make call will continue with the next file
> leading to an incomplete database. Use a temporary file to fix this.
> ---
> 
>    Changes since v1:
> 
>       * remove temp file on failure
> 
>  Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 6b3f8e7..6ff9b5c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -63,7 +63,9 @@ mingwrpm:  mingw-osinfo-db.spec $(ARCHIVE)
>  
>  %.xml: %.xml.in Makefile
>  	@mkdir -p `dirname $@` po
> -	$(V_I18N) LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_MERGE_OPTS) -x -u -c po/.intltool-merge-cache $(VPATH)/po $< $@
> +	$(V_I18N) LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_MERGE_OPTS) -x -u -c po/.intltool-merge-cache $(VPATH)/po $< $@.tmp \
> +	    || { rm $@.tmp && exit 1; }
> +	@mv $@.tmp $@
>  
>  %.rng: %.rng.in Makefile
>  	@mkdir -p `dirname $@` po

ACK


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|




More information about the Libosinfo mailing list