fix: os was not initialized with "--target i586".
CVS patchset: 2952 CVS date: 1999/04/06 16:54:55
This commit is contained in:
parent
e1cef20ad0
commit
c06d64a88c
1
CHANGES
1
CHANGES
|
@ -1,5 +1,6 @@
|
|||
2.93 -> 2.94
|
||||
- fix: segfault while parsing target string.
|
||||
- fix: os was not initialized with "--target i586".
|
||||
|
||||
2.92 -> 2.93
|
||||
- eliminate old rpmrc configuration syntax.
|
||||
|
|
38
lib/rpmrc.c
38
lib/rpmrc.c
|
@ -1123,7 +1123,7 @@ void rpmGetOsInfo(char ** name, int * num) {
|
|||
void rpmRebuildTargetVars(const char **buildtarget, const char ** canontarget)
|
||||
{
|
||||
|
||||
char *ca = NULL, *co = NULL, *ct;
|
||||
char *ca = NULL, *co = NULL, *ct = NULL;
|
||||
int x;
|
||||
|
||||
/* Rebuild the compat table to recalculate the current target arch. */
|
||||
|
@ -1142,30 +1142,41 @@ void rpmRebuildTargetVars(const char **buildtarget, const char ** canontarget)
|
|||
if ((co = strrchr(c, '-')) == NULL) {
|
||||
co = c;
|
||||
} else {
|
||||
if (!strcmp(co, "-gnu"))
|
||||
if (!strcasecmp(co, "-gnu"))
|
||||
*co = '\0';
|
||||
if ((co = strrchr(c, '-')) == NULL)
|
||||
co = c;
|
||||
else
|
||||
co++;
|
||||
}
|
||||
if (co != NULL) co = strdup(co);
|
||||
}
|
||||
ct = strdup(*buildtarget);
|
||||
} else {
|
||||
/* Set build target from default arch and os */
|
||||
/* Set build target from rpm arch and os */
|
||||
rpmGetArchInfo(&ca,NULL);
|
||||
if (ca) ca = strdup(ca);
|
||||
rpmGetOsInfo(&co,NULL);
|
||||
if (co) co = strdup(co);
|
||||
}
|
||||
|
||||
if (ca == NULL) defaultMachine(&ca, NULL);
|
||||
if (co == NULL) defaultMachine(NULL, &co);
|
||||
/* If still not set, Set target arch/os from default uname(2) values */
|
||||
if (ca == NULL) {
|
||||
defaultMachine(&ca, NULL);
|
||||
ca = strdup(ca);
|
||||
for (x = 0; ca[x]; x++)
|
||||
ca[x] = tolower(ca[x]);
|
||||
co = strdup(co);
|
||||
for (x = 0; co[x]; x++)
|
||||
co[x] = tolower(co[x]);
|
||||
}
|
||||
for (x = 0; ca[x]; x++)
|
||||
ca[x] = tolower(ca[x]);
|
||||
|
||||
ct = malloc(strlen(co)+strlen(ca)+2);
|
||||
if (co == NULL) {
|
||||
defaultMachine(NULL, &co);
|
||||
co = strdup(co);
|
||||
}
|
||||
for (x = 0; co[x]; x++)
|
||||
co[x] = tolower(co[x]);
|
||||
|
||||
/* XXX For now, set canonical target to arch-os */
|
||||
if (ct == NULL) {
|
||||
ct = malloc(strlen(ca) + sizeof("-") + strlen(co));
|
||||
sprintf(ct, "%s-%s", ca, co);
|
||||
}
|
||||
|
||||
|
@ -1184,7 +1195,8 @@ void rpmRebuildTargetVars(const char **buildtarget, const char ** canontarget)
|
|||
*canontarget = ct;
|
||||
else
|
||||
free(ct);
|
||||
free(ca); /* XXX this frees co too */
|
||||
free(ca);
|
||||
free(co);
|
||||
}
|
||||
|
||||
int rpmShowRC(FILE *f)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 1999-04-05 15:17-0400\n"
|
||||
"POT-Creation-Date: 1999-04-06 12:51-0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
Loading…
Reference in New Issue