From 1f3c20915a44a923bdfaaa4c05929dbe953e1cfdf25e38a0dd3c6b0ba4e9f396 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Thu, 7 Oct 2021 13:00:27 +0000 Subject: [PATCH] Accepting request 923734 from home:lnussel:usrmove - Fix logic for detecting conflicts with directories (boo#1191111) - exit file triggers early if alread usrmerged OBS-URL: https://build.opensuse.org/request/show/923734 OBS-URL: https://build.opensuse.org/package/show/Base:System/compat-usrmerge?expand=0&rev=23 --- compat-usrmerge.changes | 10 ++++++++++ compat-usrmerge.spec | 3 +++ convertfs | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/compat-usrmerge.changes b/compat-usrmerge.changes index 698b601..666c6f4 100644 --- a/compat-usrmerge.changes +++ b/compat-usrmerge.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Oct 7 11:57:22 UTC 2021 - Ludwig Nussel + +- Fix logic for detecting conflicts with directories (boo#1191111) + +------------------------------------------------------------------- +Fri Aug 27 08:39:30 UTC 2021 - Ludwig Nussel + +- exit file triggers early if alread usrmerged + ------------------------------------------------------------------- Fri Aug 27 06:35:26 UTC 2021 - Ludwig Nussel diff --git a/compat-usrmerge.spec b/compat-usrmerge.spec index 6b6f803..55df725 100644 --- a/compat-usrmerge.spec +++ b/compat-usrmerge.spec @@ -147,6 +147,7 @@ EOF %endif %filetriggerin -p -- %{_sbindir} %{_bindir} %{_libdir} +if posix.stat("/lib", "type") ~= "directory" then return end require("usrmerge") if posix.getenv("VERBOSE_FILETRIGGERS") then usrmerge.debug = "%{nvr}(in)" @@ -159,6 +160,7 @@ end io.flush() %filetriggerpostun -p -- %{_sbindir} %{_bindir} %{_libdir} +if posix.stat("/lib", "type") ~= "directory" then return end -- the module is already gone if we get called for ourselves if pcall(require, 'usrmerge') then if posix.getenv("VERBOSE_FILETRIGGERS") then @@ -173,6 +175,7 @@ if pcall(require, 'usrmerge') then end %filetriggerpostun -p -- /sbin /bin /%{_lib} +if posix.stat("/lib", "type") ~= "directory" then return end -- the module is already gone if we get called for ourselves if pcall(require, 'usrmerge') then if posix.getenv("VERBOSE_FILETRIGGERS") then diff --git a/convertfs b/convertfs index 91115be..ca90e1f 100644 --- a/convertfs +++ b/convertfs @@ -69,7 +69,7 @@ for dir in bin sbin lib lib64; do # 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 + if test -L "$f" -o \( -e "$f" -a ! -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~"