From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 10 Mar 2008 17:31:48 +0300 From: Alexey Tourbin To: ALT Linux Team development discussions Message-ID: <20080310143148.GO24653@solemn.turbinal> Mail-Followup-To: ALT Linux Team development discussions References: <20080310034622.GH24653@solemn.turbinal> <20080310101755.GL24653@solemn.turbinal> <20080310103745.GM24653@solemn.turbinal> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="B3NBd8mrXZtPJEYR" Content-Disposition: inline In-Reply-To: <20080310103745.GM24653@solemn.turbinal> Subject: Re: [devel] contents_index provides (rxvt-unicode vs xinitrc) X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.10b3 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2008 14:31:49 -0000 Archived-At: List-Archive: List-Post: --B3NBd8mrXZtPJEYR Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: > > =F3=CF=C2=D3=D4=D7=C5=CE=CE=CF, =C5=D3=CC=C9 =C2=D9 =D0=D2=C9 =D3=C2=CF= =D2=CB=C5 =D0=C1=CB=C5=D4=C1 xinitrc =D7 =D3=C2=CF=D2=CF=DE=CE=CF=CD =DE=D2= =D5=D4=C5 > > =D3=D4=CF=D1=CC =C8=CF=D4=D1 =C2=D9 =CF=C4=C9=CE =C9=DA =D0=C1=CB=C5=D4= =CF=D7 =D3 =C1=CC=D8=D4=C5=D2=CE=C1=D4=C9=D7=CF=CA xvt, =D4=CF =DA=C1=D7=C9= =D3=C9=CD=CF=D3=D4=D8 > > =CE=C1 /usr/bin/xvt =D0=CF=D1=D7=C9=CC=C1=D3=D8 =C2=D9 =C1=D7=D4=CF=CD= =C1=D4=C9=C9=DE=C5=D3=CB=C9. > >=20 > > $ rpm -ql xinitrc |xargs grep -w xvt=20 > > /etc/X11/Xsession: export BROWSER=3D"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_i= ndex_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 > > $=20 > >=20 > > =F4=CF =C5=D3=D4=D8 =DA=C4=C5=D3=D8 =D0=D2=CF=C2=CC=C5=CD=C1 =D7 =D4=CF= =CD, =DE=D4=CF /usr/bin/xvt =CF=D4=D3=D5=D4=D3=D4=D7=D5=C5=D4 =D7 > > contents_index (=D0=CF=D4=CF=CD=D5 =DE=D4=CF =C1=CC=D8=D4=C5=D2=CE=C1= =D4=C9=D7=C1 =CE=C1 =DA=C1=D0=C1=CB=CF=D7=C1=CE=C1 =CB=C1=CB =C6=C1=CA=CC = =D7 =D0=C1=CB=C5=D4=C5, > > =C1 =D3=CF=DA=C4=C1=A3=D4=D3=D1 =D4=CF=CC=D8=CB=CF =D0=CF=D3=CC=C5 =D5= =D3=D4=C1=CE=CF=D7=CB=C9). =F0=CF=DC=D4=CF=CD=D5 =CF=D3=D4=C1=A3=D4=D3=D1 = =C9=D3=CB=C1=D4=D8 > > /usr/bin/xvt =D4=CF=CC=D8=CB=CF =D7 =C8=CF=D3=D4-=D3=C9=D3=D4=C5=CD=C5.= =E9, =D4=C1=CB=C9=CD =CF=C2=D2=C1=DA=CF=CD, =D0=D2=C9 =D3=C2=CF=D2=CB=C5 > > =D7 =C8=C5=DB=C5=D2=C5 =DA=C1=D7=C9=D3=C9=CD=CF=D3=D4=D8 =CE=C1 /usr/bi= n/xvt =D4=C5=D2=D1=C5=D4=D3=D1. >=20 > /ALT/beehive/success/xinitrc-2.4.28-alt1: > 121 find-requires: running scripts (files,lib,pam,perl,pkgconfig,pkgc= onfiglib,python,shebang,shell,static,symlinks) > 122 shell.req: /usr/src/tmp/xinitrc-buildroot/usr/bin/runwm: xvt not = found (skip) >=20 > > =F1 =D7=CF=D4 =C4=D5=CD=C1=C0, =D3=D4=CF=C9=D4 =CC=C9 =C4=CF=D0=CF=CC= =CE=C9=D4=D8 contents_index =C1=CC=D8=D4=C5=D2=CE=C1=D4=C9=D7=C1=CD=C9. >=20 > =F4=CF=DE=CE=C5=C5, =C5=D3=CC=C9 =CB=C1=CB=CF=CA-=CC=C9=C2=CF =D0=D5=D4= =D8 =D0=D2=C5=C4=CF=D3=D4=C1=D7=CC=D1=C5=D4=D3=D1 =D0=C1=CB=C5=D4=CF=CD, = =CE=CF =CE=C5 =DA=C1=D0=C1=CB=CF=D7=C1=CE > =D7 =CE=A3=CD, =D4=CF =D7 contents_index =CD=CF=D6=CE=CF =C4=CF=C2=C1=D7= =CC=D1=D4=D8 mapping =D0=D5=D4=D8 -> =D0=D5=D4=D8. > =E1=CC=D8=D4=C5=D2=CE=C1=D4=C9=D7=D9 =D7 =D4=C1=CB=CF=CD =D3=CC=D5=DE=C1= =C5 =D1=D7=CC=D1=C0=D4=D3=D1 =DE=C1=D3=D4=CE=D9=CD =D3=CC=D5=DE=C1=C5=CD = =DC=D4=CF=C7=CF > =D0=D2=C1=D7=C9=CC=C1. =E4=D2=D5=C7=CF=CA =D3=CC=D5=DE=C1=CA -- /usr/bin= /python. =EB=CF=D2=CF=DE=C5, =D1 =D0=CF=C4=C7=CF=D4=CF=D7=C9=CC =CE=CF=D7=D5=C0 =D7= =C5=D2=D3=C9=C0 =D0=C1=CB=C5=D4=C1 sisyphus, =CB=CF=D4=CF=D2=D9=CA =C9=D3= =D0=CF=CC=D8=DA=D5=C5=D4=D3=D1 =C4=CC=D1 =C7=C5=CE=C5=D2=C1=C3=C9=C9 =D2=C5=D0=CF=DA=C9=D4=C1=D2=C9=D1 (= =D7 =D4=CF=CD =DE=C9=D3=CC=C5 =C9 =C4=CC=D1 =C7=C5=CE=C5=D2=C1=C3=C9=C9 con= tents_index). =F4=C5=D0=C5=D2=D8 =D5 =D0=C1=CB=C5=D4=C1 xinitrc =C4=CF=CC=D6=CE=C1 =D0=CF= =D1=D7=C9=D4=D8=D3=D1 =C1=D7=D4=CF=CD=C1=D4=C9=DE=C5=D3=CB=C1=D1 =DA=C1=D7= =C9=D3=C9=CD=CF=D3=D4=D8 =CE=C1 /usr/bin/xvt. =F7=CF=D4 =CF=D3=CE=CF=D7=CE=CF=C5 =C9=DA=CD=C5=CE=C5=CE=C9= =C5. commit 923a806dd766aee0eeac505e18a1b3189af6aa8e Author: Alexey Tourbin Date: Mon Mar 10 16:46:18 2008 +0300 sisyphus_gen_contents: do alternatives-like virtual paths =20 Consider xinitrc package, which cannot resolve "xvt" dependency: shell.req: /usr/src/tmp/xinitrc-buildroot/usr/bin/runwm: xvt not found = (skip) =20 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 wor= k, too. We've simply lost the dependency. =20 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=3D"$(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 =20 cd "$WORKDIR" =20 -# find dups. -cut -f1 dups + awk '{if ($1 !=3D "1") printf("%s\t%s\n",$2,$2)}' >f-dups + +# generate alternatives-like virtual path list. +comm -13 f-list p-list >vp-list =20 -# find uniquie lines. -cut -f1 dups | - join -v1 list - | - tr -s ' ' '\t' >uniq +# virtual paths should always map to themselves. +cut -f1 vp-force-dups =20 -sort -u dups uniq +sort -u -k1,1 vp-force-dups f-dups f-list --B3NBd8mrXZtPJEYR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) iEYEARECAAYFAkfVRlQACgkQfBKgtDjnu0ZfBgCfaS6G8+P1Kawa2jCa9YxmhgB+ F0gAnisLrYLzzJZLDiQsK9Ezwy840h7j =jK5J -----END PGP SIGNATURE----- --B3NBd8mrXZtPJEYR--