[Build-common-hackers] waf.mk and broken fakeroot debian/rules clean call in packaging-only branches.

Emilio Pozuelo Monfort pochu at debian.org
Wed Mar 30 08:27:28 UTC 2011


On 29/03/11 18:42, Krzysztof Klimonda wrote:
> I can only assume that, as the problem seems new to you, the issue of
> d/rules clean not working has never been raised here. So it means that
> either all other maintainers are copying full source to the packaging
> branch for the duration of work, only to remove it before commiting
> changes, or it has always worked this way for other packages, and waf.mk
> does things differently.

It has always worked fine, because historically the clean target has
ignored errors, see e.g. autotools.mk:

makefile-clean::
	$(if $(cdbs_make_flavors),-rmdir --ignore-fail-on-non-empty debian/stamp-autotools,rm -f debian/stamp-autotools)

$(cdbs_make_clean_nonstamps)::
	$(if $(call cdbs_streq,$(cdbs_make_curbuilddir),$(DEB_BUILDDIR_$(cdbs_curpkg))),,-rmdir --ignore-fail-on-non-empty $(cdbs_make_curbuilddir))
	$(if $(cdbs_make_flavors),rm -f $(@:makefile-clean%=debian/stamp-autotools%))


or makefile.mk

cleanbuilddir:: makefile-clean
makefile-clean:: $(if $(cdbs_make_flavors),$(cdbs_make_clean_nonstamps))
        $(if $(cdbs_make_flavors),-rmdir --ignore-fail-on-non-empty debian/stamp-makefile-build debian/stamp-makefile-install,rm -f debian/stamp-makefile-build debian/stamp-makefile-install)

$(cdbs_make_clean_nonstamps)::
        $(if $(DEB_MAKE_CLEAN_TARGET),+-$(DEB_MAKE_INVOKE) -k $(DEB_MAKE_CLEAN_TARGET), at echo "DEB_MAKE_CLEAN_TARGET unset, not running clean")
        $(if $(cdbs_make_flavors),rm -f $(@:makefile-clean%=debian/stamp-makefile-build%) $(@:makefile-clean%=debian/stamp-makefile-install%))


or python-distutils:

$(patsubst %,python-module-clean/%,$(cdbs_python_indep_packages)) :: python-module-clean/%:
        -cd $(DEB_SRCDIR) && \
                $(cdbs_curpythonindepbinary) $(cdbs_python_setup_cmd) clean \
                $(cdbs_python_clean_args)

$(patsubst %,python-module-clean/%,$(cdbs_python_arch_packages)) :: python-module-clean/%:
        -for buildver in $(cdbs_curpythonbuildversions); do \
                cd $(CURDIR) && cd $(DEB_SRCDIR) && \
                        $(call cdbs_python_binary,python$$buildver) $(cdbs_python_setup_cmd) clean \
                        $(cdbs_python_clean_args); \
        done


and all the others.

I can't find anything in policy that says clean shouldn't fail if there
are missing files, but I thought it did, given e.g. dpkg source format
1 will ignore removed files when generating the diff.gz. I think waf.mk
should do the same and not fail if some files are missing, just try to
run "-./waf clean" or whatever it has to do, ignoring errors.

Cheers,
Emilio



More information about the Build-common-hackers mailing list