Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ trap - EXIT

echo ""
echo "Vellum installed successfully!"
echo "Run 'source ~/.bashrc' or start a new shell to use vellum."
echo "Run 'exec bash --login' to use vellum."
if [ -n "$OFFLINE_DIR" ]; then
echo ""
echo "Offline install complete. When network is available, run:"
Expand Down
9 changes: 8 additions & 1 deletion src/commands/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,27 @@ fn run_add_directly(apk: &Apk, args: &[String]) {

fn get_index() -> anyhow::Result<Vec<Package>> {
let cache_dir = format!("{VELLUM_ROOT}/etc/apk/cache");
let mut all_packages = Vec::new();

if let Ok(entries) = fs::read_dir(&cache_dir) {
for entry in entries.flatten() {
let path = entry.path();
if let Some(name) = path.file_name().and_then(|n| n.to_str()) {
if name.starts_with("APKINDEX.") && name.ends_with(".tar.gz") {
if let Some(path_str) = path.to_str() {
return parse_index_tar_gz(path_str);
if let Ok(packages) = parse_index_tar_gz(path_str) {
all_packages.extend(packages);
}
}
}
}
}
}

if !all_packages.is_empty() {
return Ok(all_packages);
}

let repo_url = match get_repo_url() {
Some(url) => url,
None => return Err(anyhow::anyhow!("no cached index and could not determine repository URL")),
Expand Down
9 changes: 8 additions & 1 deletion src/commands/check_os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,27 @@ pub fn handle_check_os(apk: &Apk, target_os: &str) {

fn get_index() -> anyhow::Result<Vec<Package>> {
let cache_dir = format!("{VELLUM_ROOT}/etc/apk/cache");
let mut all_packages = Vec::new();

if let Ok(entries) = fs::read_dir(&cache_dir) {
for entry in entries.flatten() {
let path = entry.path();
if let Some(name) = path.file_name().and_then(|n| n.to_str()) {
if name.starts_with("APKINDEX.") && name.ends_with(".tar.gz") {
if let Some(path_str) = path.to_str() {
return parse_index_tar_gz(path_str);
if let Ok(packages) = parse_index_tar_gz(path_str) {
all_packages.extend(packages);
}
}
}
}
}
}

if !all_packages.is_empty() {
return Ok(all_packages);
}

let repo_url = get_repo_url().ok_or_else(|| {
anyhow::anyhow!("no cached index and could not determine repository URL")
})?;
Expand Down
9 changes: 8 additions & 1 deletion src/commands/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,20 +225,27 @@ fn check_os_compatibility_internal(apk: &Apk, target_os: &str) -> Option<Vec<Str

fn get_index() -> anyhow::Result<Vec<Package>> {
let cache_dir = format!("{VELLUM_ROOT}/etc/apk/cache");
let mut all_packages = Vec::new();

if let Ok(entries) = fs::read_dir(&cache_dir) {
for entry in entries.flatten() {
let path = entry.path();
if let Some(name) = path.file_name().and_then(|n| n.to_str()) {
if name.starts_with("APKINDEX.") && name.ends_with(".tar.gz") {
if let Some(path_str) = path.to_str() {
return parse_index_tar_gz(path_str);
if let Ok(packages) = parse_index_tar_gz(path_str) {
all_packages.extend(packages);
}
}
}
}
}
}

if !all_packages.is_empty() {
return Ok(all_packages);
}

let repo_url = match get_repo_url() {
Some(url) => url,
None => return Err(anyhow::anyhow!("no cached index and could not determine repository URL")),
Expand Down