xx = hge(h, RPMTAG_ARCH, NULL, (void **)&arch, NULL);
os = NULL;
xx = hge(h, RPMTAG_OS, NULL, (void **)&os, NULL);
- hcolor = hGetColor(h);
+ hcolor = headerGetColor(h);
pkgKey = RPMAL_NOMATCH;
/* Check for supported payload format if it's a package */
while((oh = rpmdbNextIterator(mi)) != NULL) {
/* Ignore colored packages not in our rainbow. */
- ohcolor = hGetColor(oh);
+ ohcolor = headerGetColor(oh);
if (tscolor && hcolor && ohcolor && !(hcolor & ohcolor))
continue;
while((oh = rpmdbNextIterator(mi)) != NULL) {
/* Ignore colored packages not in our rainbow. */
- ohcolor = hGetColor(oh);
+ ohcolor = headerGetColor(oh);
/* XXX provides *are* colored, effectively limiting Obsoletes:
to matching only colored Provides: based on pkg coloring. */
if (tscolor && hcolor && ohcolor && !(hcolor & ohcolor))
*/
if (rpmdsEVR(obsoletes) == NULL
|| rpmdsAnyMatchesDep(oh, obsoletes, _rpmds_nopromote)) {
- const char * ohNEVRA = hGetNEVRA(oh, NULL);
+ const char * ohNEVRA = headerGetNEVRA(oh, NULL);
#ifdef DYING /* XXX see http://bugzilla.redhat.com #134497 */
if (rpmVersionCompare(h, oh))
#endif
rpmds requires, conflicts;
int rc;
- pkgNEVRA = hGetNEVRA(h, NULL);
+ pkgNEVRA = headerGetNEVRA(h, NULL);
requires = rpmdsNew(h, RPMTAG_REQUIRENAME, scareMem);
(void) rpmdsSetNoPromote(requires, _rpmds_nopromote);
conflicts = rpmdsNew(h, RPMTAG_CONFLICTNAME, scareMem);
if (payloadfmt && strncmp(payloadfmt, "cpio", strlen("cpio")) == 0) {
rc = RPMRC_OK;
} else {
- const char *nevra = hGetNEVRA(h, NULL);
+ const char *nevra = headerGetNEVRA(h, NULL);
if (payloadfmt && strncmp(payloadfmt, "drpm", strlen("drpm")) == 0) {
rpmlog(RPMLOG_ERR,
_("%s is a Delta RPM and cannot be directly installed\n"),
size_t nb;
int xx;
- p->NEVR = hGetNEVR(h, NULL);
+ p->NEVR = headerGetNEVR(h, NULL);
p->name = xstrdup(p->NEVR);
if ((p->release = strrchr(p->name, '-')) != NULL)
*p->release++ = '\0';
int _rpmts_stats = 0;
-char * hGetNEVR(Header h, const char ** np)
-{
- const char * n, * v, * r;
- char * NVR, * t;
-
- (void) headerNVR(h, &n, &v, &r);
- NVR = t = xcalloc(1, strlen(n) + strlen(v) + strlen(r) + sizeof("--"));
- t = stpcpy(t, n);
- t = stpcpy(t, "-");
- t = stpcpy(t, v);
- t = stpcpy(t, "-");
- t = stpcpy(t, r);
- if (np)
- *np = n;
- return NVR;
-}
-
-char * hGetNEVRA(Header h, const char ** np)
-{
- const char * n, * v, * r, * a;
- char * NVRA, * t;
- int xx;
-
- (void) headerNVR(h, &n, &v, &r);
- xx = headerGetEntry(h, RPMTAG_ARCH, NULL, (void **) &a, NULL);
- NVRA = t = xcalloc(1, strlen(n) + strlen(v) + strlen(r) + strlen(a) + sizeof("--."));
- t = stpcpy(t, n);
- t = stpcpy(t, "-");
- t = stpcpy(t, v);
- t = stpcpy(t, "-");
- t = stpcpy(t, r);
- t = stpcpy(t, ".");
- t = stpcpy(t, a);
- if (np)
- *np = n;
- return NVRA;
-}
-
-uint32_t hGetColor(Header h)
-{
- HGE_t hge = (HGE_t)headerGetEntryMinMemory;
- uint32_t hcolor = 0;
- uint32_t * fcolors;
- int32_t ncolors;
- int i;
-
- fcolors = NULL;
- ncolors = 0;
- if (hge(h, RPMTAG_FILECOLORS, NULL, (void **)&fcolors, &ncolors)
- && fcolors != NULL && ncolors > 0)
- {
- for (i = 0; i < ncolors; i++)
- hcolor |= fcolors[i];
- }
- hcolor &= 0x0f;
-
- return hcolor;
-}
-
rpmts XrpmtsUnlink(rpmts ts, const char * msg, const char * fn, unsigned ln)
{
if (_rpmts_debug)
fnpyKey ** ep,
int * nep);
-/**
- * Return (malloc'd) header name-version-release string.
- * @param h header
- * @retval np name tag value
- * @return name-version-release string
- */
-char * hGetNEVR(Header h, const char ** np );
-
-/**
- * Return (malloc'd) header name-version-release.arch string.
- * @param h header
- * @retval np name tag value
- * @return name-version-release string
- */
-char * hGetNEVRA(Header h, const char ** np );
-
-/**
- * Return header color.
- * @param h header
- * @return header color
- */
-uint32_t hGetColor(Header h);
-
#ifdef __cplusplus
}
#endif
mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES,
&shared->otherPkg, sizeof(shared->otherPkg));
while ((h = rpmdbNextIterator(mi)) != NULL) {
- altNEVR = hGetNEVRA(h, NULL);
+ altNEVR = headerGetNEVRA(h, NULL);
otherFi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem);
break;
}
if (rc == 0) {
rpmps ps = rpmtsProblems(ts);
- const char * altNEVR = hGetNEVRA(h, NULL);
+ const char * altNEVR = headerGetNEVRA(h, NULL);
rpmpsAppend(ps, RPMPROB_OLDPACKAGE,
rpmteNEVRA(p), rpmteKey(p),
NULL, NULL,
psi = rpmpsInitIterator(ps);
if (rpmpsNumProblems(ps) > 0) {
- char *nevra = hGetNEVRA(h, NULL);
+ char *nevra = headerGetNEVRA(h, NULL);
rpmlog(RPMLOG_NOTICE, "Unsatisfied dependencies for %s:\n", nevra);
free(nevra);
while (rpmpsNextIterator(psi) >= 0) {
}
return 0;
}
+
+char * headerGetNEVR(Header h, const char ** np)
+{
+ const char * n, * v, * r;
+ char * NVR, * t;
+
+ (void) headerNVR(h, &n, &v, &r);
+ NVR = t = xcalloc(1, strlen(n) + strlen(v) + strlen(r) + sizeof("--"));
+ t = stpcpy(t, n);
+ t = stpcpy(t, "-");
+ t = stpcpy(t, v);
+ t = stpcpy(t, "-");
+ t = stpcpy(t, r);
+ if (np)
+ *np = n;
+ return NVR;
+}
+
+char * headerGetNEVRA(Header h, const char ** np)
+{
+ const char * n, * v, * r, * a;
+ char * NVRA, * t;
+ int xx;
+
+ (void) headerNVR(h, &n, &v, &r);
+ xx = headerGetEntry(h, RPMTAG_ARCH, NULL, (void **) &a, NULL);
+ NVRA = t = xcalloc(1, strlen(n) + strlen(v) + strlen(r) + strlen(a) + sizeof("--."));
+ t = stpcpy(t, n);
+ t = stpcpy(t, "-");
+ t = stpcpy(t, v);
+ t = stpcpy(t, "-");
+ t = stpcpy(t, r);
+ t = stpcpy(t, ".");
+ t = stpcpy(t, a);
+ if (np)
+ *np = n;
+ return NVRA;
+}
+
+uint32_t headerGetColor(Header h)
+{
+ HGE_t hge = (HGE_t)headerGetEntryMinMemory;
+ uint32_t hcolor = 0;
+ uint32_t * fcolors;
+ int32_t ncolors;
+ int i;
+
+ fcolors = NULL;
+ ncolors = 0;
+ if (hge(h, RPMTAG_FILECOLORS, NULL, (void **)&fcolors, &ncolors)
+ && fcolors != NULL && ncolors > 0)
+ {
+ for (i = 0; i < ncolors; i++)
+ hcolor |= fcolors[i];
+ }
+ hcolor &= 0x0f;
+
+ return hcolor;
+}
+
return NULL;
}
+/** \ingroup header
+ * Return (malloc'd) header name-version-release string.
+ * @param h header
+ * @retval np name tag value
+ * @return name-version-release string
+ */
+char * headerGetNEVR(Header h, const char ** np );
+
+/** \ingroup header
+ * Return (malloc'd) header name-version-release.arch string.
+ * @param h header
+ * @retval np name tag value
+ * @return name-version-release string
+ */
+char * headerGetNEVRA(Header h, const char ** np );
+
+/** \ingroup header
+ * Return header color.
+ * @param h header
+ * @return header color
+ */
+uint32_t headerGetColor(Header h);
+
#ifdef __cplusplus
}
#endif