try performing migration in posttrans to fix problematic long-term updates [release 2.3-5mamba;Mon Apr 19 2021]

This commit is contained in:
Silvan Calarco 2024-01-05 22:18:25 +01:00
parent 2161a72985
commit 81eeeba99f

View File

@ -2,7 +2,7 @@
Name: filesystem Name: filesystem
Version: 2.3 Version: 2.3
Release: 4mamba Release: 5mamba
Summary: The basic directory layout for a Linux system Summary: The basic directory layout for a Linux system
Group: System/Configuration Group: System/Configuration
Vendor: openmamba Vendor: openmamba
@ -74,6 +74,21 @@ ln -s ../run %{buildroot}/var/run
[ -e /run/$b ] || mv $f /run/ [ -e /run/$b ] || mv $f /run/
done done
} }
%post
/sbin/ldconfig
if [ $1 -ge 1 ]; then
groupadd tty -g %{tty_groupid} 2>/dev/null || true
fi
:
%triggerpostun -- filesystem < 2.3
# /bin and /sbin are removed during old filesystem postun
[ -e /bin ] || /usr/bin/ln -s usr/bin /bin
[ -e /sbin ] || /usr/bin/ln -s usr/sbin /sbin
:
%posttrans
[ -L /bin -a -L /sbin ] || { [ -L /bin -a -L /sbin ] || {
# /bin -> /usr/bin and /sbin -> /usr/sbin migration # /bin -> /usr/bin and /sbin -> /usr/sbin migration
for f in mv rm rmdir ln; do for f in mv rm rmdir ln; do
@ -118,26 +133,6 @@ ln -s ../run %{buildroot}/var/run
/usr/bin/ln -s usr/$d /$d /usr/bin/ln -s usr/$d /$d
done done
} }
# Add if missing for safety
[ -e /bin ] || /usr/bin/ln -s usr/bin /bin
[ -e /sbin ] || /usr/bin/ln -s usr/sbin /sbin
:
%post
/sbin/ldconfig
if [ $1 -ge 1 ]; then
groupadd tty -g %{tty_groupid} 2>/dev/null || true
fi
:
%triggerpostun -p /usr/bin/bash -- filesystem < 2.3
# /bin and /sbin are removed during old filesystem postun
[ -e /bin ] || /usr/bin/ln -s usr/bin /bin
[ -e /sbin ] || /usr/bin/ln -s usr/sbin /sbin
:
%posttrans -p /usr/bin/bash
# /bin and /sbin are removed on upgrade
[ -e /bin ] || /usr/bin/ln -s usr/bin /bin [ -e /bin ] || /usr/bin/ln -s usr/bin /bin
[ -e /sbin ] || /usr/bin/ln -s usr/sbin /sbin [ -e /sbin ] || /usr/bin/ln -s usr/sbin /sbin
: :
@ -231,6 +226,9 @@ fi
/usr/tmp /usr/tmp
%changelog %changelog
* Mon Apr 19 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3-5mamba
- try performing migration in posttrans to fix problematic long-term updates
* Fri Mar 05 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3-4mamba * Fri Mar 05 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3-4mamba
- use /usr/bin/bash insted of /usr/bin/sh in posttrans script - use /usr/bin/bash insted of /usr/bin/sh in posttrans script
- add triggerpostun to try to fix further problems - add triggerpostun to try to fix further problems