diff --git a/configure.ac b/configure.ac index 6edabcd..4cc60b6 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6 +32,6 @@ AM_PATH_PYTHON([3.0]) AC_CONFIG_FILES([ Makefile src/Makefile - src/manager/Makefile + src/builder/Makefile ]) AC_OUTPUT diff --git a/dist/releases/neoricalex-0eab785-dirty-src.tar.gz b/dist/releases/neoricalex-0eab785-dirty-src.tar.gz deleted file mode 100644 index 5ed8b97..0000000 Binary files a/dist/releases/neoricalex-0eab785-dirty-src.tar.gz and /dev/null differ diff --git a/dist/releases/neoricalex-2dfd2c1-dirty-1-g5e2db8b-src.tar.gz b/dist/releases/neoricalex-2dfd2c1-dirty-1-g5e2db8b-src.tar.gz deleted file mode 100644 index dbf9d8c..0000000 Binary files a/dist/releases/neoricalex-2dfd2c1-dirty-1-g5e2db8b-src.tar.gz and /dev/null differ diff --git a/dist/releases/neoricalex-2dfd2c1-dirty-src.tar.gz b/dist/releases/neoricalex-2dfd2c1-dirty-src.tar.gz deleted file mode 100644 index b43a20c..0000000 Binary files a/dist/releases/neoricalex-2dfd2c1-dirty-src.tar.gz and /dev/null differ diff --git a/dist/releases/neoricalex-b6961cd-dirty-src.tar.gz b/dist/releases/neoricalex-b6961cd-dirty-src.tar.gz deleted file mode 100644 index 5d9a53f..0000000 Binary files a/dist/releases/neoricalex-b6961cd-dirty-src.tar.gz and /dev/null differ diff --git a/src/Makefile.am b/src/Makefile.am index 018038e..c7fcae1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = manager +SUBDIRS = builder bin_SCRIPTS = neoricalex CLEANFILES = $(bin_SCRIPTS) diff --git a/src/bootstrap.py b/src/bootstrap.py index 992efa5..0a63732 100644 --- a/src/bootstrap.py +++ b/src/bootstrap.py @@ -15,25 +15,25 @@ class Application(object): def run(self): self._ensure_venv() - self.launch_welcome() + self.launch_neoricalex() def _ensure_venv(self): - """Cria e ativa o ambiente virtual, caso ainda não exista.""" + """Cria e ativa o ambiente Python, caso ainda não exista.""" base_path = Path(__file__).resolve().parents[1] venv_path = base_path / "venv" os.chdir(base_path) if not venv_path.exists(): - print("[+] Criando ambiente virtual...") + print("[+] Criando ambiente Python...") subprocess.run([sys.executable, "-m", "venv", str(venv_path)], check=True) else: - print("[=] Ambiente virtual já existente.") + print("[=] Ambiente Python já existente.") - def launch_welcome(self): - """Lança o gestor de módulos.""" + def launch_neoricalex(self): + """Lança o neoricalex.""" base_path = Path(__file__).resolve().parent - manager = base_path / "manager" / "manager_main.py" - subprocess.run(["python3", str(manager)]) + neoricalex = base_path / "builder" / "__main__.py" + subprocess.run(["python3", str(neoricalex)]) diff --git a/src/manager/Makefile.am b/src/builder/Makefile.am similarity index 71% rename from src/manager/Makefile.am rename to src/builder/Makefile.am index c27bfc7..104c229 100644 --- a/src/manager/Makefile.am +++ b/src/builder/Makefile.am @@ -1,5 +1,5 @@ # =========================== -# Módulos Python do Manager +# Módulos Python do neoricalex # =========================== # Diretório de instalação Python @@ -7,10 +7,7 @@ neoricalexdir = $(pythondir) # Fontes do manager dist_neoricalex_PYTHON = \ - manager_main.py \ - manifest_parser.py \ - module_loader.py \ - tui_manager.py \ + __main__.py \ __init__.py # Inclui o bootstrap (nível acima) como parte deste pacote diff --git a/src/manager/__init__.py b/src/builder/__init__.py similarity index 100% rename from src/manager/__init__.py rename to src/builder/__init__.py diff --git a/src/builder/__main__.py b/src/builder/__main__.py new file mode 100644 index 0000000..f88fe09 --- /dev/null +++ b/src/builder/__main__.py @@ -0,0 +1 @@ +print("NEORICALEX — ambiente ok") diff --git a/src/manager/manager_main.py b/src/manager/manager_main.py deleted file mode 100644 index f924fe4..0000000 --- a/src/manager/manager_main.py +++ /dev/null @@ -1,81 +0,0 @@ -from rich.console import Console -from rich.table import Table -from pathlib import Path -import os, subprocess, json - -console = Console() -BASE_DIR = Path(__file__).resolve().parents[2] -MODULES_FILE = BASE_DIR / "src" / "modules.json" -MODULES_DIR = BASE_DIR / "src" / "modules" - -def load_modules(): - if MODULES_FILE.exists(): - with open(MODULES_FILE) as f: - data = json.load(f) - return data.get("modules", []) - return [] - -def clone_module(mod): - path = Path(mod["path"]) - if not path.exists(): - console.print(f"[cyan]📦 Clonando {mod['name']}...[/cyan]") - subprocess.run(["git", "clone", mod["repo"], str(path)], check=True) - else: - console.print(f"[yellow]✔ {mod['name']} já existe localmente.[/yellow]") - -def update_module(mod): - path = Path(mod["path"]) - if path.exists(): - console.print(f"[blue]🔄 Atualizando {mod['name']}...[/blue]") - subprocess.run(["git", "-C", str(path), "pull"], check=True) - else: - console.print(f"[red]⚠ Módulo {mod['name']} não encontrado![/red]") - -def run_module(mod): - path = Path(mod["path"]) - if not path.exists(): - console.print(f"[red]❌ Módulo {mod['name']} não encontrado.[/red]") - return - console.print(f"[green]🚀 Executando {mod['name']}...[/green]") - subprocess.run(mod["entrypoint"], cwd=path, shell=True) - -def menu(): - modules = load_modules() - while True: - console.clear() - table = Table(title="NEORICALEX – System Manager") - table.add_column("ID", justify="center") - table.add_column("Módulo") - table.add_column("Ação") - - for i, mod in enumerate(modules, start=1): - table.add_row(str(i), mod["name"], mod["repo"]) - table.add_row("0", "Sair", "") - - console.print(table) - choice = console.input("[cyan]\nSelecione um módulo> [/cyan]") - - if choice == "0": - break - if not choice.isdigit() or int(choice) > len(modules): - continue - - mod = modules[int(choice)-1] - console.print(f"[bold yellow]Selecionado:[/bold yellow] {mod['name']}") - console.print("[1] Executar [2] Atualizar [3] Reinstalar [0] Voltar") - sub = console.input("[cyan]> [/cyan]") - - if sub == "1": - run_module(mod) - elif sub == "2": - update_module(mod) - elif sub == "3": - if Path(mod["path"]).exists(): - subprocess.run(["rm", "-rf", mod["path"]]) - clone_module(mod) - else: - continue - -if __name__ == "__main__": - os.makedirs(MODULES_DIR, exist_ok=True) - menu() diff --git a/src/manager/manifest_parser.py b/src/manager/manifest_parser.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/manager/module_loader.py b/src/manager/module_loader.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/manager/tui_manager.py b/src/manager/tui_manager.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/modules.json b/src/modules.json deleted file mode 100644 index 1de0de2..0000000 --- a/src/modules.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "modules": [ - { - "name": "my_os", - "repo": "https://gitea.neoricalex.com/neo/my_os.git", - "path": "src/modules/my_os", - "entrypoint": "python3 tui/menu_main.py" - }, - { - "name": "my_distro", - "repo": "https://gitea.neoricalex.com/neo/my_distro.git", - "path": "src/modules/my_distro", - "entrypoint": "bash build.sh" - } - ] -} diff --git a/src/neoricalex b/src/neoricalex index 8aaa3a0..87370e1 100755 --- a/src/neoricalex +++ b/src/neoricalex @@ -6,6 +6,6 @@ sys.path.insert(1, '/usr/local/local/lib/python3.12/dist-packages') from bootstrap import Application if __name__ == "__main__": - app = Application(package="neoricalex", version="b6961cd-dirty") + app = Application(package="neoricalex", version="2dfd2c1-dirty-2-gb2f1b14-dirty") app.run()