script: Improve update sources script
- remove unused variable to pass pylint - Use another approach to detect if known-good remote is already present to avoid the need for "ignore following errors" message.
This commit is contained in:
parent
16cf5a5dc2
commit
fa403b9691
@ -66,7 +66,7 @@ def command_retval(cmd, directory):
|
|||||||
p = subprocess.Popen(cmd,
|
p = subprocess.Popen(cmd,
|
||||||
cwd=directory,
|
cwd=directory,
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
(stdout, _) = p.communicate()
|
p.communicate()
|
||||||
return p.returncode
|
return p.returncode
|
||||||
|
|
||||||
|
|
||||||
@ -95,8 +95,8 @@ class GoodCommit(object):
|
|||||||
|
|
||||||
def AddRemote(self):
|
def AddRemote(self):
|
||||||
"""Add the remote 'known-good' if it does not exist."""
|
"""Add the remote 'known-good' if it does not exist."""
|
||||||
print('Ignore "fatal" errors for missing known-good remote:')
|
remotes = command_output(['git', 'remote'], self.subdir).splitlines()
|
||||||
if command_retval(['git', 'remote', 'show', 'known-good'], self.subdir) != 0:
|
if 'known-good' not in remotes:
|
||||||
command_output(['git', 'remote', 'add', 'known-good', self.GetUrl()], self.subdir)
|
command_output(['git', 'remote', 'add', 'known-good', self.GetUrl()], self.subdir)
|
||||||
|
|
||||||
def HasCommit(self):
|
def HasCommit(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user