Add (and use) rpmfiles counterpart for rpmfiColor()

This commit is contained in:
Panu Matilainen 2013-11-08 09:43:22 +02:00
parent c29ce0dcc0
commit dbc2ed980a
2 changed files with 11 additions and 4 deletions

View File

@ -445,19 +445,24 @@ rpm_ino_t rpmfilesFInode(rpmfiles fi, int ix)
return finode;
}
rpm_color_t rpmfiColor(rpmfi fi)
rpm_color_t rpmfilesColor(rpmfiles files)
{
rpm_color_t color = 0;
if (fi != NULL && fi->files->fcolors != NULL) {
for (int i = 0; i < fi->files->fc; i++)
color |= fi->files->fcolors[i];
if (files != NULL && files->fcolors != NULL) {
for (int i = 0; i < files->fc; i++)
color |= files->fcolors[i];
/* XXX ignore all but lsnibble for now. */
color &= 0xf;
}
return color;
}
rpm_color_t rpmfiColor(rpmfi fi)
{
return (fi != NULL) ? rpmfilesColor(fi->files) : 0;
}
rpm_color_t rpmfilesFColor(rpmfiles fi, int ix)
{
rpm_color_t fcolor = 0;

View File

@ -151,6 +151,8 @@ rpmfi rpmfilesIter(rpmfiles files, int flags);
int rpmfilesDigestAlgo(rpmfiles fi);
rpm_color_t rpmfilesColor(rpmfiles files);
/* Temporary ugly kludge to eliminate direct struct rpmfi access... */
void rpmfiSetApath(rpmfi fi, char **apath);