Main Page Modules Data Structures File List Data Fields Globals Related Pages

# lib/query.c File Reference

Display tag values from package metadata. More...

`#include "system.h"`
`#include <rpmcli.h>`
`#include <rpmbuild.h>`
`#include "rpmdb.h"`
`#include "rpmfi.h"`
`#include "rpmts.h"`
`#include "manifest.h"`
`#include "debug.h"`

Go to the source code of this file.

## Defines

#define | PATH_MAX 255

## Functions

void | printFileInfo (char *te, const char *name, unsigned int size, unsigned short mode, unsigned int mtime, unsigned short rdev, unsigned int nlink, const char *owner, const char *group, const char *linkto)
const char * | queryHeader (Header h, const char *qfmt)
int | showQueryPackage (QVA_t qva, rpmts ts, Header h)
void | printNewSpecfile (Spec spec)
| Print copy of spec file, filling in Group/Description/Summary from specspo. More...
void | rpmDisplayQueryTags (FILE *fp)
int | rpmcliShowMatches (QVA_t qva, rpmts ts)
unsigned char | nibble (char c)
| Convert hex to binary nibble. More...
int | rpmQueryVerify (QVA_t qva, rpmts ts, const char *arg)
int | rpmcliQuery (rpmts ts, QVA_t qva, const char **argv)

## Variables

int(* | parseSpecVec )(Spec *specp, const char *specFile, const char *rootdir, const char *buildRoot, int recursing, const char *passPhrase, char *cookie, int anyarch, int force)=NULL
Spec(* | freeSpecVec )(Spec spec)=NULL

## Detailed Description

Display tag values from package metadata.

Definition in file query.c.

## Define Documentation

#define PATH_MAX 255

| Definition at line 10 of file query.c. Referenced by rpmQueryVerify.

## Function Documentation

unsigned char nibble | ( | char | c | ) | `[inline, static]`

Convert hex to binary nibble.

Parameters:

  c | hex character

Returns:
  binary nibble

Definition at line 505 of file query.c.

void printFileInfo | ( | char * | te,
|  | const char * | name,
|  | unsigned int | size,
|  | unsigned short | mode,
|  | unsigned int | mtime,
|  | unsigned short | rdev,
|  | unsigned int | nlink,
|  | const char * | owner,
|  | const char * | group,
|  | const char * | linkto
| ) | `[static]`

| Definition at line 31 of file query.c. References _free, alloca, rpmPermsString, and S_ISLNK. Referenced by showQueryPackage.

void printNewSpecfile | ( | Spec | spec | ) | `[static]`

Print copy of spec file, filling in Group/Description/Summary from specspo.

Parameters:

  spec | spec file control structure

Definition at line 349 of file query.c.

References _, _free, PackageStruct::header, headerNVR, headerSprintf, PackageStruct::next, RPMBUILD_DEFAULT_LANG, RPMTAG_DESCRIPTION, RPMTAG_GROUP, RPMTAG_SUMMARY, speclines_s::sl_lines, speclines_s::sl_nlines, spectags_s::st_ntags, spectags_s::st_t, stpcpy, spectag_s::t_lang, spectag_s::t_msgid, spectag_s::t_nlines, spectag_s::t_startx, spectag_s::t_tag, tagName, xmalloc, and xstrdup.

Referenced by rpmQueryVerify.

const char* queryHeader | ( | Header | h,
|  | const char * | qfmt
| ) | `[inline, static]`

| Definition at line 112 of file query.c. References _, and headerSprintf. Referenced by showQueryPackage.

int rpmcliQuery | ( | rpmts | ts,
|  | QVA_t | qva,
|  | const char ** | argv
| ) |

| Definition at line 931 of file query.c. References _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, rpmExpandNumeric, rpmQueryVerify, rpmts, rpmtsEmpty, rpmtsSetVSFlags, RPMVSF_NOHDRCHK, rpmVSFlags, and showQueryPackage. Referenced by main.

int rpmcliShowMatches | ( | QVA_t | qva,
|  | rpmts | ts
| ) |

| Definition at line 486 of file query.c. References rpmdbFreeIterator, rpmdbNextIterator, and rpmts. Referenced by rpmQueryVerify.

void rpmDisplayQueryTags | ( | FILE * | fp | ) |

| Definition at line 459 of file query.c. References HEADER_EXT_MORE, HEADER_EXT_TAG, headerSprintfExtension_s::name, headerTagTableEntry_s::name, headerSprintfExtension_s::type, and headerSprintfExtension_s::u. Referenced by main, and rpmcliAllArgCallback.

int rpmQueryVerify | ( | QVA_t | qva,
|  | rpmts | ts,
|  | const char * | arg
| ) |

Definition at line 531 of file query.c.

References _, _free, errno, F_OK, Fclose, Ferror, Fopen, freeSpecVec, Fstrerror, PackageStruct::header, headerFree, PackageStruct::next, nibble, SpecStruct::packages, parseSpecVec, PATH_MAX, printNewSpecfile, realpath, rpmCleanPath, rpmcliShowMatches, rpmdbCheckSignals, rpmdbFreeIterator, RPMDBI_LABEL, RPMDBI_PACKAGES, rpmdbSetIteratorRE, rpmGlob, RPMMIRE_DEFAULT, rpmRC, RPMRC_NOKEY, RPMRC_NOTFOUND, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile, rpmReadPackageManifest, RPMTAG_BASENAMES, RPMTAG_FILEMD5S, RPMTAG_GROUP, RPMTAG_INSTALLTID, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_SHA1HEADER, RPMTAG_SIGMD5, RPMTAG_TRIGGERNAME, rpmts, rpmtsEmpty, rpmtsInitIterator, showQueryPackage, strerror, and xstrdup.

Referenced by rpmcliQuery, and rpmcliVerify.

int showQueryPackage | ( | QVA_t | qva,
|  | rpmts | ts,
|  | Header | h
| ) |

Definition at line 126 of file query.c.

References _, _free, headerNVR, int_32, printFileInfo, queryHeader, rpmfi, RPMFILE_CONFIG, RPMFILE_DOC, RPMFILE_GHOST, RPMFILE_STATE_MISSING, RPMFILE_STATE_NETSHARED, RPMFILE_STATE_NORMAL, RPMFILE_STATE_NOTINSTALLED, RPMFILE_STATE_REPLACED, rpmfileAttrs, rpmfileState, RPMTAG_BASENAMES, rpmts, stpcpy, xmalloc, and xrealloc.

Referenced by rpmcliQuery, and rpmQueryVerify.

## Variable Documentation

Spec(* freeSpecVec)(Spec spec) = NULL

Todo:
  Eliminate linkage loop into librpmbuild.a

Definition at line 527 of file query.c.

Referenced by rpmQueryVerify.

int(* parseSpecVec)(Spec *specp, const char *specFile, const char *rootdir, const char *buildRoot, int recursing, const char *passPhrase, char *cookie, int anyarch, int force) = NULL

Todo:
  Eliminate linkage loop into librpmbuild.a

Definition at line 521 of file query.c.

Referenced by rpmQueryVerify.