//! Simple usage example for APT wrapper use apt_wrapper::{AptTransaction, init, search_packages}; fn main() -> Result<(), Box> { println!("=== Simple APT Wrapper Example ==="); // Initialize init()?; println!("✓ APT wrapper initialized"); // Search for packages let packages = search_packages("vim")?; println!("Found {} packages matching 'vim'", packages.len()); // Create transaction let mut tx = AptTransaction::new()?; println!("✓ Created transaction"); // Add packages tx.add_package("apt")?; tx.add_package("curl")?; println!("✓ Added packages to transaction"); // Resolve dependencies tx.resolve()?; println!("✓ Dependencies resolved"); // Show what would be installed println!("Packages in transaction: {:?}", tx.packages()); // Note: We don't actually commit in the example to avoid installing packages // tx.commit()?; // println!("✓ Transaction committed"); // If commit failed, you could rollback: // tx.rollback()?; // println!("✓ Transaction rolled back"); // println!("Changed packages: {:?}", tx.changed_packages()); println!("✓ Transaction ready (not committed in example)"); println!("=== Example completed ==="); Ok(()) }