Skip to content

"Unable to open /etc/scl/prefixes/" error after running f19.rb #3

Description

@jrafanie

Running f19.rb, changes the gem install convention to gem_install but doesn't deal or warn about quoting of the scl enable line. Perhaps this script is not really applicable to SCL but I thought it was worth asking about. Perhaps even linking to this issue is enough for anyone else who runs into this.

Before:

mkdir -p .%{gem_dir}        
 %{?scl:scl enable %{scl} "}
gem install \       +%gem_install -n %{SOURCE0}
    -V \        
    --local \       
    --install-dir $(pwd)/%{gem_dir} \       
    --force \       
    --rdoc \        
    %{SOURCE0}      
 %{?scl:"}

After f19.rb, see commit:

%{?scl:scl enable %{scl} "}
%gem_install -n %{SOURCE0}
%{?scl:"}        %{?scl:"}

This causes what appears to be a quoting issue:

Fixes this error:
+ scl enable ruby200 '
mkdir -p ./opt/rh/ruby200/root/usr/share/gems
CONFIGURE_ARGS=--with-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' ' gem install         -V         --local         --install-dir ./opt/rh/ruby200/root
'
Unable to open /etc/scl/prefixes/
mkdir -p ./opt/rh/ruby200/root/usr/share/gems

The fix was to clean up the quoting of the scl enable string to not use quotes and instead a heredoc:
Before:

%{?scl:scl enable %{scl} "}
%gem_install -n %{SOURCE0}
%{?scl:"}       

After(fixed), see commit

%{?scl:scl enable %scl - << \EOF}
 %gem_install -n %{SOURCE0}
%{?scl:EOF}

See full PR: ManageIQ/srpms#1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions