From: Alexey Tourbin <alexey.tourbin@gmail.com>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] Утилиты для работы с setversions?
Date: Sat, 26 Oct 2019 17:17:25 +0300
Message-ID: <CA+qzenmQtq7HVeBTbvrR8h0z=9A88Qk4tcpORudA5-UPR5kEQw@mail.gmail.com> (raw)
In-Reply-To: <20191026163106.f46ebfad9db83685236b56a1@altlinux.org>
[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]
On Sat, Oct 26, 2019 at 4:31 PM Andrey Savchenko <bircoph@altlinux.org> wrote:
> Добрый день!
>
> Есть ли у нас утилиты для работы с set versions? На вики ничего
> не нашёл. Мне нужно развернуть set:<hash_array> в список символов.
> Понятно, что для этого нужны бинарники, они в пакете есть.
Set-версия состоит из упорядоченного набора bpp-битных хешей (а
кодируются дельты между хешами). Хеши можно получить через закрытое
API, которое доступно через только через #include "set.c". Прикрепил
пример.
$ rpm -q --provides glibc-core |grep 'libdl.*set'
libdl.so.2()(64bit) = set:hdBjS1I4gQ8BohwImELo8Zh
$ ./a.out set:hdBjS1I4gQ8BohwImELo8Zh
0272
0a8f
12b4
1f1c
1fb0
23f5
31a1
3571
35d3
3bcb
> Ещё было бы полезно знать, как получить список символов для каждой
> библиотеки до вычисления хешей.
Список для Provides делается через /usr/lib/rpm/provided_symbols.
Список для Requires делается более сложным образом с использованием
/usr/lib/rpm/ldd.
[-- Attachment #2: printset.c --]
[-- Type: text/x-csrc, Size: 514 bytes --]
#include <stdio.h>
#include "set.c"
int main(int argc, char **argv)
{
assert(argc == 2);
const char *s = argv[1];
assert(strncmp(s, "set:", 4) == 0);
s += 4;
int bpp, m;
int rc = decode_set_init(s, &bpp, &m);
assert(rc == 0);
size_t len = strlen(s);
int n = decode_set_size(len, m);
assert(n > 0);
unsigned v[n];
n = decode_set(s, m, v);
assert(n > 0);
int w = (bpp + 3) / 4;
for (int i = 0; i < n; i++)
printf("%0*x\n", w, v[i]);
return 0;
}
next prev parent reply other threads:[~2019-10-26 14:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-26 13:31 Andrey Savchenko
2019-10-26 14:17 ` Alexey Tourbin [this message]
2019-10-26 15:10 ` Andrey Savchenko
2019-10-26 22:38 ` Alexey Tourbin
2019-10-26 22:47 ` Andrey Savchenko
2019-10-29 18:23 ` Andrey Savchenko
2019-10-30 2:04 ` Alexey Tourbin
2019-10-30 9:06 ` Andrey Savchenko
2019-10-30 10:46 ` Vladimir D. Seleznev
2019-10-30 11:38 ` Andrey Savchenko
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='CA+qzenmQtq7HVeBTbvrR8h0z=9A88Qk4tcpORudA5-UPR5kEQw@mail.gmail.com' \
--to=alexey.tourbin@gmail.com \
--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