diff options
Diffstat (limited to 'repo')
| -rwxr-xr-x | repo | 17 |
1 files changed, 16 insertions, 1 deletions
| @@ -108,6 +108,7 @@ repodir = '.repo' # name of repo's private directory | |||
| 108 | S_repo = 'repo' # special repo repository | 108 | S_repo = 'repo' # special repo repository |
| 109 | S_manifests = 'manifests' # special manifest repository | 109 | S_manifests = 'manifests' # special manifest repository |
| 110 | REPO_MAIN = S_repo + '/main.py' # main script | 110 | REPO_MAIN = S_repo + '/main.py' # main script |
| 111 | MIN_PYTHON_VERSION = (2, 6) # minimum supported python version | ||
| 111 | 112 | ||
| 112 | 113 | ||
| 113 | import optparse | 114 | import 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 | ||
| 134 | ver = sys.version_info | ||
| 135 | if 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) | ||
| 140 | if (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 | |||
| 132 | home_dot_repo = os.path.expanduser('~/.repoconfig') | 146 | home_dot_repo = os.path.expanduser('~/.repoconfig') |
| 133 | gpg_dir = os.path.join(home_dot_repo, 'gnupg') | 147 | gpg_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') |
| 165 | group.add_option('-g', '--groups', | 179 | group.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') |
| 169 | group.add_option('-p', '--platform', | 184 | group.add_option('-p', '--platform', |
| 170 | dest='platform', default="auto", | 185 | dest='platform', default="auto", |
