Skip to content

root-config fails if spaces are part of ROOTSYS path #10759

@olifre

Description

@olifre
  • Checked for duplicates

Describe the bug

The root-config script fails in several ways when located in a PATH containing spaces.

Expected behavior

No errors when there are spaces in the path.

To Reproduce

mkdir foo\ bar
cd foo\ bar
wget https://root.cern/download/root_v6.26.04.Linux-ubuntu18-x86_64-gcc7.5.tar.gz
tar xf root_v6.26.04.Linux-ubuntu18-x86_64-gcc7.5.tar.gz
source root/bin/thisroot.sh                             
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 31: [: too many arguments

It also affects other output (as expected):

$ root-config --incdir                                                         
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 31: [: too many arguments
/home/me ./include

and:

$ root-config --version
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 31: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 553: test: /home/me: binary operator expected
cannot read /home/me
./include/RVersion.h

Setup

  1. ROOT: versions: seen with 6.14, 6.26, likely others
  2. Operating system: any Linux-based system (seen with Ubuntu in WSL, Gentoo)

Additional context

While spaces in paths are always nasty, this case was reported by a student of mine (who extracted the tarball in a subdirectory with spaces).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions