From: Alexey Tourbin <at@altlinux.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] Q: contents_index content ?
Date: Fri, 3 Oct 2008 08:33:09 +0400
Message-ID: <20081003043309.GE6399@altlinux.org> (raw)
In-Reply-To: <48E33830.5010508@altlinux.org>
[-- Attachment #1.1: Type: text/plain, Size: 1233 bytes --]
On Wed, Oct 01, 2008 at 12:43:28PM +0400, Vitaly Ostanin wrote:
> Скажите, а как создаются файлы contents_index в
> репозиториях и с какой целью?
Создаются в /usr/bin/sisyphus_gen_contents,
используются в /usr/lib/rpm/find-package с целью
отображения пути файла в имя зависимости.
> То, что они содержат кучу строк вида
> /file /file
> вместо
> /file package
> , ещё терпимо, пакеты можно выдрать из
> pkglist апта.
Запись '/file /file', означает, что файл принадлежт более чем одному
пакету (то есть двум или более пакетам с разными названиями). Поэтому
отображение файл -> зависимость принимает вид файл0 -> файл0.
> Но вот в пакете service есть каталог
> /etc/rc.d/init.d. А в contents_index (Sisyphus/i586/base) записи
> об этом нет. Так и должно быть?
$ fgrep $'/etc/rc.d/init.d\t' /ALT/Sisyphus/i586/base/contents_index
/etc/rc.d/init.d /etc/rc.d/init.d
$
Каталогом /etc/rc.d/init.d владеют несколько пакетов.
$ bzcat /ALT/Sisyphus/i586/base/pkglist.classic.bz2 |./pkglist-query '[%{FILENAMES}\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
$
[-- Attachment #1.2: pkglist-query.c --]
[-- Type: text/plain, Size: 731 bytes --]
#include <rpmlib.h>
#include <stdio.h>
///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: */
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-10-03 4:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-01 8:43 Vitaly Ostanin
2008-10-03 4:33 ` Alexey Tourbin [this message]
2008-10-03 6:18 ` Slava Semushin
2008-10-03 6:56 ` Alexey Gladkov
2008-10-03 7:15 ` Alexey Tourbin
2008-10-03 7:31 ` Alexey Gladkov
2008-10-03 7:42 ` Alexey Tourbin
2008-10-04 6:13 ` Vitaly Ostanin
2008-10-04 8:16 ` Slava Semushin
2008-10-04 8:29 ` Vitaly Ostanin
2008-10-06 8:35 ` Vitaly Ostanin
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=20081003043309.GE6399@altlinux.org \
--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