pkg_state[pkg]["build_status"] = "success"
- log_print("Ensuring pkgs directory exists...")
- if not os.path.exists(other_state['pkg_out_dir']):
- pkg_out_dir_path = Path(other_state['pkg_out_dir'])
- pkg_out_dir_path.mkdir(parents=True)
log_print("Moving pkg to pkgs directory...")
for f in pkg_list:
log_print(f'Moving "{f}"...')
return True
+def validate_and_verify_paths(other_state):
+ if not os.path.exists(other_state['chroot']):
+ log_print(f"ERROR: chroot at "{other_state['chroot']}" does not exist")
+ sys.exit(1)
+ log_print("Ensuring pkgs directory exists...")
+ if not os.path.exists(other_state['pkg_out_dir']):
+ pkg_out_dir_path = Path(other_state['pkg_out_dir'])
+ pkg_out_dir_path.mkdir(parents=True)
+ if not os.path.exists(other_state['gpg_home']):
+ log_print(f"ERROR: checkingGPG at "{other_state['gpg_home']}" does not exist")
+ sys.exit(1)
+ log_print("Ensuring logs directory exists...")
+ if other_state['logs_dir'] is None:
+ log_print('ERROR: "logs_dir" was not specified!')
+ sys.exit(1)
+ if not os.path.exists(other_state['logs_dir']):
+ logs_dir_path = Path(other_state['logs_dir'])
+ logs_dir_path.mkdir(parents=True)
+ log_print("Ensuring clones directory exists...")
+ if not os.path.exists(other_state['clones_dir']):
+ clones_dir_path = Path(other_state['clones_dir'])
+ clones_dir_path.mkdir(parents=True)
+
+
if __name__ == "__main__":
editor = None
parser = argparse.ArgumentParser(description="Update AUR pkgs")
log_print('ERROR: At least "--config" or "--pkg" must be specified')
sys.exit(1)
+ validate_and_verify_paths(other_state)
+
if args.editor is not None:
editor = args.editor