tools.vpm: validate VCS during parsing #19943
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
馃[deprecated] Generated by Copilot at 4143aa7
This pull request enhances the V package manager (VPM) to support different version control systems (VCS) for V modules, such as
git
andhg
. It also adds the ability to install specific versions ofgit
modules with flags. It refactors and reorganizes some code to improve readability and maintainability.馃[deprecated] Generated by Copilot at 4143aa7
vcs
field of theModule
andSettings
structs from a string to aVCS
type, which represents a version control system with its command and arguments (link, link, link, link, link, link)version
field to theVCS
struct, which specifies the flag to use for installing a specific version of a module (link, link, link)VCS
struct and theinstall
function of theModule
struct from thevpm.v
andinstall.v
files to thecommon.v
file, since they are used by both theinstall
andupdate
commands (link, link, link)is_git_setting
to check if the globalsettings.vcs
isgit
, which is the default and most common VCS used for V modules (link)resolve_modules
function (link, link)is_git_setting
variable is true before calling thehas_vmod
function, which verifies the existence of av.mod
file in the module's repository (link)vcs
in theresolve_modules
function (link)modules
array, and if so, verify that the globalsettings.vcs
is executable in theresolve_modules
function (link)vcs
argument from theinstall
function of theModule
struct, and use thevcs
field of the struct instead (link, link, link, link)install_modules
function, which checked if the globalsettings.vcs
was executable, since this check was moved to theresolve_modules
function (link)is_installed
field of theModule
struct the value of agit
command output, which checks if the module's repository has any remote references, only if the module usesgit
as its VCS (link)