From 2816cb5316f5e588ff4f57d73aa56c5af3d036dd Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Fri, 1 Sep 2023 09:38:34 -0500 Subject: [PATCH 1/3] apt2aptly: Log on distribution deletion *before* the deletion starts This makes the cause of blocked execution clearer. Signed-off-by: Ryan Gonzalez --- apt2aptly/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apt2aptly/src/main.rs b/apt2aptly/src/main.rs index 5f9dc1e..223eb48 100644 --- a/apt2aptly/src/main.rs +++ b/apt2aptly/src/main.rs @@ -347,15 +347,15 @@ async fn sync_dist( publish_prefix, dist_path ); } else { + info!( + "Deleting previous published distribution {}/{}...", + publish_prefix, dist_path + ); aptly .publish_prefix(publish_prefix) .distribution(&dist_path) .delete(&publish::DeleteOptions { force: true }) .await?; - info!( - "Deleted previous published distribution {}/{}", - publish_prefix, dist_path - ); } aptly_published_cache.remove(&publish_key); From ce2afcfd9b393f02d004f99bdc1cfcdb9636e298 Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Fri, 1 Sep 2023 09:39:38 -0500 Subject: [PATCH 2/3] apt2aptly: Take snapshot publish deletions into account on dry runs Signed-off-by: Ryan Gonzalez --- apt2aptly/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apt2aptly/src/main.rs b/apt2aptly/src/main.rs index 223eb48..1c9b59f 100644 --- a/apt2aptly/src/main.rs +++ b/apt2aptly/src/main.rs @@ -436,9 +436,9 @@ async fn sync_dist( ) .await?; } - - aptly_published_cache.insert(publish_key); } + + aptly_published_cache.insert(publish_key); } Ok(()) From d25d611e2d0eb850a73520b9aed5d3d067084291 Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Fri, 1 Sep 2023 09:40:38 -0500 Subject: [PATCH 3/3] apt2aptly: Add support for setting a publish's origin and label Signed-off-by: Ryan Gonzalez --- apt2aptly/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apt2aptly/src/main.rs b/apt2aptly/src/main.rs index 1c9b59f..f1e126d 100644 --- a/apt2aptly/src/main.rs +++ b/apt2aptly/src/main.rs @@ -49,6 +49,12 @@ struct Opts { /// Publish the repo and snapshots to the given prefix. #[clap(long = "publish-to")] publish_prefix: Option, + /// Set the published release's 'Origin' to the given value. + #[clap(long, requires_if(ArgPredicate::IsPresent, "publish_prefix"))] + publish_origin: Option, + /// Set the published release's 'Label' to the given value. + #[clap(long, requires_if(ArgPredicate::IsPresent, "publish_prefix"))] + publish_label: Option, /// Use the given GPG key when publishing. #[clap(long, requires_if(ArgPredicate::IsPresent, "publish_prefix"))] publish_gpg_key: Option, @@ -431,6 +437,8 @@ async fn sync_dist( signing: Some(signing), skip_bz2: true, skip_contents: true, + origin: opts.publish_origin.clone(), + label: opts.publish_label.clone(), ..Default::default() }, )