I agree with Chris's comments above. Autogenerating debian/control like this is dangerous and tends to play hell with tools that expect the list of package names to be accurate at the point when the source package is built; as written this will probably result in an incorrect .dsc file in some cases, causing archive problems. Best practice when this stuff is necessary is to do it in the clean rule so that the source package is accurate, or to have a script to update it manually when necessary.
I agree with Chris's comments above. Autogenerating debian/control like this is dangerous and tends to play hell with tools that expect the list of package names to be accurate at the point when the source package is built; as written this will probably result in an incorrect .dsc file in some cases, causing archive problems. Best practice when this stuff is necessary is to do it in the clean rule so that the source package is accurate, or to have a script to update it manually when necessary.