From eb057107c5dd58114c01aec05cf2d0020c150b7e Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Mon, 26 Jul 2010 14:02:05 +0000 Subject: [PATCH] pkg_install - bpm - changes to work with minix ftp client by Gautam Tirumala. --- commands/pkg_install/bpm/bpm.sh | 41 ++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/commands/pkg_install/bpm/bpm.sh b/commands/pkg_install/bpm/bpm.sh index ca6f00742..601cc13a5 100644 --- a/commands/pkg_install/bpm/bpm.sh +++ b/commands/pkg_install/bpm/bpm.sh @@ -81,13 +81,34 @@ tmpcategories=/tmp/categories.$$ tmppackages=/tmp/packages.$$ # some base parameters -base=ftp://ftp.NetBSD.org/pub/pkgsrc/packages +site=ftp.minix3.org +base=pub/minix/packages release=`${unameprog} -r | ${sedprog} -e 's/_STABLE//'` -machine=`${unameprog} -m` +machine=`${unameprog} -p` -sleepsecs=1 +read_ftp_dir() +{ + ftp_base=$1 + ftp_dir=$2 + +${ftpprog} < $tmpcategories - ${echoprog} ls | ${ftpprog} ${base}/${release}/${machine}/ 2>/dev/null | \ - ${awkprog} 'NF == 9 { if ($9 != "All") print $9 }' >> $tmpcategories + read_ftp_dir $site $base/${release}/${machine} | get_dir_entries >> $tmpcategories fi # check for bad release numbering @@ -143,11 +163,10 @@ while true; do # get possible packages ${echoprog} "" - ${echoprog} "Downloading package names from ${base}/${category}..." + ${echoprog} "Downloading package names from ftp://${site}/${base}/${category}..." ${echoprog} "** QUIT" > $tmppackages ${echoprog} "** Change category" >> $tmppackages - ${echoprog} ls | ${ftpprog} ${base}/${release}/${machine}/${category}/ 2>/dev/null \ - | ${awkprog} 'NF == 11 { print $9 }' >> $tmppackages + read_ftp_dir $site $base/${release}/${machine}/${category} | get_dir_entries >> $tmppackages ;; esac @@ -185,9 +204,9 @@ while true; do # Tell people what we're doing ${echoprog} "" - ${echoprog} "Adding package ${base}/${release}/${machine}/${category}/${package}" + ${echoprog} "Adding package ftp://${site}/${base}/${release}/${machine}/${category}/${package}" - cmd="env PKG_PATH=${base}/${release}/${machine}/All ${pkg_addprog} ${package}" + cmd="${pkg_addprog} ftp://${site}/${base}/${release}/${machine}/All/${package}" # check if we need to become root for this if [ `${idprog} -u` != 0 ]; then -- 2.44.0