From 3318269fb9dc3fb8598e1d041e9ff0a1b74fa05baf9ada1254bc0f77d62946c7 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Tue, 8 Jun 2021 09:47:14 +0000 Subject: [PATCH] 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 --- compat-usrmerge.changes | 6 ++++++ convertfs | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/compat-usrmerge.changes b/compat-usrmerge.changes index e2f59de..a873f68 100644 --- a/compat-usrmerge.changes +++ b/compat-usrmerge.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 8 07:37:33 UTC 2021 - Fabian Vogt + +- Avoid dependency on mountpoint from util-linux +- Also check for availability of find + ------------------------------------------------------------------- Mon Jun 7 09:02:56 UTC 2021 - Ludwig Nussel diff --git a/convertfs b/convertfs index 4c25e87..01cc310 100644 --- a/convertfs +++ b/convertfs @@ -5,7 +5,7 @@ ROOT= # the package is installed with AutoReq off, so no guarantee that # 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" exit 1 fi @@ -24,11 +24,11 @@ cleanup() { trap 'ret=$?; [[ $ret -ne 0 ]] && cleanup;exit $ret;' EXIT trap 'exit 1;' SIGINT -mountpoint -q "$ROOT/usr" || CP_HARDLINK="-l" - set -e +usrismountpoint= while read dev mp other; do + [ "$mp" = "/usr" ] && usrismountpoint=1 for dir in bin sbin lib lib64; do if [ "${mp#$ROOT/$dir}" != "$mp" ] || [ "${mp#$ROOT/usr/$dir}" != "$mp" ]; then echo "Please unmount $mp before the conversion" @@ -37,6 +37,8 @@ while read dev mp other; do done done < /proc/mounts +[ -n "$usrismountpoint" ] || CP_HARDLINK="-l" + # merge / and /usr in new dir in /usr for dir in bin sbin lib lib64; do rm -rf -- "$ROOT/usr/${dir}.usrmerge"