meta: replace bluelib with fx
This commit is contained in:
+24
-22
@@ -1,6 +1,6 @@
|
||||
#include "commands.h"
|
||||
|
||||
#include <blue/cmd.h>
|
||||
#include <fx/cmdline/cmd.h>
|
||||
#include <ropkg/instance.h>
|
||||
|
||||
enum {
|
||||
@@ -8,53 +8,55 @@ enum {
|
||||
};
|
||||
|
||||
static int bootstrap(
|
||||
const b_command *self,
|
||||
const b_arglist *opt,
|
||||
const b_array *args)
|
||||
const fx_command *self,
|
||||
const fx_arglist *opt,
|
||||
const fx_array *args)
|
||||
{
|
||||
const char *root_path = NULL;
|
||||
b_status status = b_arglist_get_string(
|
||||
fx_status status = fx_arglist_get_string(
|
||||
opt,
|
||||
B_COMMAND_INVALID_ID,
|
||||
FX_COMMAND_INVALID_ID,
|
||||
ARG_PATH,
|
||||
0,
|
||||
&root_path);
|
||||
if (!B_OK(status)) {
|
||||
b_arglist_report_missing_args(
|
||||
if (!FX_OK(status)) {
|
||||
fx_arglist_report_missing_args(
|
||||
opt,
|
||||
B_COMMAND_INVALID_ID,
|
||||
FX_COMMAND_INVALID_ID,
|
||||
ARG_PATH,
|
||||
0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct ropkg_instance *inst;
|
||||
b_result result = ropkg_instance_bootstrap(root_path, &inst);
|
||||
if (b_result_is_error(result)) {
|
||||
b_throw(result);
|
||||
fx_result result = ropkg_instance_bootstrap(root_path, &inst);
|
||||
if (fx_result_is_error(result)) {
|
||||
fx_throw(result);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ropkg_instance_close(inst);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
B_COMMAND(CMD_BOOTSTRAP, CMD_ROOT)
|
||||
FX_COMMAND(CMD_BOOTSTRAP, CMD_ROOT)
|
||||
{
|
||||
B_COMMAND_NAME("bootstrap");
|
||||
B_COMMAND_DESC(
|
||||
FX_COMMAND_NAME("bootstrap");
|
||||
FX_COMMAND_DESC(
|
||||
"initialise a new Rosetta package manager instance. use this "
|
||||
"command to prepare a sysroot for the installation of Rosetta "
|
||||
"packages.");
|
||||
B_COMMAND_FLAGS(B_COMMAND_SHOW_HELP_BY_DEFAULT);
|
||||
B_COMMAND_FUNCTION(bootstrap);
|
||||
FX_COMMAND_FLAGS(FX_COMMAND_SHOW_HELP_BY_DEFAULT);
|
||||
FX_COMMAND_FUNCTION(bootstrap);
|
||||
|
||||
B_COMMAND_ARG(ARG_PATH)
|
||||
FX_COMMAND_ARG(ARG_PATH)
|
||||
{
|
||||
B_ARG_NAME("sysroot");
|
||||
B_ARG_DESC(
|
||||
FX_ARG_NAME("sysroot");
|
||||
FX_ARG_DESC(
|
||||
"the path to the system root directory to initialise.");
|
||||
B_ARG_NR_VALUES(1);
|
||||
FX_ARG_NR_VALUES(1);
|
||||
}
|
||||
|
||||
B_COMMAND_HELP_OPTION();
|
||||
FX_COMMAND_HELP_OPTION();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user