Skip to content

Commit f98a583

Browse files
author
Sam Kleinman
committed
build: minor corrections to new scripts
1 parent cec4ec5 commit f98a583

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

bin/makefile_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ def target(self, target):
2626
self.makefile.append(target + '\n')
2727

2828
def var(self, variable, value):
29-
self.makefile.append(variable + '=' + value + '\n')
29+
self.makefile.append(variable + ' = ' + value + '\n')
3030

3131
def append_var(self, variable, value):
32-
self.makefile.append(variable + '+=' + value + '\n')
32+
self.makefile.append(variable + ' += ' + value + '\n')
3333

3434
def job(self, job):
3535
self.makefile.append('\t' + job + '\n')

bin/pdf_makefile_builder.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,30 @@ def makefile_builder(name, tag):
3030
content.target('$(public-branch-output)/' + name_tagged + '.pdf:$(public-branch-output)/' + name_tagged + '-$(current-branch).pdf')
3131
content.job('@bin/create-link $(notdir $<) $(notdir $@) $@')
3232

33-
content.section_break('Variables, Interaction, and Integration')
33+
content.comment('adding ' + name + '.pdf to the build dependency.')
3434
content.append_var('PDF_OUTPUT', '$(public-branch-output)/' + name_tagged + '.pdf')
3535

3636
return content.makefile
3737

3838
class MongoDBManualPdfMakefile(object):
39-
def __init__(self):
40-
self.output = []
39+
def __init__(self, makefile=[]):
40+
self.makefile = makefile
4141
for pdfs in pdfs_to_build:
4242
for item in makefile_builder(pdfs[0], pdfs[1]):
43-
self.output.append(item)
43+
self.makefile.append(item)
4444

45-
self.output.append('manual-pdfs:$(PDF_OUTPUT)')
45+
self.makefile.append('\n')
46+
self.makefile.append('manual-pdfs:$(PDF_OUTPUT)')
4647

4748
def print_content(self):
48-
for line in self.output:
49-
print(line)
49+
for line in self.makefile:
50+
print(line.rstrip('\n'))
5051

5152
def write(self, filename):
5253
with open(filename, 'w') as f:
53-
for line in self.output:
54+
for line in self.makefile:
5455
f.write(line)
55-
56+
f.write('\n')
5657
print('[meta-build]: built "' + sys.argv[1] + '" to specify pdf builders.' )
5758

5859
def main():

0 commit comments

Comments
 (0)