Lines Matching +full:shebang +full:- +full:regex
1 # -*- coding: utf-8 -*-
3 # Use of this source code is governed by a BSD-style license that can be
41 AUTHENTICATION_BUCKET = 'gs://chromeos-authentication-bucket/'
55 # Format used by "gsutil ls -l" when reporting modified time.
56 DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
58 # Regexp for parsing each line of output from "gsutil ls -l".
60 # too, even though they are not expected until we use "-a".
63 # 99908 2014-03-01T05:50:08Z gs://bucket/foo/abc#1234 metageneration=1
65 # 99908 2014-03-04T01:16:55Z gs://bucket/foo/def#5678 metageneration=1
139 e.g. 'gs://chromeos-image-archive/path/file' ->
192 # content_type string application/octet-stream
256 self.ctx.Copy('-', self.path, input=str(value), version=generation)
282 return self.AtomicCounterOperation(-1, lambda x: x - 1)
301 """Decrement the counter if it is negative, otherwise set it to -1.
306 return self.AtomicCounterOperation(-1, lambda x: x - 1 if x < 0 else -1)
317 DEFAULT_GSUTIL_TRACKER_DIR = os.path.expanduser('~/.gsutil/tracker-files')
331 'chromeos-mirror/gentoo/distfiles/%s' % GSUTIL_TAR)
353 b"doesn't match cloud-supplied digest",
422 # non-root, just flag it and return.
431 # We probe `python` as that's what gsutil uses for its shebang.
433 ['python', '-c', 'from crcmod.crcmod import _usingExtension; '
443 [pyver, 'setup.py', 'build', '--build-base', tempdir,
444 '--build-platlib', tempdir],
504 self.gsutil_flags = ['-o', 'Boto:num_retries=10']
514 self.gsutil_flags += ['-o', 'Boto:proxy=%s' % url.hostname]
516 self.gsutil_flags += ['-o', 'Boto:proxy_user=%s' % url.username]
518 self.gsutil_flags += ['-o', 'Boto:proxy_pass=%s' % url.password]
520 self.gsutil_flags += ['-o', 'Boto:proxy_port=%d' % url.port]
548 cmd = ['-q', 'version']
566 """Pre-flight check for valid inputs.
615 # gsutil doesn't support cat-ting a local path, so read it ourselves.
688 # people using filename as a multi-directory path fragment.
725 (prefix, m.hexdigest(), filename[-16:]))
733 e: Exception object to filter. Exception may be re-raised as
760 sig_name = signals.StrSignal(-e.result.returncode)
770 error = error.encode('utf-8')
798 if 'cp' in e.result.cmd[:-2]:
802 tracker_filenames = self.GetTrackerFilenames(e.result.cmd[-1])
815 message_pattern=resumable_error.decode('utf-8'),
821 message_pattern=transient_error.decode('utf-8'),
840 update. Note this is not the same as sequence-number; it's
843 is what we expect. This is useful for distributed reasons- for example,
852 kwargs.setdefault('encoding', 'utf-8')
857 cmd += ['-h', header]
859 cmd += ['-h', 'x-goog-if-generation-match:%d' % int(version)]
865 cmd += ['-m']
913 # -v causes gs://bucket/path#generation to be listed in output.
914 cmd = ['cp', '-v']
917 # a directory if the -r option is used. If it's really a file, gsutil will
919 # around that problem by surpressing the -r flag if we detect the source
922 cmd.append('-r')
924 cmd.append('-e')
927 cmd.append('-Z')
931 cmd += ['-a', acl]
937 if src_path == '-' and kwargs.get('input') is not None:
941 data = data.encode('utf-8')
947 cmd += ['--', src_path, dest_path]
960 # Created: gs://chromeos-throw-away-bucket/foo#1360630664537000.1
991 self.Copy('-', gs_uri, input=contents, **kwargs)
1013 kwargs.setdefault('encoding', 'utf-8')
1037 cmd += ['-l']
1038 cmd += ['--', path]
1047 lines = lines[:-1]
1090 cmd = ['mv', '--', src_path, dest_path]
1178 cmd.append('-R')
1179 cmd.append('--')
1214 res = self.DoCommand(['stat', '--', path], stdout=True, **kwargs)
1234 content_type='application/octet-stream',
1241 # We expect Stat output like the following. However, the Content-Language
1247 # Content-Language: en
1248 # Content-Length: 74
1249 # Content-Type: application/octet-stream
1272 content_length=int(_GetField('Content-Length')),
1273 content_type=_GetField('Content-Type'),
1332 'chromeos_R17-1413.0.0-a1_x86-mario_full_dev.bin'). Returns the name only
1340 pattern: a path pattern (glob or regex) identifying the files we need.
1344 is_regex_pattern: Whether the pattern is a regex (otherwise a glob).
1409 url = '%s/chromite-temp/%s/%s/%s' % (constants.TRASH_BUCKET, prefix,