3
0

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
This commit is contained in:
Ludwig Nussel 2021-10-07 13:00:27 +00:00 committed by Git OBS Bridge
parent 4dd25b596d
commit 1f3c20915a
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>

View File

@ -147,6 +147,7 @@ EOF
%endif
%filetriggerin -p <lua> -- %{_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 <lua> -- %{_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 <lua> -- /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

View File

@ -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~"