Skip to content

Commit

Permalink
Rebase with origin/main fix conflicts
Browse files Browse the repository at this point in the history
Support for refresh channel and `FEATURE_LOCAL` was missing during
rebase added that support to both CLI v2 and CLI v4.

Signed-off-by: Abhijit Gadgil <[email protected]>
  • Loading branch information
agadgil-progress committed Jan 7, 2025
1 parent c1ee772 commit ae3bf2e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
11 changes: 10 additions & 1 deletion components/hab/src/cli_v4/pkg/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ pub(crate) struct PkgBuildOptions {
/// Uses a Dockerized Studio for the build
#[arg(name = "DOCKER", short = 'D', long = "docker", action = ArgAction::SetTrue)]
docker: bool,

/// Channel used to retrieve plan dependencies for Chef supported origins
#[arg(name = "REFRESH_CHANNEL",
short = 'f',
long = "refresh-channel",
env = "HAB_REFRESH_CHANNEL",
default_value = "stable")]
refresh_channel: Option<String>,
}

impl PkgBuildOptions {
Expand Down Expand Up @@ -101,7 +109,8 @@ impl PkgBuildOptions {
&self.hab_origin_keys,
native_package,
reuse_flag,
docker_flag).await
docker_flag,
self.refresh_channel.as_deref()).await
}

#[cfg(target_os = "linux")]
Expand Down
13 changes: 6 additions & 7 deletions components/hab/src/cli_v4/pkg/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub(crate) struct PkgInstallOptions {
/// from Builder
#[arg(long = "ignore-local",
action = ArgAction::SetTrue,
hide = !FEATURE_FLAGS.contains(FeatureFlag::IGNORE_LOCAL))]
)]
ignore_local: bool,
}

Expand All @@ -105,12 +105,11 @@ impl PkgInstallOptions {
InstallMode::default()
};

let local_package_usage =
if feature_flags.contains(FeatureFlag::IGNORE_LOCAL) && self.ignore_local {
LocalPackageUsage::Ignore
} else {
LocalPackageUsage::default()
};
let local_package_usage = if self.ignore_local {
LocalPackageUsage::Ignore
} else {
LocalPackageUsage::default()
};

let install_hook_mode = if !self.ignore_install_hook {
InstallHookMode::Ignore
Expand Down
15 changes: 8 additions & 7 deletions components/hab/src/main_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ async fn sub_pkg_build(ui: &mut UI, m: &ArgMatches<'_>, feature_flags: FeatureFl
let plan_context = required_value_of(m, "PLAN_CONTEXT");
let root = m.value_of("HAB_STUDIO_ROOT");
let src = m.value_of("SRC_PATH");
let refresh_channel = m.value_of("REFRESH_CHANNEL");

let origins = hab_key_origins(m)?;
if !origins.is_empty() {
Expand Down Expand Up @@ -844,7 +845,8 @@ async fn sub_pkg_build(ui: &mut UI, m: &ArgMatches<'_>, feature_flags: FeatureFl
&origins,
native_package,
reuse,
docker).await
docker,
refresh_channel).await
}

fn sub_pkg_config(m: &ArgMatches<'_>) -> Result<()> {
Expand Down Expand Up @@ -1102,12 +1104,11 @@ async fn sub_pkg_install(ui: &mut UI,
InstallMode::default()
};

let local_package_usage =
if feature_flags.contains(FeatureFlag::IGNORE_LOCAL) && m.is_present("IGNORE_LOCAL") {
LocalPackageUsage::Ignore
} else {
LocalPackageUsage::default()
};
let local_package_usage = if m.is_present("IGNORE_LOCAL") {
LocalPackageUsage::Ignore
} else {
LocalPackageUsage::default()
};

let install_hook_mode = if m.is_present("IGNORE_INSTALL_HOOK") {
InstallHookMode::Ignore
Expand Down

0 comments on commit ae3bf2e

Please sign in to comment.