Frogging-Family / nvidia-all

Nvidia driver latest to 396 series AIO installer
788 stars 69 forks source link

Suggested solution for #30, only update if newer driver #31

Closed flindeberg closed 3 years ago

flindeberg commented 3 years ago

Suggested solution for #30 , only updates if newer.

Perhaps some variable names should be changed, since it strictly speaking also does not build, and not only not update, if a newer version is not available.

I tried looking for nvidia version formats, and they all seem to work. I am unsure if there are vulkandev-versions, or similar, which deviate from the normal nvidia version format.

Tk-Glitch commented 3 years ago

Wouldn't it be easier to just use pacman to check for the version of the package installed? Going through nvidia-smi isn't reliable IMO.

flindeberg commented 3 years ago

@Tk-Glitch Do you think pacman -Q "nvidia-utils" | grep -oP '\d+(\.\d+)+' would do the trick?

I wanted to avoid looking for a specific package name and a specific package version format since I do not know all possibilities.

This catches the packages nvidia-utils and nvidia-utils-tkg (but not the lib32 versions) and versions on formats with digits separated with one or more periods.

Tk-Glitch commented 3 years ago

Yeah I think that should do the trick. Thanks! :frog: :heart: