From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 3 Oct 2008 08:33:09 +0400 From: Alexey Tourbin To: ALT Devel discussion list Message-ID: <20081003043309.GE6399@altlinux.org> Mail-Followup-To: ALT Devel discussion list References: <48E33830.5010508@altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3607uds81ZQvwCD0" Content-Disposition: inline In-Reply-To: <48E33830.5010508@altlinux.org> Subject: Re: [devel] Q: contents_index content ? 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: Fri, 03 Oct 2008 04:33:21 -0000 Archived-At: List-Archive: List-Post: --3607uds81ZQvwCD0 Content-Type: multipart/mixed; boundary="XStn23h1fwudRqtG" Content-Disposition: inline --XStn23h1fwudRqtG Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 01, 2008 at 12:43:28PM +0400, Vitaly Ostanin wrote: > =F3=CB=C1=D6=C9=D4=C5, =C1 =CB=C1=CB =D3=CF=DA=C4=C1=C0=D4=D3=D1 =C6=C1= =CA=CC=D9 contents_index =D7=20 > =D2=C5=D0=CF=DA=C9=D4=CF=D2=C9=D1=C8 =C9 =D3 =CB=C1=CB=CF=CA =C3=C5=CC=D8= =C0? =F3=CF=DA=C4=C1=C0=D4=D3=D1 =D7 /usr/bin/sisyphus_gen_contents, =C9=D3=D0=CF=CC=D8=DA=D5=C0=D4=D3=D1 =D7 /usr/lib/rpm/find-package =D3 =C3= =C5=CC=D8=C0 =CF=D4=CF=C2=D2=C1=D6=C5=CE=C9=D1 =D0=D5=D4=C9 =C6=C1=CA=CC=C1 =D7 =C9=CD= =D1 =DA=C1=D7=C9=D3=C9=CD=CF=D3=D4=C9. > =F4=CF, =DE=D4=CF =CF=CE=C9 =D3=CF=C4=C5=D2=D6=C1=D4 =CB=D5=DE=D5 =D3=D4= =D2=CF=CB =D7=C9=C4=C1 > /file /file > =D7=CD=C5=D3=D4=CF > /file package > , =C5=DD=A3 =D4=C5=D2=D0=C9=CD=CF, =D0=C1=CB=C5=D4=D9 =CD=CF=D6=CE=CF =D7= =D9=C4=D2=C1=D4=D8 =C9=DA=20 > pkglist =C1=D0=D4=C1. =FA=C1=D0=C9=D3=D8 '/file /file', =CF=DA=CE=C1=DE=C1=C5=D4, =DE=D4=CF =C6= =C1=CA=CC =D0=D2=C9=CE=C1=C4=CC=C5=D6=D4 =C2=CF=CC=C5=C5 =DE=C5=CD =CF=C4= =CE=CF=CD=D5 =D0=C1=CB=C5=D4=D5 (=D4=CF =C5=D3=D4=D8 =C4=D7=D5=CD =C9=CC=C9 =C2=CF=CC=C5= =C5 =D0=C1=CB=C5=D4=C1=CD =D3 =D2=C1=DA=CE=D9=CD=C9 =CE=C1=DA=D7=C1=CE=C9= =D1=CD=C9). =F0=CF=DC=D4=CF=CD=D5 =CF=D4=CF=C2=D2=C1=D6=C5=CE=C9=C5 =C6=C1=CA=CC -> =DA=C1=D7=C9=D3=C9=CD=CF= =D3=D4=D8 =D0=D2=C9=CE=C9=CD=C1=C5=D4 =D7=C9=C4 =C6=C1=CA=CC0 -> =C6=C1=CA= =CC0. > =EE=CF =D7=CF=D4 =D7 =D0=C1=CB=C5=D4=C5 service =C5=D3=D4=D8 =CB=C1=D4=C1= =CC=CF=C7=20 > /etc/rc.d/init.d. =E1 =D7 contents_index (Sisyphus/i586/base) =DA=C1=D0= =C9=D3=C9=20 > =CF=C2 =DC=D4=CF=CD =CE=C5=D4. =F4=C1=CB =C9 =C4=CF=CC=D6=CE=CF =C2=D9=D4= =D8? $ fgrep $'/etc/rc.d/init.d\t' /ALT/Sisyphus/i586/base/contents_index=20 /etc/rc.d/init.d /etc/rc.d/init.d $ =EB=C1=D4=C1=CC=CF=C7=CF=CD /etc/rc.d/init.d =D7=CC=C1=C4=C5=C0=D4 =CE=C5= =D3=CB=CF=CC=D8=CB=CF =D0=C1=CB=C5=D4=CF=D7. $ bzcat /ALT/Sisyphus/i586/base/pkglist.classic.bz2 |./pkglist-query '[%{FI= LENAMES}\t%{NAME}\n]' - |fgrep $'/etc/rc.d/init.d\t' /etc/rc.d/init.d 3proxy /etc/rc.d/init.d atslog /etc/rc.d/init.d ez-ipupdate /etc/rc.d/init.d service $=20 --XStn23h1fwudRqtG Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pkglist-query.c" #include #include ///extern int _rpmio_debug = 1; int main(int argc, const char *argv[]) { const char *progname = argv[0]; if (argc != 3) { fprintf(stderr, "Usage: %s QUERY pkglist", progname); exit(2); } const char *query = argv[1], *pkglist = argv[2]; FD_t Fd = Fopen(pkglist, "r"); if (Ferror(Fd)) { fprintf(stderr, "%s: %s: %s\n", progname, pkglist, Fstrerror(Fd)); exit(1); } Header h; while ((h = headerRead(Fd, HEADER_MAGIC_YES))) { char *str = headerSprintf(h, query, rpmTagTable, rpmHeaderFormats, NULL); if (str) { fputs(str, stdout); str = _free(str); } headerFree(h); } Fclose(Fd); return 0; } /* ex:set ts=8 sts=4 sw=4 noet: */ --XStn23h1fwudRqtG-- --3607uds81ZQvwCD0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkjloIUACgkQfBKgtDjnu0bDugCggkV4yGDug1E8OY5mOPSYOQ8E JgMAn0/XsqRaqyNf1ncd/JPmUJ/6s8/X =Y19s -----END PGP SIGNATURE----- --3607uds81ZQvwCD0--