Avoid file-rc being considered for removal by deborphan
authorMichael Prokop <mika@grml.org>
Wed, 5 Jun 2013 17:44:49 +0000 (19:44 +0200)
committerMichael Prokop <mika@grml.org>
Wed, 5 Jun 2013 17:44:49 +0000 (19:44 +0200)
For whatever reason deborphan seems to consider file-rc
being available for removal since a few days:

| =====   shell: DEBORPHAN/98-clean-chroot   =====
| [...]
| (Reading database ... 24676 files and directories currently installed.)
| Removing file-rc ...
| Purging configuration files for file-rc ...
| Please purge /var/backups/rc.* manually.
| DEBORPHAN/98-clean-chroot OK.

etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot

index 8c08357..68136ea 100755 (executable)
@@ -14,6 +14,12 @@ if ! [ -x $target/usr/bin/deborphan ] ; then
   exit 0
 fi
 
+# avoid file-rc being considered for removal by deborphan
+if [ -d $target/usr/share/file-rc -a -x $target/usr/bin/deborphan ] ; then
+  echo "Adding file-rc to keep-list of deborphan to avoid accidental removal"
+  $ROOTCMD deborphan --add-keep file-rc || /bin/true
+fi
+
 # remove all packages not necessary anymore:
 $ROOTCMD apt-get -y --purge autoremove