7 package_dir
= 'packages'
8 for pkgdir_name
in sorted(os
.listdir(package_dir
)):
9 dir_path
= package_dir
+ '/' + pkgdir_name
10 build_sh_path
= dir_path
+ '/build.sh'
11 if not os
.path
.isfile(build_sh_path
):
12 sys
.exit('No build.sh file in: ' + pkgdir_name
)
13 with
open(build_sh_path
) as build_sh
:
14 lines
= build_sh
.readlines()
15 validate_package(pkgdir_name
, lines
)
17 def validate_package(package_name
, lines
):
19 print('Too few lines in package: ' + package_name
)
21 if not lines
[0].startswith('TERMUX_PKG_HOMEPAGE='):
22 print('The first line is not TERMUX_PKG_HOMEPAGE: ' + package_name
)
23 if not lines
[1].startswith('TERMUX_PKG_DESCRIPTION='):
24 print('The second line is not TERMUX_PKG_DESCRIPTION: ' + package_name
)
28 if line
.endswith(' \n'):
29 print('Line ' + str(line_number
) + ' has trailing whitespace: ' + package_name
)
32 if __name__
== '__main__':