Skip to content

Commit

Permalink
Add some debug show
Browse files Browse the repository at this point in the history
  • Loading branch information
rikonaka committed Sep 19, 2024
1 parent d7c74c6 commit 014f154
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aoit"
version = "0.1.7"
version = "0.1.8"
edition = "2021"
authors = ["Riko Naka <[email protected]>"]
license = "GPL-3.0-only"
Expand Down
6 changes: 5 additions & 1 deletion src/pack.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use glob::glob;
// use log::debug;
use log::debug;
use log::error;
use log::info;
// use log::warn;
Expand Down Expand Up @@ -48,6 +48,7 @@ fn resolve_depends(package_name: &str, packags_vec: &mut Vec<String>) -> Result<
let command_output = String::from_utf8_lossy(&command.stdout);
for line in command_output.lines() {
if line.contains("Depends:") && !line.contains("|") {
debug!("depends line: {line}");
let line_split: Vec<&str> = line
.split(":")
.map(|x| x.trim())
Expand All @@ -56,6 +57,7 @@ fn resolve_depends(package_name: &str, packags_vec: &mut Vec<String>) -> Result<

if line_split.len() == 2 {
let depends_package_name = line_split[1];
debug!("depends package: {depends_package_name}");
let depends = resolve_depends(depends_package_name, packags_vec)?;
let apt_depends = AptDepends::new(depends_package_name, &depends);
ret.push(apt_depends);
Expand All @@ -70,6 +72,7 @@ fn resolve_depends_root(package_name: &str) -> Result<(AptDepends, Vec<String>)>
let mut packages_vec = Vec::new();
let root_depends = resolve_depends(package_name, &mut packages_vec)?;
let root = AptDepends::new(&package_name, &root_depends);
debug!("depends root: {:?}", root);
Ok((root, packages_vec))
}

Expand All @@ -85,6 +88,7 @@ fn download_depends(package_name: &str, target_dir: &str) -> Result<String> {
match entry {
Ok(path) => {
let package_full_name = path.to_string_lossy().to_string();
debug!("move {package_full_name} to {target_dir}");
utils::move_file_to_dir(&target_dir, &package_full_name)?;
return Ok(package_full_name);
}
Expand Down

0 comments on commit 014f154

Please sign in to comment.