Changeset 338 for cleverbox/branches

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/branches/0.4
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • cleverbox/branches/0.4/cleverbox/scripts/admin.py

    r332 r338  
    6969        self.envname = envname 
    7070        self.prompt = "Cleverbox [%s] > " % self.envname 
    71          
     71 
    7272        # Check if environment needs an upgrade 
    7373        #  - open VERSION 
     
    7979                print "Please upgrade or downgrade your trac installation." 
    8080                print 
    81                  
     81 
    8282                sys.exit(1) 
    83              
     83 
    8484            env_version = open(os.path.join(self.envname, 'VERSION')).read().strip() 
    85              
     85 
    8686            #  - compare with self._version 
    8787            #  - if VERSION < self._version : 
    88             if parse_version(env_version) < parse_version(_version):  
     88            if parse_version(env_version) < parse_version(_version): 
    8989                print "\nCleverbox environment needs to be upgraded. Please run :" 
    9090                print "  cleverbox-admin %s upgrade\n" % self.envname 
     
    9393            # no VERSION file means user wants to create an environment 
    9494            pass 
    95          
     95 
    9696        if env is not None: 
    9797            self.__env = env 
     
    185185        # root user & group 
    186186        # we keep the ssh_user notion for backward compatibility. 
    187         # this will have to disappear in a future release  
     187        # this will have to disappear in a future release 
    188188        collected_infos['ssh_user'] = 0 
    189189        collected_infos['ssh_group'] = 0 
     
    191191        # Host server domain name 
    192192        collected_infos['domain'] = raw_input('Domain name > ').strip() 
    193          
     193 
    194194        # Authentication backend password (if any) 
    195195        collected_infos['authbackend_pass'] = raw_input('Authentication backend password (if any) []> ').strip() or '' 
     
    198198        dcp = 'default' 
    199199        collected_infos['default_profile'] = raw_input('Default configuration profile [%s]> ' % dcp).strip() or dcp 
    200                  
     200 
    201201        # Write ini file 
    202202        self._config.add_section('general') 
     
    214214        for directive, value in trac_infos.items() : 
    215215            self._config.set('trac', directive, str(value)) 
    216          
     216 
    217217        fh_config = open(os.path.join(self.envname, 'cleverbox.ini'), 'w+') 
    218218        self._config.write(fh_config) 
     
    241241        for filename in _defaults['profile_files']: 
    242242            shutil.copy(collected_infos['assets_dir'] + '/' + filename, os.path.join(self.envname, 'profiles', 'default')) 
    243          
     243 
    244244 
    245245        print 
     
    251251    def do_upgrade(self, line=None): 
    252252        env_version = open(os.path.join(self.envname, 'VERSION')).read() 
    253         if parse_version(env_version) < parse_version(_version):  
     253        if parse_version(env_version) < parse_version(_version): 
    254254            from cleverbox.upgrades import upgrades 
    255255            i = 1 
     
    261261                    break 
    262262                i = i + 1 
    263              
     263 
    264264 
    265265    ## help 
     
    432432                     int(self.getConfig('ssh_user', 'general')), int(self.getConfig('apache_group', 'general')) ) 
    433433            os.chmod( os.path.join(collected_infos['home_dir'], 'tmp'), 0775 ) 
    434   
     434 
    435435            print "  Fixed permissions in %s\n" % collected_infos['home_dir'] 
    436436 
     
    795795                # -- Revoke all permissions in trac 
    796796                self._project_trac_revoke_all_perms( collected_infos ) 
    797          
     797 
    798798                # -- Trac initial permissions 
    799799                self._project_trac_setperms( collected_infos ) 
     
    801801                # -- Modifies Trac default conf 
    802802                self._project_trac_defaultconf( collected_infos ) 
    803                  
     803 
    804804                # -- Fix perms 
    805805                self._project_fix_perms( collected_infos ) 
     
    870870                                'var/svn', 
    871871                                infos['short_name'] ) 
    872          
     872 
    873873        cmd_data = { 'env_path'         : trac_env_path, 
    874874                     'title'            : '"%s - %s - Trac"' % (infos['client'], infos['short_name']), 
     
    878878                     'trac_install_dir' : self.getConfig('lib_dir', 'trac')} 
    879879 
    880         trac_cmd = '/usr/bin/trac-admin %(env_path)s initenv %(title)s %(db_dsn)s svn %(svn_path)s %(templates_path)s' % cmd_data 
    881          
     880        trac_cmd = 'trac-admin %(env_path)s initenv %(title)s %(db_dsn)s svn %(svn_path)s %(templates_path)s' % cmd_data 
     881 
    882882        (stdin, stdout, stderr) = os.popen3( trac_cmd ) 
    883883 
     
    923923    def _project_trac_revoke_all_perms(self, infos): 
    924924        import trac.env 
    925          
     925 
    926926        trac_env_path = os.path.join( self.getConfig('clients_root', 'general'), 
    927927                                     infos['client'], 
    928928                                     'var/trac', 
    929929                                     infos['short_name'] ) 
    930          
     930 
    931931        # Revoke all permissions 
    932932        trac_env = trac.env.open_environment(trac_env_path) 
     
    935935        db_cursor.execute('DELETE FROM permission') 
    936936        trac_db.commit() 
    937          
     937 
    938938        print "  Revoked Trac default permissions\n" 
    939939 
     
    970970                                       infos['short_name'], 
    971971                                       'conf','trac.ini' ) 
    972         os.chmod( trac_ini_path, 0777 )  
     972        os.chmod( trac_ini_path, 0777 ) 
    973973 
    974974        # Subversion repository 
     
    996996        Overrides project's default trac.ini with values provided in configuration profile. 
    997997        """ 
    998          
     998 
    999999        # New defaults 
    10001000        tracdefaults_config = ConfigParser.SafeConfigParser() 
    10011001        tracdefaults_config.read(os.path.join(self.envname, 'profiles', infos['profile'], 'trac-defaults.ini')) 
    1002          
     1002 
    10031003        # Trac base config file 
    10041004        project_config_path = os.path.join(self.getConfig('clients_root', 'general'), infos['client'], 'var', 'trac', infos['short_name'], 'conf', 'trac.ini') 
  • cleverbox/branches/0.4/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> 
    66Standards-Version: 3.7.2 
    77 
    8 Package: cleverbox  
     8Package: cleverbox 
    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 Conflicts:  trac-0.10.3  
    12 Suggests: libapache2-mod-macro  
    13 Description: Trac and Subversion instances deployment shell  
    14  The cleverbox provides an interactive command line shell dedicated to the  
     11Conflicts:  trac-0.10.3 
     12Suggests: libapache2-mod-macro 
     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/branches/0.4/debian/rules

    r263 r338  
    1010        # Project documentation is superceded by dedicated Debian docs 
    1111        rm -r debian/cleverbox/usr/share/doc 
    12          
    13 binary-install/cleverbox:: 
    14          
    15         # Enable mandatory apache modules 
    16         a2enmod dav_fs 
    17         a2enmod dav_svn 
    18  
    19         # Reload apache 
    20         /etc/init.d/apache2 reload 
  • cleverbox/branches/0.4/docs/CHANGELOG

    r330 r338  
    44 
    55== Changelog == 
     6=== 2008-05-14 | 0.4.4-beta === 
    67 
     8see http://www.clever-age.org/trac/milestone/cleverbox-0.4.4 for details. 
     9 
     10==== Fixes ==== 
     11 
     12 * fixed Cleverbox does not work if trac-admin script is in a non standard location (#48) 
     13 * fixed trac version dependency in setup.py 
     14 * debian packaging : binary-install actions should go in postinst file (#46) 
     15 * debian packaging : added `python-setuptools` to build dependencies 
    716=== 2008-02-29 | 0.4.3-beta === 
    817 
  • cleverbox/branches/0.4/setup.py

    r332 r338  
    2222 
    2323setup( 
    24      
     24 
    2525    # Project identity 
    2626    name='Cleverbox', 
     
    3232    url='http://www.clever-age.org/trac/wiki/cleverbox', 
    3333    license='GPLv3', 
    34      
     34 
    3535    # Files 
    3636    packages=find_packages(), 
     
    3939                ('/usr/share/doc/cleverbox', glob('docs/*')), 
    4040                ('/usr/share/man/man1',     glob('scripts/*.1'))], 
    41      
     41 
    4242    # Dependencies 
    43     install_requires=['setuptools>=0.6b1', 'trac>=0.10.4'] 
     43    install_requires=['setuptools>=0.6b1', 'trac>=0.10.4', 'trac<=0.10.999'] 
    4444)