3
0

Accepting request 923737 from Base:System

- Fix logic for detecting conflicts with directories (boo#1191111)
- exit file triggers early if alread usrmerged (forwarded request 923734 from lnussel)

OBS-URL: https://build.opensuse.org/request/show/923737
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/compat-usrmerge?expand=0&rev=5
This commit is contained in:
Dominique Leuenberger 2021-10-18 19:58:12 +00:00 committed by Git OBS Bridge
commit fca1c4e1bf
3 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Oct 7 11:57:22 UTC 2021 - Ludwig Nussel <lnussel@suse.de>
- Fix logic for detecting conflicts with directories (boo#1191111)
-------------------------------------------------------------------
Fri Aug 27 08:39:30 UTC 2021 - Ludwig Nussel <lnussel@suse.de>
- exit file triggers early if alread usrmerged
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Aug 27 06:35:26 UTC 2021 - Ludwig Nussel <lnussel@suse.de> Fri Aug 27 06:35:26 UTC 2021 - Ludwig Nussel <lnussel@suse.de>

View File

@ -147,6 +147,7 @@ EOF
%endif %endif
%filetriggerin -p <lua> -- %{_sbindir} %{_bindir} %{_libdir} %filetriggerin -p <lua> -- %{_sbindir} %{_bindir} %{_libdir}
if posix.stat("/lib", "type") ~= "directory" then return end
require("usrmerge") require("usrmerge")
if posix.getenv("VERBOSE_FILETRIGGERS") then if posix.getenv("VERBOSE_FILETRIGGERS") then
usrmerge.debug = "%{nvr}(in)" usrmerge.debug = "%{nvr}(in)"
@ -159,6 +160,7 @@ end
io.flush() io.flush()
%filetriggerpostun -p <lua> -- %{_sbindir} %{_bindir} %{_libdir} %filetriggerpostun -p <lua> -- %{_sbindir} %{_bindir} %{_libdir}
if posix.stat("/lib", "type") ~= "directory" then return end
-- the module is already gone if we get called for ourselves -- the module is already gone if we get called for ourselves
if pcall(require, 'usrmerge') then if pcall(require, 'usrmerge') then
if posix.getenv("VERBOSE_FILETRIGGERS") then if posix.getenv("VERBOSE_FILETRIGGERS") then
@ -173,6 +175,7 @@ if pcall(require, 'usrmerge') then
end end
%filetriggerpostun -p <lua> -- /sbin /bin /%{_lib} %filetriggerpostun -p <lua> -- /sbin /bin /%{_lib}
if posix.stat("/lib", "type") ~= "directory" then return end
-- the module is already gone if we get called for ourselves -- the module is already gone if we get called for ourselves
if pcall(require, 'usrmerge') then if pcall(require, 'usrmerge') then
if posix.getenv("VERBOSE_FILETRIGGERS") then if posix.getenv("VERBOSE_FILETRIGGERS") then

View File

@ -69,7 +69,7 @@ for dir in bin sbin lib lib64; do
# link on older distros # link on older distros
while read d; do while read d; do
f="$ROOT/usr/$dir.usrmerge/$d" 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" echo "Warning: /$dir/$d conflicts with directory /usr/$dir/$d and will be removed"
rm -rf "$f.usrmerge~" rm -rf "$f.usrmerge~"
mv "$f" "$f.usrmerge~" mv "$f" "$f.usrmerge~"