Always generate meta-default-modes.h
This adds a hard requirement on having cvt installed, which in the past was soft, where the generated file was added to the repository.
This commit is contained in:
19
src/backends/native/gen-default-modes.py
Normal file → Executable file
19
src/backends/native/gen-default-modes.py
Normal file → Executable file
@ -1,3 +1,5 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2016 Red Hat Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -18,6 +20,10 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: %s [output file]"%sys.argv[0])
|
||||
exit(1)
|
||||
|
||||
common_resolutions = [
|
||||
# 4:3
|
||||
(800, 600),
|
||||
@ -109,6 +115,13 @@ for resolution in common_resolutions:
|
||||
cvt.close()
|
||||
output_lines.append("};")
|
||||
|
||||
for line in output_lines:
|
||||
sys.stdout.write(line + "\n")
|
||||
sys.stdout.flush()
|
||||
try:
|
||||
output_file = open(sys.argv[1], 'w')
|
||||
|
||||
for line in output_lines:
|
||||
output_file.write(line + "\n")
|
||||
output_file.flush()
|
||||
output_file.close()
|
||||
except:
|
||||
print("Failed to generate modelines:", sys.exc_info()[0])
|
||||
exit(1)
|
||||
|
Reference in New Issue
Block a user