Adds nala on android support (#97)

This commit is contained in:
Thomas Schönauer
2022-11-01 22:20:47 +00:00
committed by GitHub
parent 027c99ea6b
commit 6cb9e96151

View File

@@ -5,27 +5,33 @@ use crate::Step;
use anyhow::Result;
pub fn upgrade_packages(ctx: &ExecutionContext) -> Result<()> {
let pkg = require("pkg")?;
//let pkg = require("pkg")?;
let pkg = which("nala").or_else(|| which("pkg")).unwrap();
print_separator("Termux Packages");
let is_nala = pkg.end_with("nala");
let mut command = ctx.run_type().execute(&pkg);
command.arg("upgrade");
if ctx.config().yes(Step::System) {
command.arg("-y");
}
command.check_run()?;
if ctx.config().cleanup() {
ctx.run_type().execute(&pkg).arg("clean").check_run()?;
if !is_nala {
if ctx.config().cleanup() {
ctx.run_type().execute(&pkg).arg("clean").check_run()?;
let apt = require("apt")?;
let mut command = ctx.run_type().execute(&apt);
command.arg("autoremove");
if ctx.config().yes(Step::System) {
command.arg("-y");
let apt = require("apt")?;
let mut command = ctx.run_type().execute(&apt);
command.arg("autoremove");
if ctx.config().yes(Step::System) {
command.arg("-y");
}
command.check_run()?;
}
command.check_run()?;
}
Ok(())