
alkisg
By: a guest on Jan 22nd, 2010 | syntax:
None | size: 0.82 KB | hits: 59 | expires: Never
add_mirrors() {
# feed a list of comma-separated or enter-separated mirrors,
# add them to the chroot's sources.list
echo "$1" | tr ',' '\n' \
| while read mirror dist components; do
if [ -z "$mirror" ] || [ "$mirror" = "none" ]; then
continue;
fi
dist="${dist:$DIST}"
components="${components:$COMPONENTS}"
echo "deb $mirror $dist $components" >> $ROOT/etc/apt/sources.list
case "$mirror" in
file:///*) dir=$(echo "$mirror" | sed -e 's,^file://,,g')
mkdir -p $ROOT/$dir
chroot_mount $dir $dir --bind
;;
esac
fi
}