Open junaruga opened 3 years ago
You're right, if we stick to this formatting.
The lines 60 and 70 are responsible for the double space. Could be resolved by writing it like so. f.e.:
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
<%
unless spec.extensions.empty? -%>
Or any other adjustment which changes one of those empty lines to either end with -%>
or start with <%
.
The problem is that the template tags are expanded into empty lines and AFAIK, using ERB, there is no way to get easily rid of them. In theory they could be remove for the price of worse template readability, what is not win either.
I do not think so. You can see https://puppet.com/docs/puppet/5.5/lang_template_erb.html . -%>
trims 1 line break after -%>
. I see the reason is simply how to write the template is not correct. I sent a PR.
-%> — If the tag ends a line, trim the following line break.
The current gem2rpm creates 2 empty lines between
cp -a
andmkdir -p
for a generated spec file.As a result on the following PR line 13, the 2 lines is changed to 1 line. https://src.fedoraproject.org/rpms/rubygem-rack/pull-request/3#request_diff
1 empty line is better for the template than 2 empty lines, isn't it?
Here is the log for rubygem-rack.