[Zope-Checkins] CVS: Zope/inst - acceptable_version.py:1.1.2.1 register_software.py:1.1.2.1 software_name.py:1.1.2.1

Matt Behrens matt@zigg.com
Sun, 19 May 2002 21:37:34 -0400


Update of /cvs-repository/Zope/inst
In directory cvs.zope.org:/tmp/cvs-serv14149/inst

Added Files:
      Tag: zigg_unix-install-control-config-branch
	acceptable_version.py register_software.py software_name.py 
Log Message:
Kick off the Grand Unified Installer/Controller/Configurator branch.

This is only half done right now, and doesn't deliver everything I
have promised just yet, so don't expect magic.  However,

- setup.py will install ALL of Zope for you, i.e.

	python2.1 setup.py --home=/where/ever/you/want

- configure is mostly done,

- 'make build' and 'make install' work largely as expected.

The controller in particular probably doesn't work yet, but it's a
short leap from here to there.

(Note: I see fdrake committed setup.py-age on HEAD for ZCTextIndex,
but that module is not actually on the HEAD for Zope?  Am I missing
something?)



=== Added File Zope/inst/acceptable_version.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# 
##############################################################################

"""
Make up a software name for this version of Zope, and say whether it's
suitable for becoming the system's default version.
"""

import string, sys

version = string.split(sys.version, ' ')[0]
print version

supported_version = sys.argv[1]
minimum_patchlevel = sys.argv[2]

if version[:3] == supported_version:
    if version >= minimum_patchlevel:
	sys.exit(0)

sys.exit(1)



=== Added File Zope/inst/register_software.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# 
##############################################################################

"""
Register an installed version of Zope.
"""

import ConfigParser, os, sys

config_dir = sys.argv[1]
software_name = sys.argv[2]
software_home = sys.argv[3]
register_default = int(sys.argv[4])

system_conf_name = os.path.join(config_dir, 'system.conf')
system_conf = ConfigParser.ConfigParser()
system_conf.read(system_conf_name)

if not system_conf.has_section('SoftwareHomes'):
    system_conf.add_section('SoftwareHomes')
system_conf.set('SoftwareHomes', software_name, software_home)
if register_default:
    if not system_conf.has_section('Defaults'):
        system_conf.add_section('Defaults')
    system_conf.set('Defaults', 'Instance', software_name)
f = open(system_conf_name, 'w')
system_conf.write(f)
f.close()



=== Added File Zope/inst/software_name.py ===
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# 
##############################################################################

"""Determine a good software name for this Zope version."""

from os import stat
from time import localtime, strftime

released = 0
try:
    # First try the first word of version.txt.
    version_txt = open('lib/python/version.txt', 'r')
    name = version_txt.readline().split()[0]
    released = 1
except IOError:
    try:
	# Next see if what we have is a CVS branch.
	cvs_tag_file = open('CVS/Tag', 'r')
	cvs_tag = cvs_tag.readline() + '-'
    except IOError:
	try:
	    # See if this is a CVS checkout at all.
	    stat('CVS')
	    cvs_tag = 'HEAD-'
	except OSError:
	    cvs_tag = 'noncvs-'
    name = cvs_tag + strftime('%Y_%m_%d', localtime())

print name, released