]> git.proxmox.com Git - mirror_zfs.git/commitdiff
make install only works once
authorMatthew Ahrens <mahrens@delphix.com>
Thu, 31 May 2018 16:19:59 +0000 (09:19 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 31 May 2018 16:19:59 +0000 (09:19 -0700)
`make install` shouldn't fail if a directory it created still exists.
In this case we can blow away the spl src directory before recreating
it.  This also gracefully handles the migration from pre-spl-merge to
post-spl-merge.

Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #7580

Makefile.am

index 669231c074abe7ab26bd94ed46c7d6d1ab424464..55cae89fab669341de4fe171faf0d3ffa532fc7c 100644 (file)
@@ -49,6 +49,7 @@ dist-hook:
 # compatibility links will be removed in the next major release.
 if CONFIG_KERNEL
 install-data-hook:
+       rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
        mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
        cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
        ln -s ../zfs-$(VERSION)/include/spl include && \
@@ -56,8 +57,8 @@ install-data-hook:
        ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \
        ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \
        cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \
-       ln -s zfs_config.h spl_config.h && \
-       ln -s zfs.release spl.release
+       ln -fs zfs_config.h spl_config.h && \
+       ln -fs zfs.release spl.release
 endif
 
 checkstyle: cstyle shellcheck flake8 commitcheck mancheck testscheck