From 81eeeba99fa58802aa04a6d8bc3367848a60a560 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 22:18:25 +0100 Subject: [PATCH] try performing migration in posttrans to fix problematic long-term updates [release 2.3-5mamba;Mon Apr 19 2021] --- filesystem.spec | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/filesystem.spec b/filesystem.spec index 3b133d1..5f03d8d 100644 --- a/filesystem.spec +++ b/filesystem.spec @@ -2,7 +2,7 @@ Name: filesystem Version: 2.3 -Release: 4mamba +Release: 5mamba Summary: The basic directory layout for a Linux system Group: System/Configuration Vendor: openmamba @@ -74,6 +74,21 @@ ln -s ../run %{buildroot}/var/run [ -e /run/$b ] || mv $f /run/ 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 ] || { # /bin -> /usr/bin and /sbin -> /usr/sbin migration 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 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 /sbin ] || /usr/bin/ln -s usr/sbin /sbin : @@ -231,6 +226,9 @@ fi /usr/tmp %changelog +* Mon Apr 19 2021 Silvan Calarco 2.3-5mamba +- try performing migration in posttrans to fix problematic long-term updates + * Fri Mar 05 2021 Silvan Calarco 2.3-4mamba - use /usr/bin/bash insted of /usr/bin/sh in posttrans script - add triggerpostun to try to fix further problems