Use dh_prep instead of removing old build directories manually. Use dh_clean instead of removing build directories and debian/files manually. Call dh_testdir and dh_testroot for preliminary checks.
Showing the changes to scripts (2 of 2 files). Show all
Unified · Split
| @@ -28,8 +28,6 @@ install_linux_image () { · 27 unmodified lines | |||
| 28 | pname=$1 | 28 | pname=$1 |
| 29 | pdir=debian/$1 | 29 | pdir=debian/$1 |
| 30 | 30 | ||
| 31 | rm -rf ${pdir} | ||
| 32 | |||
| 33 | # Only some architectures with OF support have this target | 31 | # Only some architectures with OF support have this target |
| 34 | if is_enabled CONFIG_OF_EARLY_FLATTREE && [ -d "${srctree}/arch/${SRCARCH}/boot/dts" ]; then | 32 | if is_enabled CONFIG_OF_EARLY_FLATTREE && [ -d "${srctree}/arch/${SRCARCH}/boot/dts" ]; then |
| 35 | ${MAKE} -f ${srctree}/Makefile INSTALL_DTBS_PATH="${pdir}/usr/lib/linux-image-${KERNELRELEASE}" dtbs_install | 33 | ${MAKE} -f ${srctree}/Makefile INSTALL_DTBS_PATH="${pdir}/usr/lib/linux-image-${KERNELRELEASE}" dtbs_install |
| @@ -97,8 +95,6 @@ install_linux_image () { · 61 unmodified lines | |||
| 97 | install_linux_image_dbg () { | 95 | install_linux_image_dbg () { |
| 98 | pdir=debian/$1 | 96 | pdir=debian/$1 |
| 99 | 97 | ||
| 100 | rm -rf ${pdir} | ||
| 101 | |||
| 102 | # Parse modules.order directly because 'make modules_install' may sign, | 98 | # Parse modules.order directly because 'make modules_install' may sign, |
| 103 | # compress modules, and then run unneeded depmod. | 99 | # compress modules, and then run unneeded depmod. |
| 104 | while read -r mod; do | 100 | while read -r mod; do |
| @@ -128,8 +124,6 @@ install_kernel_headers () { · 23 unmodified lines | |||
| 128 | pdir=debian/$1 | 124 | pdir=debian/$1 |
| 129 | version=${1#linux-headers-} | 125 | version=${1#linux-headers-} |
| 130 | 126 | ||
| 131 | rm -rf $pdir | ||
| 132 | |||
| 133 | "${srctree}/scripts/package/install-extmod-build" "${pdir}/usr/src/linux-headers-${version}" | 127 | "${srctree}/scripts/package/install-extmod-build" "${pdir}/usr/src/linux-headers-${version}" |
| 134 | 128 | ||
| 135 | mkdir -p $pdir/lib/modules/$version/ | 129 | mkdir -p $pdir/lib/modules/$version/ |
| @@ -139,8 +133,6 @@ install_kernel_headers () { · 3 unmodified lines | |||
| 139 | install_libc_headers () { | 133 | install_libc_headers () { |
| 140 | pdir=debian/$1 | 134 | pdir=debian/$1 |
| 141 | 135 | ||
| 142 | rm -rf $pdir | ||
| 143 | |||
| 144 | $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH=$pdir/usr | 136 | $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH=$pdir/usr |
| 145 | 137 | ||
| 146 | # move asm headers to /usr/include/<libc-machine>/asm to match the structure | 138 | # move asm headers to /usr/include/<libc-machine>/asm to match the structure |
| @@ -42,6 +42,9 @@ package = $($(@:binary-%=%-package)) · 41 unmodified lines | |||
| 42 | DH_OPTIONS = -p$(package) | 42 | DH_OPTIONS = -p$(package) |
| 43 | 43 | ||
| 44 | define binary | 44 | define binary |
| 45 | $(Q)dh_testdir $(DH_OPTIONS) | ||
| 46 | $(Q)dh_testroot $(DH_OPTIONS) | ||
| 47 | $(Q)dh_prep $(DH_OPTIONS) | ||
| 45 | $(Q)+$(MAKE) $(make-opts) run-command KBUILD_RUN_COMMAND='+$$(srctree)/scripts/package/builddeb $(package)' | 48 | $(Q)+$(MAKE) $(make-opts) run-command KBUILD_RUN_COMMAND='+$$(srctree)/scripts/package/builddeb $(package)' |
| 46 | $(Q)dh_installdocs $(DH_OPTIONS) | 49 | $(Q)dh_installdocs $(DH_OPTIONS) |
| 47 | $(Q)dh_installchangelogs $(DH_OPTIONS) | 50 | $(Q)dh_installchangelogs $(DH_OPTIONS) |
| @@ -72,7 +75,8 @@ build-arch: · 24 unmodified lines | |||
| 72 | 75 | ||
| 73 | .PHONY: clean | 76 | .PHONY: clean |
| 74 | clean: | 77 | clean: |
| 75 | $(Q)rm -rf debian/files debian/linux-* debian/deb-env.vars* debian/*.files | 78 | $(Q)dh_clean |
| 79 | $(Q)rm -rf debian/deb-env.vars* debian/*.files | ||
| 76 | $(Q)$(MAKE) ARCH=$(ARCH) clean | 80 | $(Q)$(MAKE) ARCH=$(ARCH) clean |
| 77 | 81 | ||
| 78 | # If DEB_HOST_ARCH is empty, it is likely that debian/rules was executed | 82 | # If DEB_HOST_ARCH is empty, it is likely that debian/rules was executed |