sclorg / spec2scl

MIT License
7 stars 7 forks source link

Make spec2scl aware of scriptlet runtime sections #36

Closed mbooth101 closed 6 years ago

mbooth101 commented 7 years ago

Ensures correct sclisation of spec files that contain scriptlet sections such as %pre and %post

Previously, if your spec contained, for example:

%install
install_stuff

%postun
do_stuff

%files

Then spec2scl would incorrectly transform it to this:


%install
%{?scl:scl enable %{scl} - << \EOF}
set -ex
install_stuff

%postun
do_stuff
%{?scl:EOF}

%files

Which clearly breaks both scriptlets due to missing EOF in %install and an extra EOF in %postun. This change teaches spec2scl about all the scriptlets so they can transformed correctly.

Additional test case parameter is also added.

irushchyshyn commented 6 years ago

Thanks!