<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>44643</bug_id>
          
          <creation_ts>2022-12-15 14:54:35 +0300</creation_ts>
          <short_desc>Optimize /usr/lib/rpm/tex.req.files</short_desc>
          <delta_ts>2022-12-20 17:06:07 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>rpm-build-tex</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan A. Melnikov">iv</reporter>
          <assigned_to name="viy">viy</assigned_to>
          <cc>viy</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>218955</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2022-12-15 14:54:35 +0300</bug_when>
    <thetext>Некоторые пакеты, свои и чужие, я собираю вне хешера, на системе, где есть и сборочные зависимости других пакетов. Иногда я замечаю, что FindRequires/FindProvides как-то непривычно тормозит, а вот сегодня завершения работы /usr/lib/rpm/tex.req.files над boost-devel-headers я вообще не дождался.  Простое

 rpm -ql boost-devel-headers | /usr/lib/rpm/tex.prov.files

заняло больше 5 минут.

Да, в boost-devel-headers сейчас 13258 файлов и каталогов, поэтому не удивительно, что shell не очень быстро это пережёввывает. Однако можно внести в usr/lib/rpm/tex.prov.files простое изменение, которое приведёт к быстрому ответу &quot;нет&quot; для тех файлов, которые к tex явно не имеют никакого отношения. Например:

@@ -44,7 +44,7 @@ CheckPath()
         test ${1#${RPM_BUILD_ROOT-}${RPM_TEXMFMAIN:-/usr/share/texmf}-dist/tex/} != &quot;$1&quot;
 }

-while IFS=$&apos;\t&apos; read -r f t; do
+grep -F &apos;/tex/&apos; | while IFS=$&apos;\t&apos; read -r f t; do
     if CheckExt &quot;$f&quot; &amp;&amp; CheckPath &quot;$f&quot;; then
        echo &quot;$f&quot;
     fi


И, без наблюдаемых изменений в логике пакета, мы получим:

$ time sh -c  &apos;rpm -ql boost-devel-headers | /usr/lib/rpm/tex.prov.files&apos;
0.05user 0.01system 0:00.05elapsed 115%CPU (0avgtext+0avgdata 13152maxresident)k
0inputs+0outputs (0major+3151minor)pagefaults 0swaps

и я смогу дождаться завершения сборки буста. Нельзя ли внести какое-нибудь такое изменение в /usr/lib/rpm/tex.prov.files?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>219296</commentid>
    <comment_count>1</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2022-12-20 17:00:52 +0300</bug_when>
    <thetext>rpm-build-tex-0.4.5-alt1 -&gt; sisyphus:

 Tue Dec 20 2022 Igor Vlasenko &lt;viy@altlinux&gt; 0.4.5-alt1
 - optimized tex.(req/prov).files (closes: #44643)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>219297</commentid>
    <comment_count>2</comment_count>
    <who name="viy">viy</who>
    <bug_when>2022-12-20 17:06:07 +0300</bug_when>
    <thetext>Добавил grep.
В принципе, если все равно достаточно долго, можно на C написать простой
универсальный helper для rpm/*prov.files и rpm/*req.files
опции --prefix (colon separated prefix) --ext (colon separated extencions)
такое пригодится и для других rpm-build-*.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>