diff --git a/README.md b/README.md index 018cb3d..c4d577f 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,8 @@ For example, if your repo's name is `MyAURRepo`, then `repo` should be set to `.../MyAURRepo.db.tar`. You must also create symlinks such that `MyAURRepo.db` points to -`MyAURRepo.db.tar` and `MyAURRepo.files` points to `MyAURRepo.files.tar`. +`MyAURRepo.db.tar` and `MyAURRepo.files` points to `MyAURRepo.files.tar`, and +`MyAURRepo.db.sig` points to `MyAURRepo.db.tar.sig`. To use the repository, you can add an entry to your `/etc/pacman.conf` with the following: diff --git a/example_config.toml b/example_config.toml index 62fa127..aabeeec 100644 --- a/example_config.toml +++ b/example_config.toml @@ -7,6 +7,7 @@ gpg_dir = "/home/stephen/Downloads/aur/checkingGPG" logs_dir = "/home/stephen/Downloads/aur/logs" signing_gpg_dir = "/home/stephen/Downloads/aur/signingGPG" signing_gpg_key_fp = "04D9E3A2880F6418EC4BA70EA0F3F8FAA2088E62" +editor = "/usr/bin/vim" ########## END OF MANDATORY VARIABLES # Each [[entry]] needs a "name". diff --git a/update.py b/update.py index 5db60db..ea22f99 100755 --- a/update.py +++ b/update.py @@ -786,13 +786,13 @@ def update_pkg_list( pkg_state[pkg]["build_status"] = "add_fail" continue - log_print('Signing "custom.db"...') + log_print(f'Signing "{repo}"...') try: subprocess.run( [ "/usr/bin/rm", "-f", - str(os.path.join(pkg_out_dir, "custom.db.sig")), + str(os.path.join(pkg_out_dir, f"{repo}.sig")), ] ) subprocess.run( @@ -806,7 +806,7 @@ def update_pkg_list( "--default-key", signing_gpg_key_fp, "--detach-sign", - str(os.path.join(pkg_out_dir, "custom.db")), + str(os.path.join(pkg_out_dir, f"{repo}")), ], check=True, input=signing_gpg_pass, @@ -814,7 +814,7 @@ def update_pkg_list( env={"GNUPGHOME": signing_gpg_dir}, ) except subprocess.CalledProcessError: - log_print('WARNING: Failed to sign "custom.db"') + log_print(f'WARNING: Failed to sign "{repo}"') pkg_state[pkg]["build_status"] = "success" @@ -940,7 +940,7 @@ if __name__ == "__main__": parser.add_argument( "-e", "--editor", - default="vim", + default=None, help="editor to use when viewing PKGBUILDs", metavar="editor", ) @@ -1076,10 +1076,15 @@ if __name__ == "__main__": args_signing_gpg_pass, ): sys.exit(1) + if "editor" in d: + editor = d["editor"] else: log_print('ERROR: At least "--config" or "--pkg" must be specified') sys.exit(1) + if args.editor is not None: + editor = args.editor + os.putenv("CHROOT", os.path.realpath(args_chroot)) os.putenv("GNUPGHOME", os.path.realpath(args_gpg_home)) if not os.path.exists(args_logs_dir): @@ -1123,7 +1128,7 @@ if __name__ == "__main__": i += 1 continue else: - check_pkg_build_result = check_pkg_build(pkg_list[i], args.editor) + check_pkg_build_result = check_pkg_build(pkg_list[i], editor) if check_pkg_build_result == "ok": pass elif check_pkg_build_result == "not_ok":