How to cleanup sources to rebuild package with dpkg-buildpackage?

George Shuklin picture George Shuklin · May 26, 2014 · Viewed 12.3k times · Source

I'm playing with dpkg, but I got rather strange problem: Package can not be build second time after 1st package was successfully build.

dpkg-buildpackage -sa
....
dpkg-source: warning: newly created empty file 'build/lib.linux-x86_64-2.7/neutron/api/__init__.py' will not be represented in diff
(repeats 100500 times for different files).

How can I to rebuild deb second time?

It looks like I miss some cleanup command.

Answer

umläute picture umläute · May 26, 2014

the debian/rules file is actually a Makefile, and it MUST (according to the Debian policy) have a clean target to cleanup the build.

if this target is not run automatically, you can call it explictely with something like:

 dpkg-buildpackage -rfakeroot -Tclean