rpm-software-management / spec-cleaner

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

performance: 'cleaning' bundle-lang-other.spec takes considerable amount of time #183

Closed DimStar77 closed 7 years ago

DimStar77 commented 7 years ago

While working on bundle-lang-common, I realized that running spec-cleaner over bundle-lang-other.spec in this package takes a considerable amount of time (in the region of 15 - 30 minutes)

and the spec looks even really trivial compared to the other 3 spec files in this package:

Name:           bundle-lang-other
Version:        13.2
Release:        0
Summary:        Translations for languages not covered by one of the bundle-lang-*-* packages
License:        MIT
Group:          System/GUI/KDE
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Provides:       locale(aa;af;am;ang;as;az;be;bg;bn;bo;br;bs;byn)
Provides:       locale(csb;cy;dv;dz;ee;eo;et;eu)
Provides:       locale(fa;fo;fy;ga;gd;gez;gl;gn;gu;gv;haw;he;hi;hr)
Provides:       locale(hy;ia;id;is;iu;ka;kk;kl;km)
Provides:       locale(kn;kok;ku;kw;ky;lg;li;lo;lt;lv;mg;mi;mk;ml;mn;mr;ms;mt;my;nds;ne)
Provides:       locale(nn;nso;oc;om;or;pa;ps;rm;ro)
Provides:       locale(rw;sa;se;si;sid;sk;sl;so;sp;sq;sr)
Provides:       locale(ss;st;sw;syr;ta;te;tg;th;ti;tig;tk;tl;tr;tt;ug;uk;ur;urd;uz)
Provides:       locale(ve;ven;vi;wa;wal;wo;xh;yi;yo;zu)
Source0:        README.other

%description
This package collects translations for languages not covered by one of
the bundle-lang-*-* packages.

%prep

%build

%install
install -D -m 644 %{SOURCE0} $RPM_BUILD_ROOT%_docdir/%name/README

%files
%defattr(-,root,root)
%_docdir/%name

%changelog

to reproduce, simply pasted this into a .spec file and run spec-cleaner over it (it does not have to be related to the bundle-lang-common package)

scarabeusiv commented 7 years ago

This is caused by the dependency_parser.py the matching is simply too slow for this it seems.

I guess we really should just match the brackets and skip. @sleep-walker could you please take look on this.

scarabeusiv commented 7 years ago

Actually this is duplicate of #181

DimStar77 commented 7 years ago

confirmed - monkey patched my local install of spec-cleaner and this spec now passes in:

real    0m0.663s
user    0m0.632s
sys 0m0.024s