Bug#656586: fails to purge - rmdir: failed to remove '/var/lib/routino/data': No such file or directory

2013-04-09 Thread Andreas Beckmann
Followup-For: Bug #656586
Control: tag -1 patch

Hi,

I'm attaching a patch to fix the postrm. This is targeted at
testing-proposed-updates, but the same can be applied to sid, too.
Unfortunately the git repository is not up-to-date, otherwise I would
have sent some git commits :-)

I'll ask for a t-p-u approval and intend to NMU routino to t-p-u to get
this fixed for wheezy.


Andreas
diffstat for routino-2.2 routino-2.2

 changelog  |9 +
 routino-www.postrm |   27 ---
 2 files changed, 13 insertions(+), 23 deletions(-)

diff -Nru routino-2.2/debian/changelog routino-2.2/debian/changelog
--- routino-2.2/debian/changelog	2012-05-09 08:28:30.0 +0200
+++ routino-2.2/debian/changelog	2013-04-09 12:24:54.0 +0200
@@ -1,3 +1,12 @@
+routino (2.2-4+deb7u1) testing; urgency=low
+
+  * Non-maintainer upload.
+  * routino-www.postrm: Don't fail on removal of a non-existing directory.
+Don't repeat the same actions on remove and purge - only remove the
+results directory during purge.  (Closes: #656586)
+
+ -- Andreas Beckmann a...@debian.org  Tue, 09 Apr 2013 12:09:30 +0200
+
 routino (2.2-4) unstable; urgency=low
 
   * routino-www: added OSM CycleMap to list of layers
diff -Nru routino-2.2/debian/routino-www.postrm routino-2.2/debian/routino-www.postrm
--- routino-2.2/debian/routino-www.postrm	2012-03-07 11:07:10.0 +0100
+++ routino-2.2/debian/routino-www.postrm	2013-04-09 12:15:25.0 +0200
@@ -7,29 +7,10 @@
   set -x
 fi
 
-case $1 in
-	purge)
-		rm -rf /var/lib/routino/results
-		rmdir --ignore-fail-on-non-empty /var/lib/routino/data
-
-	;;
-	remove)
-		rm -rf /var/lib/routino/results
-		rmdir --ignore-fail-on-non-empty /var/lib/routino/data
-
-	;;
-
-  upgrade)
-
-  ;;
-
-	failed-upgrade|abort-install|abort-upgrade|disappear)
-	;;
-*)
-echo postrm called with unknown argument \`$1' 2
-exit 1
-
-esac
+if [ $1 = purge ]; then
+	rm -rf /var/lib/routino/results
+	rmdir --ignore-fail-on-non-empty /var/lib/routino/data || true
+fi
 
 #DEBHELPER#
 


Bug#656586: fails to purge - rmdir: failed to remove '/var/lib/routino/data': No such file or directory

2013-03-15 Thread Andreas Beckmann
Followup-For: Bug #656586

Hi,

I just had a look at the postrm script. rmdir --ignore-fail-on-non-empty
*does fail* if the directory to be removed does not exist. So you still
need a 'test -d $dir ' prefix or '|| true' suffix.

Also doing the same actions for both remove and purge is useless as
the postrm script will be called two times anyway. So one of the two
blocks should be removed simply.



Andreas


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org