summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/build.c3
-rw-r--r--build/buildio.h3
-rw-r--r--build/expression.c10
-rw-r--r--build/files.c3
-rw-r--r--build/misc.c3
-rw-r--r--build/myftw.c5
-rw-r--r--build/myftw.h3
-rw-r--r--build/names.c3
-rw-r--r--build/pack.c5
-rw-r--r--build/parseBuildInstallClean.c3
-rw-r--r--build/parseChangelog.c3
-rw-r--r--build/parseDescription.c3
-rw-r--r--build/parseFiles.c3
-rw-r--r--build/parsePreamble.c9
-rw-r--r--build/parsePrep.c3
-rw-r--r--build/parseReqs.c3
-rw-r--r--build/parseScript.c3
-rw-r--r--build/parseSpec.c73
-rw-r--r--build/reqprov.c3
-rw-r--r--build/rpmbuild.h3
-rw-r--r--build/rpmspec.h3
-rw-r--r--build/spec.c3
-rw-r--r--lib/cpio.c11
-rw-r--r--lib/cpio.h19
-rw-r--r--lib/db1.c8
-rw-r--r--lib/db2.c4
-rw-r--r--lib/db3.c12
27 files changed, 144 insertions, 63 deletions
diff --git a/build/build.c b/build/build.c
index 268ced106..721a4a643 100644
--- a/build/build.c
+++ b/build/build.c
@@ -1,4 +1,5 @@
-/** \file build/build.c
+/** \ingroup rpmbuild
+ * \file build/build.c
* Top-level build dispatcher.
*/
diff --git a/build/buildio.h b/build/buildio.h
index 46769b6b9..7b3fae9c7 100644
--- a/build/buildio.h
+++ b/build/buildio.h
@@ -1,7 +1,8 @@
#ifndef _H_BUILDIO_
#define _H_BUILDIO_
-/** \file build/buildio.h
+/** \ingroup rpmbuild
+ * \file build/buildio.h
* XXX this information will move elsewhere eventually
*/
diff --git a/build/expression.c b/build/expression.c
index 883bf66c3..4bd9be7af 100644
--- a/build/expression.c
+++ b/build/expression.c
@@ -1,17 +1,13 @@
-/** \file build/expression.c
+/** \ingroup rpmbuild
+ * \file build/expression.c
* 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
* integer and string datatypes. For ease of programming, we use the
* top-down "recursive descent" method of parsing. While a
* table-driven bottom-up parser might be faster, it does not really
* 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.
*/
diff --git a/build/files.c b/build/files.c
index 7a73c2ea3..b58797e6a 100644
--- a/build/files.c
+++ b/build/files.c
@@ -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
* manifest.
*/
diff --git a/build/misc.c b/build/misc.c
index 267ab9501..95b95937b 100644
--- a/build/misc.c
+++ b/build/misc.c
@@ -1,3 +1,6 @@
+/** \ingroup rpmbuild
+ * \file build/misc.c
+ */
#include "system.h"
#include "rpmbuild.h"
diff --git a/build/myftw.c b/build/myftw.c
index fa590bd66..4b036bfe6 100644
--- a/build/myftw.c
+++ b/build/myftw.c
@@ -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.
This file is part of the GNU C Library.
diff --git a/build/myftw.h b/build/myftw.h
index f4011f675..3b19d7abc 100644
--- a/build/myftw.h
+++ b/build/myftw.h
@@ -1,7 +1,8 @@
#ifndef _H_MYFTW_
#define _H_MYFTW_
-/** \file build/myftw.h
+/** \ingroup rpmbuild
+ * \file build/myftw.h
* Portable ftw(3) using lstat() instead of stat().
*/
diff --git a/build/names.c b/build/names.c
index 6b5586637..c49349103 100644
--- a/build/names.c
+++ b/build/names.c
@@ -1,4 +1,5 @@
-/** \file build/names.c
+/** \ingroup rpmbuild
+ * \file build/names.c
* Simple user/group name/id cache (plus hostname and buildtime)
*/
diff --git a/build/pack.c b/build/pack.c
index 4603d7338..f5463b78e 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -1,4 +1,5 @@
-/** \file build/pack.c
+/** \ingroup rpmbuild
+ * \file build/pack.c
* Assemble components of an RPM package.
*/
@@ -415,8 +416,10 @@ int writeRPM(Header h, const char *fileName, int type,
archnum = -1;
osnum = -1;
if (Fileno(csa->cpioFdIn) < 0) {
+#ifndef DYING
rpmGetArchInfo(NULL, &archnum);
rpmGetOsInfo(NULL, &osnum);
+#endif
} else if (csa->lead != NULL) { /* XXX FIXME: exorcize lead/arch/os */
archnum = csa->lead->archnum;
osnum = csa->lead->osnum;
diff --git a/build/parseBuildInstallClean.c b/build/parseBuildInstallClean.c
index 0f2259b2a..c43e722f3 100644
--- a/build/parseBuildInstallClean.c
+++ b/build/parseBuildInstallClean.c
@@ -1,4 +1,5 @@
-/** \file build/parseBuildInstallClean.c
+/** \ingroup rpmbuild
+ * \file build/parseBuildInstallClean.c
* Parse %build/%install/%clean section from spec file.
*/
#include "system.h"
diff --git a/build/parseChangelog.c b/build/parseChangelog.c
index 086d5914e..4edd4f25d 100644
--- a/build/parseChangelog.c
+++ b/build/parseChangelog.c
@@ -1,4 +1,5 @@
-/** \file build/parseChangelog.c
+/** \ingroup rpmbuild
+ * \file build/parseChangelog.c
* Parse %changelog section from spec file.
*/
diff --git a/build/parseDescription.c b/build/parseDescription.c
index d38049192..5b44c8b9f 100644
--- a/build/parseDescription.c
+++ b/build/parseDescription.c
@@ -1,4 +1,5 @@
-/** \file build/parseDescription.c
+/** \ingroup rpmbuild
+ * \file build/parseDescription.c
* Parse %description section from spec file.
*/
diff --git a/build/parseFiles.c b/build/parseFiles.c
index 36aaef36e..fe6d1293d 100644
--- a/build/parseFiles.c
+++ b/build/parseFiles.c
@@ -1,4 +1,5 @@
-/** \file build/parseFiles.c
+/** \ingroup rpmbuild
+ * \file build/parseFiles.c
* Parse %files section from spec file.
*/
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index 04787da9d..8a36fe717 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -1,4 +1,5 @@
-/** \file build/parsePreamble.c
+/** \ingroup rpmbuild
+ * \file build/parsePreamble.c
* 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)
{
+#ifndef DYING
const char *arch = NULL;
const char *os = NULL;
rpmGetArchInfo(&arch, 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,
arch, RPMTAG_EXCLUDEARCH) == 1) {
diff --git a/build/parsePrep.c b/build/parsePrep.c
index c0cc6eb9b..d28e249c8 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -1,4 +1,5 @@
-/** \file build/parsePrep.c
+/** \ingroup rpmbuild
+ * \file build/parsePrep.c
* Parse %prep section from spec file.
*/
diff --git a/build/parseReqs.c b/build/parseReqs.c
index 3a77c266a..3f5c5dffc 100644
--- a/build/parseReqs.c
+++ b/build/parseReqs.c
@@ -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.
*/
diff --git a/build/parseScript.c b/build/parseScript.c
index 721c40ba3..3e8fdf64d 100644
--- a/build/parseScript.c
+++ b/build/parseScript.c
@@ -1,4 +1,5 @@
-/** \file build/parseScript.c
+/** \ingroup rpmbuild
+ * \file build/parseScript.c
* Parse install-time script section from spec file.
*/
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 7662d54bd..2a9446387 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -1,4 +1,5 @@
-/** \file build/parseSpec.c
+/** \ingroup rpmbuild
+ * \file build/parseSpec.c
* Top level dispatcher for spec file parsing.
*/
@@ -40,7 +41,6 @@ static inline void initParts(struct PartRec *p)
p->len = strlen(p->token);
}
-/** */
int isPart(char *line)
{
char c;
@@ -91,7 +91,6 @@ static int matchTok(const char *token, const char *line)
return rc;
}
-/** */
void handleComments(char *s)
{
SKIPSPACE(s);
@@ -168,11 +167,12 @@ static int copyNextLine(Spec spec, OFI_t *ofi, int strip)
/* 1 - EOF */
/* <0 - error */
-/** */
int readLine(Spec spec, int strip)
{
+#ifdef DYING
const char *arch;
const char *os;
+#endif
char *s;
int match;
struct ReadLevelEntry *rl;
@@ -229,10 +229,12 @@ retry:
}
}
+#ifdef DYING
arch = NULL;
rpmGetArchInfo(&arch, NULL);
os = NULL;
rpmGetOsInfo(&os, NULL);
+#endif
/* Copy next file line into the spec line buffer */
if ((rc = copyNextLine(spec, ofi, strip)) != 0)
@@ -243,17 +245,25 @@ retry:
match = -1;
if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) {
+ const char *arch = rpmExpand("%{_target_cpu}", NULL);
s += 7;
match = matchTok(arch, s);
+ xfree(arch);
} else if (! strncmp("%ifnarch", s, sizeof("%ifnarch")-1)) {
+ const char *arch = rpmExpand("%{_target_cpu}", NULL);
s += 8;
match = !matchTok(arch, s);
+ xfree(arch);
} else if (! strncmp("%ifos", s, sizeof("%ifos")-1)) {
+ const char *os = rpmExpand("%{_target_os}", NULL);
s += 5;
match = matchTok(os, s);
+ xfree(os);
} else if (! strncmp("%ifnos", s, sizeof("%ifnos")-1)) {
+ const char *os = rpmExpand("%{_target_os}", NULL);
s += 6;
match = !matchTok(os, s);
+ xfree(os);
} else if (! strncmp("%if", s, sizeof("%if")-1)) {
s += 3;
match = parseExpressionBoolean(spec, s);
@@ -326,7 +336,6 @@ retry:
return 0;
}
-/** */
void closeSpec(Spec spec)
{
OFI_t *ofi;
@@ -342,14 +351,15 @@ void closeSpec(Spec spec)
extern int noLang; /* XXX FIXME: pass as arg */
-/** */
int parseSpec(Spec *specp, const char *specFile, const char *rootURL,
const char *buildRootURL, int inBuildArch, const char *passPhrase,
char *cookie, int anyarch, int force)
{
int parsePart = PART_PREAMBLE;
int initialPackage = 1;
+#ifdef DYING
const char *saveArch;
+#endif
Package pkg;
int x, index;
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++) {
if (rpmMachineScore(RPM_MACHTABLE_BUILDARCH,
spec->buildArchitectures[x])) {
+#ifdef DYING
rpmGetMachine(&saveArch, NULL);
saveArch = xstrdup(saveArch);
rpmSetMachine(spec->buildArchitectures[x], NULL);
+#else
+ addMacro(NULL, "_target_cpu", NULL, spec->buildArchitectures[x], RMIL_RPMRC);
+#endif
if (parseSpec(&(spec->buildArchitectureSpecs[index]),
specFile, spec->rootURL, buildRootURL, 1,
passPhrase, cookie, anyarch, force)) {
@@ -460,8 +474,12 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU
freeSpec(spec);
return RPMERR_BADSPEC;
}
+#ifdef DYING
rpmSetMachine(saveArch, NULL);
xfree(saveArch);
+#else
+ delMacro(NULL, "_target_cpu");
+#endif
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 */
- { const char *arch = NULL;
- const char *os = NULL;
- char *myos = NULL;
-
- rpmGetArchInfo(&arch, NULL);
- rpmGetOsInfo(&os, NULL);
- /*
- * 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-platform (e.g "linux" from "sparc-*-linux").
- * XXX A copy of this string is embedded in headers.
- */
- if (!strcmp(os, "linux")) {
+ {
+#ifdef DYING
+ const char *arch = NULL;
+ const char *os = NULL;
+ char *myos = NULL;
+
+ rpmGetArchInfo(&arch, NULL);
+ rpmGetOsInfo(&os, NULL);
+ /*
+ * 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-platform (e.g "linux" from "sparc-*-linux").
+ * XXX A copy of this string is embedded in headers.
+ */
+ if (!strcmp(os, "linux")) {
myos = xstrdup(os);
*myos = 'L';
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) {
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_ARCH, RPM_STRING_TYPE, arch, 1);
- }
- FREE(myos);
}
+#ifdef DYING
+ FREE(myos);
+#else
+ xfree(arch);
+ xfree(os);
+#endif
+ }
closeSpec(spec);
*specp = spec;
diff --git a/build/reqprov.c b/build/reqprov.c
index 136ec8ba5..7a4ec38fa 100644
--- a/build/reqprov.c
+++ b/build/reqprov.c
@@ -1,4 +1,5 @@
-/** \file build/reqprov.c
+/** \ingroup rpmbuild
+ * \file build/reqprov.c
* Add dependency tags to package header(s).
*/
diff --git a/build/rpmbuild.h b/build/rpmbuild.h
index 0ab66d6de..e838bff84 100644
--- a/build/rpmbuild.h
+++ b/build/rpmbuild.h
@@ -1,7 +1,8 @@
#ifndef _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.
*/
diff --git a/build/rpmspec.h b/build/rpmspec.h
index aa4ceccbd..ee65a462c 100644
--- a/build/rpmspec.h
+++ b/build/rpmspec.h
@@ -1,7 +1,8 @@
#ifndef _H_SPEC_
#define _H_SPEC_
-/** \file build/rpmspec.h
+/** \ingroup rpmbuild
+ * \file build/rpmspec.h
* The Spec and Package data structures used during build.
*/
diff --git a/build/spec.c b/build/spec.c
index 11598be4f..a85e2a93d 100644
--- a/build/spec.c
+++ b/build/spec.c
@@ -1,4 +1,5 @@
-/** \file build/spec.c
+/** \ingroup rpmbuild
+ * \file build/spec.c
* Handle spec data structure.
*/
diff --git a/lib/cpio.c b/lib/cpio.c
index b5c616317..06ca42327 100644
--- a/lib/cpio.c
+++ b/lib/cpio.c
@@ -1,7 +1,8 @@
-/** \file lib/cpio.c
+/** \ingroup payload rpmio
+ * \file lib/cpio.c
* 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
* that's not true!
*/
@@ -16,7 +17,7 @@
#define CPIO_CRC_MAGIC "070702"
#define TRAILER "TRAILER!!!"
-/**
+/** \ingroup payload
* Keeps track of set of all hard linked files in archive.
*/
struct hardLink {
@@ -33,7 +34,7 @@ struct hardLink {
enum hardLinkType { HARDLINK_INSTALL=1, HARDLINK_BUILD };
-/**
+/** \ingroup payload
* Cpio archive header information.
*/
struct cpioCrcPhysicalHeader {
@@ -55,7 +56,7 @@ struct cpioCrcPhysicalHeader {
#define PHYS_HDR_SIZE 110 /* don't depend on sizeof(struct) */
-/**
+/** \ingroup payload
* File name and stat information.
*/
struct cpioHeader {
diff --git a/lib/cpio.h b/lib/cpio.h
index a10448a53..887a22525 100644
--- a/lib/cpio.h
+++ b/lib/cpio.h
@@ -1,7 +1,8 @@
#ifndef H_CPIO
#define H_CPIO
-/** \file lib/cpio.h
+/** \ingroup payload
+ * \file lib/cpio.h
* Structures used to handle cpio payloads within rpm packages.
*
* Warning: Don't think that rpm's cpio implementation behaves just like
@@ -17,7 +18,7 @@
#include <rpmio_internal.h>
-/**
+/** \ingroup payload
* 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.
*/
@@ -53,7 +54,7 @@
#define CPIO_FOLLOW_SYMLINKS (1 << 4) /* 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.
*/
struct cpioFileMapping {
@@ -65,7 +66,7 @@ struct cpioFileMapping {
int mapFlags;
};
-/**
+/** \ingroup payload
* The first argument passed in a cpio progress callback.
*
* Note: When building the cpio payload, only "file" is filled in.
@@ -81,11 +82,11 @@ struct cpioCallbackInfo {
extern "C" {
#endif
-/**
+/** \ingroup payload
*/
typedef void (*cpioCallback) (struct cpioCallbackInfo * filespec, void * data);
-/**
+/** \ingroup payload
* The RPM internal equivalent of the command line "cpio -i".
* If no mappings are passed, this installs everything! If one is passed
* 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)
/*@modifies fileSystem, cfd, *failedFile @*/;
-/**
+/** \ingroup payload
* The RPM internal equivalent of the command line "cpio -o".
*
* @param cfd file handle
@@ -124,7 +125,7 @@ int cpioBuildArchive(FD_t cfd, const struct cpioFileMapping * mappings,
unsigned int * archiveSize, /*@out@*/const char ** failedFile)
/*@modifies fileSystem, cfd, *archiveSize, *failedFile @*/;
-/**
+/** \ingroup payload
* Compare two cpio file map entries (qsort/bsearch).
* This is designed to be qsort/bsearch compatible.
* @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) /*@*/;
-/**
+/** \ingroup payload
* Return fornmatted error message on payload handling failure.
*/
/*@observer@*/ const char *cpioStrerror(int rc) /*@*/;
diff --git a/lib/db1.c b/lib/db1.c
index 7de04d0db..8344773b7 100644
--- a/lib/db1.c
+++ b/lib/db1.c
@@ -1,5 +1,9 @@
#include "system.h"
+/** \ingroup db1
+ * \file lib/db1.c
+ */
+
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
#include <db1/db.h>
@@ -37,6 +41,8 @@ static inline DBTYPE db3_to_dbtype(int dbitype)
/*@notreached@*/ return DB_HASH;
}
+/** \ingroup db1
+ */
char * db1basename (int rpmtag) {
char * base = NULL;
switch (rpmtag) {
@@ -487,6 +493,8 @@ exit:
return rc;
}
+/** \ingroup db1
+ */
struct _dbiVec db1vec = {
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
db1open, db1close, db1sync, db1copen, db1cclose, db1cdel, db1cget, db1cput,
diff --git a/lib/db2.c b/lib/db2.c
index de6218c63..8359dd257 100644
--- a/lib/db2.c
+++ b/lib/db2.c
@@ -1,5 +1,9 @@
#include "system.h"
+/** \ingroup db2
+ * \file lib/db2.c
+ */
+
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
#include <db2/db.h>
diff --git a/lib/db3.c b/lib/db3.c
index 50259dedd..78c51ac8c 100644
--- a/lib/db3.c
+++ b/lib/db3.c
@@ -1,5 +1,9 @@
#include "system.h"
+/** \ingroup db3
+ * \file lib/db3.c
+ */
+
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
#ifdef __LCLINT__
@@ -25,7 +29,9 @@ typedef int int32_t;
struct _dbiIndex db3dbi;
-/* Analogue to struct poptOption */
+/** \ingroup db3
+ * Analogue to struct poptOption
+ */
struct dbOption {
const char * longName; /* may be NULL */
int argInfo;
@@ -36,6 +42,8 @@ struct dbOption {
#define _POPT_SET_BIT (POPT_ARG_VAL|POPT_ARGFLAG_OR)
/*@-immediatetrans@*/
+/** \ingroup db3
+ */
struct dbOption rdbOptions[] = {
/* XXX DB_CXX_NO_EXCEPTIONS */
{ "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;
}
+/** \ingroup db3
+ */
struct _dbiVec db3vec = {
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
db3open, db3close, db3sync, db3copen, db3cclose, db3cdel, db3cget, db3cput,