diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-01-13 07:14:58 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-01-13 07:14:58 +0000 |
commit | fbf80e90c2b9595edf7857e5f19f2b64b4931508 (patch) | |
tree | 2de90377331e926aeeaccd5837e8cf872d08fda4 /loader2/loader.c | |
parent | 234a0ed83bf5b06ccffb911463d3e39ae469d9f6 (diff) | |
download | anaconda-fbf80e90c2b9595edf7857e5f19f2b64b4931508.tar.gz anaconda-fbf80e90c2b9595edf7857e5f19f2b64b4931508.tar.xz anaconda-fbf80e90c2b9595edf7857e5f19f2b64b4931508.zip |
don't substitute PRODUCTNAME at build time and instead read it from
/.buildstamp at runtime
Diffstat (limited to 'loader2/loader.c')
-rw-r--r-- | loader2/loader.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/loader2/loader.c b/loader2/loader.c index 9d4eca5b7..c4a716782 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -163,7 +163,7 @@ void doSuspend(void) { void startNewt(int flags) { if (!newtRunning) { - char *buf = sdupprintf(_("Welcome to %s"), PRODUCTNAME); + char *buf = sdupprintf(_("Welcome to %s"), getProductName()); newtInit(); newtCls(); newtDrawRootText(0, 0, buf); @@ -182,6 +182,27 @@ void stopNewt(void) { newtRunning = 0; } +char * getProductName(void) { + static char * productName = NULL; + FILE *f; + + if (!productName) { + f = fopen("/.buildstamp", "r"); + if (!f) { + productName = strdup("anaconda"); + } else { + productName = malloc(256); + fgets(productName, 256, f); /* stamp time */ + fgets(productName, 256, f); /* product name */ + return productName; + } + } else { + return productName; + } + + return NULL; +} + void initializeConsole(moduleList modLoaded, moduleDeps modDeps, moduleInfoSet modInfo, int flags) { if (!FL_NOFB(flags)) @@ -546,7 +567,7 @@ static void checkForRam(int flags) { if (totalMemory() < MIN_RAM) { char *buf; buf = sdupprintf(_("You do not have enough RAM to install %s " - "on this machine."), PRODUCTNAME); + "on this machine."), getProductName()); startNewt(flags); newtWinMessage(_("Error"), _("OK"), buf); free(buf); @@ -1146,7 +1167,7 @@ int main(int argc, char ** argv) { closeLog(); if (!FL_TESTING(flags)) { - char *buf = sdupprintf(_("Running anaconda, the %s system installer - please wait...\n"), PRODUCTNAME); + char *buf = sdupprintf(_("Running anaconda, the %s system installer - please wait...\n"), getProductName()); printf("%s", buf); execv(anacondaArgs[0], anacondaArgs); perror("exec"); |