Closed wesbarnett closed 3 years ago
I think that this is something we should not consider. That is super edgy and people are always encouraged to not do a partial upgrade.
people are always encouraged to not do a partial upgrade.
My point is that a partial upgrade would occur without the user knowing it if he rollback an upgrade pre/post snapshot pair using these pacman hooks and then installed something.
Maybe this will clarify:
pacman -Syu
)snapper rollback
.How can the user do that without now performing a partial upgrade since the pacman database is now synced (and can't be rolled back)? Are is the user just out of luck?
I dont know, how often will that happen? If the error does not get resolved, you have a problem anyways. So you can just leave the system as is, without installing new packages.
Even if you have a perfect solution that holds back the correct and old database, it is very likely that the mirror will remove those old packages and you cannot install new ones anyways.
So in my opinion the only work we have is to inform the user about this limitation in the readme, nothing more.
Documented.
I was thinking about exactly when pacman hooks are run and think I see a situation that could lend itself to a user unwittingly performing a partial upgrade. pacman pre hooks are run before transactions occur (upgrade, removal, installation) but after the database is synchronized when using
pacman -Sy
as part of a transaction (like when runningpacman -Syu
).So here is a scenario when using snap-pac:
pacman -Syu
to upgrade system. snap-pac calls snapper to take pre/post snapshots.snapper undochange
.pacman -S <package>
.The user has now performed a partial upgrade since the database was synchronized, but the packages were not. This would not be a problem if the pre hooks were run before the database was synchronized but they are run after database synchronization.
I have validated that this can indeed happen using the following steps:
pacman -Syu
when having snap-pac installed and where packages are actually upgradedsnapper undochange <pre>...<post>
where<pre>
is the pre snapshot number and<post>
is the post snapshot numberpacman -Qu
to list all packages that are out of date. If it lists any packages that means any kind of installation at this point will be a partial upgrade, and indeed it lists all the packages that were upgraded before the rollback.Additionally using
ls -lh /var/lib/pacman/sync/
it is clear that the database is not rolled back when usingsnapper undochange
.I'm not sure that there is a solution when it comes to these hooks and script because ultimately the pre snapshot needs to be run before the database sync but that is controlled by pacman, not here.