-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request / searching for solution] Import recursively #282
Comments
Quick addition: It looks like vcs does accept (and obviously ignore) additional fields in the YAML .repos file so that I could store the "subdependencies" in the .repos file. Be like: repositories:
other/repo2:
type: git
url: /home/rolands/workspace/_test/test_vcs/repo2/
version: 2ea2ca5138d042eca88fdbd119bd2661f8de5213
subdependencies: [test.repos, other_dependency.repos] The wrapper is then a lot easier as I just need to take the location ( Still, if there's an easier solution working with the current vcs version, my question holds. |
Why not to make a conditional import? repositories:
other/repo2:
type: git
url: /home/rolands/workspace/_test/test_vcs/repo2/
version: 2ea2ca5138d042eca88fdbd119bd2661f8de5213
if:
expr: (( TESTS )) # a bash shell condition
then:
- import: test.repos # relative to this file
- import:
- other/test.repos # relative to this file
- ./_externals/myproj1/.repos # conditional import from an external repository of the `other/repo2` repository
- $PROJECT_ROOT/_externals/myproj2/.repos # conditional import from an external repository of an arbitrary root repository
- $UNEXISTED/_externals/myproj3/.repos # invalid import, `$UNEXISTED` is empty
if:
expr: (( OTHER_DEPS ))
then:
- import: other/other_dependency.repos PROJECT_ROOT=~/myreporoot
TESTS=1 OTHER_DEPS=1 vcs import < .repos |
Or, before downloading the remote repository, you could check whether the local path (e.g., <your_workspace>/src/other/ros2) already exists in your filesystem. If the folder exists, you could throw an error or warning indicating that the repository has already been downloaded and take appropriate action accordingly. |
Also using vcs for the same reasons mentioned in #221 (git submodules being too error-prone, especially for non-git-affine developers), I still see a downside to vcs, which is the (apparent) inability to import / pull recursively into the pointed-to repositories.
The
--recursive
is obviously not an option since it involves git submodules - which we want to avoid at all costs. Since there can be multiple .repos files in the imported repos - and we may not want to recursively import all of them - the manifest file could contain an optionaldependencies
(or any other good name) list field that points to the .repos files inside the repo that vcs then shall use when importing recursively.For the time being, and since vcs doesn't allow for custom fields, I plan to write a wrapper around vcs that imports all new dependencies.repos files found after an import. Here some pseudo-code:
My question here: Is there a more straightforward way to import recursively with the current vcs version? I may have missed some very simple way.
Thanks in advance for the answers.
The text was updated successfully, but these errors were encountered: