summaryrefslogtreecommitdiffstats
path: root/repo
diff options
context:
space:
mode:
Diffstat (limited to 'repo')
-rwxr-xr-xrepo17
1 files changed, 16 insertions, 1 deletions
diff --git a/repo b/repo
index 6b374f72..791e40cb 100755
--- a/repo
+++ b/repo
@@ -108,6 +108,7 @@ repodir = '.repo' # name of repo's private directory
108S_repo = 'repo' # special repo repository 108S_repo = 'repo' # special repo repository
109S_manifests = 'manifests' # special manifest repository 109S_manifests = 'manifests' # special manifest repository
110REPO_MAIN = S_repo + '/main.py' # main script 110REPO_MAIN = S_repo + '/main.py' # main script
111MIN_PYTHON_VERSION = (2, 6) # minimum supported python version
111 112
112 113
113import optparse 114import optparse
@@ -129,6 +130,19 @@ else:
129 urllib.request = urllib2 130 urllib.request = urllib2
130 urllib.error = urllib2 131 urllib.error = urllib2
131 132
133# Python version check
134ver = sys.version_info
135if ver[0] == 3:
136 print('error: Python 3 support is not fully implemented in repo yet.\n'
137 'Please use Python 2.6 - 2.7 instead.',
138 file=sys.stderr)
139 sys.exit(1)
140if (ver[0], ver[1]) < MIN_PYTHON_VERSION:
141 print('error: Python version %s unsupported.\n'
142 'Please use Python 2.6 - 2.7 instead.'
143 % sys.version.split(' ')[0], file=sys.stderr)
144 sys.exit(1)
145
132home_dot_repo = os.path.expanduser('~/.repoconfig') 146home_dot_repo = os.path.expanduser('~/.repoconfig')
133gpg_dir = os.path.join(home_dot_repo, 'gnupg') 147gpg_dir = os.path.join(home_dot_repo, 'gnupg')
134 148
@@ -164,7 +178,8 @@ group.add_option('--depth', type='int', default=None,
164 help='create a shallow clone with given depth; see git clone') 178 help='create a shallow clone with given depth; see git clone')
165group.add_option('-g', '--groups', 179group.add_option('-g', '--groups',
166 dest='groups', default='default', 180 dest='groups', default='default',
167 help='restrict manifest projects to ones with a specified group', 181 help='restrict manifest projects to ones with specified '
182 'group(s) [default|all|G1,G2,G3|G4,-G5,-G6]',
168 metavar='GROUP') 183 metavar='GROUP')
169group.add_option('-p', '--platform', 184group.add_option('-p', '--platform',
170 dest='platform', default="auto", 185 dest='platform', default="auto",