fix apply-live-updates failing because of /lib symlink
Since cp won't copy a directory over a symlink, any updates that were supposed to go into e.g. /lib would get dropped if you had /updates/lib as an actual directory, but the target system had /lib->/usr/lib.master
parent
66666c670a
commit
b43d651511
|
@ -1,9 +1,17 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if [ -b /dev/mapper/live-rw ]; then
|
|
||||||
if [ -d /updates ]; then
|
. /tmp/root.info
|
||||||
echo "Applying updates to live image..."
|
|
||||||
|
if [ -b /dev/mapper/live-rw ] && [ -d /updates ]; then
|
||||||
|
info "Applying updates to live image..."
|
||||||
|
# avoid overwriting symlinks (e.g. /lib -> /usr/lib) with directories
|
||||||
|
(
|
||||||
cd /updates
|
cd /updates
|
||||||
/bin/cp -a -t $NEWROOT .
|
find . -depth -type d | while read dir; do
|
||||||
cd -
|
[ -d "$NEWROOT/$dir" ] || mkdir -p "$NEWROOT/$dir"
|
||||||
fi
|
done
|
||||||
|
find . -depth \! -type d | while read file; do
|
||||||
|
cp -a "$file" "$NEWROOT/$file"
|
||||||
|
done
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue