Fabian Greffrath wrote: > please add a --no-log option to the dh_uto_* helper to prevent them from > appearing in debian/debhelper.log. > > Rationale: I am going to package a software "program" that comes in two > variants "A" and "B" that need to selected at build time. I want to package > both variants and do the following: > > override_dh_auto_build: > dh_auto_build -- VARIANT=A > cp program program-a > dh_auto_build -- VARIANT=B > > Obviously, this won't work, because the time stamps of all object files are > still up-to-date and thus they won't get rebuilt. So I have to do the > following: > > override_dh_auto_build: > dh_auto_build -- VARIANT=A > cp program program-a > $(MAKE) clean > dh_auto_build -- VARIANT=B > > But wait, there is a debhelper script for this: > > override_dh_auto_build: > dh_auto_build -- VARIANT=A > cp program program-a > dh_auto_clean > dh_auto_build -- VARIANT=B > > However, this will only work for the first build. If I try to build a second > time from the same source tree, "dh clean" will refuse to run dh_auto_clean, > because it is already in the debian/debhelper.log file. Thus things will > break...
That seems a special case of the general problem with dh that restarting debian/rules after a failure won't do what is often expected, since it will avoid re-running commands that have been run before. But the workaround for that general problem is to run debian/rules clean, as that lets dh_clean remove the old logs. And here, calling clean doesn't work, due to the logs. So, I think maybe this problem only affects the clean target, and perhaps it could be fixed by a special case involving it. dh could ignore the log entirely when running the clean target, or the commands in it (dh_auto_clean and dh_clean). Or, maybe the place to put the special case is dh_auto_clean. dh_clean already inhibits logging of being run. (So does dh_testdir, which is run in multiple targets.) If dh_auto_clean always inhibited logging, the worst that should happen is, if dh_clean failed for some reason, a re-run of debian/rules clean would re-run dh_auto_clean again, which should always be a no-op. -- see shy jo
signature.asc
Description: Digital signature

