]> git.seodisparate.com - AnotherAURHelper/commitdiff
Fix hardcoded signature of db, editor
authorStephen Seo <seo.disparate@gmail.com>
Thu, 2 Jun 2022 07:45:50 +0000 (16:45 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 2 Jun 2022 07:45:50 +0000 (16:45 +0900)
README.md
example_config.toml
update.py

index 018cb3d1e6adf8305974278c18a40646a05b824e..c4d577fb1c47397cf76ce688737fb5e9669bfbc5 100644 (file)
--- 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:
index 62fa127e754fb2edd3e13a5e57dd3ec2266775bd..aabeeec74ad7213d068342d52e3e7d563b2251dd 100644 (file)
@@ -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".
index 5db60db66929bd7cd564e7bbfb93fc356368693a..ea22f99edddb5bf66839c251192437af16459137 100755 (executable)
--- 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":