diff -urNp pkgcore-0.4.3-orig/pkgcore/ebuild/portage_conf.py pkgcore-0.4.3/pkgcore/ebuild/portage_conf.py
|
old
|
new
|
|
| 125 | 125 | if timeout is not None: |
| 126 | 126 | base['timeout'] = timeout.strip() |
| 127 | 127 | |
| | 128 | proxy = options.pop('RSYNC_PROXY', None) |
| | 129 | if proxy is not None: |
| | 130 | base['proxy'] = proxy.strip() |
| | 131 | |
| 128 | 132 | excludes = options.pop('RSYNC_EXCLUDEFROM', None) |
| 129 | 133 | if excludes is not None: |
| 130 | 134 | extra_opts.extend('--exclude-from=%s' % x |
diff -urNp pkgcore-0.4.3-orig/pkgcore/sync/rsync.py pkgcore-0.4.3/pkgcore/sync/rsync.py
|
old
|
new
|
|
| 27 | 27 | |
| 28 | 28 | default_retries = 5 |
| 29 | 29 | binary = "rsync" |
| | 30 | use_proxy = False |
| 30 | 31 | |
| 31 | 32 | @classmethod |
| 32 | 33 | def parse_uri(cls, raw_uri): |
| … |
… |
|
| 45 | 46 | |
| 46 | 47 | pkgcore_config_type = ConfigHint({'basedir':'str', 'uri':'str', |
| 47 | 48 | 'timeout':'str', 'compress':'bool', 'excludes':'list', |
| 48 | | 'includes':'list', 'retries':'str', 'extra_opts':'list'}, |
| | 49 | 'includes':'list', 'retries':'str', 'extra_opts':'list', |
| | 50 | 'proxy':'str'}, |
| 49 | 51 | typename='syncer') |
| 50 | 52 | |
| 51 | 53 | def __init__(self, basedir, uri, timeout=default_timeout, |
| 52 | 54 | compress=False, excludes=(), includes=(), |
| 53 | | retries=default_retries, |
| | 55 | retries=default_retries, proxy=None, |
| 54 | 56 | extra_opts=[]): |
| 55 | 57 | |
| 56 | 58 | uri = uri.rstrip(os.path.sep) + os.path.sep |
| … |
… |
|
| 67 | 69 | self.excludes = list(self.default_excludes) + list(excludes) |
| 68 | 70 | self.includes = list(self.default_includes) + list(includes) |
| 69 | 71 | self.retries = int(retries) |
| | 72 | if proxy is not None: |
| | 73 | self.use_proxy = True |
| | 74 | self.sets_env = True |
| | 75 | self.env = {'RSYNC_PROXY':proxy} |
| 70 | 76 | self.is_ipv6 = "--ipv6" in self.opts or "-6" in self.opts |
| 71 | 77 | self.is_ipv6 = self.is_ipv6 and socket.has_ipv6 |
| 72 | 78 | |
| … |
… |
|
| 75 | 81 | return uri[len("rsync://"):].split("@", 1)[-1].split("/", 1)[0] |
| 76 | 82 | |
| 77 | 83 | def _get_ips(self): |
| | 84 | if self.use_proxy is True: |
| | 85 | # If we're using a proxy, name resolution is best left to the proxy |
| | 86 | yield self.hostname |
| | 87 | return |
| | 88 | |
| 78 | 89 | af_fam = socket.AF_INET |
| 79 | 90 | if self.is_ipv6: |
| 80 | 91 | af_fam = socket.AF_INET6 |