package dkml-package-console
Console setup and uninstall executables for DkML installation
Install
Dune Dependency
Authors
Maintainers
Sources
src.tar.gz
md5=4636532b5971d7aa058b492448b02908
sha512=66e28e6c47b3de638601f0002289849d9af6bcbb9a2eb816d1dfe640bf3e5a350ad16b99d88b474b7be2482de480b5dd1fad4dbf87c702ee421bc033a3ca1327
doc/src/dkml-package-console.create/installer_archive.ml.html
Source file installer_archive.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
(** Creates archives meant to be unpacked by an end-user, with a setup executable inside. This module creates a shell script that you need to run to produce a final archive.tar.gz, archive.tar.bz2, etc. *) open Bos open Dkml_install_runner.Error_handling.Monad_syntax let generate ~(install_direction : Dkml_install_register.install_direction) ~archive_dir ~target_dir ~abi_selector ~program_name ~program_version = let abi_name = Dkml_install_runner.Path_location.show_abi_selector abi_selector in let program_name_kebab_lower_case = program_name.Dkml_package_console_common.Author_types.name_kebab_lower_case in let direction = match install_direction with Install -> "i" | Uninstall -> "u" in let installer_basename_with_direction_and_ver = Fmt.str "%s-%s-%s-%s" program_name_kebab_lower_case abi_name direction program_version in let installer_create_sh = Fpath.( target_dir / Printf.sprintf "bundle-%s-%s-%s.sh" program_name_kebab_lower_case abi_name direction) in let* buildhost_abi', _fl = Dkml_install_runner.Host_abi.create_v2 () in let buildhost_abi = Dkml_install_api.Context.Abi_v2.to_canonical_string buildhost_abi' in let translate s = Str.( s |> global_replace (regexp_string "__PLACEHOLDER_BASENAME__") installer_basename_with_direction_and_ver |> global_replace (regexp_string "__PLACEHOLDER_BUILDHOST_ABI__") buildhost_abi |> global_replace (regexp_string "__PLACEHOLDER_ARCHIVE_DIR__") (Fpath.to_string archive_dir)) in Logs.info (fun l -> l "Generating script %a that can produce %s.tar.gz (etc.) archives" Fpath.pp installer_create_sh installer_basename_with_direction_and_ver); Dkml_install_runner.Error_handling.map_rresult_error_to_progress (OS.File.write ~mode:0o750 installer_create_sh (translate (Option.get (Shell_scripts.read "bundle.sh"))))
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>