Skip to content
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

Dynamic subdirs in Makefile #887

Merged
merged 6 commits into from
Apr 19, 2023
Merged

Dynamic subdirs in Makefile #887

merged 6 commits into from
Apr 19, 2023

Conversation

ninsbl
Copy link
Member

@ninsbl ninsbl commented Apr 15, 2023

With sparse checkout of addons in g.extension implemented in OSGeo/grass#2895, not all subdirs of the repository exist at all time.

Runing make in a directory below module level is thus likely to fail. This PR should make sure that make is run in all subdirs that contain a Makefile. And instead of hardcoded directory names, relevant subdirs are identified with the find command line tool.

When g.extension is improved to support also the installation of multiple AddOns (which now should be relatively straight forward on UNIX like systems) then make should be run at the root of the addon repository to install all downloaded addons.

Are find, basename, dirname and xargs available on all relevant UNIX like platforms*?
It seems Mac OS has those (but I have only Fedora and Ubuntu to test).

*On MS Windows addons are not compiled anyway.

src/Makefile Outdated Show resolved Hide resolved
@ninsbl ninsbl merged commit 0d52912 into OSGeo:grass8 Apr 19, 2023
@tmszi
Copy link
Member

tmszi commented Apr 19, 2023

@ninsbl with this change we introduce this issue:

GRASS nc_basic_spm_grass7/PERMANENT:~ > g.extension db.join
WARNING: Extension <db.join> already installed. Re-installing...
Fetching <db.join> from <https://github.com/OSGeo/grass-addons> (be
patient)...
Traceback (most recent call last):
  File "/usr/lib64/grass83/scripts/g.extension", line 2877, in <module>
    sys.exit(main())
  File "/usr/lib64/grass83/scripts/g.extension", line 2857, in main
    install_extension(source=source, url=url, xmlurl=xmlurl, branch=branch)
  File "/usr/lib64/grass83/scripts/g.extension", line 1240, in install_extension
    ) = install_extension_std_platforms(
  File "/usr/lib64/grass83/scripts/g.extension", line 2001, in install_extension_std_platforms
    srcdir = download_source_code(
  File "/usr/lib64/grass83/scripts/g.extension", line 1913, in download_source_code
    directory = download_source_code_official_github(
  File "/usr/lib64/grass83/scripts/g.extension", line 1779, in download_source_code_official_github
    ga = GitAdapter(
  File "/usr/lib64/grass83/scripts/g.extension", line 252, in __init__
    self.addons = self._get_addons_list()
  File "/usr/lib64/grass83/scripts/g.extension", line 388, in _get_addons_list
    addons_dict[file_path.split("/")[3]] = "/".join(
IndexError: list index out of range

cwhite911 pushed a commit to cwhite911/grass-addons that referenced this pull request Sep 19, 2023
* add Makefile at root

* get subdirs dynamically

* add Makefile

* add Makefile

* add Makefile

* reuse subdir filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport_needed PR needs to be backported to grass7 addon branch bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants