From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 31 Aug 2006 08:05:05 +0400 From: Alexey Tourbin To: ALT Devel discussion list Message-ID: <20060831040505.GM11420@localhost.localdomain> Mail-Followup-To: ALT Devel discussion list References: <20060830151053.GB11420@localhost.localdomain> <20060830152946.GC30667@basalt.office.altlinux.org> <20060830160036.GC11420@localhost.localdomain> <20060830161050.GA31919@basalt.office.altlinux.org> <20060830162849.GD11420@localhost.localdomain> <20060830164352.GA32596@basalt.office.altlinux.org> <20060830201207.GE10840@procyon.home> <20060830210106.GH11420@localhost.localdomain> <20060830224851.GI11420@localhost.localdomain> <20060830231937.GJ11420@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oiL9LJXJsdjS5rzq" Content-Disposition: inline In-Reply-To: <20060830231937.GJ11420@localhost.localdomain> Subject: Re: [devel] =?koi8-r?b?z9DUyc3J2sHDydEg08LP0s/eztnIINrB18nTyc3P09TF?= =?koi8-r?b?yg==?= X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.7 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Aug 2006 04:05:06 -0000 Archived-At: List-Archive: List-Post: --oiL9LJXJsdjS5rzq Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 31, 2006 at 03:19:37AM +0400, Alexey Tourbin wrote: > On Thu, Aug 31, 2006 at 02:48:51AM +0400, Alexey Tourbin wrote: > > $ cat ./optimize_package_list > > #!/bin/sh -ef > > . tmpdir.sh > > cd $TMPDIR > > rpm -q --qf '[%{REQUIRENAME}\t%{NAME}\n]' -- "$@" >qR > > rpm -q --qf '[%{PROVIDENAME}\t%{NAME}\n]' -- "$@" >qP > > awk '{print$2,$1}' qR |sort -u -k2,2 -k1,1 -o qR > > awk '{print$2,$1}' qP |sort -u -k2,2 -k1,1 -o qP > > #head -v qR qP > > join -j 2 -o '1.1 2.1' qR qP |sort -u >p2p > > tsort p2p >tsorted || [ -s tsorted ] > > #head -v p2p tsorted > > set -- `cat tsorted` > > for i in `seq 1 $(($#-1))`; do > > eval master=3D"\$$i" >=20 > =EB =D3=CF=D6=C1=CC=C5=CE=C9=C0 =C4=CC=D1 i>9 =DC=D4=C1 =CB=CF=CE=D3=D4= =D2=D5=CB=C3=C9=D1 =CE=C5 =D2=C1=C2=CF=D4=C1=C5=D4. > =F4.=C5. i=3D$10 =D7=CF=D3=D0=D2=C9=CE=C9=CD=C1=C5=D4=D3=D1 =DB=C5=CC=CC= =CF=CD =CB=C1=CB i=3D${1}0 =C9 =D4.=C4. > =F4=CF =C5=D3=D4=D8 =D3=CB=D2=C9=D0=D4 =CD=CF=D6=C5=D4 =CC=C1=D6=C1=D4=D8= =D3=D1 =D0=D2=C9 =DE=C9=D3=CC=C5 =C1=D2=C7=D5=CD=C5=CE=D4=CF=D7 10 =C9 =C2= =CF=CC=C5=C5. > =F7=C5=D3=D8 =DC=D4=CF=D4 =D7=CC=CF=D6=C5=CE=CE=D9=CA =C3=C9=CB=CC =CE=D5= =D6=CE=CF =D0=C5=D2=C5=D0=C9=D3=C1=D4=D8 =CE=C1 awk =C9=CC=C9 =CE=C1 =D0=C5= =D2=CC=C5. :) --- optimize_package_list- 2006-08-30 23:31:38 +0000 +++ optimize_package_list 2006-08-31 04:00:46 +0000 @@ -9,17 +9,25 @@ awk '{print$2,$1}' qP |sort -u -k2,2 -k1 join -j 2 -o '1.1 2.1' qR qP |sort -u >p2p tsort p2p >tsorted || [ -s tsorted ] #head -v p2p tsorted -set -- `cat tsorted` -for i in `seq 1 $(($#-1))`; do - eval master=3D"\$$i" - for j in `seq $((i+1)) $#`; do - eval slave=3D"\$$j" - if grep -qs -Fx "$master $slave" p2p; then - #echo master=3D$master slave=3D$slave >&2 - echo "$slave" - fi - done -done >extrareq +awk -f - p2p >extrareq <<'EOF' +BEGIN { # process tsorted + while (getline <"tsorted") + tsorted[++N] =3D $1 +} +{ # process p2p + p2p[$1,$2] =3D 1 +} +END { # output unneeded reqs + for (i =3D 1; i < N; i++) { + master =3D tsorted[i] + for (j =3D i+1; j <=3D N; j++) { + slave =3D tsorted[j] + if (p2p[master,slave]) + print slave + } + } +} +EOF sort -o extrareq -u extrareq awk '{print$1}' qR |sort -u >req #head -v req extrareq --oiL9LJXJsdjS5rzq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFE9l/xfBKgtDjnu0YRAok/AKDRwxRwTe0tpaWlEUztlNj7JNPc0wCgqRn+ sIkCX+9o6AmJHwpGz/yIISw= =N+/+ -----END PGP SIGNATURE----- --oiL9LJXJsdjS5rzq--