[Build-common-hackers] Bug#263168: clean target doesn't reverse patches if some failed to apply

Ross Burton Ross Burton <ross@debian.org>, 263168@bugs.debian.org
Tue, 03 Aug 2004 09:33:40 +0100


Package: cdbs
Version: 0.4.21-0.1
Severity: normal

I have a package which uses simple-patchsys to apply 4 patches to the source.
New release, and one of the patches failed to apply:

...
patches: debian/patches/feedparser-remove-py.patch debian/patches/desktop-categories.diff debian/patches/sharedir.diff debian/patches/straw-libdir.diff
Trying patch debian/patches/feedparser-remove-py.patch at level 0...1...success.
Trying patch debian/patches/desktop-categories.diff at level 0...1...2...failure.
make: *** [debian/stamp-patched] Error 1

Ok, I can handle this.  I run debuild clean to reverse the applied patches so I
can see what the pristine source is like:

ross@hactar ~/Programming/debian/packaging/straw-0.25.1
$ debuild clean
test -x debian/rules
test "`id -u`" = 0
if test -n "" && test "" != "."; then rmdir ""; fi
if test "." != "."; then rmdir .; fi
dh_clean
patches: debian/patches/feedparser-remove-py.patch debian/patches/desktop-categories.diff debian/patches/sharedir.diff debian/patches/straw-libdir.diff
Not reversing not applied patches.
if [ "reverse-patches" = "debian/stamp-patched" ]; then touch debian/stamp-patched; fi
rm -f debian/stamp-patch*
rm -f debian/patches/*.log
python setup.py clean -a
running clean
'build/lib.linux-i686-2.3' does not exist -- can't clean it
'build/bdist.linux-i686' does not exist -- can't clean it
'build/scripts-2.3' does not exist -- can't clean it
rm -rf build
rm -f src/eggtray/trayicon.c
find . -name *.pyc -exec rm {} \;
ross@hactar ~/Programming/debian/packaging/straw-0.25.1

Note how no patches were reversed, although feedparser-remove-py.patch applied
correctly.

This causes all manner of problems as the patches are then re-applied on the
next build, and persist in the source.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.4.26-1-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8

-- no debconf information