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"