LEFT | RIGHT |
1 # This file is part of the Adblock Plus web scripts, | 1 # This file is part of the Adblock Plus web scripts, |
2 # Copyright (C) 2006-2016 Eyeo GmbH | 2 # Copyright (C) 2006-2016 Eyeo GmbH |
3 # | 3 # |
4 # Adblock Plus is free software: you can redistribute it and/or modify | 4 # Adblock Plus is free software: you can redistribute it and/or modify |
5 # it under the terms of the GNU General Public License version 3 as | 5 # it under the terms of the GNU General Public License version 3 as |
6 # published by the Free Software Foundation. | 6 # published by the Free Software Foundation. |
7 # | 7 # |
8 # Adblock Plus is distributed in the hope that it will be useful, | 8 # Adblock Plus is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 def copyRepository(self): | 116 def copyRepository(self): |
117 """ | 117 """ |
118 Create a repository copy in a temporary directory | 118 Create a repository copy in a temporary directory |
119 """ | 119 """ |
120 self.tempdir = tempfile.mkdtemp(prefix=self.config.repositoryName) | 120 self.tempdir = tempfile.mkdtemp(prefix=self.config.repositoryName) |
121 command = ['hg', 'clone', '-q', self.config.repository, '-u', 'default',
self.tempdir] | 121 command = ['hg', 'clone', '-q', self.config.repository, '-u', 'default',
self.tempdir] |
122 subprocess.check_call(command) | 122 subprocess.check_call(command) |
123 | 123 |
124 # Make sure to run ensure_dependencies.py if present | 124 # Make sure to run ensure_dependencies.py if present |
125 command = [ | 125 depscript = os.path.join(self.tempdir, 'ensure_dependencies.py') |
126 sys.executable, | 126 if os.path.isfile(depscript): |
127 os.path.join(self.tempdir, 'ensure_dependencies.py'), '-q' | 127 subprocess.check_call([sys.executable, depscript, '-q']) |
128 ] | |
129 if os.path.isfile(command[0]): | |
130 subprocess.check_call(command) | |
131 | 128 |
132 def writeChangelog(self, changes): | 129 def writeChangelog(self, changes): |
133 """ | 130 """ |
134 write the changelog file into the cloned repository | 131 write the changelog file into the cloned repository |
135 """ | 132 """ |
136 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) | 133 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) |
137 if not os.path.exists(baseDir): | 134 if not os.path.exists(baseDir): |
138 os.makedirs(baseDir) | 135 os.makedirs(baseDir) |
139 changelogFile = '%s-%s.changelog.xhtml' % (self.basename, self.version) | 136 changelogFile = '%s-%s.changelog.xhtml' % (self.basename, self.version) |
140 changelogPath = os.path.join(baseDir, changelogFile) | 137 changelogPath = os.path.join(baseDir, changelogFile) |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 except Exception, ex: | 630 except Exception, ex: |
634 logging.error('The build for %s failed:', repo) | 631 logging.error('The build for %s failed:', repo) |
635 logging.exception(ex) | 632 logging.exception(ex) |
636 | 633 |
637 file = open(nightlyConfigFile, 'wb') | 634 file = open(nightlyConfigFile, 'wb') |
638 nightlyConfig.write(file) | 635 nightlyConfig.write(file) |
639 | 636 |
640 | 637 |
641 if __name__ == '__main__': | 638 if __name__ == '__main__': |
642 main() | 639 main() |
LEFT | RIGHT |