runtime-cleanup: log broken symlinks being removed

Print out a message about each broken symlink being removed. Also, no
need to bother looking in /lib since it's just a symlink to /usr/lib.
This commit is contained in:
Will Woods 2012-06-19 18:14:06 -04:00
parent 3fda56b499
commit 7150cad31b

View File

@ -348,8 +348,9 @@ removefrom ${product.name}-logos /usr/share/{firstboot,gnome-screensaver,kde4,pi
runcmd find ${root} -name "*.pyo" -type f -delete
runcmd find ${root} -name "*.pyc" -type f -exec ln -sf /dev/null {} \;
## remove any broken links in /etc, /usr, /lib
## remove any broken links in /etc or /usr
## (broken systemd service links lead to confusing noise at boot)
## NOTE: not checking /var because we want to keep /var/run
## NOTE: Excluding /etc/mtab which links to /proc/self/mounts for systemd
runcmd chroot ${root} find -L /etc /usr /lib -xdev -type l -and \! -name "mtab" -delete
runcmd chroot ${root} find -L /etc /usr -xdev -type l -and \! -name "mtab" \
-printf "removing broken symbolic link %p -> %l\n" -delete