Re: [PATCH osinfo-db] Abort on XML errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 08, 2016 at 08:14:07AM +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.
> ---
>  Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 6b3f8e7..d08f5cc 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -63,7 +63,8 @@ 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
> +	@mv $@.tmp $@

Won't this leave a .tmp file on disk if it fails. IIUC you need to have

 ...CMD... && mv $@.tmp $@  || rm -f $@.tmp

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/ :|

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux