drivers: gpu: drm: msm: registers: improve reproducibility
The files generated by gen_header.py capture the source path to the input files and the date. While that can be informative, it varies based on where and when the kernel was built as the full path is captured. Since all of the files that this tool is run on is under the drivers directory, this modifies the application to strip all of the path before drivers. Additionally it prints <stripped> instead of the date. Signed-off-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/655599/ Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>pull/1270/head
parent
2b520c6104
commit
ba64c6737f
|
|
@ -11,6 +11,7 @@ import collections
|
||||||
import argparse
|
import argparse
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
import re
|
||||||
|
|
||||||
class Error(Exception):
|
class Error(Exception):
|
||||||
def __init__(self, message):
|
def __init__(self, message):
|
||||||
|
|
@ -877,13 +878,14 @@ The rules-ng-ng source files this header was generated from are:
|
||||||
""")
|
""")
|
||||||
maxlen = 0
|
maxlen = 0
|
||||||
for filepath in p.xml_files:
|
for filepath in p.xml_files:
|
||||||
maxlen = max(maxlen, len(filepath))
|
new_filepath = re.sub("^.+drivers","drivers",filepath)
|
||||||
|
maxlen = max(maxlen, len(new_filepath))
|
||||||
for filepath in p.xml_files:
|
for filepath in p.xml_files:
|
||||||
pad = " " * (maxlen - len(filepath))
|
pad = " " * (maxlen - len(new_filepath))
|
||||||
filesize = str(os.path.getsize(filepath))
|
filesize = str(os.path.getsize(filepath))
|
||||||
filesize = " " * (7 - len(filesize)) + filesize
|
filesize = " " * (7 - len(filesize)) + filesize
|
||||||
filetime = time.ctime(os.path.getmtime(filepath))
|
filetime = time.ctime(os.path.getmtime(filepath))
|
||||||
print("- " + filepath + pad + " (" + filesize + " bytes, from " + filetime + ")")
|
print("- " + new_filepath + pad + " (" + filesize + " bytes, from <stripped>)")
|
||||||
if p.copyright_year:
|
if p.copyright_year:
|
||||||
current_year = str(datetime.date.today().year)
|
current_year = str(datetime.date.today().year)
|
||||||
print()
|
print()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue