Sanity check

CVS patchset: 1835
CVS date: 1997/09/30 20:23:20
This commit is contained in:
marc 1997-09-30 20:23:20 +00:00
parent b7d6861f74
commit d518d25eb9
6 changed files with 21 additions and 12 deletions

View File

@ -5,6 +5,9 @@
have been obsoleted
- updated rpmdepUpgradePackage() to deal with obsoletes tag
- moved popt into a separate library
- directory created with %doc is now name-version (dropped
the release)
- added buildarch/buildos macros
2.4.6 -> 2.4.7:
- had some wrong month lengths in changelog date parsing

View File

@ -26,7 +26,7 @@
#include "stringbuf.h"
#include "misc.h"
#include "pack.h"
#include "popt.h"
#include "popt/popt.h"
#include "names.h"

View File

@ -86,7 +86,7 @@ int finish_filelists(Spec spec)
FILE *file;
struct PackageRec *pr = spec->packages;
char *s, **files, **line;
char *version, *release, *packageVersion, *packageRelease, *docs, *name;
char *version, *release, *packageVersion, *docs, *name;
headerGetEntry(spec->packages->header, RPMTAG_VERSION, NULL,
(void *) &version, NULL);
@ -119,20 +119,16 @@ int finish_filelists(Spec spec)
}
freeSplitString(files);
/* Handle subpackage version/release overrides */
/* Handle subpackage version overrides */
if (!headerGetEntry(pr->header, RPMTAG_VERSION, NULL,
(void *) &packageVersion, NULL)) {
packageVersion = version;
}
if (!headerGetEntry(pr->header, RPMTAG_RELEASE, NULL,
(void *) &packageRelease, NULL)) {
packageRelease = release;
}
/* Generate the doc script */
appendStringBuf(spec->doc, "DOCDIR=$RPM_ROOT_DIR/$RPM_DOC_DIR/");
headerGetEntry(pr->header, RPMTAG_NAME, NULL, (void *) &name, NULL);
sprintf(buf, "%s-%s-%s", name, packageVersion, packageRelease);
sprintf(buf, "%s-%s", name, packageVersion);
appendLineStringBuf(spec->doc, buf);
docs = getStringBuf(pr->doc);
if (*docs) {
@ -262,8 +258,8 @@ int process_filelist(Header header, struct PackageRec *pr,
processFileListFailed = 1;
fp++; continue;
}
sprintf(buf, "%s/%s-%s-%s", rpmGetVar(RPMVAR_DEFAULTDOCDIR),
name, version, release);
sprintf(buf, "%s/%s-%s", rpmGetVar(RPMVAR_DEFAULTDOCDIR),
name, version);
filename = buf;
passed_special_doc = 1;
}

View File

@ -1151,6 +1151,7 @@ Spec parseSpecAux(FILE *f, char *specfile, char *buildRootOverride,
int gotRoot = 0;
int versionMacroSet = 0;
int releaseMacroSet = 0;
char *arch, *os;
struct PackageRec *cur_package = NULL;
Spec spec = (struct SpecRec *) malloc(sizeof(struct SpecRec));
@ -1177,6 +1178,11 @@ Spec parseSpecAux(FILE *f, char *specfile, char *buildRootOverride,
sb = newStringBuf();
reset_spec(); /* Reset the parser */
rpmGetArchInfo(&arch, NULL);
rpmGetOsInfo(&os, NULL);
addMacro("buildarch", arch);
addMacro("buildos", os);
scriptProg[0] = '\0';
cur_part = PREAMBLE_PART;
while ((x = read_line(f, buf)) > 0) {

View File

@ -66,8 +66,8 @@ extern const struct headerSprintfExtension rpmHeaderFormats[];
#define RPMTAG_ROOT 1038
#define RPMTAG_FILEUSERNAME 1039
#define RPMTAG_FILEGROUPNAME 1040
#define RPMTAG_EXCLUDE 1041 /* not used - internal */
#define RPMTAG_EXCLUSIVE 1042 /* not used - internal */
#define RPMTAG_EXCLUDE 1041 /* not used - depricated */
#define RPMTAG_EXCLUSIVE 1042 /* not used - depricated */
#define RPMTAG_ICON 1043
#define RPMTAG_SOURCERPM 1044
#define RPMTAG_FILEVERIFYFLAGS 1045

View File

@ -31,6 +31,10 @@ StringBuf newStringBuf(void)
void freeStringBuf(StringBuf sb)
{
if (! sb) {
return;
}
free(sb->buf);
free(sb);
}