- subdir_path = packages_dir + '/' + subdir_name
- if os.path.exists(subdir_path + '/BROKEN.txt'): continue
- build_sh_path = subdir_path + '/build.sh'
-
- this_package = DebianPackage(subdir_name)
- all_packages.append(this_package)
- packages_map[this_package.name] = this_package
-
- if not os.path.isfile(build_sh_path): die('The directory ' + subdir_name + ' does not contain build.sh')
- with open(build_sh_path) as build_sh_file:
- for line in build_sh_file:
- if line.startswith('TERMUX_PKG_DEPENDS='):
- deps_comma_separated = line[(line.index('=')+2):(len(line)-2)]
- for dep in deps_comma_separated.split(','):
- dep = dep.strip()
- if not dep.endswith('libandroid-support-dev'): this_package.remaining_dependencies.add(dep)
- for file_in_subdir_name in sorted(os.listdir(subdir_path)):
- if file_in_subdir_name.endswith('.subpackage.sh'):
- subpackage_name = file_in_subdir_name[0:-len(".subpackage.sh"):]
- this_package.sub_packages.add(subpackage_name)
- packages_map[subpackage_name] = this_package
- with open(subdir_path + '/' + file_in_subdir_name) as subpackage_sh_file:
- for line in subpackage_sh_file:
- if line.startswith('TERMUX_SUBPKG_DEPENDS='):
- deps_comma_separated = line[(line.index('=')+2):(len(line)-2)]
- for dep in deps_comma_separated.split(','):
- dep = dep.strip()
- this_package.remaining_dependencies.add(dep)
- this_package.remaining_dependencies.discard(this_package.name) # Do not depend on itself
- this_package.remaining_dependencies.difference_update(this_package.sub_packages) # Do not depend on any sub package
+ subdir_path = packages_dir + '/' + subdir_name
+
+ if os.path.exists(subdir_path + '/BROKEN.txt'):
+ continue
+
+ build_sh_path = subdir_path + '/build.sh'
+
+ this_package = DebianPackage(subdir_name)
+ all_packages.append(this_package)
+ packages_map[this_package.name] = this_package
+
+ if not os.path.isfile(build_sh_path):
+ die('The directory ' + subdir_name + ' does not contain build.sh')
+
+ with open(build_sh_path) as build_sh_file:
+ for line in build_sh_file:
+ if line.startswith('TERMUX_PKG_DEPENDS='):
+ deps_comma_separated = line[(line.index('=')+2):(len(line)-2)]
+ for dep in deps_comma_separated.split(','):
+ dep = dep.strip()
+ if not dep.endswith('libandroid-support-dev'):
+ this_package.remaining_dependencies.add(dep)
+ for file_in_subdir_name in sorted(os.listdir(subdir_path)):
+ if file_in_subdir_name.endswith('.subpackage.sh'):
+ subpackage_name = file_in_subdir_name[0:-len(".subpackage.sh"):]
+ this_package.sub_packages.add(subpackage_name)
+ packages_map[subpackage_name] = this_package
+ with open(subdir_path + '/' + file_in_subdir_name) as subpackage_sh_file:
+ for line in subpackage_sh_file:
+ if line.startswith('TERMUX_SUBPKG_DEPENDS='):
+ deps_comma_separated = line[(line.index('=')+2):(len(line)-2)]
+ for dep in deps_comma_separated.split(','):
+ dep = dep.strip()
+ this_package.remaining_dependencies.add(dep)
+ # Do not depend on itself
+ this_package.remaining_dependencies.discard(this_package.name)
+ # Do not depend on any sub package
+ this_package.remaining_dependencies.difference_update(this_package.sub_packages)