fix: Switch to space-separated sources.conf format
- Change from colon to space separation to avoid URL parsing issues - Update sources.conf format: TYPE NAME URL VERSION BUILD_FUNCTION [EXTRA] - Implement awk-based parsing for reliable field extraction - Fix firmware package list (remove unavailable linux-firmware-marvell)
This commit is contained in:
@@ -34,28 +34,22 @@ function components_parse_sources_conf() {
|
||||
|
||||
local component_count=0
|
||||
|
||||
# Process each line in sources.conf
|
||||
while IFS=: read -r type name url version build_func extra; do
|
||||
# Skip comments and empty lines
|
||||
if [[ "$type" =~ ^[[:space:]]*# ]] || [[ -z "${type// }" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# Trim whitespace
|
||||
type=$(echo "$type" | xargs)
|
||||
name=$(echo "$name" | xargs)
|
||||
url=$(echo "$url" | xargs)
|
||||
version=$(echo "$version" | xargs)
|
||||
build_func=$(echo "$build_func" | xargs)
|
||||
extra=$(echo "$extra" | xargs)
|
||||
# Process each line using awk for reliable parsing
|
||||
awk '!/^#/ && NF >= 5 {print $1, $2, $3, $4, $5, $6}' "$sources_file" | while read -r type name url version build_func extra; do
|
||||
|
||||
if [[ -z "$type" || -z "$name" || -z "$url" || -z "$version" || -z "$build_func" ]]; then
|
||||
log_warn "Skipping invalid line: ${type}:${name}:${url}:${version}:${build_func}:${extra}"
|
||||
log_warn "Skipping invalid line: ${type} ${name} ${url} ${version} ${build_func} ${extra}"
|
||||
continue
|
||||
fi
|
||||
|
||||
((component_count++))
|
||||
log_info "Processing component ${component_count}: ${name} (${type})"
|
||||
log_info " URL: ${url}"
|
||||
log_info " Version: ${version}"
|
||||
log_info " Build function: ${build_func}"
|
||||
if [[ -n "$extra" ]]; then
|
||||
log_info " Extra options: ${extra}"
|
||||
fi
|
||||
|
||||
# Download component
|
||||
case "$type" in
|
||||
@@ -74,7 +68,7 @@ function components_parse_sources_conf() {
|
||||
# Build and install component
|
||||
components_build_component "$name" "$build_func" "$components_dir"
|
||||
|
||||
done < "$sources_file"
|
||||
done
|
||||
|
||||
if [[ $component_count -eq 0 ]]; then
|
||||
log_warn "No components found in sources configuration"
|
||||
|
||||
Reference in New Issue
Block a user