manjaro / pamac

Graphical Package Manager for Manjaro Linux with Alpm, AUR, Appstream, Flatpak and Snap support
GNU General Public License v3.0
235 stars 42 forks source link

Don't Update Files Databases When Checking For Updates #369

Closed lots0logs closed 6 years ago

lots0logs commented 6 years ago

Don't update files databases when checking for updates because files data is not needed to determine if updates are available and downloading the files data takes considerably more time than the package databases.

Fixes #368

philmmanjaro commented 6 years ago

@guinux: when do we update the file-dbs? At some point it is needed after all, to have the current files listed. Maybe we can do that async and not so often.

lots0logs commented 6 years ago

@philmmanjaro This PR simply removes the check when checking for updates. Well, at least that's the intention. @guinux Please let me know if other changes are needed to accomplish the goal.

guinux commented 6 years ago

The code you removed is here to sync files dbs in tmp when checking for updates. I added it so pamac-tray can do it in background when it checks for updates. When you install updates, those files dbs are copied in /var/lib/pacman/sync and another sync is tried to be sure. If we remove this code this last sync will be longer.

lots0logs commented 6 years ago

@guinux

another sync is tried to be sure

That is the problem actually. For some reason the files databases are always downloaded when installing updates. It doesn't matter if they were updated in the background one minute before installing the updates.

Also, once again I want to note that technically, installing updates does not require the files databases to be current, or even to exist for that matter.

guinux commented 6 years ago

In all the tests I did with Manjaro and Arch it worked as expected, if pamac-tray already updated databases, they were not synced again. Do you use pamac-tray or let the time (around 1 min) after session startup to pamac-tray to sync databases in background ?

lots0logs commented 6 years ago

Yes I use pamac-tray and it doesn't matter when I install updates, whether the system was booted 5 minutes ago or the day before. The files database are always redownloaded 100% of the times I install updates with pamac. Its annoying. TBH, I really don't understand why you insist on trying to ensure files databases are synced prior to installing updates anyway. They are not even used by libalpm when checking for and installing updates.

guinux commented 6 years ago

Since I sync packages dbs in tmp to check updates, I need to sync packages dbs for real before upgrading, so I also update files dbs at the same time so all is synced.

lots0logs commented 6 years ago

Syncing the normal package databases make sense (obviously) but the files databases are a different story. It'd be much more appropriate to setup a cron job or systemd timer to update files databases once every 24 hours IMO. What do you think?

lots0logs commented 6 years ago

Superseded by #414