Enable PKGSYSTEM_ENABLE_FSYNC=0 optimization for HDDs during MIME database updates

This commit is contained in:
marcin-
2026-06-11 12:41:32 +02:00
parent 75a836247c
commit b0cc20a186
3 changed files with 58 additions and 2 deletions
@@ -4,4 +4,11 @@ import os
# Update global mime databases, mime database format may change (0.70)
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
os.system("/usr/bin/update-mime-database /usr/share/mime")
cmd = (
"disk=$(findmnt -n -o SOURCE / | sed 's/[0-9]*$//'); "
"env $( [ -f \"/sys/block/${disk##*/}/queue/rotational\" ] && "
"[ \"$(cat \"/sys/block/${disk##*/}/queue/rotational\")\" = \"1\" ] && "
"echo PKGSYSTEM_ENABLE_FSYNC=0 ) "
"/usr/bin/update-mime-database /usr/share/mime"
)
os.system(cmd)