rpm-software-management / spec-cleaner

spec-cleaner
BSD 3-Clause "New" or "Revised" License
28 stars 34 forks source link

Bug in prefix replacement #201

Closed danimo closed 7 years ago

danimo commented 7 years ago

Problem description

Input:

%install
mkdir -p %{buildroot}/usr/sbin

expected output:

%install
mkdir -p %{buildroot}%{_sbindir}

actual output:

%install
mkdir -p %{buildroot}%{_prefix}/sbin

However, a few lines down, it correctly replaced the string inline

-ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcacmeresponder +ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcacmeresponder

I would therefore guess that the problem is the immediate line ending that is causing a bug.

Version

Name        : spec-cleaner
Version     : 0.9.8
Release     : 31.9.1
Architecture: noarch
Install Date: Mon 03 Jul 2017 09:49:01 AM CEST
Group       : Development/Tools/Other
Size        : 1917711
License     : BSD-3-Clause
Signature   : RSA/SHA256, Thu 29 Jun 2017 06:09:49 PM CEST, Key ID b88b2fd43dbdc284
Source RPM  : spec-cleaner-0.9.8-31.9.1.src.rpm
Build Date  : Thu 29 Jun 2017 06:09:42 PM CEST
Build Host  : wildcard3
Relocations : (not relocatable)
Packager    : http://bugs.opensuse.org
Vendor      : openSUSE
URL         : http://github.com/openSUSE/spec-cleaner
Summary     : .spec file cleaner
Description :
This script cleans spec file according to some arbitrary style guide. The
results it produces should always be checked by someone since it is not and
will never be perfect.
Distribution: openSUSE Leap 42.2
scarabeusiv commented 7 years ago

Good spot. I've added testcase and will check up what is causing it.