Guest

alkisg

By: a guest on Jan 22nd, 2010  |  syntax: None  |  size: 0.82 KB  |  hits: 59  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1.         add_mirrors() {
  2.             # feed a list of comma-separated or enter-separated mirrors,
  3.             # add them to the chroot's sources.list
  4.  
  5.             echo "$1" | tr ',' '\n' \
  6.             | while read mirror dist components; do
  7.                 if [ -z "$mirror" ] || [ "$mirror" = "none" ]; then
  8.                     continue;
  9.                 fi
  10.                 dist="${dist:$DIST}"
  11.                 components="${components:$COMPONENTS}"
  12.  
  13.                 echo "deb $mirror $dist $components" >> $ROOT/etc/apt/sources.list
  14.                 case "$mirror" in
  15.                     file:///*) dir=$(echo "$mirror" | sed -e 's,^file://,,g')
  16.                         mkdir -p $ROOT/$dir
  17.                         chroot_mount $dir $dir --bind
  18.                         ;;
  19.                 esac
  20.             fi
  21.         }