RPM Community Forums

Mailing List Message of <rpm-devel>

tagNum and fpNum

From: Alexey Tourbin <at@altlinux.ru>
Date: Fri 29 Aug 2008 - 20:52:33 CEST
Message-ID: <20080829185233.GV6477@altlinux.org>
rpmdb/rpmdb.h:
    63  struct _dbiIndexItem {
    64      rpmuint32_t hdrNum;                 /*!< header instance in db */
    65      rpmuint32_t tagNum;                 /*!< tag index in header */
    66      rpmuint32_t fpNum;                  /*!< finger print index */
    67  };

Please explain what is tagNum and how it is used.
(I just need to understand the coder better.)

Here is some reverse engeneering (against older rpmdb,
actually created with rpm-4.0.4+).  
$ ./rpm -qa --qf '%{NAME}\t%{DBINSTANCE}\n' |grep -w perl-base
perl-base       1068
$

Package perl-base is instance #1068.

$ rpm -q --qf '[%{BASENAMES}\t%{FILENAMES}\n]' perl-base |cat -n |awk '{$1--}($2=="perl5")'   
0 perl5 /etc/perl5
2 perl5 /usr/bin/perl5
9 perl5 /usr/lib/perl5
$

Package perl-base have 3 entries for "perl5" basename.

$ perl -MDB_File -le 'tie %db, "DB_File", "/var/lib/rpm/Basenames", 0 and print join ",", unpack "I*", $db{perl5}'
707,165,775,0,800,14,1068,0,1068,2,1068,9
$

We can see (1068,0), (1068,2), and (1068,9) pairs.
Okay, perhaps I can understand what tagNum is.

What is fpNum then?


  • application/pgp-signature attachment: stored
Received on Fri Aug 29 20:53:15 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.