# HG changeset patch # User Richard Dunbar # Date 1329409996 0 # Node ID c0dfe349e3775ca984a894c1ea6eb2549b6a3785 # Parent a4087d70cc43a1d2c0d78bc1782eebffab40c33e zsh: pre_remove restore sh link diff -r a4087d70cc43 -r c0dfe349e377 zsh/receipt --- a/zsh/receipt Thu Feb 16 15:21:17 2012 +0000 +++ b/zsh/receipt Thu Feb 16 16:33:16 2012 +0000 @@ -70,3 +70,16 @@ fi fi } + +# Restore a valid sh link if needed. +pre_remove() +{ + local root + root=$1 + sh=`readlink $root/bin/sh` + if [ ! "$sh" = "busybox" ]; then + rm $root/bin/sh && + ln -s /bin/busybox $root/bin/sh + fi +} +