From ecb7de9b4e304faec007f734489e0a025efa70c4 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 26 May 2015 00:45:29 -0400 Subject: Merge branch 'master' into feature/installer-integration Conflicts: lib/cmd/install.sh --- (limited to 'lib') diff --git a/lib/feed.sh b/lib/feed.sh index 2e4a141..8d29640 100644 --- a/lib/feed.sh +++ b/lib/feed.sh @@ -42,7 +42,7 @@ feed_download() local gzip= if ${use_gzip}; then - gzip=gzip + gzip=gunzip else gzip=cat fi diff --git a/lib/profile.sh b/lib/profile.sh index de2c6a1..44c58a2 100644 --- a/lib/profile.sh +++ b/lib/profile.sh @@ -66,31 +66,20 @@ profile_default_plat() "prof_${profile}_default_plat" } -# TODO: This should pass through to prof_${profile}_validate_archplat(). -profile_validate_archplat() +profile_select_mirror() { - local arch="${1}" - local plat="${2}" - local prof_arch= - local prof_plat= - - while read -r prof_arch prof_plat; do - [ "x${prof_arch}" = 'x' ] && continue - if [ "x${arch}" = "x${prof_arch}" ]; then - if [ "x${plat}" = "x${prof_plat}" ]; then - return 0 - fi - fi - done <<-EOF - $(eval "printf '%s\n' \"\${prof_${profile}_archplats}\"") - EOF - - return 1 + "prof_${profile}_select_mirror" } -profile_select_mirror() +profile_validate_archplat() { - "prof_${profile}_select_mirror" + local mirror="${1}" + local arch="${2}" + local plat="${3}" + local suite="${4}" + + "prof_${profile}_validate_archplat" "${mirror}" "${arch}" "${plat}" \ + "${suite}" } profile_feeds() diff --git a/lib/profile/proteanos.sh b/lib/profile/proteanos.sh index f19af65..b78c5e8 100644 --- a/lib/profile/proteanos.sh +++ b/lib/profile/proteanos.sh @@ -20,16 +20,6 @@ use opkg -# TODO: This should be replaced with a prof_proteanos_validate_archplat() -# function that gets valid architectures and platforms from the package archive -# (which pro-archman needs to list in the distribution). -prof_proteanos_archplats=' -amd64-linux-glibc dev -i686-linux-glibc dev -i686-linux-glibc ao751h -i686-linux-glibc dimension2400 -i686-linux-glibc x60 -' prof_proteanos_fstab_linux="\ proc /proc proc defaults sys /sys sysfs defaults @@ -111,6 +101,27 @@ prof_proteanos_select_mirror() printf '%s\n' "${mirror}" } +prof_proteanos_validate_archplat() +{ + local mirror="${1}" + local arch="${2}" + local plat="${3}" + local suite="${4}" + + while read -r archplat; do + case "${archplat}" in + "${arch}/${plat}") + return 0 + ;; + esac + done <<-EOF + $(wget -q -O - "${mirror}/feeds/${suite}/Manifest" | sed \ + 's|/[^/]*$||; /^all\//d; /\/all$/d;') + EOF + + return 1 +} + prof_proteanos_feeds() { local mirror="${1}" @@ -124,10 +135,10 @@ prof_proteanos_feeds() for a in "${arch}" 'all'; do for p in "${plat}" 'all'; do for s in 'base'; do - printf 'src proteanos_%s_%s_%s_%s_%s ' \ + printf 'src/gz proteanos_%s_%s_%s_%s_%s ' \ "${suite%/*}" "${suite#*/}" \ "${a}" "${p}" "${s}" - printf '%s/feeds/%s/%s/%s/%s/Packages\n' \ + printf '%s/feeds/%s/%s/%s/%s/Packages.gz\n' \ "${mirror}" "${suite}" \ "${a}" "${p}" "${s}" done @@ -135,10 +146,10 @@ prof_proteanos_feeds() done for s in 'base'; do - printf 'src proteanos_%s_%s_%s_%s_%s ' \ + printf 'src/gz proteanos_%s_%s_%s_%s_%s ' \ "${suite%/*}" "${suite#*/}" \ 'src' 'all' "${s}" - printf '%s/feeds/%s/%s/%s/%s/Packages\n' \ + printf '%s/feeds/%s/%s/%s/%s/Packages.gz\n' \ "${mirror}" "${suite}" \ 'src' 'all' "${s}" done -- cgit v0.9.1