summaryrefslogtreecommitdiffstats
path: root/pyanaconda/product.py
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2010-05-11 17:31:06 +0200
committerMartin Sivak <msivak@redhat.com>2010-05-31 14:21:49 +0200
commit78421d4ed23ad58b021c4d9d1bae690b99c167fe (patch)
tree909c1b650afe9afea03ecf1a03b2d39d39cf72b7 /pyanaconda/product.py
parent40b979f28cfd73078d5dd58b8f7e97e76198a222 (diff)
downloadanaconda-78421d4ed23ad58b021c4d9d1bae690b99c167fe.tar.gz
anaconda-78421d4ed23ad58b021c4d9d1bae690b99c167fe.tar.xz
anaconda-78421d4ed23ad58b021c4d9d1bae690b99c167fe.zip
Structure the repo layout so it matches final structure better and make isys a real Python package.
Also updates the build and autotools stuff to work with the new structure
Diffstat (limited to 'pyanaconda/product.py')
-rw-r--r--pyanaconda/product.py63
1 files changed, 63 insertions, 0 deletions
diff --git a/pyanaconda/product.py b/pyanaconda/product.py
new file mode 100644
index 000000000..68df00c66
--- /dev/null
+++ b/pyanaconda/product.py
@@ -0,0 +1,63 @@
+#
+# product.py: product identification string
+#
+# Copyright (C) 2003 Red Hat, Inc. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+import os
+
+if os.access("/tmp/product/.buildstamp", os.R_OK):
+ path = "/tmp/product/.buildstamp"
+elif os.access("/.buildstamp", os.R_OK):
+ path = "/.buildstamp"
+elif os.environ.has_key("PRODBUILDPATH") and \
+ os.access(os.environ["PRODBUILDPATH"], os.R_OK):
+ path = os.environ["PRODBUILDPATH"]
+else:
+ path = None
+
+productStamp = ""
+productName = "anaconda"
+productVersion = "bluesky"
+productPath = "Packages"
+productArch = None
+bugUrl = "your distribution provided bug reporting tool."
+
+if path is not None:
+ f = open(path, "r")
+ lines = f.readlines()
+ del f
+ 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:
+ bugUrl = lines[3][:-1]
+
+if os.environ.has_key("ANACONDA_PRODUCTNAME"):
+ productName = os.environ["ANACONDA_PRODUCTNAME"]
+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"]
+
+if productVersion == "development": # hack to transform for now
+ productVersion = "rawhide"