summaryrefslogtreecommitdiff
path: root/cscript
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-11-26 12:20:18 +0100
committerCarl Hetherington <cth@carlh.net>2024-11-26 12:20:18 +0100
commitf87a458bdaa427179ccf241c97c306acc18fb180 (patch)
tree80387e0e856e8f8c02afa2fe2f999338ee199521 /cscript
parent3852c23093f892f348eba8da6bbb6b0a648a8ae4 (diff)
Make sure that debian/files is closed after writing it.
Diffstat (limited to 'cscript')
-rw-r--r--cscript8
1 files changed, 4 insertions, 4 deletions
diff --git a/cscript b/cscript
index ac45d413b..1f45fccd0 100644
--- a/cscript
+++ b/cscript
@@ -749,10 +749,10 @@ def package_debian(target, cpu, version, options):
# Get the required capability to write to disks
print('setcap "cap_dac_override+ep cap_sys_admin+ep" /usr/bin/dcpomatic2_disk_writer', file=f)
target.command('./waf dist')
- f = open('debian/files', 'w')
- suffix = '' if options['gui'] else '-cli'
- arch = 'amd64' if cpu == 'x86' else 'aarch64' if cpu == 'arm' else None
- print(f'{name}{suffix}_{version}-1_{arch}.deb video extra', file=f)
+ with open('debian/files', 'w') as f:
+ suffix = '' if options['gui'] else '-cli'
+ arch = 'amd64' if cpu == 'x86' else 'aarch64' if cpu == 'arm' else None
+ print(f'{name}{suffix}_{version}-1_{arch}.deb video extra', file=f)
shutil.rmtree('build/deb', ignore_errors=True)
os.makedirs('build/deb')