mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
builder: move the gpgkey_type type from Sigchecker to Utils
No functional change, just code motion.
This commit is contained in:
@@ -154,13 +154,13 @@ let main () =
|
||||
fun { Sources.uri = uri; Sources.gpgkey = gpgkey; Sources.proxy = proxy } ->
|
||||
let gpgkey =
|
||||
match gpgkey with
|
||||
| None -> Sigchecker.No_Key
|
||||
| Some key -> Sigchecker.KeyFile key in
|
||||
| None -> Utils.No_Key
|
||||
| Some key -> Utils.KeyFile key in
|
||||
uri, gpgkey, proxy
|
||||
) repos in
|
||||
let sources = List.map (
|
||||
fun (source, fingerprint) ->
|
||||
source, Sigchecker.Fingerprint fingerprint, Downloader.SystemProxy
|
||||
source, Utils.Fingerprint fingerprint, Downloader.SystemProxy
|
||||
) sources in
|
||||
let sources = List.append repos sources in
|
||||
let index : Index_parser.index =
|
||||
|
||||
@@ -50,10 +50,10 @@ and list_entries_long ~sources index =
|
||||
fun (source, key, proxy) ->
|
||||
printf (f_"Source URI: %s\n") source;
|
||||
(match key with
|
||||
| Sigchecker.No_Key -> ()
|
||||
| Sigchecker.Fingerprint fp ->
|
||||
| Utils.No_Key -> ()
|
||||
| Utils.Fingerprint fp ->
|
||||
printf (f_"Fingerprint: %s\n") fp;
|
||||
| Sigchecker.KeyFile kf ->
|
||||
| Utils.KeyFile kf ->
|
||||
printf (f_"Key: %s\n") kf;
|
||||
);
|
||||
printf "\n"
|
||||
@@ -103,10 +103,10 @@ and list_entries_json ~sources index =
|
||||
let item = [ "uri", JSON.String source ] in
|
||||
let item =
|
||||
match key with
|
||||
| Sigchecker.No_Key -> item
|
||||
| Sigchecker.Fingerprint fp ->
|
||||
| Utils.No_Key -> item
|
||||
| Utils.Fingerprint fp ->
|
||||
("fingerprint", JSON.String fp) :: item
|
||||
| Sigchecker.KeyFile kf ->
|
||||
| Utils.KeyFile kf ->
|
||||
("key", JSON.String kf) :: item in
|
||||
JSON.Dict item
|
||||
) sources in
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*)
|
||||
|
||||
val list_entries : list_format:([ `Short | `Long | `Json ]) -> sources:(string * Sigchecker.gpgkey_type * Downloader.proxy_mode) list -> Index_parser.index -> unit
|
||||
val list_entries : list_format:([ `Short | `Long | `Json ]) -> sources:(string * Utils.gpgkey_type * Downloader.proxy_mode) list -> Index_parser.index -> unit
|
||||
|
||||
@@ -24,11 +24,6 @@ open Utils
|
||||
open Printf
|
||||
open Unix
|
||||
|
||||
type gpgkey_type =
|
||||
| No_Key
|
||||
| Fingerprint of string
|
||||
| KeyFile of string
|
||||
|
||||
type t = {
|
||||
verbose : bool;
|
||||
gpg : string;
|
||||
|
||||
@@ -18,12 +18,7 @@
|
||||
|
||||
type t
|
||||
|
||||
type gpgkey_type =
|
||||
| No_Key
|
||||
| Fingerprint of string
|
||||
| KeyFile of string
|
||||
|
||||
val create : verbose:bool -> gpg:string -> gpgkey:gpgkey_type -> check_signature:bool -> t
|
||||
val create : verbose:bool -> gpg:string -> gpgkey:Utils.gpgkey_type -> check_signature:bool -> t
|
||||
|
||||
val verify : t -> string -> unit
|
||||
(** Verify the file is signed (if check_signature is true). *)
|
||||
|
||||
@@ -22,6 +22,11 @@ open Printf
|
||||
|
||||
open Common_utils
|
||||
|
||||
type gpgkey_type =
|
||||
| No_Key
|
||||
| Fingerprint of string
|
||||
| KeyFile of string
|
||||
|
||||
let prog = Filename.basename Sys.executable_name
|
||||
let error ?exit_code fs = error ~prog ?exit_code fs
|
||||
let warning fs = warning ~prog fs
|
||||
|
||||
Reference in New Issue
Block a user