mirror of
https://codeberg.org/Toasterson/ips.git
synced 2026-04-10 13:20:42 +00:00
Remove unused imports and the synchronous flag in pkg6repo, adjust comments for clarity and grammar, and refine logging statements.
This commit is contained in:
parent
a3b2686b0a
commit
8760bf0c4d
1 changed files with 3 additions and 15 deletions
|
|
@ -7,7 +7,7 @@ use clap::{Parser, Subcommand};
|
|||
use serde::Serialize;
|
||||
use std::convert::TryFrom;
|
||||
use std::path::PathBuf;
|
||||
use tracing::{debug, error, info, warn};
|
||||
use tracing::{debug, info};
|
||||
use tracing_subscriber::fmt;
|
||||
|
||||
use libips::repository::{FileBackend, ReadableRepository, RepositoryVersion, WritableRepository};
|
||||
|
|
@ -81,10 +81,6 @@ enum Commands {
|
|||
#[clap(short = 'n')]
|
||||
dry_run: bool,
|
||||
|
||||
/// Wait for the operation to complete
|
||||
#[clap(long)]
|
||||
synchronous: bool,
|
||||
|
||||
/// Publishers to remove
|
||||
publisher: Vec<String>,
|
||||
},
|
||||
|
|
@ -325,7 +321,7 @@ enum Commands {
|
|||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
// Initialize the tracing subscriber with default log level as debug and no decorations
|
||||
// Initialize the tracing subscriber with the default log level as debug and no decorations
|
||||
fmt::Subscriber::builder()
|
||||
.with_max_level(tracing::Level::DEBUG)
|
||||
.without_time()
|
||||
|
|
@ -379,14 +375,13 @@ fn main() -> Result<()> {
|
|||
Commands::RemovePublisher {
|
||||
repo_uri_or_path,
|
||||
dry_run,
|
||||
synchronous,
|
||||
publisher,
|
||||
} => {
|
||||
info!(
|
||||
"Removing publishers {:?} from repository {}",
|
||||
publisher, repo_uri_or_path
|
||||
);
|
||||
debug!("Dry run: {}, Synchronous: {}", dry_run, synchronous);
|
||||
debug!("Dry run: {}", dry_run);
|
||||
|
||||
// Open the repository
|
||||
let mut repo = FileBackend::open(repo_uri_or_path)?;
|
||||
|
|
@ -397,13 +392,6 @@ fn main() -> Result<()> {
|
|||
repo.remove_publisher(p, *dry_run)?;
|
||||
}
|
||||
|
||||
// The synchronous parameter is used to wait for the operation to complete before returning
|
||||
// For FileBackend, operations are already synchronous, so this parameter doesn't have any effect
|
||||
// For RestBackend, this would wait for the server to complete the operation before returning
|
||||
if *synchronous {
|
||||
debug!("Operation completed synchronously");
|
||||
}
|
||||
|
||||
if *dry_run {
|
||||
info!("Dry run completed. No changes were made.");
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue