forked from pool/compat-usrmerge
Accepting request 879892 from home:lnussel:usrmove
- cp can't handle copying a dir over non-directories. So move those away in advance. Happened with /lib/udev existing as link on older distros OBS-URL: https://build.opensuse.org/request/show/879892 OBS-URL: https://build.opensuse.org/package/show/Base:System/compat-usrmerge?expand=0&rev=8
This commit is contained in:
parent
7217d89630
commit
ccc2543924
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 18 12:24:15 UTC 2021 - Ludwig Nussel <lnussel@suse.de>
|
||||
|
||||
- cp can't handle copying a dir over non-directories. So move those
|
||||
away in advance. Happened with /lib/udev existing as link on older
|
||||
distros
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 15 17:41:10 UTC 2021 - Ludwig Nussel <lnussel@suse.de>
|
||||
|
||||
|
11
convertfs
11
convertfs
@ -33,6 +33,17 @@ for dir in bin sbin lib lib64; do
|
||||
echo "Make a copy of \`$ROOT/$dir'."
|
||||
[[ -d "$ROOT/$dir" ]] \
|
||||
&& cp -ax -l "$ROOT/$dir" "$ROOT/usr/${dir}.usrmerge"
|
||||
# cp can't handle copying a dir over non-directories. So move
|
||||
# those away in advance. Happened with /lib/udev existing as
|
||||
# link on older distros
|
||||
while read d; do
|
||||
f="$ROOT/usr/$dir.usrmerge/$d"
|
||||
if test -e "$f" -a \( -L "$f" -o ! -d "$f" \); then
|
||||
echo "Warning: /$dir/$d conflicts with directory /usr/$dir/$d and will be removed"
|
||||
rm -rf "$f.usrmerge~"
|
||||
mv "$f" "$f.usrmerge~"
|
||||
fi
|
||||
done < <(find "$ROOT/usr/$dir" -type d -printf "%P\n" )
|
||||
echo "Merge the copy with \`$ROOT/usr/$dir'."
|
||||
[[ -d "$ROOT/usr/${dir}.usrmerge" ]] \
|
||||
|| mkdir -p "$ROOT/usr/${dir}.usrmerge"
|
||||
|
Loading…
Reference in New Issue
Block a user