]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Change tabsize
authorLzu Tao <taolzu@gmail.com>
Fri, 30 Nov 2018 04:01:19 +0000 (11:01 +0700)
committerLzu Tao <taolzu@gmail.com>
Sat, 1 Dec 2018 16:18:59 +0000 (23:18 +0700)
build/meson/GetZstdLibraryVersion.py

index 364edc5aa61e3968ca30032fa819531dddda19cd..5659a3283a1f37bfb3f12e318583c36966c1053c 100644 (file)
@@ -12,34 +12,34 @@ import sys
 
 
 def usage():
-    print('usage: python3 GetZstdLibraryVersion.py <path/to/zstd.h>')
-    sys.exit(1)
+  print('usage: python3 GetZstdLibraryVersion.py <path/to/zstd.h>')
+  sys.exit(1)
 
 
 def find_version(filepath):
-    version_file_data = None
-    with open(filepath) as fd:
-        version_file_data = fd.read()
+  version_file_data = None
+  with open(filepath) as fd:
+    version_file_data = fd.read()
 
-    patterns = r"""#\s*define\s+ZSTD_VERSION_MAJOR\s+([0-9]+)
+  patterns = r"""#\s*define\s+ZSTD_VERSION_MAJOR\s+([0-9]+)
 #\s*define\s+ZSTD_VERSION_MINOR\s+([0-9]+)
 #\s*define\s+ZSTD_VERSION_RELEASE\s+([0-9]+)
 """
-    regex = re.compile(patterns, re.MULTILINE)
-    version_match = regex.search(version_file_data)
-    if version_match:
-        return version_match.groups()
-    raise RuntimeError("Unable to find version string.")
+  regex = re.compile(patterns, re.MULTILINE)
+  version_match = regex.search(version_file_data)
+  if version_match:
+    return version_match.groups()
+  raise RuntimeError("Unable to find version string.")
 
 
 def main():
-    if len(sys.argv) < 2:
-        usage()
+  if len(sys.argv) < 2:
+    usage()
 
-    filepath = sys.argv[1]
-    version_tup = find_version(filepath)
-    print('.'.join(version_tup))
+  filepath = sys.argv[1]
+  version_tup = find_version(filepath)
+  print('.'.join(version_tup))
 
 
 if __name__ == '__main__':
-    main()
+  main()