Skip to content

[Bug] g.extension -s generates unexpected warnings in case of read-only target #3052

@neteler

Description

@neteler

Describe the bug

Using g.extension -s generates unexpected warnings in case of a read-only target directory:

WARNING: Unable to create
         '/home/mneteler/software/grass82/dist.x86_64-pc-linux-gnu/docs/html/grass_logo.png':
         '/home/mneteler/software/grass82/dist.x86_64-pc-linux-gnu/docs/html/grass_logo.png'
         and
         '/home/mneteler/software/grass82/dist.x86_64-pc-linux-gnu/docs/html/grass_logo.png'
         are the same file. Is the GRASS GIS documentation package
         installed? Installation continues, but documentation may not look
         right.
...

In a docker container, it may look like this:

Executing <g.extension -s extension=i.cutlines> ...
WARNING: Unable to create '/usr/local/grass82/docs/html/grass_logo.png':
         '/usr/local/grass82/docs/html/grass_logo.png' and
         '/usr/local/grass82/docs/html/grass_logo.png' are the same file.
         Is the GRASS GIS documentation package installed? Installation
         continues, but documentation may not look right.
WARNING: Unable to create
         '/usr/local/grass82/docs/html/hamburger_menu.svg':
         '/usr/local/grass82/docs/html/hamburger_menu.svg' and
         '/usr/local/grass82/docs/html/hamburger_menu.svg' are the same
         file. Is the GRASS GIS documentation package installed?
         Installation continues, but documentation may not look right.
WARNING: Unable to create
         '/usr/local/grass82/docs/html/hamburger_menu_close.svg':
         '/usr/local/grass82/docs/html/hamburger_menu_close.svg' and
         '/usr/local/grass82/docs/html/hamburger_menu_close.svg' are the
         same file. Is the GRASS GIS documentation package installed?
         Installation continues, but documentation may not look right.
WARNING: Unable to create '/usr/local/grass82/docs/html/grassdocs.css':
         '/usr/local/grass82/docs/html/grassdocs.css' and
         '/usr/local/grass82/docs/html/grassdocs.css' are the same file. Is
         the GRASS GIS documentation package installed? Installation
         continues, but documentation may not look right.
Fetching <i.cutlines> from GRASS GIS Addons repository (be patient)...
Compiling...
Installing...
Updating extensions metadata file...
Updating extension modules metadata file...
Installation of <i.cutlines> successfully finished
Execution of <g.extension -s extension=i.cutlines> finished.

To Reproduce
Steps to reproduce the behavior:

Just compile and do not install GRASS GIS but run it from the compile directory (so, at user level):

grass82 ~/grassdata/nc_spm_08_grass7/user1
g.extension -s i.cutlines

However, -s tries to write to /usr/ which is write-protected when running things a user.

See above error.

Expected behavior

Catch the read-only situation and issue an appropriate warning which directory g.extension unsuccessfully tries to write into.

System description (please complete the following information):

  • Operating System: Fedora, alpine docker, ...
  • GRASS GIS version: 8.x (tested with 8.2 and 8.4.dev).

Metadata

Metadata

Assignees

No one assigned

    Labels

    PythonRelated code is in PythonbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions