From: marc Date: Fri, 1 May 1998 21:10:51 +0000 (+0000) Subject: - save/restore existing arch when done with buildarch X-Git-Tag: rpm-4.4-release~3653 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72dedbf1dd34327db2ad911010730093d8342c59;p=platform%2Fupstream%2Frpm.git - save/restore existing arch when done with buildarch CVS patchset: 2105 CVS date: 1998/05/01 21:10:51 --- diff --git a/CHANGES b/CHANGES index d580be8..ee343a6 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,7 @@ - headerGetEntry() should return count of 1 when returning strings plucked from i18n strings - do not remove comments in scripts + - save/restore existing arch when done with buildarch 2.4.108 -> 2.4.109: - remove icons with --rmsource diff --git a/build/parseSpec.c b/build/parseSpec.c index 124b113..ab197a7 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -19,6 +19,7 @@ int parseSpec(Spec *specp, char *specFile, char *buildRoot, int parsePart = PART_PREAMBLE; int initialPackage = 1; char *name, *arch, *os; + char *saveArch; Package pkg; int x, index; Spec spec; @@ -111,6 +112,8 @@ int parseSpec(Spec *specp, char *specFile, char *buildRoot, while (x < spec->buildArchitectureCount) { if (rpmMachineScore(RPM_MACHTABLE_BUILDARCH, spec->buildArchitectures[x])) { + rpmGetMachine(&saveArch, NULL); + saveArch = strdup(saveArch); rpmSetMachine(spec->buildArchitectures[x], NULL); if (parseSpec(&(spec->buildArchitectureSpecs[index]), specFile, buildRoot, 1, @@ -119,6 +122,8 @@ int parseSpec(Spec *specp, char *specFile, char *buildRoot, freeSpec(spec); return RPMERR_BADSPEC; } + rpmSetMachine(saveArch, NULL); + free(saveArch); index++; } x++; diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 764e9fe..d8ba4ad 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -261,6 +261,7 @@ void rpmSetTables(int archTable, int osTable); /* only used by build code */ /* if either are NULL, they are set to the default value (munged uname()) pushed through a translation table (if appropriate) */ void rpmSetMachine(char * arch, char * os); +void rpmGetMachine(char **arch, char **os); /** **/ diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 763b106..4a101ff 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -872,6 +872,17 @@ int rpmMachineScore(int type, char * name) { return 0; } +void rpmGetMachine(char **arch, char **os) +{ + if (arch) { + *arch = current[ARCH]; + } + + if (os) { + *os = current[OS]; + } +} + void rpmSetMachine(char * arch, char * os) { int transOs = os == NULL; int transArch = arch == NULL;