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 4452812 commit c36cdd0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dist/obs-bundled-gems.spec
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 c36cdd0

Please sign in to comment.