diff options
author | jbj <devnull@localhost> | 2000-08-27 19:18:25 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2000-08-27 19:18:25 +0000 |
commit | a131131381d03cd76c1e6d15ab5b3486ed6f17b3 (patch) | |
tree | a8c31b435ff494b028e8f1f5ba2a1d8b6d9fc563 /build | |
parent | 918188a90c4911652bbcbe1f20a09b3123d2b5fa (diff) | |
download | rpm-a131131381d03cd76c1e6d15ab5b3486ed6f17b3.tar.gz rpm-a131131381d03cd76c1e6d15ab5b3486ed6f17b3.tar.bz2 rpm-a131131381d03cd76c1e6d15ab5b3486ed6f17b3.zip |
Doxygen annotations.
CVS patchset: 4130
CVS date: 2000/08/27 19:18:25
Diffstat (limited to 'build')
-rw-r--r-- | build/build.c | 3 | ||||
-rw-r--r-- | build/buildio.h | 3 | ||||
-rw-r--r-- | build/expression.c | 10 | ||||
-rw-r--r-- | build/files.c | 3 | ||||
-rw-r--r-- | build/misc.c | 3 | ||||
-rw-r--r-- | build/myftw.c | 5 | ||||
-rw-r--r-- | build/myftw.h | 3 | ||||
-rw-r--r-- | build/names.c | 3 | ||||
-rw-r--r-- | build/pack.c | 5 | ||||
-rw-r--r-- | build/parseBuildInstallClean.c | 3 | ||||
-rw-r--r-- | build/parseChangelog.c | 3 | ||||
-rw-r--r-- | build/parseDescription.c | 3 | ||||
-rw-r--r-- | build/parseFiles.c | 3 | ||||
-rw-r--r-- | build/parsePreamble.c | 9 | ||||
-rw-r--r-- | build/parsePrep.c | 3 | ||||
-rw-r--r-- | build/parseReqs.c | 3 | ||||
-rw-r--r-- | build/parseScript.c | 3 | ||||
-rw-r--r-- | build/parseSpec.c | 73 | ||||
-rw-r--r-- | build/reqprov.c | 3 | ||||
-rw-r--r-- | build/rpmbuild.h | 3 | ||||
-rw-r--r-- | build/rpmspec.h | 3 | ||||
-rw-r--r-- | build/spec.c | 3 |
22 files changed, 105 insertions, 48 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. */ |