Bug 50149 - %pretrans scripts are not shown
Summary: %pretrans scripts are not shown
Status: RESOLVED FIXED
Alias: None
Product: Infrastructure
Classification: Infrastructure
Component: packages.altlinux.org (show other bugs)
Version: unspecified
Hardware: x86_64 Linux
: P5 normal
Assignee: Danil Shein
QA Contact: Andrey Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-24 19:01 MSK by Arseny Maslennikov
Modified: 2024-05-03 15:19 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arseny Maslennikov 2024-04-24 19:01:44 MSK
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 <lua>):
  migrate = false
  if posix.stat("/usr") then
    -- See if we need to migrate to merged-usr.
    for i, d in pairs({
  "/bin",
  "/sbin",
  "/lib",
  "/lib64",
  "/libx32",
  }) do
      local dt = posix.stat(d, "type")
      if dt == "directory" 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('printf "%s: %s\n" "filesystem-3.1-alt1" "' .. s .. '"')
    end
    print_l("Migration is needed before the package can be installed.")
    hier_convert_prog = "/usr/libexec/usrmerge/hier-convert"
    if not posix.stat(hier_convert_prog) then
      error("Looks like usrmerge-hier-convert is not installed. Aborting.")
    end
    print_l("Starting usrmerge-hier-convert...")
    assert(os.execute(hier_convert_prog))
  end
Comment 1 Danil Shein 2024-04-25 13:05:19 MSK
Действительно, в настоящий момент в БД сохраняются только скрипты из тэгов:
RPMTAG_PREIN
RPMTAG_POSTIN
RPMTAG_PREUN
RPMTAG_POSTUN

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

Необходима модификация структуры БД, кода парсера RPM пакетов, запросов к АПИ и отображения на фронте.
Comment 2 Danil Shein 2024-05-03 15:19:18 MSK
исправлено в altrepodb v2.14.0 и altrepo-api v1.18.2

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