- save/restore existing arch when done with buildarch
authormarc <devnull@localhost>
Fri, 1 May 1998 21:10:51 +0000 (21:10 +0000)
committermarc <devnull@localhost>
Fri, 1 May 1998 21:10:51 +0000 (21:10 +0000)
CVS patchset: 2105
CVS date: 1998/05/01 21:10:51

CHANGES
build/parseSpec.c
lib/rpmlib.h
lib/rpmrc.c

diff --git a/CHANGES b/CHANGES
index d580be8..ee343a6 100644 (file)
--- 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
index 124b113..ab197a7 100644 (file)
@@ -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++;
index 764e9fe..d8ba4ad 100644 (file)
@@ -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);
 
 /** **/
 
index 763b106..4a101ff 100644 (file)
@@ -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;