~mdw
/
termux-packages
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
58e5e9b
)
Add TERMUX_PKG_REVISION check to lint-packages.py
author
Fredrik Fornwall
<fredrik@fornwall.net>
Tue, 19 Dec 2017 23:13:01 +0000
(
00:13
+0100)
committer
Fredrik Fornwall
<fredrik@fornwall.net>
Tue, 19 Dec 2017 23:13:01 +0000
(
00:13
+0100)
scripts/lint-packages.py
patch
|
blob
|
blame
|
history
diff --git
a/scripts/lint-packages.py
b/scripts/lint-packages.py
index
dc48a3d
..
5cfbe53
100755
(executable)
--- a/
scripts/lint-packages.py
+++ b/
scripts/lint-packages.py
@@
-1,6
+1,7
@@
#!/usr/bin/env python3
import os
#!/usr/bin/env python3
import os
+import re
import sys
def main():
import sys
def main():
@@
-26,7
+27,12
@@
def validate_package(package_name, lines):
line_number = 1
for line in lines:
if line.endswith(' \n'):
line_number = 1
for line in lines:
if line.endswith(' \n'):
- print('Line ' + str(line_number) + ' has trailing whitespace: ' + package_name)
+ print(package_name + ': Line ' + str(line_number) + ' has trailing whitespace')
+ if line.startswith('TERMUX_PKG_REVISION='):
+ value = line[len('TERMUX_PKG_REVISION='):].strip()
+ if not re.match('[0-9]+', value):
+ print(package_name + ': strange TERMUX_PKG_REVISION value "' + value + '"')
+
line_number += 1
if __name__ == '__main__':
line_number += 1
if __name__ == '__main__':