1 |
# |
2 |
# product.py: product identification string |
3 |
# |
4 |
# Copyright 2003 Red Hat, Inc. |
5 |
# |
6 |
# This software may be freely redistributed under the terms of the GNU |
7 |
# library public license. |
8 |
# |
9 |
# You should have received a copy of the GNU Library Public License |
10 |
# along with this program; if not, write to the Free Software |
11 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
12 |
|
13 |
import os |
14 |
|
15 |
if os.access("/tmp/product/.buildstamp", os.R_OK): |
16 |
path = "/tmp/product/.buildstamp" |
17 |
elif os.access("/.buildstamp", os.R_OK): |
18 |
path = "/.buildstamp" |
19 |
else: |
20 |
path = None |
21 |
|
22 |
if path is None: |
23 |
productName = "anaconda" |
24 |
productVersion = "bluesky" |
25 |
productPath = "CentOS" |
26 |
else: |
27 |
f = open(path, "r") |
28 |
lines = f.readlines() |
29 |
if len(lines) < 4: |
30 |
productName = "anaconda" |
31 |
productVersion = "bluesky" |
32 |
productPath = "CentOS" |
33 |
else: |
34 |
productName = lines[1][:-1] |
35 |
productVersion = lines[2][:-1] |
36 |
productPath = lines[3][:-1] |
37 |
|
38 |
|
39 |
productName = "SME Server" |
40 |
productVersion = "8.0" |
41 |
productPath = "CentOS" |