Commits

Anonymous committed 3a330c5

git support ( not yet tested )

  • Participants
  • Parent commits 5531bfd

Comments (0)

Files changed (1)

File enablr/__init__.py

 
 from setuptools import setup, find_packages
 
-import enablr
-
 setup(
     name='%(package)s',
     version=".".join(map(str, enablr.__version__)),
 
 
 CLONE={'hg':'hg clone %(url)s %(src)s',
-       'git':'git clone %(url)s',
-       'svn':'svn checkout %(url)s', }
+       'git':'git clone %(url)s %(src)s',
+       'svn':'svn checkout %(url)s %(src)s,' 
+       }
+
 ADD = {'hg': 'hg -R %(src)s add %(src)s/*' ,
        'svn': 'svn add %(src)s/* ',
-       'git': 'git add', }
+       'git': 'git --git-dir=%(src)s/.git add %(src)s/*', }
 
 ADD_IGNORE_SVN = {'hg': 'hg -R %(src)s add %(src)s/.svnignore ' , }
 ADD_IGNORE_HG  = {'hg': 'hg -R %(src)s add %(src)s/.hgignore ' , }
+ADD_IGNORE_GIT = {'git': 'git --git-dir=%(src)s add %(src)s/.gitignore' , }
 
-COMMIT={'hg': 'hg -R %(src)s commit -u %(username)s -m "initialized" ' , }
+COMMIT={
+    'hg': 'hg -R %(src)s commit -u %(username)s -m "initialized" ' , 
+    'git': 'git --git-dir=%(src)s commit -u %(username)s -m "initialized" ' , 
+    }
 
-PUSH={'hg': 'hg -R %(src)s push ' , }
+PUSH={
+    'hg': 'hg -R %(src)s push ' , 
+    'git': 'git --git-dir=%(src)s push ' , 
+    }
 
-INSTALL={'hg':'pip install -e hg+%(url)s#egg=%(package)s',}
+INSTALL={
+    'hg':'pip install -e hg+%(url)s#egg=%(package)s',
+    'git':'pip install -e git+%(url)s#egg=%(package)s',
+    }
 
 def enable(repository,package):
     import pit
     conf['commit']=COMMIT[conf['repository']] % conf
     conf['push']=PUSH[conf['repository']] % conf
     conf['install']=INSTALL[conf['repository']] % conf
+
     conf['svn_ignore']=ADD_IGNORE_SVN[conf['repository']] % conf
     conf['hg_ignore']=ADD_IGNORE_HG[conf['repository']] % conf
+    conf['git_ignore']=ADD_IGNORE_GIT[conf['repository']] % conf
    
-    
     for (k,v) in conf.iteritems():
         print "CONF:",k,"=>",v
 
-
     print commands.getoutput('mkdir -p %(tmp)s' % conf)
     if False == os.path.isdir(conf['src']):
         print "checkouting ...",conf['url'] ,"to",conf['src']
     print commands.getoutput('mkdir -p %(src)s/%(package)s' % conf)
     open(conf['src']+'/.svnignore','w').write(IGNORE)
     open(conf['src']+'/.hgignore','w').write(IGNORE)
+    open(conf['src']+'/.gitignore','w').write(IGNORE)
     open(conf['src']+'/setup.py','w').write(SETUP%conf)
     open(conf['src']+'/LICENSE','w').write(LICENSE%conf)
     open(conf['src']+'/MANIFEST.in','w').write(MANIFEST%conf)
     print conf['svn_ignore']
     print commands.getoutput( conf['svn_ignore'])
     print conf['hg_ignore']
+    print commands.getoutput( conf['git_ignore'])
+    print conf['git_ignore']
     print commands.getoutput( conf['hg_ignore'])
     print conf['commit']
     print commands.getoutput( conf['commit'])