3
0

Accepting request 898293 from home:favogt:branches:Base:System

- Avoid dependency on mountpoint from util-linux
- Also check for availability of find

OBS-URL: https://build.opensuse.org/request/show/898293
OBS-URL: https://build.opensuse.org/package/show/Base:System/compat-usrmerge?expand=0&rev=16
This commit is contained in:
Ludwig Nussel 2021-06-08 09:47:14 +00:00 committed by Git OBS Bridge
parent e0d86ebe21
commit 3318269fb9
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jun 8 07:37:33 UTC 2021 - Fabian Vogt <fvogt@suse.com>
- Avoid dependency on mountpoint from util-linux
- Also check for availability of find
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jun 7 09:02:56 UTC 2021 - Ludwig Nussel <lnussel@suse.com> Mon Jun 7 09:02:56 UTC 2021 - Ludwig Nussel <lnussel@suse.com>

View File

@ -5,7 +5,7 @@ ROOT=
# the package is installed with AutoReq off, so no guarantee that # the package is installed with AutoReq off, so no guarantee that
# coreutils actually works # coreutils actually works
if ! (cp --help && mountpoint --help && mountpoint --help) > /dev/null; then if ! { cp --help && find --help; } > /dev/null; then
echo "tools not functional, exit" echo "tools not functional, exit"
exit 1 exit 1
fi fi
@ -24,11 +24,11 @@ cleanup() {
trap 'ret=$?; [[ $ret -ne 0 ]] && cleanup;exit $ret;' EXIT trap 'ret=$?; [[ $ret -ne 0 ]] && cleanup;exit $ret;' EXIT
trap 'exit 1;' SIGINT trap 'exit 1;' SIGINT
mountpoint -q "$ROOT/usr" || CP_HARDLINK="-l"
set -e set -e
usrismountpoint=
while read dev mp other; do while read dev mp other; do
[ "$mp" = "/usr" ] && usrismountpoint=1
for dir in bin sbin lib lib64; do for dir in bin sbin lib lib64; do
if [ "${mp#$ROOT/$dir}" != "$mp" ] || [ "${mp#$ROOT/usr/$dir}" != "$mp" ]; then if [ "${mp#$ROOT/$dir}" != "$mp" ] || [ "${mp#$ROOT/usr/$dir}" != "$mp" ]; then
echo "Please unmount $mp before the conversion" echo "Please unmount $mp before the conversion"
@ -37,6 +37,8 @@ while read dev mp other; do
done done
done < /proc/mounts done < /proc/mounts
[ -n "$usrismountpoint" ] || CP_HARDLINK="-l"
# merge / and /usr in new dir in /usr # merge / and /usr in new dir in /usr
for dir in bin sbin lib lib64; do for dir in bin sbin lib lib64; do
rm -rf -- "$ROOT/usr/${dir}.usrmerge" rm -rf -- "$ROOT/usr/${dir}.usrmerge"