X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=odoo.py;h=e5f861baa0b1349b59980b20e5be17c8849a36c8;hb=6db5e04155f2ff974e9cb9558e145c30c964b18a;hp=cafd13c3a6cd61ad1774bead989a0d6015ee6e0d;hpb=1f7a2eaf3050d82f53fd27aa724cfc32f246f33a;p=odoo%2Fodoo.git diff --git a/odoo.py b/odoo.py index cafd13c..e5f861b 100755 --- a/odoo.py +++ b/odoo.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python #---------------------------------------------------------- # odoo cli # @@ -47,18 +47,18 @@ def git_locate(): os.chdir('odoo') path = os.getcwd() - while path != '/': + while path != os.path.abspath(os.sep): gitconfig_path = os.path.join(path, '.git/config') if os.path.isfile(gitconfig_path): release_py = os.path.join(path, 'openerp/release.py') if os.path.isfile(release_py): break path = os.path.dirname(path) - if path == '/': + if path == os.path.abspath(os.sep): path = None return path -def cmd_setup_git_init(): +def cmd_setup_git(): git_dir = git_locate() if git_dir: printf('git repo found at %s',git_dir) @@ -67,12 +67,15 @@ def cmd_setup_git_init(): os.chdir('odoo') git_dir = os.getcwd() if git_dir: - # sane push config for git < 2.0 - run('git','config','push.default','simple') + # push sane config for git < 2.0, and hooks + #run('git','config','push.default','simple') + # alias + run('git','config','alias.st','status') # merge bzr style - run('git','config','merge.ff','no') run('git','config','merge.commit','no') - # push hooks + # pull let me choose between merge or rebase only works in git > 2.0, use an alias for 1 + run('git','config','pull.ff','only') + run('git','config','alias.pl','pull --ff-only') pre_push_path = os.path.join(git_dir, '.git/hooks/pre-push') open(pre_push_path,'w').write(GIT_HOOKS_PRE_PUSH.strip()) os.chmod(pre_push_path, 0755) @@ -114,9 +117,10 @@ def cmd_setup_git_review(): run('git','config','--add','remote.odoo.fetch','+refs/pull/*:refs/remotes/odoo/pull/*') def setup_deps_debian(git_dir): - debian_control_path = os.path.join(git_dir, 'setup/debian/control') + debian_control_path = os.path.join(git_dir, 'debian/control') debian_control = open(debian_control_path).read() debs = re.findall('python-[0-9a-z]+',debian_control) + debs += ["postgresql"] proc = subprocess.Popen(['sudo','apt-get','install'] + debs, stdin=open('/dev/tty')) proc.communicate() @@ -137,7 +141,7 @@ def cmd_setup_pg(): setup_pg_debian(git_dir) def cmd_setup(): - cmd_setup_git_init() + cmd_setup_git() cmd_setup_deps() cmd_setup_pg()