Skip to content

Commit 3870e5b

Browse files
Addressing copilot review comments
Signed-off-by: Abhijit Gadgil <agadgil@progress.com>
1 parent ae09d4b commit 3870e5b

4 files changed

Lines changed: 12 additions & 17 deletions

File tree

.expeditor/scripts/shared.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ curlbash_hab() {
2727
mv -f /usr/local/bin/hab /usr/local/bin/.hab-orig
2828
fi
2929

30-
sudo -E ./components/hab/install.sh -t "$pkg_target" -c "$_channel" -b "aarch64-darwin-opt" || \
30+
sudo -E ./components/hab/install.sh -t "$pkg_target" -c "$_channel" || \
3131
mv -f /usr/local/bin/.hab-orig /usr/local/bin/hab
3232

3333
hab_binary="/usr/local/bin/hab"
@@ -565,7 +565,8 @@ macos_teardown_exit() {
565565

566566
need_cmd() {
567567
if ! command -v "$1" >/dev/null 2>&1; then
568-
exit_with "Required command '$1' not found on PATH" 127
568+
echo "Required command '$1' not found on PATH" ;
569+
exit 127
569570
fi
570571
}
571572

@@ -582,7 +583,6 @@ install_acceptance_bootstrap_hab_binary() {
582583
need_cmd gtar
583584
need_cmd gtail
584585

585-
local hab_scratch_dir
586586
local hab_scratch_dir="hab_scratch"
587587
rm -Rf "${hab_scratch_dir}"
588588
mkdir "${hab_scratch_dir}"
@@ -592,8 +592,7 @@ install_acceptance_bootstrap_hab_binary() {
592592
--url https://bldr.acceptance.habitat.sh \
593593
--download-directory="${hab_scratch_dir}"
594594

595-
local hab_artifact
596-
hab_artifact=$(find "${hab_scratch_dir}"/artifacts -type f -name 'chef-hab-*-aarch64-darwin.hart')
595+
local hab_artifact=$(find "${hab_scratch_dir}"/artifacts -type f -name 'chef-hab-*-aarch64-darwin.hart')
597596

598597
# GNU tail, tar, from the mac-bootstrapper
599598
gtail --lines=+6 "${hab_artifact}" | \
@@ -603,7 +602,6 @@ install_acceptance_bootstrap_hab_binary() {
603602
--strip-components=8 \
604603
--wildcards "opt/hab/pkgs/chef/hab/*/*/bin"
605604

606-
local bootstrap_hab_binary
607605
local bootstrap_hab_binary="hab"
608606

609607
install -v "${bootstrap_hab_binary}" /usr/local/bin/hab

.expeditor/verify.pipeline.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ steps:
577577
limit: 2 # Addressing current Anka system timeouts due to oversubscription
578578

579579
- label: "[unit] :darwin: common"
580-
if: false
581580
env:
582581
HOMEBREW_NO_AUTO_UPDATE: 1
583582
agents:
@@ -597,7 +596,6 @@ steps:
597596
limit: 2 # Addressing current Anka system timeouts due to oversubscription
598597

599598
- label: "[unit] :darwin: core"
600-
if: false
601599
env:
602600
HOMEBREW_NO_AUTO_UPDATE: 1
603601
agents:
@@ -617,7 +615,6 @@ steps:
617615
limit: 2 # Addressing current Anka system timeouts due to oversubscription
618616

619617
- label: "[unit] :darwin: hab"
620-
if: false
621618
env:
622619
HOMEBREW_NO_AUTO_UPDATE: 1
623620
agents:
@@ -637,7 +634,6 @@ steps:
637634
limit: 2 # Addressing current Anka system timeouts due to oversubscription
638635

639636
- label: "[unit] :darwin: http-client"
640-
if: false
641637
env:
642638
HOMEBREW_NO_AUTO_UPDATE: 1
643639
agents:

components/core/src/fs.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ lazy_static::lazy_static! {
223223
PathBuf::from(CACHE_ARTIFACT_PATH)
224224
} else {
225225
match dirs::home_dir() {
226-
Some(home) => home.join(format!(".{}", CACHE_ARTIFACT_PATH)),
226+
Some(home) => home.join(format!(".{}", CACHE_ARTIFACT_PATH.strip_prefix("opt/").unwrap_or(CACHE_ARTIFACT_PATH))),
227227
None => PathBuf::from(CACHE_ARTIFACT_PATH),
228228
}
229229
}
@@ -234,7 +234,7 @@ lazy_static::lazy_static! {
234234
PathBuf::from(CACHE_BUILD_PATH)
235235
} else {
236236
match dirs::home_dir() {
237-
Some(home) => home.join(format!(".{}", CACHE_BUILD_PATH)),
237+
Some(home) => home.join(format!(".{}", CACHE_BUILD_PATH.strip_prefix("opt/").unwrap_or(CACHE_BUILD_PATH))),
238238
None => PathBuf::from(CACHE_BUILD_PATH),
239239
}
240240
}
@@ -245,7 +245,7 @@ lazy_static::lazy_static! {
245245
PathBuf::from(CACHE_KEY_PATH_POSTFIX)
246246
} else {
247247
match dirs::home_dir() {
248-
Some(home) => home.join(format!(".{}", CACHE_KEY_PATH_POSTFIX)),
248+
Some(home) => home.join(format!(".{}", CACHE_KEY_PATH_POSTFIX.strip_prefix("opt/").unwrap_or(CACHE_KEY_PATH_POSTFIX))),
249249
None => PathBuf::from(CACHE_KEY_PATH_POSTFIX),
250250
}
251251
}
@@ -259,7 +259,7 @@ lazy_static::lazy_static! {
259259
PathBuf::from(CACHE_SRC_PATH)
260260
} else {
261261
match dirs::home_dir() {
262-
Some(home) => home.join(format!(".{}", CACHE_SRC_PATH)),
262+
Some(home) => home.join(format!(".{}", CACHE_SRC_PATH.strip_prefix("opt/").unwrap_or(CACHE_SRC_PATH))),
263263
None => PathBuf::from(CACHE_SRC_PATH),
264264
}
265265
}
@@ -270,7 +270,7 @@ lazy_static::lazy_static! {
270270
PathBuf::from(CACHE_SSL_PATH)
271271
} else {
272272
match dirs::home_dir() {
273-
Some(home) => home.join(format!(".{}", CACHE_SSL_PATH)),
273+
Some(home) => home.join(format!(".{}", CACHE_SSL_PATH.strip_prefix("opt/").unwrap_or(CACHE_SSL_PATH))),
274274
None => PathBuf::from(CACHE_SSL_PATH),
275275
}
276276
}

components/hab/src/command/supportbundle.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ use crate::{common::ui::{Status,
33
UIWriter},
44
error::{Error,
55
Result},
6-
hcore::{fs::FS_ROOT_PATH,
6+
hcore::{fs::{FS_ROOT_PATH,
7+
ROOT_PATH},
78
os::net::hostname}};
89
use chrono::Local;
910
use flate2::{Compression,
@@ -39,7 +40,7 @@ pub fn start(ui: &mut UI) -> Result<()> {
3940
&host,
4041
dt.format("%Y%m%d%H%M%S"));
4142

42-
let sup_root = Path::new(&*FS_ROOT_PATH).join("hab").join("sup");
43+
let sup_root = Path::new(&*FS_ROOT_PATH).join(ROOT_PATH).join("sup");
4344
let tar_gz = File::create(&tarball_name)?;
4445
let enc = GzEncoder::new(tar_gz, Compression::default());
4546
let mut tar = tar::Builder::new(enc);

0 commit comments

Comments
 (0)