summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--constants.py1
-rw-r--r--loader2/loader.c22
-rw-r--r--loader2/loader.h1
-rw-r--r--product.py4
-rw-r--r--text.py5
6 files changed, 42 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 03e3b939b..edfa54dec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2007-08-23 Martin Sivak <msivak@redhat.com>
+
+ All changes are about #244531.
+
+ * loader2/loader.h: Add getProductArch method.
+ * loader2/loader.c: Populate productArch and define getProductArch.
+ Show the architecture in stage1.
+
+ * constants.py: add productArch
+ * product.py: populate productArch
+ * text.py: Show the architecture during text mode stage2.
+
2007-08-22 Chris Lumens <clumens@redhat.com>
* anaconda.spec: Bump version.
diff --git a/constants.py b/constants.py
index 5924e505e..4e1a2c917 100644
--- a/constants.py
+++ b/constants.py
@@ -59,6 +59,7 @@ NUMBER_OF_CDS = 5
import product
productName = product.productName
productVersion = product.productVersion
+productArch = product.productArch
productPath = product.productPath
bugzillaUrl = product.bugUrl
diff --git a/loader2/loader.c b/loader2/loader.c
index 1130f3bc5..07ccc2660 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -151,7 +151,10 @@ void doShell(void) {
void startNewt(void) {
if (!newtRunning) {
- char *buf = sdupprintf(_("Welcome to %s"), getProductName());
+ char *buf;
+ if(getProductArch()) buf = sdupprintf(_("Welcome to %s for %s"), getProductName(), getProductArch());
+ else buf = sdupprintf(_("Welcome to %s"), getProductName());
+
newtInit();
newtCls();
newtDrawRootText(0, 0, buf);
@@ -174,6 +177,8 @@ void stopNewt(void) {
static char * productName = NULL;
static char * productPath = NULL;
+static char * productArch = NULL;
+static char * productStamp = NULL;
static void initProductInfo(void) {
FILE *f;
@@ -184,9 +189,13 @@ static void initProductInfo(void) {
productName = strdup("anaconda");
productPath = strdup("anaconda");
} else {
+ productStamp = malloc(256);
productName = malloc(256);
productPath = malloc(256);
- productName = fgets(productName, 256, f); /* stamp time */
+ productStamp = fgets(productStamp, 256, f); /* stamp time and architecture */
+ productArch = strstr(productStamp, "."); /* architecture is separated by dot */
+ if(productArch) productArch++;
+
productName = fgets(productName, 256, f); /* product name */
productPath = fgets(productPath, 256, f); /* product version */
productPath = fgets(productPath, 256, f); /* product path */
@@ -202,6 +211,8 @@ static void initProductInfo(void) {
i--;
}
}
+
+ if(!productArch) productArch = strdup("unknown architecture");
}
char * getProductName(void) {
@@ -211,6 +222,13 @@ char * getProductName(void) {
return productName;
}
+char * getProductArch(void) {
+ if (!productArch) {
+ initProductInfo();
+ }
+ return productArch;
+}
+
char * getProductPath(void) {
if (!productPath) {
initProductInfo();
diff --git a/loader2/loader.h b/loader2/loader.h
index 5c47e1cba..7ab83bb51 100644
--- a/loader2/loader.h
+++ b/loader2/loader.h
@@ -90,6 +90,7 @@ void startNewt(void);
void stopNewt(void);
char * getProductName(void);
char * getProductPath(void);
+char * getProductArch(void);
#include "modules.h"
#include "moduledeps.h"
diff --git a/product.py b/product.py
index 970a1164c..408c22d63 100644
--- a/product.py
+++ b/product.py
@@ -26,6 +26,7 @@ productStamp = ""
productName = "anaconda"
productVersion = "bluesky"
productPath = "anaconda"
+productArch = None
bugUrl = "your distribution provided bug reporting tool."
if path is not None:
@@ -33,6 +34,7 @@ if path is not None:
lines = f.readlines()
if len(lines) >= 3:
productStamp = lines[0][:-1]
+ productArch = productStamp[productStamp.index(".")+1:]
productName = lines[1][:-1]
productVersion = lines[2][:-1]
if len(lines) >= 4:
@@ -46,5 +48,7 @@ if os.environ.has_key("ANACONDA_PRODUCTVERSION"):
productVersion = os.environ["ANACONDA_PRODUCTVERSION"]
if os.environ.has_key("ANACONDA_PRODUCTPATH"):
productPath = os.environ["ANACONDA_PRODUCTPATH"]
+if os.environ.has_key("ANACONDA_PRODUCTARCH"):
+ productArch = os.environ["ANACONDA_PRODUCTARCH"]
if os.environ.has_key("ANACONDA_BUGURL"):
bugUrl = os.environ["ANACONDA_BUGURL"]
diff --git a/text.py b/text.py
index fee675bc8..6c396f56e 100644
--- a/text.py
+++ b/text.py
@@ -467,7 +467,10 @@ class InstallInterface:
def drawFrame(self):
self.screen.drawRootText (0, 0, self.screen.width * " ")
- self.screen.drawRootText (0, 0, _("Welcome to %s") % productName)
+ if productArch:
+ self.screen.drawRootText (0, 0, _("Welcome to %s for %s") % (productName, productArch,))
+ else:
+ self.screen.drawRootText (0, 0, _("Welcome to %s") % productName)
if (os.access("/usr/share/anaconda/help/C/s1-help-screens-lang.txt", os.R_OK)):
self.screen.pushHelpLine(_(" <F1> for help | <Tab> between elements | <Space> selects | <F12> next screen"))