[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue-common setup.py
From: |
Reinhard Mueller |
Subject: |
gnue-common setup.py |
Date: |
Fri, 26 Sep 2003 09:09:19 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue-common
Branch:
Changes by: Reinhard Mueller <address@hidden> 03/09/26 09:09:19
Modified files:
. : setup.py
Log message:
Introduced new user-option --install-config. That was easier than I
thought.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/setup.py.diff?tr1=1.72&tr2=1.73&r1=text&r2=text
Patches:
Index: gnue-common/setup.py
diff -c gnue-common/setup.py:1.72 gnue-common/setup.py:1.73
*** gnue-common/setup.py:1.72 Fri Sep 26 06:43:51 2003
--- gnue-common/setup.py Fri Sep 26 09:09:19 2003
***************
*** 162,167 ****
--- 162,184 ----
class gnue_install (install):
+ user_options = install.user_options
+ i = 0
+ for option in user_options:
+ i = i + 1
+ if option [0] == "install-data=":
+ user_options.insert (i, ("install-config=", None,
+ "installation directory for configuration
files"))
+ break
+
+ #
---------------------------------------------------------------------------
+ # Initalize options
+ #
---------------------------------------------------------------------------
+
+ def initialize_options (self):
+ install.initialize_options (self)
+ self.install_config = None
+
#
---------------------------------------------------------------------------
# Check dependencies
#
---------------------------------------------------------------------------
***************
*** 177,184 ****
def _write_config (self):
- self.install_config = os.path.join (self.install_data, "etc") # FIXME!
-
output = open ("module/base/paths.py", "w")
output.write ("# This file was generated during installation.\n")
output.write ("\n")
--- 194,199 ----
***************
*** 322,327 ****
--- 337,351 ----
if self.finalized:
return
+ # try to set a reasonable default for --install-config
+ if self.install_config is None:
+ if self.home == "/usr" or self.prefix == "/usr":
+ self.install_config = "/etc"
+ elif self.home == "/opt/gnue" or self.prefix == "/opt/gnue":
+ self.install_config = "/etc/opt/gnue"
+ else:
+ self.install_config = os.path.join (self.install_data, "etc")
+
# if install directory isn't in Python's search path, add it there
if self.install_lib in sys.path:
path_line = ""
***************
*** 404,414 ****
'prune images/CVS'],
preserve_path = 1),
Data_Files(
! base_dir = 'install_data',
copy_to = '',
template = ['recursive-include etc *',
'prune etc/CVS'],
! preserve_path = 1),
Data_Files(
base_dir = 'install_data',
copy_to = '',
--- 428,438 ----
'prune images/CVS'],
preserve_path = 1),
Data_Files(
! base_dir = 'install_config',
copy_to = '',
template = ['recursive-include etc *',
'prune etc/CVS'],
! preserve_path = 0),
Data_Files(
base_dir = 'install_data',
copy_to = '',
- gnue-common setup.py, (continued)
- gnue-common setup.py, Jason Cater, 2003/09/18
- gnue-common setup.py, Jason Cater, 2003/09/18
- gnue-common setup.py, Jan Ischebeck, 2003/09/22
- gnue-common setup.py, Reinhard Mueller, 2003/09/23
- gnue-common setup.py, Reinhard Mueller, 2003/09/23
- gnue-common setup.py, Bajusz Tamás, 2003/09/24
- gnue-common setup.py, Reinhard Mueller, 2003/09/25
- gnue-common setup.py, Jan Ischebeck, 2003/09/25
- gnue-common setup.py, Reinhard Mueller, 2003/09/25
- gnue-common setup.py, Bajusz Tamás, 2003/09/26
- gnue-common setup.py,
Reinhard Mueller <=
- gnue-common setup.py, Reinhard Mueller, 2003/09/29
- gnue-common setup.py, Reinhard Mueller, 2003/09/29
- gnue-common setup.py, Reinhard Mueller, 2003/09/29
- gnue-common setup.py, Reinhard Mueller, 2003/09/29
- gnue-common setup.py, Reinhard Mueller, 2003/09/29
- gnue-common setup.py, Reinhard Mueller, 2003/09/29
- gnue-common setup.py, Reinhard Mueller, 2003/09/30