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

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

    <bug>
          <bug_id>50149</bug_id>
          
          <creation_ts>2024-04-24 19:01:44 +0300</creation_ts>
          <short_desc>%pretrans scripts are not shown</short_desc>
          <delta_ts>2024-05-03 15:19:18 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Infrastructure</classification>
          <product>Infrastructure</product>
          <component>packages.altlinux.org</component>
          <version>unspecified</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="Arseny Maslennikov">arseny</reporter>
          <assigned_to name="Danil Shein">dshein</assigned_to>
          <cc>glebfm</cc>
    
    <cc>ldv</cc>
          
          <qa_contact name="Andrey Cherepanov">cas</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>245353</commentid>
    <comment_count>0</comment_count>
    <who name="Arseny Maslennikov">arseny</who>
    <bug_when>2024-04-24 19:01:44 +0300</bug_when>
    <thetext>https://packages.altlinux.org/en/sisyphus/binary/filesystem/x86_64/scripts/3064974635408237436

Не вижу скрипта.

Ожидаемое поведение: в пакете есть скрипт %pretrans.

Для сравнения, вот как это видит наш rpm:
  # rpm -qp --scripts /var/cache/apt/archives/filesystem_3.1-alt1%3asisyphus+345302.300.2.1@1713620017_x86%5f64.rpm
  pretrans scriptlet (using &lt;lua&gt;):
  migrate = false
  if posix.stat(&quot;/usr&quot;) then
    -- See if we need to migrate to merged-usr.
    for i, d in pairs({
  &quot;/bin&quot;,
  &quot;/sbin&quot;,
  &quot;/lib&quot;,
  &quot;/lib64&quot;,
  &quot;/libx32&quot;,
  }) do
      local dt = posix.stat(d, &quot;type&quot;)
      if dt == &quot;directory&quot; then
        migrate = true
      end
    end
  end
  
  if migrate then
    -- We cannot use built-in print in case standard output
    -- is not line-buffered, e. g. points to a file.
    -- We know the shell is available at this point, so use it
    -- to print log lines.
    function print_l(s)
      os.execute(&apos;printf &quot;%s: %s\n&quot; &quot;filesystem-3.1-alt1&quot; &quot;&apos; .. s .. &apos;&quot;&apos;)
    end
    print_l(&quot;Migration is needed before the package can be installed.&quot;)
    hier_convert_prog = &quot;/usr/libexec/usrmerge/hier-convert&quot;
    if not posix.stat(hier_convert_prog) then
      error(&quot;Looks like usrmerge-hier-convert is not installed. Aborting.&quot;)
    end
    print_l(&quot;Starting usrmerge-hier-convert...&quot;)
    assert(os.execute(hier_convert_prog))
  end</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>245404</commentid>
    <comment_count>1</comment_count>
    <who name="Danil Shein">dshein</who>
    <bug_when>2024-04-25 13:05:19 +0300</bug_when>
    <thetext>Действительно, в настоящий момент в БД сохраняются только скрипты из тэгов:
RPMTAG_PREIN
RPMTAG_POSTIN
RPMTAG_PREUN
RPMTAG_POSTUN

Скрипты из тэгов:
RPMTAG_PRETRANS
RPMTAG_POSTTRANS
не обрабатываются.

Необходима модификация структуры БД, кода парсера RPM пакетов, запросов к АПИ и отображения на фронте.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>245792</commentid>
    <comment_count>2</comment_count>
    <who name="Danil Shein">dshein</who>
    <bug_when>2024-05-03 15:19:18 +0300</bug_when>
    <thetext>исправлено в altrepodb v2.14.0 и altrepo-api v1.18.2

в ближайшее время версии с исправлениями будут развёрнуты на проде</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>