summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2008-02-25 21:11:21 -0500
committerJeremy Katz <katzj@redhat.com>2008-02-25 21:11:21 -0500
commitb1f0b34783a38a29faa28a18c4de1a6fa2d8ca71 (patch)
tree8fbd513607ab04a5972dbd1e7cff1b5e85e92be0 /scripts
parent4fac60011ee51b18c78160179f18b77e2c5e97e3 (diff)
downloadanaconda-b1f0b34783a38a29faa28a18c4de1a6fa2d8ca71.tar.gz
anaconda-b1f0b34783a38a29faa28a18c4de1a6fa2d8ca71.tar.xz
anaconda-b1f0b34783a38a29faa28a18c4de1a6fa2d8ca71.zip
Fix up symlinks that could be broken with our movement here (#434882)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/upd-instroot14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index d9f5d7240..e5a8d58ea 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -1036,6 +1036,20 @@ for p in $DEST $DESTGR; do
rm -rf $p/bin
rm -rf $p/sbin
+ # Fix relative links like /usr/bin/udevinfo -> ../../sbin/udevadm
+ for brokenlink in $(find $p/usr/{bin,sbin} -follow -lname '*'); do
+ target="$(readlink $brokenlink)"
+ for pathbit in bin sbin; do
+ # if it starts with "../../sbin/", remove that
+ newtarget="${target##../../$pathbit/}"
+ # if we removed something, replace it with the proper path
+ if [ "$newtarget" != "$target" ]; then
+ # make it ../sbin/ instead
+ ln -sf "../$pathbit/$newtarget" "$brokenlink"
+ fi
+ done
+ done
+
# copy bootloader files for sparc
if [ $ARCH = sparc -a $p = $DESTGR ]; then
mkdir -p $p/usr/lib/anaconda-runtime/boot