Commit ffb89852 authored by Tim Gardner's avatar Tim Gardner

UBUNTU: [Debian] Don't fail if a symlink already exists

A restarted build (dpkg-buildpackage -nc) currently fails if the linux-tools
symlinks remain from a previous build. Use ln -sf to allow the build to
continue by overwriting any existing links.
Signed-off-by: default avatardann frazier <dann.frazier@canonical.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 48c9bf62
......@@ -229,6 +229,9 @@ lockme_file = $(CURDIR)/debian/.LOCK
lockme_cmd = flock -w 60
lockme = $(lockme_cmd) $(lockme_file)
# Don't fail if a link already exists.
LN = ln -sf
# Checks if a var is overriden by the custom rules. Called with var and
# flavour as arguments.
custom_override = \
......
......@@ -155,7 +155,7 @@ endif
# Some initramfs-tools specific modules
install -d $(pkgdir)/lib/modules/$(abi_release)-$*/initrd
if [ -f $(pkgdir)/lib/modules/$(abi_release)-$*/kernel/drivers/video/vesafb.ko ]; then\
ln -f $(pkgdir)/lib/modules/$(abi_release)-$*/kernel/drivers/video/vesafb.ko \
$(LN) $(pkgdir)/lib/modules/$(abi_release)-$*/kernel/drivers/video/vesafb.ko \
$(pkgdir)/lib/modules/$(abi_release)-$*/initrd/; \
fi
......@@ -256,7 +256,7 @@ endif
$(SHELL) $(DROOT)/scripts/link-headers "$(hdrdir)" "$(indeppkg)" "$*"
# The build symlink
install -d debian/$(basepkg)-$*/lib/modules/$(abi_release)-$*
ln -s /usr/src/$(basepkg)-$* \
$(LN) /usr/src/$(basepkg)-$* \
debian/$(basepkg)-$*/lib/modules/$(abi_release)-$*/build
# And finally the symvers
install -m644 $(builddir)/build-$*/Module.symvers \
......@@ -301,27 +301,27 @@ ifeq ($(do_linux_tools),true)
# Create the linux-tools tool links
install -d $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
ifeq ($(do_tools_usbip),true)
ln -s ../../$(src_pkg_name)-tools-$(abi_release)/usbip $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
ln -s ../../$(src_pkg_name)-tools-$(abi_release)/usbipd $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/usbip $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/usbipd $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
endif
ifeq ($(do_tools_cpupower),true)
ln -s ../../$(src_pkg_name)-tools-$(abi_release)/cpupower $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/cpupower $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
endif
ifeq ($(do_tools_perf),true)
ln -s ../../$(src_pkg_name)-tools-$(abi_release)/perf $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/perf $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
endif
ifeq ($(do_tools_x86),true)
ln -s ../../$(src_pkg_name)-tools-$(abi_release)/x86_energy_perf_policy $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
ln -s ../../$(src_pkg_name)-tools-$(abi_release)/turbostat $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/x86_energy_perf_policy $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/turbostat $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
endif
endif
ifeq ($(do_cloud_tools),true)
ifeq ($(do_tools_hyperv),true)
# Create the linux-hyperv tool links
install -d $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
ln -s ../../$(src_pkg_name)-tools-$(abi_release)/hv_kvp_daemon $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
ln -s ../../$(src_pkg_name)-tools-$(abi_release)/hv_vss_daemon $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
ln -s ../../$(src_pkg_name)-tools-$(abi_release)/hv_fcopy_daemon $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_kvp_daemon $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_vss_daemon $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_fcopy_daemon $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
endif
endif
......@@ -511,7 +511,7 @@ $(stampdir)/stamp-prepare-perarch:
ifeq ($(do_any_tools),true)
rm -rf $(builddirpa)
install -d $(builddirpa)
for i in *; do ln -s $(CURDIR)/$$i $(builddirpa); done
for i in *; do $(LN) $(CURDIR)/$$i $(builddirpa); done
rm $(builddirpa)/tools
rsync -a tools/ $(builddirpa)/tools/
endif
......
......@@ -77,7 +77,7 @@ ifeq ($(do_source_package_content),true)
-path './debian/tmp' -prune -o \
-print | \
cpio -pd --preserve-modification-time $(srcdir)
ln -s $(srcpkg)/$(srcpkg).tar.bz2 $(srcdir)/..
$(LN) $(srcpkg)/$(srcpkg).tar.bz2 $(srcdir)/..
endif
endif
......@@ -94,7 +94,7 @@ install-tools: install-source $(stampdir)/stamp-build-perarch
rm -rf $(builddir)/tools
install -d $(builddir)/tools
for i in *; do ln -s $(CURDIR)/$$i $(builddir)/tools/; done
for i in *; do $(LN) $(CURDIR)/$$i $(builddir)/tools/; done
rm $(builddir)/tools/tools
rsync -a tools/ $(builddir)/tools/tools/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment