3 # Copyright (C) 2018 Simon Ruderich
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 repo_path = os.environ['OLDPWD']
27 submodule_path = os.getcwd()
28 submodule = os.path.relpath(submodule_path, repo_path)
30 evtag = subprocess.check_output(['git-evtag-compute-py', sha1]).split('\n')
31 assert evtag[0].startswith('# git-evtag comment: ')
32 assert evtag[1].startswith('Git-EVTag-v0-SHA512: ')
36 log = subprocess.check_output(['git', 'log', '-1', '--', submodule])
40 for line in log.split('\n'):
43 elif evtag[1] in line:
46 if not found_comment or not found_evtag:
47 print('missing or invalid evtag, aborting')
50 subprocess.check_call(['git', 'submodule', 'update', '--checkout', '--',