rwfus
rwfus copied to clipboard
Pacman db and cache invalid after update
When updating the Deck, Valve swaps out the entire filesystem and pacman dbs for new ones. This very much makes pacman freak out.
TODO: What? TODO: Why? TODO: What can we do about it?
It seems like, after an update, we'll have to run a script to delete pacman DBs in the upper dir before it gets mounted. TODO: How to detect an update's occurred?
I had this Issue pack when I played around with pacman.
I resorted to just deleting the oldest Version Entry of every duplicate in the Pacman DB. Seemed to work fine for me.
I think I've thought of a way to detect updates? Whenever steam updates, the date created of the packages should change to the day they updated. So we should be able to use that to make a startup script. Here's an example of what I mean:
#!/bin/bash
cd /var/lib/pacman/local/
pacmandb="/home/deck/rwfus/pacmandb.txt"
pacmandbcheck="/home/deck/rwfus/pacmandbcheck.txt"
ls -lt > "$pacmandbcheck"
if ! diff "$pacmandb" "$pacmandbcheck"; then
ls -lt > "$pacmandb"
#Script to delete pacman db duplicates here
fi
If run before the overlay is mounted, then ls would only output changes in the read only filesystem right? I'm not super experienced in scripting/programming so sorry if my example is not the best.
One optimization you could make is to hash the files with (for example) sha256sum. If the hash is different, the file's definitely been modified. If it's the same, it probably hasn't.