#617525 quilt remove does not handle errors well

#617525#5
Date:
2011-03-09 16:06:12 UTC
From:
To:
Hi,

I just observed this:

~/debian/pkg-haskell/packages/ghc-7.0.2 $ quilt delete
Removing patch debian-changes-7.0.2-2
rm: cannot remove `.pc/debian-changes-7.0.2-2/rts/Linker.c': Permission denied
~/debian/pkg-haskell/packages/ghc-7.0.2 $ sudo quilt delete
Removing patch powerpc-compile-616635
Now at patch haddock-no-library
Entferne Patch powerpc-compile-616635

If quilt cannot completely delete a patch, then ideally the delete would have
had no effect.

Greetings,
Joachim

- -- System Information:
Debian Release: 6.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.36-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages quilt depends on:
ii  bzip2                         1.0.5-6    high-quality block-sorting file co
ii  diffstat                      1.54-1     produces graph of changes introduc
ii  gettext                       0.18.1.1-3 GNU Internationalization utilities
ii  patch                         2.6-3      Apply a diff file to an original

quilt recommends no packages.

Versions of packages quilt suggests:
ii  graphviz                      2.26.3-5   rich set of graph drawing tools
ii  procmail                      3.22-19    Versatile e-mail processor

- -- no debconf information
iEYEARECAAYFAk13pXEACgkQ9ijrk0dDIGxDOQCg1cB3A8B87NZegz6M2nI0cIrG
uwoAoJ/y5wMhZR7HrWq+s06uMcTYfY1M
=VhSd
-----END PGP SIGNATURE-----

#617525#10
Date:
2012-12-30 21:49:38 UTC
From:
To:
I digged a bit on this issue, and it seems that the problem is due to
the following chunk of backup-files:
        if [ -z "$OPT_KEEP_BACKUP" ]; then
		rm -rf "$OPT_PREFIX"
	fi
So that utility fails to clean the .pc after removing the patch.
That, in turn, breaks the following chunck of the delete command.
        if ! quilt_command pop -fq
	then
		exit 1
	fi


This could be easily be ignored (I guess) with something like
		rm -rf "$OPT_PREFIX" || echo "cannot clean all backup files, some cruft was left over"
or similar, but that's obviously not very clean.

Another approach would be to get quilt to drop its privileges when
writing to the .pc directory ?

Sorry for the delay in digging in that bug,
Mt.