rwfus icon indicating copy to clipboard operation
rwfus copied to clipboard

Pacman db and cache invalid after update

Open ValShaped opened this issue 2 years ago • 4 comments

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?

ValShaped avatar Jul 22 '22 13:07 ValShaped

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?

ValShaped avatar Aug 10 '22 19:08 ValShaped

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.

NightHammer1000 avatar Aug 17 '22 19:08 NightHammer1000

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.

Krules02 avatar Nov 07 '22 04:11 Krules02

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.

ValShaped avatar Nov 13 '22 14:11 ValShaped