Doxygen annotations.
CVS patchset: 4130 CVS date: 2000/08/27 19:18:25
This commit is contained in:
parent
918188a90c
commit
a131131381
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/build.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/build.c
|
||||||
* Top-level build dispatcher.
|
* Top-level build dispatcher.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#ifndef _H_BUILDIO_
|
#ifndef _H_BUILDIO_
|
||||||
#define _H_BUILDIO_
|
#define _H_BUILDIO_
|
||||||
|
|
||||||
/** \file build/buildio.h
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/buildio.h
|
||||||
* XXX this information will move elsewhere eventually
|
* XXX this information will move elsewhere eventually
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
/** \file build/expression.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/expression.c
|
||||||
* Simple logical expression parser.
|
* Simple logical expression parser.
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Simple Expression Parser
|
|
||||||
* Copyright (C) 1998 Tom Dyas <tdyas@eden.rutgers.edu>
|
|
||||||
*
|
|
||||||
* This module implements a basic expression parser with support for
|
* This module implements a basic expression parser with support for
|
||||||
* integer and string datatypes. For ease of programming, we use the
|
* integer and string datatypes. For ease of programming, we use the
|
||||||
* top-down "recursive descent" method of parsing. While a
|
* top-down "recursive descent" method of parsing. While a
|
||||||
* table-driven bottom-up parser might be faster, it does not really
|
* table-driven bottom-up parser might be faster, it does not really
|
||||||
* matter for the expressions we will be parsing.
|
* matter for the expressions we will be parsing.
|
||||||
*
|
*
|
||||||
|
* Copyright (C) 1998 Tom Dyas <tdyas@eden.rutgers.edu>
|
||||||
* This work is provided under the GPL or LGPL at your choice.
|
* This work is provided under the GPL or LGPL at your choice.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/files.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/files.c
|
||||||
* The post-build, pre-packaging file tree walk to assemble the package
|
* The post-build, pre-packaging file tree walk to assemble the package
|
||||||
* manifest.
|
* manifest.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/misc.c
|
||||||
|
*/
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#include "rpmbuild.h"
|
#include "rpmbuild.h"
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
/* Modified ftw() -- uses Lstat() instead of stat() */
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/myftw.c
|
||||||
|
* Modified ftw() -- uses Lstat() instead of stat().
|
||||||
|
*/
|
||||||
|
|
||||||
/* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
|
/* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#ifndef _H_MYFTW_
|
#ifndef _H_MYFTW_
|
||||||
#define _H_MYFTW_
|
#define _H_MYFTW_
|
||||||
|
|
||||||
/** \file build/myftw.h
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/myftw.h
|
||||||
* Portable ftw(3) using lstat() instead of stat().
|
* Portable ftw(3) using lstat() instead of stat().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/names.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/names.c
|
||||||
* Simple user/group name/id cache (plus hostname and buildtime)
|
* Simple user/group name/id cache (plus hostname and buildtime)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/pack.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/pack.c
|
||||||
* Assemble components of an RPM package.
|
* Assemble components of an RPM package.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -415,8 +416,10 @@ int writeRPM(Header h, const char *fileName, int type,
|
||||||
archnum = -1;
|
archnum = -1;
|
||||||
osnum = -1;
|
osnum = -1;
|
||||||
if (Fileno(csa->cpioFdIn) < 0) {
|
if (Fileno(csa->cpioFdIn) < 0) {
|
||||||
|
#ifndef DYING
|
||||||
rpmGetArchInfo(NULL, &archnum);
|
rpmGetArchInfo(NULL, &archnum);
|
||||||
rpmGetOsInfo(NULL, &osnum);
|
rpmGetOsInfo(NULL, &osnum);
|
||||||
|
#endif
|
||||||
} else if (csa->lead != NULL) { /* XXX FIXME: exorcize lead/arch/os */
|
} else if (csa->lead != NULL) { /* XXX FIXME: exorcize lead/arch/os */
|
||||||
archnum = csa->lead->archnum;
|
archnum = csa->lead->archnum;
|
||||||
osnum = csa->lead->osnum;
|
osnum = csa->lead->osnum;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/parseBuildInstallClean.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/parseBuildInstallClean.c
|
||||||
* Parse %build/%install/%clean section from spec file.
|
* Parse %build/%install/%clean section from spec file.
|
||||||
*/
|
*/
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/parseChangelog.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/parseChangelog.c
|
||||||
* Parse %changelog section from spec file.
|
* Parse %changelog section from spec file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/parseDescription.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/parseDescription.c
|
||||||
* Parse %description section from spec file.
|
* Parse %description section from spec file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/parseFiles.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/parseFiles.c
|
||||||
* Parse %files section from spec file.
|
* Parse %files section from spec file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/parsePreamble.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/parsePreamble.c
|
||||||
* Parse tags in global section from spec file.
|
* Parse tags in global section from spec file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -131,11 +132,17 @@ static int isMemberInEntry(Header header, const char *name, int tag)
|
||||||
|
|
||||||
static int checkForValidArchitectures(Spec spec)
|
static int checkForValidArchitectures(Spec spec)
|
||||||
{
|
{
|
||||||
|
#ifndef DYING
|
||||||
const char *arch = NULL;
|
const char *arch = NULL;
|
||||||
const char *os = NULL;
|
const char *os = NULL;
|
||||||
|
|
||||||
rpmGetArchInfo(&arch, NULL);
|
rpmGetArchInfo(&arch, NULL);
|
||||||
rpmGetOsInfo(&os, NULL);
|
rpmGetOsInfo(&os, NULL);
|
||||||
|
#else
|
||||||
|
const char *arch = rpmExpand("%{_target_cpu}", NULL);
|
||||||
|
const char *os = rpmExpand("%{_target_os}", NULL);
|
||||||
|
/* XXX FIXME memory leak here. */
|
||||||
|
#endif
|
||||||
|
|
||||||
if (isMemberInEntry(spec->buildRestrictions,
|
if (isMemberInEntry(spec->buildRestrictions,
|
||||||
arch, RPMTAG_EXCLUDEARCH) == 1) {
|
arch, RPMTAG_EXCLUDEARCH) == 1) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/parsePrep.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/parsePrep.c
|
||||||
* Parse %prep section from spec file.
|
* Parse %prep section from spec file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/parseReqs.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/parseReqs.c
|
||||||
* Parse dependency tag from spec file or from auto-dependency generator.
|
* Parse dependency tag from spec file or from auto-dependency generator.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/parseScript.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/parseScript.c
|
||||||
* Parse install-time script section from spec file.
|
* Parse install-time script section from spec file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/parseSpec.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/parseSpec.c
|
||||||
* Top level dispatcher for spec file parsing.
|
* Top level dispatcher for spec file parsing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -40,7 +41,6 @@ static inline void initParts(struct PartRec *p)
|
||||||
p->len = strlen(p->token);
|
p->len = strlen(p->token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
|
||||||
int isPart(char *line)
|
int isPart(char *line)
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
|
@ -91,7 +91,6 @@ static int matchTok(const char *token, const char *line)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
|
||||||
void handleComments(char *s)
|
void handleComments(char *s)
|
||||||
{
|
{
|
||||||
SKIPSPACE(s);
|
SKIPSPACE(s);
|
||||||
|
@ -168,11 +167,12 @@ static int copyNextLine(Spec spec, OFI_t *ofi, int strip)
|
||||||
/* 1 - EOF */
|
/* 1 - EOF */
|
||||||
/* <0 - error */
|
/* <0 - error */
|
||||||
|
|
||||||
/** */
|
|
||||||
int readLine(Spec spec, int strip)
|
int readLine(Spec spec, int strip)
|
||||||
{
|
{
|
||||||
|
#ifdef DYING
|
||||||
const char *arch;
|
const char *arch;
|
||||||
const char *os;
|
const char *os;
|
||||||
|
#endif
|
||||||
char *s;
|
char *s;
|
||||||
int match;
|
int match;
|
||||||
struct ReadLevelEntry *rl;
|
struct ReadLevelEntry *rl;
|
||||||
|
@ -229,10 +229,12 @@ retry:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DYING
|
||||||
arch = NULL;
|
arch = NULL;
|
||||||
rpmGetArchInfo(&arch, NULL);
|
rpmGetArchInfo(&arch, NULL);
|
||||||
os = NULL;
|
os = NULL;
|
||||||
rpmGetOsInfo(&os, NULL);
|
rpmGetOsInfo(&os, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Copy next file line into the spec line buffer */
|
/* Copy next file line into the spec line buffer */
|
||||||
if ((rc = copyNextLine(spec, ofi, strip)) != 0)
|
if ((rc = copyNextLine(spec, ofi, strip)) != 0)
|
||||||
|
@ -243,17 +245,25 @@ retry:
|
||||||
|
|
||||||
match = -1;
|
match = -1;
|
||||||
if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) {
|
if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) {
|
||||||
|
const char *arch = rpmExpand("%{_target_cpu}", NULL);
|
||||||
s += 7;
|
s += 7;
|
||||||
match = matchTok(arch, s);
|
match = matchTok(arch, s);
|
||||||
|
xfree(arch);
|
||||||
} else if (! strncmp("%ifnarch", s, sizeof("%ifnarch")-1)) {
|
} else if (! strncmp("%ifnarch", s, sizeof("%ifnarch")-1)) {
|
||||||
|
const char *arch = rpmExpand("%{_target_cpu}", NULL);
|
||||||
s += 8;
|
s += 8;
|
||||||
match = !matchTok(arch, s);
|
match = !matchTok(arch, s);
|
||||||
|
xfree(arch);
|
||||||
} else if (! strncmp("%ifos", s, sizeof("%ifos")-1)) {
|
} else if (! strncmp("%ifos", s, sizeof("%ifos")-1)) {
|
||||||
|
const char *os = rpmExpand("%{_target_os}", NULL);
|
||||||
s += 5;
|
s += 5;
|
||||||
match = matchTok(os, s);
|
match = matchTok(os, s);
|
||||||
|
xfree(os);
|
||||||
} else if (! strncmp("%ifnos", s, sizeof("%ifnos")-1)) {
|
} else if (! strncmp("%ifnos", s, sizeof("%ifnos")-1)) {
|
||||||
|
const char *os = rpmExpand("%{_target_os}", NULL);
|
||||||
s += 6;
|
s += 6;
|
||||||
match = !matchTok(os, s);
|
match = !matchTok(os, s);
|
||||||
|
xfree(os);
|
||||||
} else if (! strncmp("%if", s, sizeof("%if")-1)) {
|
} else if (! strncmp("%if", s, sizeof("%if")-1)) {
|
||||||
s += 3;
|
s += 3;
|
||||||
match = parseExpressionBoolean(spec, s);
|
match = parseExpressionBoolean(spec, s);
|
||||||
|
@ -326,7 +336,6 @@ retry:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
|
||||||
void closeSpec(Spec spec)
|
void closeSpec(Spec spec)
|
||||||
{
|
{
|
||||||
OFI_t *ofi;
|
OFI_t *ofi;
|
||||||
|
@ -342,14 +351,15 @@ void closeSpec(Spec spec)
|
||||||
|
|
||||||
extern int noLang; /* XXX FIXME: pass as arg */
|
extern int noLang; /* XXX FIXME: pass as arg */
|
||||||
|
|
||||||
/** */
|
|
||||||
int parseSpec(Spec *specp, const char *specFile, const char *rootURL,
|
int parseSpec(Spec *specp, const char *specFile, const char *rootURL,
|
||||||
const char *buildRootURL, int inBuildArch, const char *passPhrase,
|
const char *buildRootURL, int inBuildArch, const char *passPhrase,
|
||||||
char *cookie, int anyarch, int force)
|
char *cookie, int anyarch, int force)
|
||||||
{
|
{
|
||||||
int parsePart = PART_PREAMBLE;
|
int parsePart = PART_PREAMBLE;
|
||||||
int initialPackage = 1;
|
int initialPackage = 1;
|
||||||
|
#ifdef DYING
|
||||||
const char *saveArch;
|
const char *saveArch;
|
||||||
|
#endif
|
||||||
Package pkg;
|
Package pkg;
|
||||||
int x, index;
|
int x, index;
|
||||||
Spec spec;
|
Spec spec;
|
||||||
|
@ -450,9 +460,13 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU
|
||||||
for (x = 0; x < spec->buildArchitectureCount; x++) {
|
for (x = 0; x < spec->buildArchitectureCount; x++) {
|
||||||
if (rpmMachineScore(RPM_MACHTABLE_BUILDARCH,
|
if (rpmMachineScore(RPM_MACHTABLE_BUILDARCH,
|
||||||
spec->buildArchitectures[x])) {
|
spec->buildArchitectures[x])) {
|
||||||
|
#ifdef DYING
|
||||||
rpmGetMachine(&saveArch, NULL);
|
rpmGetMachine(&saveArch, NULL);
|
||||||
saveArch = xstrdup(saveArch);
|
saveArch = xstrdup(saveArch);
|
||||||
rpmSetMachine(spec->buildArchitectures[x], NULL);
|
rpmSetMachine(spec->buildArchitectures[x], NULL);
|
||||||
|
#else
|
||||||
|
addMacro(NULL, "_target_cpu", NULL, spec->buildArchitectures[x], RMIL_RPMRC);
|
||||||
|
#endif
|
||||||
if (parseSpec(&(spec->buildArchitectureSpecs[index]),
|
if (parseSpec(&(spec->buildArchitectureSpecs[index]),
|
||||||
specFile, spec->rootURL, buildRootURL, 1,
|
specFile, spec->rootURL, buildRootURL, 1,
|
||||||
passPhrase, cookie, anyarch, force)) {
|
passPhrase, cookie, anyarch, force)) {
|
||||||
|
@ -460,8 +474,12 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU
|
||||||
freeSpec(spec);
|
freeSpec(spec);
|
||||||
return RPMERR_BADSPEC;
|
return RPMERR_BADSPEC;
|
||||||
}
|
}
|
||||||
|
#ifdef DYING
|
||||||
rpmSetMachine(saveArch, NULL);
|
rpmSetMachine(saveArch, NULL);
|
||||||
xfree(saveArch);
|
xfree(saveArch);
|
||||||
|
#else
|
||||||
|
delMacro(NULL, "_target_cpu");
|
||||||
|
#endif
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -495,23 +513,29 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for description in each package and add arch and os */
|
/* Check for description in each package and add arch and os */
|
||||||
{ const char *arch = NULL;
|
{
|
||||||
const char *os = NULL;
|
#ifdef DYING
|
||||||
char *myos = NULL;
|
const char *arch = NULL;
|
||||||
|
const char *os = NULL;
|
||||||
|
char *myos = NULL;
|
||||||
|
|
||||||
rpmGetArchInfo(&arch, NULL);
|
rpmGetArchInfo(&arch, NULL);
|
||||||
rpmGetOsInfo(&os, NULL);
|
rpmGetOsInfo(&os, NULL);
|
||||||
/*
|
/*
|
||||||
* XXX Capitalizing the 'L' is needed to insure that old
|
* XXX Capitalizing the 'L' is needed to insure that old
|
||||||
* XXX os-from-uname (e.g. "Linux") is compatible with the new
|
* XXX os-from-uname (e.g. "Linux") is compatible with the new
|
||||||
* XXX os-from-platform (e.g "linux" from "sparc-*-linux").
|
* XXX os-from-platform (e.g "linux" from "sparc-*-linux").
|
||||||
* XXX A copy of this string is embedded in headers.
|
* XXX A copy of this string is embedded in headers.
|
||||||
*/
|
*/
|
||||||
if (!strcmp(os, "linux")) {
|
if (!strcmp(os, "linux")) {
|
||||||
myos = xstrdup(os);
|
myos = xstrdup(os);
|
||||||
*myos = 'L';
|
*myos = 'L';
|
||||||
os = myos;
|
os = myos;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
const char *arch = rpmExpand("%{_target_cpu}", NULL);
|
||||||
|
const char *os = rpmExpand("%{_target_os}", NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
|
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
|
||||||
if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
|
if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
|
||||||
|
@ -524,9 +548,14 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU
|
||||||
|
|
||||||
headerAddEntry(pkg->header, RPMTAG_OS, RPM_STRING_TYPE, os, 1);
|
headerAddEntry(pkg->header, RPMTAG_OS, RPM_STRING_TYPE, os, 1);
|
||||||
headerAddEntry(pkg->header, RPMTAG_ARCH, RPM_STRING_TYPE, arch, 1);
|
headerAddEntry(pkg->header, RPMTAG_ARCH, RPM_STRING_TYPE, arch, 1);
|
||||||
}
|
|
||||||
FREE(myos);
|
|
||||||
}
|
}
|
||||||
|
#ifdef DYING
|
||||||
|
FREE(myos);
|
||||||
|
#else
|
||||||
|
xfree(arch);
|
||||||
|
xfree(os);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
closeSpec(spec);
|
closeSpec(spec);
|
||||||
*specp = spec;
|
*specp = spec;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/reqprov.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/reqprov.c
|
||||||
* Add dependency tags to package header(s).
|
* Add dependency tags to package header(s).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#ifndef _H_RPMBUILD_
|
#ifndef _H_RPMBUILD_
|
||||||
#define _H_RPMBUILD_
|
#define _H_RPMBUILD_
|
||||||
|
|
||||||
/** \file build/rpmbuild.h
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/rpmbuild.h
|
||||||
* This is the *only* module users of librpmbuild should need to include.
|
* This is the *only* module users of librpmbuild should need to include.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#ifndef _H_SPEC_
|
#ifndef _H_SPEC_
|
||||||
#define _H_SPEC_
|
#define _H_SPEC_
|
||||||
|
|
||||||
/** \file build/rpmspec.h
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/rpmspec.h
|
||||||
* The Spec and Package data structures used during build.
|
* The Spec and Package data structures used during build.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** \file build/spec.c
|
/** \ingroup rpmbuild
|
||||||
|
* \file build/spec.c
|
||||||
* Handle spec data structure.
|
* Handle spec data structure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
11
lib/cpio.c
11
lib/cpio.c
|
@ -1,7 +1,8 @@
|
||||||
/** \file lib/cpio.c
|
/** \ingroup payload rpmio
|
||||||
|
* \file lib/cpio.c
|
||||||
* Handle cpio payloads within rpm packages.
|
* Handle cpio payloads within rpm packages.
|
||||||
*
|
*
|
||||||
* @warning FIXME: We don't translate between cpio and system mode bits! These
|
* \warning FIXME: We don't translate between cpio and system mode bits! These
|
||||||
* should both be the same, but really odd things are going to happen if
|
* should both be the same, but really odd things are going to happen if
|
||||||
* that's not true!
|
* that's not true!
|
||||||
*/
|
*/
|
||||||
|
@ -16,7 +17,7 @@
|
||||||
#define CPIO_CRC_MAGIC "070702"
|
#define CPIO_CRC_MAGIC "070702"
|
||||||
#define TRAILER "TRAILER!!!"
|
#define TRAILER "TRAILER!!!"
|
||||||
|
|
||||||
/**
|
/** \ingroup payload
|
||||||
* Keeps track of set of all hard linked files in archive.
|
* Keeps track of set of all hard linked files in archive.
|
||||||
*/
|
*/
|
||||||
struct hardLink {
|
struct hardLink {
|
||||||
|
@ -33,7 +34,7 @@ struct hardLink {
|
||||||
|
|
||||||
enum hardLinkType { HARDLINK_INSTALL=1, HARDLINK_BUILD };
|
enum hardLinkType { HARDLINK_INSTALL=1, HARDLINK_BUILD };
|
||||||
|
|
||||||
/**
|
/** \ingroup payload
|
||||||
* Cpio archive header information.
|
* Cpio archive header information.
|
||||||
*/
|
*/
|
||||||
struct cpioCrcPhysicalHeader {
|
struct cpioCrcPhysicalHeader {
|
||||||
|
@ -55,7 +56,7 @@ struct cpioCrcPhysicalHeader {
|
||||||
|
|
||||||
#define PHYS_HDR_SIZE 110 /* don't depend on sizeof(struct) */
|
#define PHYS_HDR_SIZE 110 /* don't depend on sizeof(struct) */
|
||||||
|
|
||||||
/**
|
/** \ingroup payload
|
||||||
* File name and stat information.
|
* File name and stat information.
|
||||||
*/
|
*/
|
||||||
struct cpioHeader {
|
struct cpioHeader {
|
||||||
|
|
19
lib/cpio.h
19
lib/cpio.h
|
@ -1,7 +1,8 @@
|
||||||
#ifndef H_CPIO
|
#ifndef H_CPIO
|
||||||
#define H_CPIO
|
#define H_CPIO
|
||||||
|
|
||||||
/** \file lib/cpio.h
|
/** \ingroup payload
|
||||||
|
* \file lib/cpio.h
|
||||||
* Structures used to handle cpio payloads within rpm packages.
|
* Structures used to handle cpio payloads within rpm packages.
|
||||||
*
|
*
|
||||||
* Warning: Don't think that rpm's cpio implementation behaves just like
|
* Warning: Don't think that rpm's cpio implementation behaves just like
|
||||||
|
@ -17,7 +18,7 @@
|
||||||
|
|
||||||
#include <rpmio_internal.h>
|
#include <rpmio_internal.h>
|
||||||
|
|
||||||
/**
|
/** \ingroup payload
|
||||||
* Note: CPIO_CHECK_ERRNO bit is set only if errno is valid. These have to
|
* Note: CPIO_CHECK_ERRNO bit is set only if errno is valid. These have to
|
||||||
* be positive numbers or this setting the high bit stuff is a bad idea.
|
* be positive numbers or this setting the high bit stuff is a bad idea.
|
||||||
*/
|
*/
|
||||||
|
@ -53,7 +54,7 @@
|
||||||
#define CPIO_FOLLOW_SYMLINKS (1 << 4) /* only for building */
|
#define CPIO_FOLLOW_SYMLINKS (1 << 4) /* only for building */
|
||||||
#define CPIO_MULTILIB (1 << 31) /* internal, only for building */
|
#define CPIO_MULTILIB (1 << 31) /* internal, only for building */
|
||||||
|
|
||||||
/**
|
/** \ingroup payload
|
||||||
* Defines a single file to be included in a cpio payload.
|
* Defines a single file to be included in a cpio payload.
|
||||||
*/
|
*/
|
||||||
struct cpioFileMapping {
|
struct cpioFileMapping {
|
||||||
|
@ -65,7 +66,7 @@ struct cpioFileMapping {
|
||||||
int mapFlags;
|
int mapFlags;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/** \ingroup payload
|
||||||
* The first argument passed in a cpio progress callback.
|
* The first argument passed in a cpio progress callback.
|
||||||
*
|
*
|
||||||
* Note: When building the cpio payload, only "file" is filled in.
|
* Note: When building the cpio payload, only "file" is filled in.
|
||||||
|
@ -81,11 +82,11 @@ struct cpioCallbackInfo {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/** \ingroup payload
|
||||||
*/
|
*/
|
||||||
typedef void (*cpioCallback) (struct cpioCallbackInfo * filespec, void * data);
|
typedef void (*cpioCallback) (struct cpioCallbackInfo * filespec, void * data);
|
||||||
|
|
||||||
/**
|
/** \ingroup payload
|
||||||
* The RPM internal equivalent of the command line "cpio -i".
|
* The RPM internal equivalent of the command line "cpio -i".
|
||||||
* If no mappings are passed, this installs everything! If one is passed
|
* If no mappings are passed, this installs everything! If one is passed
|
||||||
* it should be sorted according to cpioFileMapCmp() and only files included
|
* it should be sorted according to cpioFileMapCmp() and only files included
|
||||||
|
@ -108,7 +109,7 @@ int cpioInstallArchive(FD_t cfd, const struct cpioFileMapping * mappings,
|
||||||
/*@out@*/const char ** failedFile)
|
/*@out@*/const char ** failedFile)
|
||||||
/*@modifies fileSystem, cfd, *failedFile @*/;
|
/*@modifies fileSystem, cfd, *failedFile @*/;
|
||||||
|
|
||||||
/**
|
/** \ingroup payload
|
||||||
* The RPM internal equivalent of the command line "cpio -o".
|
* The RPM internal equivalent of the command line "cpio -o".
|
||||||
*
|
*
|
||||||
* @param cfd file handle
|
* @param cfd file handle
|
||||||
|
@ -124,7 +125,7 @@ int cpioBuildArchive(FD_t cfd, const struct cpioFileMapping * mappings,
|
||||||
unsigned int * archiveSize, /*@out@*/const char ** failedFile)
|
unsigned int * archiveSize, /*@out@*/const char ** failedFile)
|
||||||
/*@modifies fileSystem, cfd, *archiveSize, *failedFile @*/;
|
/*@modifies fileSystem, cfd, *archiveSize, *failedFile @*/;
|
||||||
|
|
||||||
/**
|
/** \ingroup payload
|
||||||
* Compare two cpio file map entries (qsort/bsearch).
|
* Compare two cpio file map entries (qsort/bsearch).
|
||||||
* This is designed to be qsort/bsearch compatible.
|
* This is designed to be qsort/bsearch compatible.
|
||||||
* @param a 1st map
|
* @param a 1st map
|
||||||
|
@ -133,7 +134,7 @@ int cpioBuildArchive(FD_t cfd, const struct cpioFileMapping * mappings,
|
||||||
*/
|
*/
|
||||||
int cpioFileMapCmp(const void * a, const void * b) /*@*/;
|
int cpioFileMapCmp(const void * a, const void * b) /*@*/;
|
||||||
|
|
||||||
/**
|
/** \ingroup payload
|
||||||
* Return fornmatted error message on payload handling failure.
|
* Return fornmatted error message on payload handling failure.
|
||||||
*/
|
*/
|
||||||
/*@observer@*/ const char *cpioStrerror(int rc) /*@*/;
|
/*@observer@*/ const char *cpioStrerror(int rc) /*@*/;
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
|
/** \ingroup db1
|
||||||
|
* \file lib/db1.c
|
||||||
|
*/
|
||||||
|
|
||||||
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
|
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
|
||||||
|
|
||||||
#include <db1/db.h>
|
#include <db1/db.h>
|
||||||
|
@ -37,6 +41,8 @@ static inline DBTYPE db3_to_dbtype(int dbitype)
|
||||||
/*@notreached@*/ return DB_HASH;
|
/*@notreached@*/ return DB_HASH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \ingroup db1
|
||||||
|
*/
|
||||||
char * db1basename (int rpmtag) {
|
char * db1basename (int rpmtag) {
|
||||||
char * base = NULL;
|
char * base = NULL;
|
||||||
switch (rpmtag) {
|
switch (rpmtag) {
|
||||||
|
@ -487,6 +493,8 @@ exit:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \ingroup db1
|
||||||
|
*/
|
||||||
struct _dbiVec db1vec = {
|
struct _dbiVec db1vec = {
|
||||||
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
|
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
|
||||||
db1open, db1close, db1sync, db1copen, db1cclose, db1cdel, db1cget, db1cput,
|
db1open, db1close, db1sync, db1copen, db1cclose, db1cdel, db1cget, db1cput,
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
|
/** \ingroup db2
|
||||||
|
* \file lib/db2.c
|
||||||
|
*/
|
||||||
|
|
||||||
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
|
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
|
||||||
|
|
||||||
#include <db2/db.h>
|
#include <db2/db.h>
|
||||||
|
|
12
lib/db3.c
12
lib/db3.c
|
@ -1,5 +1,9 @@
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
|
/** \ingroup db3
|
||||||
|
* \file lib/db3.c
|
||||||
|
*/
|
||||||
|
|
||||||
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
|
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
|
||||||
|
|
||||||
#ifdef __LCLINT__
|
#ifdef __LCLINT__
|
||||||
|
@ -25,7 +29,9 @@ typedef int int32_t;
|
||||||
|
|
||||||
struct _dbiIndex db3dbi;
|
struct _dbiIndex db3dbi;
|
||||||
|
|
||||||
/* Analogue to struct poptOption */
|
/** \ingroup db3
|
||||||
|
* Analogue to struct poptOption
|
||||||
|
*/
|
||||||
struct dbOption {
|
struct dbOption {
|
||||||
const char * longName; /* may be NULL */
|
const char * longName; /* may be NULL */
|
||||||
int argInfo;
|
int argInfo;
|
||||||
|
@ -36,6 +42,8 @@ struct dbOption {
|
||||||
#define _POPT_SET_BIT (POPT_ARG_VAL|POPT_ARGFLAG_OR)
|
#define _POPT_SET_BIT (POPT_ARG_VAL|POPT_ARGFLAG_OR)
|
||||||
|
|
||||||
/*@-immediatetrans@*/
|
/*@-immediatetrans@*/
|
||||||
|
/** \ingroup db3
|
||||||
|
*/
|
||||||
struct dbOption rdbOptions[] = {
|
struct dbOption rdbOptions[] = {
|
||||||
/* XXX DB_CXX_NO_EXCEPTIONS */
|
/* XXX DB_CXX_NO_EXCEPTIONS */
|
||||||
{ "xa_create", _POPT_SET_BIT, &db3dbi.dbi_cflags, DB_XA_CREATE },
|
{ "xa_create", _POPT_SET_BIT, &db3dbi.dbi_cflags, DB_XA_CREATE },
|
||||||
|
@ -1168,6 +1176,8 @@ static int db3open(/*@keep@*/ rpmdb rpmdb, int rpmtag, dbiIndex * dbip)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \ingroup db3
|
||||||
|
*/
|
||||||
struct _dbiVec db3vec = {
|
struct _dbiVec db3vec = {
|
||||||
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
|
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
|
||||||
db3open, db3close, db3sync, db3copen, db3cclose, db3cdel, db3cget, db3cput,
|
db3open, db3close, db3sync, db3copen, db3cclose, db3cdel, db3cget, db3cput,
|
||||||
|
|
Loading…
Reference in New Issue