diff mbox series

[Unstable/Noble] UBUNTU: [packaging] remove debian/stamps/keep-dir

Message ID 20240301060913.270221-1-masahiro.yamada@canonical.com
State New
Headers show
Series [Unstable/Noble] UBUNTU: [packaging] remove debian/stamps/keep-dir | expand

Commit Message

Masahiro Yamada March 1, 2024, 6:09 a.m. UTC
Ubuntu kernel touches a stamp file in debian/stamps/ without creating
the directory.

Since git cannot track an empty directory, debian/stamps/keep-dir was
added to keep the debian/stamps/ directory.

Import the 'stamp' macro from Debian kernel to create the stamps
directory.

[1]: https://salsa.debian.org/kernel-team/linux/-/blob/debian/6.5.10-1/debian/rules.real#L40

Signed-off-by: Masahiro Yamada <masahiro.yamada@canonical.com>
---

This was written during the hackathon.
Since pull requests in getea are no longer considered,
let's see if the same patch is individually acceptable in kernel ML.

 debian/rules                     |  3 +--
 debian/rules.d/0-common-vars.mk  |  2 ++
 debian/rules.d/2-binary-arch.mk  | 14 +++++++-------
 debian/rules.d/3-binary-indep.mk |  4 ++--
 debian/stamps/keep-dir           |  1 -
 5 files changed, 12 insertions(+), 12 deletions(-)
 delete mode 100644 debian/stamps/keep-dir

Comments

Paolo Pisati March 1, 2024, 10:31 a.m. UTC | #1
On Fri, Mar 01, 2024 at 03:09:13PM +0900, Masahiro Yamada wrote:
> Ubuntu kernel touches a stamp file in debian/stamps/ without creating
> the directory.
> 
> Since git cannot track an empty directory, debian/stamps/keep-dir was
> added to keep the debian/stamps/ directory.
> 
> Import the 'stamp' macro from Debian kernel to create the stamps
> directory.

Applied.
diff mbox series

Patch

diff --git a/debian/rules b/debian/rules
index f7d3c10a0bad..6e775948687d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -127,8 +127,7 @@  clean: debian/control debian/canonical-certs.pem debian/canonical-revoked-certs.
 
 	# normal build junk
 	rm -rf $(DEBIAN)/abi
-	rm -rf $(builddir)
-	rm -f $(stampdir)/stamp-*
+	rm -rf $(builddir) $(stampdir)
 	rm -rf debian/linux-*/
 
 	cp $(DEBIAN)/changelog debian/changelog
diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
index 8186268746ea..9bbd412fb4f7 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -32,6 +32,8 @@  define if_package
 $(if $(filter $(1),$(packages_enabled)),$(2))
 endef
 
+stamp = [ -d $(dir $@) ] || mkdir $(dir $@); touch $@
+
 #
 # do_full_build -- are we doing a full buildd style build, i.e., are we
 #                  building in a PPA
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 510103d1b5b0..9191fc0e3508 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -9,7 +9,8 @@  debian/scripts/fix-filenames: debian/scripts/fix-filenames.c
 
 $(stampdir)/stamp-prepare-%: config-prepare-check-%
 	@echo Debug: $@
-	@touch $@
+	$(stamp)
+
 $(stampdir)/stamp-prepare-tree-%: target_flavour = $*
 $(stampdir)/stamp-prepare-tree-%: debian/scripts/fix-filenames
 	@echo Debug: $@
@@ -23,7 +24,7 @@  $(stampdir)/stamp-prepare-tree-%: debian/scripts/fix-filenames
 	find $(builddir)/build-$* -name "*.ko" | xargs rm -f
 	$(kmake) O=$(builddir)/build-$* $(conc_level) rustavailable || true
 	$(kmake) O=$(builddir)/build-$* $(conc_level) olddefconfig
-	touch $@
+	$(stamp)
 
 # Used by developers as a shortcut to prepare a tree for compilation.
 prepare-%: $(stampdir)/stamp-prepare-%
@@ -45,8 +46,7 @@  ifeq ($(do_dbgsym_package),true)
 		$(kmake) O=$(builddir)/build-$* $(conc_level) scripts_gdb ; \
 	fi
 endif
-
-	@touch $@
+	$(stamp)
 
 define build_dkms_sign =
 	$(shell set -x; if grep -q CONFIG_MODULE_SIG=y $(1)/.config; then
@@ -495,7 +495,7 @@  ifneq ($(do_full_build),false)
 	# Clean out this flavours build directory.
 	rm -rf $(builddir)/build-$*
 endif
-	@touch $@
+	$(stamp)
 
 headers_tmp := $(CURDIR)/debian/tmp-headers
 headers_dir := $(CURDIR)/debian/linux-libc-dev
@@ -629,7 +629,7 @@  ifeq ($(do_any_tools),true)
 	install -d $(builddirpa)
 	rsync -a --exclude debian --exclude debian.master --exclude $(DEBIAN) --exclude .git -a ./ $(builddirpa)/
 endif
-	touch $@
+	$(stamp)
 
 $(stampdir)/stamp-build-perarch: $(stampdir)/stamp-prepare-perarch install-arch-headers build-arch
 	@echo Debug: $@
@@ -677,7 +677,7 @@  ifeq ($(do_tools_hyperv),true)
 	cd $(builddirpa)/tools/hv && make CFLAGS="-I$(headers_dir)/usr/include -I$(headers_dir)/usr/include/$(DEB_HOST_MULTIARCH)" CROSS_COMPILE=$(CROSS_COMPILE) hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon
 endif
 endif
-	@touch $@
+	$(stamp)
 
 .PHONY: install-perarch
 install-perarch: toolspkgdir = $(CURDIR)/debian/$(tools_pkg_name)
diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk
index 70835566c168..90334b85c900 100644
--- a/debian/rules.d/3-binary-indep.mk
+++ b/debian/rules.d/3-binary-indep.mk
@@ -29,7 +29,7 @@  ifeq ($(do_flavour_header_package),true)
 	# Do not ship .o and .cmd artifacts in headers
 	find $(indep_hdrdir) -name \*.o -or -name \*.cmd -exec rm -f {} \;
 endif
-	@touch $@
+	$(stamp)
 
 srcpkg = linux-source-$(release)
 srcdir = $(CURDIR)/debian/$(srcpkg)/usr/src/$(srcpkg)
@@ -145,7 +145,7 @@  endif
 $(stampdir)/stamp-prepare-indep:
 	@echo Debug: $@
 	dh_prep -i
-	@touch $@
+	$(stamp)
 
 .PHONY: install-indep
 install-indep: $(stampdir)/stamp-install-headers install-source install-tools
diff --git a/debian/stamps/keep-dir b/debian/stamps/keep-dir
deleted file mode 100644
index 5c38d4a5c411..000000000000
--- a/debian/stamps/keep-dir
+++ /dev/null
@@ -1 +0,0 @@ 
-Place holder