]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tools: unlink bash completion files before symlinking
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 31 Jan 2018 17:30:55 +0000 (17:30 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 31 Jan 2018 17:30:55 +0000 (17:30 +0000)
"ln" will not replace an existing symlink, so if you run 'make install'
twice, the second time will get an error:

  ln: failed to create symbolic link 'virsh': File exists

We must always remove the symlink target first.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
tools/Makefile.am

index e173f56347b16303e75490ced3e95d1c1654c5c6..4c33e78a1d733ba5965b6847719b6d18077067cf 100644 (file)
@@ -425,6 +425,7 @@ install-bash-completion:
        $(INSTALL_SCRIPT) $(srcdir)/bash-completion/vsh \
                "$(DESTDIR)$(BASH_COMPLETIONS_DIR)/vsh"
        ( cd $(DESTDIR)$(BASH_COMPLETIONS_DIR) && \
+               rm -f virsh virt-admin && \
                $(LN_S) vsh virsh && \
                $(LN_S) vsh virt-admin )