From: Alexey Tourbin <at@altlinux.ru> To: ALT Linux Team development discussions <devel@lists.altlinux.org> Subject: Re: [devel] contents_index provides (rxvt-unicode vs xinitrc) Date: Mon, 10 Mar 2008 17:31:48 +0300 Message-ID: <20080310143148.GO24653@solemn.turbinal> (raw) In-Reply-To: <20080310103745.GM24653@solemn.turbinal> [-- Attachment #1: Type: text/plain, Size: 4401 bytes --] On Mon, Mar 10, 2008 at 01:37:45PM +0300, Alexey Tourbin wrote: > On Mon, Mar 10, 2008 at 01:17:55PM +0300, Alexey Tourbin wrote: > > Собственно, если бы при сборке пакета xinitrc в сборочном чруте > > стоял хотя бы один из пакетов с альтернативой xvt, то зависимость > > на /usr/bin/xvt появилась бы автоматиически. > > > > $ rpm -ql xinitrc |xargs grep -w xvt > > /etc/X11/Xsession: export BROWSER="xvt -e $n" > > /usr/bin/runwm: echo "xvt -geometry 100x25+0+0 $@" > > /usr/bin/runwm: xvt -geometry 100x25+0+0 & > > $ /usr/lib/rpm/shell.req -v /usr/bin/runwm > > shell.req: /usr/bin/runwm: cat -> /bin/cat -> coreutils (via contents_index_bin) > > coreutils > > shell.req: /usr/bin/runwm: xvt -> /usr/bin/xvt -> ... (via host_env) > > shell.req: /usr/bin/runwm: /usr/bin/xvt -> /usr/bin/xvt -> /usr/bin/xvt (alternative) > > /usr/bin/xvt > > $ > > > > То есть здесь проблема в том, что /usr/bin/xvt отсутствует в > > contents_index (потому что альтернатива на запакована как файл в пакете, > > а создаётся только после установки). Поэтому остаётся искать > > /usr/bin/xvt только в хост-системе. И, таким образом, при сборке > > в хешере зависимость на /usr/bin/xvt теряется. > > /ALT/beehive/success/xinitrc-2.4.28-alt1: > 121 find-requires: running scripts (files,lib,pam,perl,pkgconfig,pkgconfiglib,python,shebang,shell,static,symlinks) > 122 shell.req: /usr/src/tmp/xinitrc-buildroot/usr/bin/runwm: xvt not found (skip) > > > Я вот думаю, стоит ли дополнить contents_index альтернативами. > > Точнее, если какой-либо путь предоставляется пакетом, но не запакован > в нём, то в contents_index можно добавлять mapping путь -> путь. > Альтернативы в таком случае являются частным случаем этого > правила. Другой случай -- /usr/bin/python. Короче, я подготовил новую версию пакета sisyphus, который используется для генерации репозитария (в том числе и для генерации contents_index). Теперь у пакета xinitrc должна появиться автоматическая зависимость на /usr/bin/xvt. Вот основное изменение. commit 923a806dd766aee0eeac505e18a1b3189af6aa8e Author: Alexey Tourbin <at@altlinux> Date: Mon Mar 10 16:46:18 2008 +0300 sisyphus_gen_contents: do alternatives-like virtual paths Consider xinitrc package, which cannot resolve "xvt" dependency: shell.req: /usr/src/tmp/xinitrc-buildroot/usr/bin/runwm: xvt not found (skip) This is because /usr/bin/xvt is an alternative, and it has not been listed in contens_index_bin. Also note that /usr/bin/xvt did not exist in hasher chroot, that's why fallback to host-system lookup did not work, too. We've simply lost the dependency. To fix this, we need to list alternatives-like virtual paths in contents_index files. A path is virtual iff it is not packaged but explicitly provided by the package. Virutal paths should always map to themselves, because most of them are alternatives (if there is only one package in the repo that provides some alternative, we still want file-level dependency on the alternative). diff --git a/bin/sisyphus_gen_contents b/bin/sisyphus_gen_contents index 84d3ac1..7de6b82 100644 --- a/bin/sisyphus_gen_contents +++ b/bin/sisyphus_gen_contents @@ -47,18 +47,28 @@ WORKDIR="$(mktemp -d -t "$PROG.XXXXXXXXXX")" find -mindepth 1 -maxdepth 1 -name \*.rpm -print0 | xargs -r0 rpmquery -p --qf '[%{FILENAMES}\t%{NAME}\n]' -- | fgrep -v ' ' | - sort -u >"$WORKDIR"/list + sort -u >"$WORKDIR"/f-list + +# generate path-like provides list. +find -mindepth 1 -maxdepth 1 -name \*.rpm -print0 | + xargs -r0 rpmquery -p --qf '[%{PROVIDENAME}\t%{NAME}\n]' -- | + grep '^/' | + fgrep -v ')' | + fgrep -v ' ' | + sort -u >"$WORKDIR"/p-list cd "$WORKDIR" -# find dups. -cut -f1 <list | +# find file dups. +cut -f1 <f-list | uniq -c | - awk '{if ($1 != "1") printf("%s\t%s\n",$2,$2)}' >dups + awk '{if ($1 != "1") printf("%s\t%s\n",$2,$2)}' >f-dups + +# generate alternatives-like virtual path list. +comm -13 f-list p-list >vp-list -# find uniquie lines. -cut -f1 dups | - join -v1 list - | - tr -s ' ' '\t' >uniq +# virtual paths should always map to themselves. +cut -f1 <vp-list | + awk '{printf("%s\t%s\n",$1,$1)}' >vp-force-dups -sort -u dups uniq +sort -u -k1,1 vp-force-dups f-dups f-list [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-03-10 14:31 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-03-09 18:00 [devel] Q: rxvt-unicode vs xinitrc Евгений Терешков 2008-03-09 18:35 ` Alexey Gladkov 2008-03-09 19:28 ` Евгений Терешков 2008-03-10 3:46 ` Alexey Tourbin 2008-03-10 6:30 ` Andrey Rahmatullin 2008-03-10 9:54 ` Евгений Терешков 2008-03-10 10:17 ` [devel] contents_index provides (rxvt-unicode vs xinitrc) Alexey Tourbin 2008-03-10 10:37 ` Alexey Tourbin 2008-03-10 14:31 ` Alexey Tourbin [this message] 2008-03-10 17:44 ` Евгений Терешков 2008-03-11 8:22 ` [devel] alternatives provides (contents_index provides) Alexey Tourbin 2008-03-11 8:53 ` Alexey I. Froloff 2008-03-11 9:13 ` Alexey Tourbin 2008-03-11 10:23 ` Sergey Bolshakov
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=20080310143148.GO24653@solemn.turbinal \ --to=at@altlinux.ru \ --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