ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Arseny Maslennikov <arseny@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] Внезапные  post-install unowned files
Date: Thu, 11 Jul 2024 14:22:45 +0300
Message-ID: <Zo_AddUar5d6S6iz@cello> (raw)
In-Reply-To: <ZkNPpebdMCxpVSeI@cello>

[-- Attachment #1: Type: text/plain, Size: 2981 bytes --]

On Tue, May 14, 2024 at 02:48:53PM +0300, Arseny Maslennikov wrote:
> Date: Wed,  1 May 2024 23:45:47 +0300
> Message-ID: <20240501204548.25091-1-arseny@altlinux.org>
> Subject: [RFC PATCH girar.git] remote-check-install: temporarily fix unowned files reports
> 
> On merged-usr systems for each file path accessible under both /lib and
> /usr/lib, etc. `find /*` automatically optimizes away the /lib one. Many
> rpm packages contain files under /lib, though, and are reported by
> rpmquery as such, so the real file under /usr/lib is considered
> "unprovided".
> 
> For each path in the output of `(rpmquery -al; rpmquery -a --provides)`
> under a legacy directory alias, add a matching path under the prefix.
> The transformation will look like this:
>   % sed 's!^/\(bin\|lib\|lib32\|lib64\|libx32\|sbin\).\+!/usr&\n&!' <<____
>   /sbin/chroot
>   /bin/bash
>   ____
>   /usr/sbin/chroot
>   /sbin/chroot
>   /usr/bin/bash
>   /bin/bash
> 
> This way the new files under the prefix can never show up.
> 
> ---
>  gb/remote/gb-remote-check-install | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/gb/remote/gb-remote-check-install b/gb/remote/gb-remote-check-install
> index 5cac126..ac09c4f 100755
> --- a/gb/remote/gb-remote-check-install
> +++ b/gb/remote/gb-remote-check-install
> @@ -189,7 +189,10 @@ sort -u -o instprov{,}
>  hsh-run --rooter -- \
>  rpmquery -al >instfiles 2>>warnings
>  sed '/^(contains no files)$/d' -i warnings
> +# Temporary hack: for each entry in legacy aliased dirs,
> +# add its real location.
> +sed -i 's!^/\(bin\|lib\|lib32\|lib64\|libx32\|sbin\).\+!/usr&\n&!' instfiles
>  sort -u -o instfiles{,}
>  
>  sort -u instprov instfiles >instlist
>  comm -23 new-files instlist >unprovided
> -- 
> 2.42.1

Для unmerged-usr репозиториев такое решение в теории тоже подходит,
потому что, как видно из текста gb-remote-check-install далее, список
post-install unowned files получается из файла `unprovided`, т. е. не
содержит файлов, которые не оказались там по окончании процитированного
выше фрагмента.

В таком репозитории, если /bin/x есть, а /usr/bin/x нет, второй путь не
попадёт в `new-files`, но начнёт попадать в `instlist`. Следовательно,
не попадёт в `unprovided` и не повлияет на результат.

Если же мы не хотим таких допущений при формировании `instlist`, то
можно и усложнить: либо детектить merged-usr окружение, либо перед
включением па́рного файла в `instlist` проверять его фактическое наличие,
либо ещё что-то.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2024-07-11 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14 11:30 Sergey Afonin
2024-05-14 11:45 ` Arseny Maslennikov
2024-05-14 11:48   ` Arseny Maslennikov
2024-07-11 11:22     ` Arseny Maslennikov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zo_AddUar5d6S6iz@cello \
    --to=arseny@altlinux.org \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git