@@ -3346,6 +3346,7 @@ def optionxform(self, option):
3346
3346
import StringIO
3347
3347
except ImportError:
3348
3348
import io as StringIO
3349
+ import string
3349
3350
import zipfile
3350
3351
import shutil
3351
3352
import string
@@ -3560,7 +3561,7 @@ class Repository(object):
3560
3561
3561
3562
def __init__(self, name, **kwds):
3562
3563
class _TEMP_(object):
3563
- def __init__( self, root=None, trunk=None, github=None,
3564
+ def __init__( self, root=None, trunk=None,
3564
3565
release=None, tag=None, pyname=None, pypi=None,
3565
3566
dev=False, username=None, install=True, rev=None,
3566
3567
local=None, platform=None, version=None,
@@ -3663,7 +3664,6 @@ def initialize(self, config):
3663
3664
self.tag = None
3664
3665
self.release_root = None
3665
3666
#
3666
- self.github = config.github
3667
3667
self.pypi = config.pypi
3668
3668
self.local = config.local
3669
3669
self.platform = config.platform
@@ -3694,7 +3694,7 @@ def initialize(self, config):
3694
3694
self.install = config.install
3695
3695
3696
3696
def guess_versions(self):
3697
- if self.config.github is None and not self.config.root is None :
3697
+ if not self.config.root is None and not '.git' in self.config.root:
3698
3698
if not self.offline:
3699
3699
if using_subversion and not sys.platform.startswith('win'):
3700
3700
rootdir_output = subprocess.Popen(['svn','ls',self.config.root], stdout=subprocess.PIPE).communicate()[0]
@@ -3730,8 +3730,7 @@ def guess_versions(self):
3730
3730
self.release = None
3731
3731
self.release_root = None
3732
3732
else:
3733
- # NOTE: this forces the use of github, which wasn't the intent
3734
- self.trunk = self.config.github
3733
+ self.trunk = self.config.root
3735
3734
if not self.config.trunk is None:
3736
3735
if self.trunk is None:
3737
3736
self.trunk = self.config.trunk
@@ -3755,8 +3754,6 @@ def write_config(self, OUTPUT):
3755
3754
print('[%s]' % config.name)
3756
3755
if not config.root is None:
3757
3756
print('root=%s' % config.root)
3758
- if not config.github is None:
3759
- print('github=%s' % config.github)
3760
3757
if not config.trunk is None:
3761
3758
print('trunk=%s' % config.trunk)
3762
3759
if not config.tag is None:
@@ -3838,23 +3835,37 @@ def perform_install(self, dir=None, install=True, preinstall=False):
3838
3835
print("-----------------------------------------------------------------")
3839
3836
print(" Installing branch")
3840
3837
print(" Checking out source for package "+self.name)
3838
+ print(" %s %s" % (str(using_git), str(self.root)))
3841
3839
if self.local:
3842
3840
print(" Package dir: "+self.local)
3843
- elif using_git and not self.github is None:
3844
- print(" Git dir: "+self.github)
3841
+ elif using_git and not self.root is None:
3842
+ if '%23' in self.root:
3843
+ self.root = self.root.split('%23')[0]
3844
+ elif '#' in self.root:
3845
+ self.root = self.root.split('#')[0]
3846
+ print(" Git dir: "+self.root)
3845
3847
else:
3846
3848
print(" Subversion dir: "+self.pkgdir)
3847
3849
if os.path.exists(dir):
3848
3850
print(" No checkout required")
3849
3851
print("-----------------------------------------------------------------")
3850
- elif using_git and not self.github is None:
3852
+ elif using_git and not self.root is None and '.git' in self.root :
3851
3853
print("-----------------------------------------------------------------")
3852
3854
try:
3853
- self.run([self.git, 'clone', self.github, dir])
3855
+ if '%23' in self.root:
3856
+ branch= ['-b', self.root.split('%23')[1]]
3857
+ url= self.root.split('%23')[0]
3858
+ elif '#' in self.root:
3859
+ branch= ['-b', self.root.split('#')[1]]
3860
+ url= self.root.split('#')[0]
3861
+ else:
3862
+ branch = []
3863
+ url= self.root
3864
+ self.run([self.git, 'clone'] + branch + [url, dir])
3854
3865
except OSError:
3855
3866
err,tb = sys.exc_info()[1:3] # BUG?
3856
3867
print("")
3857
- print("Error checkout software %s with git at %s" % (self.name,self.github ))
3868
+ print("Error checkout software %s with git at %s" % (self.name,self.root ))
3858
3869
print(str(err))
3859
3870
print("Traceback:")
3860
3871
import traceback
@@ -4211,12 +4222,6 @@ def modify_parser(self, parser):
4211
4222
dest='localize',
4212
4223
default=False)
4213
4224
4214
- parser.add_option('--git',
4215
- help='Checkout with git if the github URL is provided',
4216
- action='store_true',
4217
- dest='using_git',
4218
- default=False)
4219
-
4220
4225
parser.add_option('--pypi-url',
4221
4226
help='Specify the url for the PyPI package index used for online installation',
4222
4227
action='store',
@@ -4291,8 +4296,6 @@ def adjust_options(self, options, args):
4291
4296
# Determine if the git command is available
4292
4297
#
4293
4298
global using_git
4294
- if not options.using_git:
4295
- using_git = False
4296
4299
if using_git:
4297
4300
try:
4298
4301
sys.stdout.flush()
0 commit comments