Skip to content

Commit

Permalink
Replace the shebangs of the ruby executables
Browse files Browse the repository at this point in the history
We're replacing all shebangs of the several ruby executables with the
defined ruby interpreted set in the obs-bundled-gems.spec

Co-authored-by: Henne Vogelsang <hvogel@opensuse.org>
  • Loading branch information
danidoni and hennevogel committed Mar 14, 2022
1 parent 5f8d3e1 commit eecc388
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dist/obs-bundled-gems.spec
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,16 @@ rm -rf %{buildroot}%_libdir/obs-api/ruby/*/gems/selenium-webdriver-*/lib/seleniu
# remove all gitignore files to fix rpmlint version-control-internal-file
find %{buildroot}%_libdir/obs-api -name .gitignore | xargs rm -rf

# fix interpreter in installed binaries
# use the ruby interpreter set by this spec file in all installed binaries.
for bin in %{buildroot}%_libdir/obs-api/ruby/*/bin/*; do
sed -i -e 's,/usr/bin/env ruby.ruby3.1,%{__obs_ruby_interpreter},' $bin
sed -i -e 's,/usr/bin/env ruby,%{__obs_ruby_interpreter},' $bin
sed -i -e 's,/usr/bin/ruby,%{__obs_ruby_interpreter},' $bin
done
for bin in %{buildroot}%_libdir/obs-api/ruby/*/gems/*/bin/*; do
sed -i -e 's,/usr/bin/env ruby.ruby3.1,%{__obs_ruby_interpreter},' $bin
sed -i -e 's,/usr/bin/env ruby,%{__obs_ruby_interpreter},' $bin
sed -i -e 's,/usr/bin/ruby,%{__obs_ruby_interpreter},' $bin
done

# remove exec bit from all other files still containing /usr/bin/env - mostly helper scripts
Expand Down

0 comments on commit eecc388

Please sign in to comment.