Changeset 338 for cleverbox/trunk

Show
Ignore:
Timestamp:
05/03/08 09:55:04 (2 years ago)
Author:
trivoallan
Message:

cleverbox :

  • fixed Cleverbox does not work if trac-admin script is in a non standard location (#48)
  • fixed trac version dependency in setup.py
  • debian packaging : binary-install actions should go in postinst file (#46)
  • debian packaging : added python-setuptools to build dependencies


all fixes on both trunk and 0.4 branch.

Location:
cleverbox/trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • cleverbox/trunk/cleverbox/model/project.py

    r267 r338  
    3636    If "status" parameter has a value (either "enabled" or "disabled"), returned list is limited to project with this status. 
    3737    """ 
    38      
     38 
    3939    list_projects = [] 
    4040 
     
    7272    if not exists(environment, client_name, project_name): 
    7373        raise Exception, 'Client "%s" has no project "%s".' % (client_name, project_name) 
    74      
     74 
    7575    try: 
    7676        os.unlink(os.path.join(environment.get_path('projects-enabled'), '%s-%s' % (client_name, project_name))) 
     
    8585    Enables project in environment. 
    8686    """ 
    87      
     87 
    8888    if not exists(environment, client_name, project_name): 
    8989        raise Exception, 'Client "%s" has no project "%s"' % (client_name, project_name) 
    90      
     90 
    9191    target = os.path.join(environment.get_path('projects-available'), 
    9292                          '%s-%s' % (client_name, project_name)) 
     
    104104    Creates a new project for client in environment. 
    105105    """ 
    106      
     106 
    107107    # Merging for consistency 
    108108    parameters['client'] = client_name 
     
    146146        # -- Modifies Trac default conf 
    147147        _trac_defaultconf(environment, parameters) 
    148          
     148 
    149149        # -- Fix perms 
    150150        _fix_perms(environment, parameters) 
     
    217217                 'trac_install_dir' : environment.config.get('trac', 'lib_dir')} 
    218218 
    219     trac_cmd = '/usr/bin/trac-admin %(env_path)s initenv %(title)s %(db_dsn)s svn %(svn_path)s %(templates_path)s' % cmd_data 
     219    trac_cmd = 'trac-admin %(env_path)s initenv %(title)s %(db_dsn)s svn %(svn_path)s %(templates_path)s' % cmd_data 
    220220 
    221221    (stdin, stdout, stderr) = os.popen3( trac_cmd ) 
     
    239239    perms_config = ConfigParser.SafeConfigParser() 
    240240    perms_config.read(os.path.join(environment.path, 'profiles', infos['profile'], 'permissions.ini')) 
    241      
     241 
    242242    # Grant permissions as defined in permissions.ini 
    243243    for profile in perms_config.options('trac'): 
     
    253253                                 'subject'    : admin_login, 
    254254                                 'perms'      : 'TRAC_ADMIN'} ) 
    255      
     255 
    256256    print "  Trac initial permissions set (admin rights given to '%s')\n" % admin_login 
    257257 
    258258def _trac_revoke_all_perms(environment, infos): 
    259259    import trac.env 
    260      
     260 
    261261    trac_env_path = os.path.join( environment.config.get('general', 'clients_root'), 
    262262                                 infos['client'], 
    263263                                 'var/trac', 
    264264                                 infos['short_name'] ) 
    265      
     265 
    266266    # Revoke all permissions 
    267267    trac_env = trac.env.open_environment(trac_env_path) 
     
    270270    db_cursor.execute('DELETE FROM permission') 
    271271    trac_db.commit() 
    272      
     272 
    273273    print "  Revoked Trac default permissions\n" 
    274274 
     
    278278    client_name = infos['client'] 
    279279    project_name = infos['short_name'] 
    280      
     280 
    281281    permissions = { 
    282282        os.path.join(environment.get_path(), 'projects-available', client_name + '-' + project_name)   : (0640, 'root', 'root'), 
     
    299299    Overrides project's default trac.ini with values provided in configuration profile. 
    300300    """ 
    301      
     301 
    302302    # New defaults 
    303303    tracdefaults_config = ConfigParser.SafeConfigParser() 
    304304    tracdefaults_config.read(os.path.join(environment.path, 'profiles', infos['profile'], 'trac-defaults.ini')) 
    305      
     305 
    306306    # Trac base config file 
    307307    project_config_path = os.path.join(environment.config.get('general', 'clients_root'), infos['client'], 'var', 'trac', infos['short_name'], 'conf', 'trac.ini') 
     
    318318            default_option = tracdefaults_config.get(section, option) 
    319319            tracproject_config.set(section, option, default_option) 
    320              
     320 
    321321    # Add cleverbox section 
    322322    # The variables in this section can be used for string substitution across the file 
     
    326326                         'authbackend_pass' : environment.config.get('general', 'authbackend_pass'), 
    327327                         'trac_install_dir' : environment.config.get('trac', 'lib_dir'), 
    328                          'domain_name'      : environment.config.get('general', 'domain')}  
     328                         'domain_name'      : environment.config.get('general', 'domain')} 
    329329    tracproject_config.add_section('cleverbox') 
    330330    for (option, value) in cleverbox_options.items(): 
  • cleverbox/trunk/debian/control

    r328 r338  
    22Section: web 
    33Priority: optional 
    4 Build-Depends: cdbs (>= 0.4.43), python-all-dev, python-support (>= 0.3), debhelper (>= 4.1.0) 
     4Build-Depends: cdbs (>= 0.4.43), python-all-dev, python-support (>= 0.3), debhelper (>= 4.1.0), python-setuptools 
    55Maintainer: Tristan Rivoallan <tristan@rivoallan.net> 
    6 Standards-Version: 3.7.2 
     6Standards-Version: 3.7.3 
    77 
    88Package: cleverboxfuture 
    99Architecture: all 
    1010Depends: ${python:Depends}, subversion (>=1.4.2), trac (>=0.10), libapache2-mod-python (>=3.2.10), libapache2-svn (>=1.4.2), python-setuptools (>=0.6c3-3) 
    11 Suggests: libapache2-mod-macro  
     11Suggests: libapache2-mod-macro 
    1212Conflicts: cleverbox, trac-0.10.3 
    13 Description: Trac and Subversion instances deployment shell  
    14  The cleverbox provides an interactive command line shell dedicated to the  
     13Description: Trac and Subversion instances deployment shell 
     14 The cleverbox provides an interactive command line shell dedicated to the 
    1515 deployment and maintenance of trac and subversion instances. 
    16  It can handle multiple configuration profiles, enabling the deployment  
    17  of differently flavored type of projects :   
     16 It can handle multiple configuration profiles, enabling the deployment 
     17 of differently flavored type of projects : 
    1818 trac configuration and permissions, apache configuration templates, etc. 
    19  Project's main objective is to make your life as simple as possible.  
     19 Project's main objective is to make your life as simple as possible. 
    2020 Thus, it comes with easy installation, easy upgrades and a comprehensive 
    2121 documentation. 
  • cleverbox/trunk/debian/postinst

    r337 r338  
    2626 
    2727        # Reload apache 
    28         /etc/init.d/apache2 reload 
     28        invoke-rc.d apache2 reload 
    2929    ;; 
    3030 
  • cleverbox/trunk/docs/CHANGELOG

    r330 r338  
    2121 * Fixed trac.ini string substitution 
    2222 * Enhanced documentation 
     23 
     24=== 2008-05-14 | 0.4.4-beta === 
     25 
     26see http://www.clever-age.org/trac/milestone/cleverbox-0.4.4 for details. 
     27 
     28==== Fixes ==== 
     29 
     30 * fixed Cleverbox does not work if trac-admin script is in a non standard location (#48) 
     31 * fixed trac version dependency in setup.py 
     32 * debian packaging : binary-install actions should go in postinst file (#46) 
     33 * debian packaging : added `python-setuptools` to build dependencies 
    2334 
    2435=== 2008-02-29 | 0.4.3-beta === 
  • cleverbox/trunk/setup.py

    r328 r338  
    1818"""Cleverbox : Script for automating multiple trac instances deployment and maintenance. 
    1919 
    20 The Cleverbox sits on top of Trac (http://trac.edgewall.org) and Subversion (http://subversion.tigris.org).  
     20The Cleverbox sits on top of Trac (http://trac.edgewall.org) and Subversion (http://subversion.tigris.org). 
    2121It provides an interactive shell for deploying and maintaining instances of both projects. 
    2222""" 
     
    4141 
    4242setup( 
    43      
     43 
    4444    # Project identity 
    4545    name='Cleverbox', 
     
    5252    classifiers = filter(None, classifiers.split("\n")), 
    5353    long_description = "\n".join(doclines[2:]), 
    54      
     54 
    5555    # Files 
    5656    packages=find_packages(), 
     
    5858    data_files=[('/usr/share/cleverbox',     glob('assets/*')), 
    5959                ('/usr/share/doc/cleverbox', glob('docs/*')), 
    60                 ('/usr/share/man/man1',     glob('scripts/*.1'))], 
    61      
     60                ('/usr/share/man/man1',      glob('scripts/*.1'))], 
     61 
    6262    # Dependencies 
    63     install_requires=['setuptools>=0.6b1', 'trac>=0.10.4'] 
     63    install_requires=['setuptools>=0.6b1', 'trac>=0.10.4', 'trac<=0.10.999'] 
    6464)