rocky-linux / rocky-tools

MIT License
401 stars 139 forks source link

Check for latest version before execution #142

Open aminvakil opened 2 years ago

aminvakil commented 2 years ago

There could be a soft warning which checks the latest migrate2rocky.sh from github and warns if it is not the latest one, this could help for other circumstances too IMHO.

This should definitely not be a barrier and force users to update as probably there are someones which execute this on local networks without internet access.

Not related to this issue but I could help creating a PR for this if you think it's useful.

Originally posted by @aminvakil in https://github.com/rocky-linux/rocky-tools/issues/141#issuecomment-1008691017

aminvakil commented 2 years ago

Sure. I suppose it would first require us to actually set up version numbers for migrate2rocky, though.

Originally posted by @pajamian in https://github.com/rocky-linux/rocky-tools/issues/141#issuecomment-1008691763

aminvakil commented 2 years ago

Sure. I suppose it would first require us to actually set up version numbers for migrate2rocky, though.

How about checking for differences between running migrate2rocky and latest from master?

Originally posted by @aminvakil in https://github.com/rocky-linux/rocky-tools/issues/141#issuecomment-1008692799

aminvakil commented 2 years ago

The only real way to do that would be some sort of checksum, and that would be spoiled by any kind of local modification to the script.

Originally posted by @pajamian in https://github.com/rocky-linux/rocky-tools/issues/141#issuecomment-1008693555

aminvakil commented 2 years ago

Let's continue here :)

Well it's a warning, right? They can skip the warning.

Also I'm not sure how versioning can help in this situtation.

pajamian commented 2 years ago

Well, versioning is on the todo list anyways (just sort of way down on the list). So it would make sense to me for this feature to use it.

aminvakil commented 2 years ago

So do you think this should wait out until versioning has been done?

pajamian commented 2 years ago

I'm more than happy if you want to add versioning as well. It could be as simple as just setting a variable at the top of the script and displaying it in the usage function.

pajamian commented 2 years ago

I'll set up versioning, and once I've done that you can look into this commit. I'll bump it up on my radar.