mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 14:32:22 +08:00
♻ update deps
This commit is contained in:
parent
0ed5f1cc81
commit
6b772b1a78
@ -38,13 +38,13 @@ CPMAddPackage(
|
||||
CPMAddPackage(
|
||||
NAME fmt
|
||||
GITHUB_REPOSITORY fmtlib/fmt
|
||||
GIT_TAG 864465419079791bf61bcf51e633cab6e6be71bb
|
||||
GIT_TAG 756822ba39941e1e033f26e4c07547cc7058948c
|
||||
EXCLUDE_FROM_ALL YES
|
||||
)
|
||||
CPMAddPackage(
|
||||
NAME spdlog
|
||||
GITHUB_REPOSITORY gabime/spdlog
|
||||
GIT_TAG 298a200f69d66114adde2d5d8ad34f2cce5a5b69
|
||||
GIT_TAG b75edfafca581e33be29ab51b9546b2e955c2853
|
||||
EXCLUDE_FROM_ALL YES
|
||||
)
|
||||
CPMAddPackage(
|
||||
@ -56,13 +56,13 @@ CPMAddPackage(
|
||||
CPMAddPackage(
|
||||
NAME cpr
|
||||
GITHUB_REPOSITORY libcpr/cpr
|
||||
GIT_TAG 2157a3126c2ef1b76f339dedd6d7585e39651512
|
||||
GIT_TAG 5ae5fdeadfbbb784192c034be0222016123c94ad
|
||||
EXCLUDE_FROM_ALL YES
|
||||
)
|
||||
CPMAddPackage(
|
||||
NAME range-v3
|
||||
GITHUB_REPOSITORY ericniebler/range-v3
|
||||
GIT_TAG 0fa54d7de5dc00655e38a08e87cda61f7aa6d5b9
|
||||
GIT_TAG 3d6e6f56e5e1a3ec4befcc7695504ea23e1d52ab
|
||||
EXCLUDE_FROM_ALL YES
|
||||
)
|
||||
|
||||
|
14
src/disk.cpp
14
src/disk.cpp
@ -141,7 +141,15 @@ void zfs_create_dataset(const std::string_view& zpath, const std::string_view& z
|
||||
#ifdef NDEVENV
|
||||
utils::exec(fmt::format(FMT_COMPILE("zfs create -o mountpoint={} {} 2>>/tmp/cachyos-install.log"), zmount, zpath), true);
|
||||
#else
|
||||
spdlog::debug("zfs create -o mountpoint={} {} 2>>/tmp/cachyos-install.log", zmount, zpath);
|
||||
spdlog::debug("zfs create -o mountpoint={} {}", zmount, zpath);
|
||||
#endif
|
||||
}
|
||||
|
||||
void zfs_destroy_dataset(const std::string_view& zdataset) noexcept {
|
||||
#ifdef NDEVENV
|
||||
utils::exec(fmt::format(FMT_COMPILE("zfs destroy -r {} 2>>/tmp/cachyos-install.log"), zdataset), true);
|
||||
#else
|
||||
spdlog::debug("zfs destroy -r {}", zdataset);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -160,6 +168,7 @@ std::string zfs_list_devs() noexcept {
|
||||
}
|
||||
|
||||
std::string zfs_list_datasets(const std::string_view& type) noexcept {
|
||||
#ifdef NDEVENV
|
||||
if (type == "zvol") {
|
||||
return utils::exec("zfs list -Ht volume -o name,volsize 2>/dev/null");
|
||||
} else if (type == "legacy") {
|
||||
@ -167,6 +176,9 @@ std::string zfs_list_datasets(const std::string_view& type) noexcept {
|
||||
}
|
||||
|
||||
return utils::exec("zfs list -H -o name 2>/dev/null | grep \"/\"");
|
||||
#else
|
||||
return "zpcachyos";
|
||||
#endif
|
||||
}
|
||||
|
||||
// Other filesystems
|
||||
|
@ -19,6 +19,7 @@ std::vector<std::string> lvm_show_vg() noexcept;
|
||||
|
||||
// ZFS filesystem
|
||||
void zfs_create_dataset(const std::string_view& zpath, const std::string_view& zmount) noexcept;
|
||||
void zfs_destroy_dataset(const std::string_view& zdataset) noexcept;
|
||||
std::string zfs_list_devs() noexcept;
|
||||
std::string zfs_list_datasets(const std::string_view& type = "none") noexcept;
|
||||
|
||||
|
100
src/tui.cpp
100
src/tui.cpp
@ -1466,6 +1466,84 @@ bool zfs_create_zpool() noexcept {
|
||||
return true;
|
||||
}
|
||||
|
||||
void zfs_import_pool() noexcept {
|
||||
}
|
||||
|
||||
void zfs_new_ds() noexcept {
|
||||
}
|
||||
|
||||
void zfs_set_property() noexcept {
|
||||
const auto& zlist = utils::make_multiline(utils::zfs_list_datasets());
|
||||
if (zlist.empty()) {
|
||||
// no available datasets
|
||||
detail::infobox_widget("\nNo datasets available\"\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
return;
|
||||
}
|
||||
|
||||
std::string zdataset{};
|
||||
{
|
||||
auto screen = ScreenInteractive::Fullscreen();
|
||||
std::int32_t selected{};
|
||||
bool success{};
|
||||
auto ok_callback = [&] {
|
||||
zdataset = zlist[static_cast<std::size_t>(selected)];
|
||||
success = true;
|
||||
screen.ExitLoopClosure()();
|
||||
};
|
||||
static constexpr auto zfs_menu_body = "\nEnter the property and value you would like to\nset using the format property=mountpoint\n \nFor example, you could enter:\ncompression=lz4\nor\nacltype=posixacl\n";
|
||||
const auto& content_size = size(HEIGHT, LESS_THAN, 10) | size(WIDTH, GREATER_THAN, 40);
|
||||
detail::menu_widget(zlist, ok_callback, &selected, &screen, zfs_menu_body, {size(HEIGHT, LESS_THAN, 18), content_size});
|
||||
/* clang-format off */
|
||||
if (!success) { return; }
|
||||
/* clang-format on */
|
||||
}
|
||||
|
||||
// const auto& content = fmt::format(FMT_COMPILE("\nPlease confirm that you want to irrevocably\ndelete all the data on '{}'\nand the data contained on all of it's children\n"), zdataset);
|
||||
// const auto& do_destroy = detail::yesno_widget(content, size(HEIGHT, LESS_THAN, 20) | size(WIDTH, LESS_THAN, 75));
|
||||
/* clang-format off */
|
||||
//if (!do_destroy) { return; }
|
||||
/* clang-format on */
|
||||
|
||||
// utils::zfs_destroy_dataset(zdataset);
|
||||
}
|
||||
|
||||
void zfs_destroy_dataset() noexcept {
|
||||
const auto& zlist = utils::make_multiline(utils::zfs_list_datasets());
|
||||
if (zlist.empty()) {
|
||||
// no available datasets
|
||||
detail::infobox_widget("\nNo datasets available\"\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
return;
|
||||
}
|
||||
|
||||
std::string zdataset{};
|
||||
{
|
||||
auto screen = ScreenInteractive::Fullscreen();
|
||||
std::int32_t selected{};
|
||||
bool success{};
|
||||
auto ok_callback = [&] {
|
||||
zdataset = zlist[static_cast<std::size_t>(selected)];
|
||||
success = true;
|
||||
screen.ExitLoopClosure()();
|
||||
};
|
||||
static constexpr auto zfs_destroy_menu_body = "\nSelect the dataset you would like to permanently delete.\nPlease note that this will recursively delete any child datasets with warning\n";
|
||||
const auto& content_size = size(HEIGHT, LESS_THAN, 10) | size(WIDTH, GREATER_THAN, 40);
|
||||
detail::menu_widget(zlist, ok_callback, &selected, &screen, zfs_destroy_menu_body, {size(HEIGHT, LESS_THAN, 18), content_size});
|
||||
/* clang-format off */
|
||||
if (!success) { return; }
|
||||
/* clang-format on */
|
||||
}
|
||||
|
||||
const auto& content = fmt::format(FMT_COMPILE("\nPlease confirm that you want to irrevocably\ndelete all the data on '{}'\nand the data contained on all of it's children\n"), zdataset);
|
||||
const auto& do_destroy = detail::yesno_widget(content, size(HEIGHT, LESS_THAN, 20) | size(WIDTH, LESS_THAN, 75));
|
||||
/* clang-format off */
|
||||
if (!do_destroy) { return; }
|
||||
/* clang-format on */
|
||||
|
||||
utils::zfs_destroy_dataset(zdataset);
|
||||
}
|
||||
|
||||
// Automated configuration of zfs. Creates a new zpool and a default set of filesystems
|
||||
void zfs_auto() noexcept {
|
||||
// first we need to create a zpool to hold the datasets/zvols
|
||||
@ -1513,27 +1591,27 @@ void zfs_menu_manual() noexcept {
|
||||
std::int32_t selected{};
|
||||
auto ok_callback = [&] {
|
||||
switch (selected) {
|
||||
/*case 0:
|
||||
zfs_create_zpool();
|
||||
case 0:
|
||||
tui::zfs_create_zpool();
|
||||
break;
|
||||
case 1:
|
||||
zfs_import_pool();
|
||||
/*case 1:
|
||||
tui::zfs_import_pool();
|
||||
break;
|
||||
case 2:
|
||||
zfs_new_ds();
|
||||
tui::zfs_new_ds();
|
||||
break;
|
||||
case 3:
|
||||
zfs_new_ds("legacy");
|
||||
tui::zfs_new_ds("legacy");
|
||||
break;
|
||||
case 4:
|
||||
zfs_new_ds("zvol");
|
||||
break;
|
||||
tui::zfs_new_ds("zvol");
|
||||
break;*/
|
||||
case 5:
|
||||
zfs_set_property();
|
||||
tui::zfs_set_property();
|
||||
break;
|
||||
case 6:
|
||||
zfs_destroy_dataset();
|
||||
break;*/
|
||||
tui::zfs_destroy_dataset();
|
||||
break;
|
||||
default:
|
||||
screen.ExitLoopClosure()();
|
||||
return;
|
||||
|
@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/libcpr/cpr.git
|
||||
revision = 2157a3126c2ef1b76f339dedd6d7585e39651512
|
||||
revision = 5ae5fdeadfbbb784192c034be0222016123c94ad
|
||||
|
||||
patch_directory = cpr
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/fmtlib/fmt.git
|
||||
revision = 864465419079791bf61bcf51e633cab6e6be71bb
|
||||
revision = 756822ba39941e1e033f26e4c07547cc7058948c
|
||||
|
||||
patch_directory = fmt
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/ericniebler/range-v3.git
|
||||
revision = 0fa54d7de5dc00655e38a08e87cda61f7aa6d5b9
|
||||
revision = 3d6e6f56e5e1a3ec4befcc7695504ea23e1d52ab
|
||||
|
||||
patch_directory = range-v3
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/gabime/spdlog.git
|
||||
revision = 298a200f69d66114adde2d5d8ad34f2cce5a5b69
|
||||
revision = b75edfafca581e33be29ab51b9546b2e955c2853
|
||||
|
||||
patch_directory = spdlog
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user