diff mbox series

[Mantic,3/6] UBUNTU: [Packaging] Fix File exists error in install-arch-headers

Message ID 20230728133817.893883-3-masahiro.yamada@canonical.com
State New
Headers show
Series [Mantic,1/6] UBUNTU: [Packaging] Add .NOTPARALLEL | expand

Commit Message

Masahiro Yamada July 28, 2023, 1:38 p.m. UTC
Our debian build scripts only work in a pristine source tree.

If you build the packages second time, the following code

    mkdir $(headers_dir)/usr/include/$(DEB_HOST_MULTIARCH)

... will fail with this message:

    mkdir: cannot create directory '...': File exists

Irrespective of the error, $(headers_dir) should be removed because
garbage files from the previous build might be remaining.

Signed-off-by: Masahiro Yamada <masahiro.yamada@canonical.com>
---
 debian/rules.d/2-binary-arch.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 1f77a787000e..7af0287b6535 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -561,7 +561,7 @@  install-arch-headers:
 ifeq ($(do_libc_dev_package),true)
 	dh_prep -plinux-libc-dev
 endif
-	rm -rf $(headers_tmp)
+	rm -rf $(headers_tmp) $(headers_dir)
 	install -d $(headers_tmp) $(headers_dir)/usr/include/
 	$(hmake) $(conc_level) headers_install
 	( cd $(headers_tmp)/install/include/ && \