diff --git a/make_chroot.sh b/make_chroot.sh index 0daa8857b6..d679d76be6 100755 --- a/make_chroot.sh +++ b/make_chroot.sh @@ -27,6 +27,8 @@ DEFAULT_PKGLIST="$SRC_ROOT/package_repo/package-list-dev.txt" # See http://code.google.com/p/shflags/wiki/Documentation10x DEFINE_string suite "$DEFAULT_DEV_SUITE" "Repository suite to base image on." DEFINE_string mirror "$DEFAULT_DEV_MIRROR" "Local repository mirror to use." +DEFINE_string mirror2 "" "Additional repository mirror to use (URL only)." +DEFINE_string suite2 "" "Repository suite for additional mirror." DEFINE_string chroot "$DEFAULT_CHROOT_DIR" \ "Destination dir for the chroot environment." DEFINE_string pkglist "$DEFAULT_PKGLIST" \ @@ -133,6 +135,12 @@ bash_chroot "echo $USER ALL=NOPASSWD: ALL >> /etc/sudoers" MIRROR_INSIDE="${FLAGS_mirror/$GCLIENT_ROOT/$CHROOT_TRUNK_DIR}" bash_chroot "echo deb $MIRROR_INSIDE $FLAGS_suite \ main restricted multiverse universe > /etc/apt/sources.list" +# Additional repo? Note: Not mounted inside - must use URL +if [ -n "$FLAGS_mirror2" ]; then + bash_chroot "echo deb $FLAGS_mirror2 $FLAGS_suite2 \ + main restricted multiverse universe >> /etc/apt/sources.list" +fi + # TODO: enable sources when needed. Currently, kernel source is checked in # and all other sources are pulled via DEPS files. #bash_chroot "echo deb-src $MIRROR_INSIDE $FLAGS_suite \ diff --git a/make_local_repo.sh b/make_local_repo.sh index 11e28bba3a..f0cbd76f21 100755 --- a/make_local_repo.sh +++ b/make_local_repo.sh @@ -19,6 +19,7 @@ DEFAULT_IMG_PKGLIST="$SRC_ROOT/package_repo/repo_list_image.txt" # Command line options DEFINE_string suite "$DEFAULT_EXT_SUITE" "Ubuntu suite to pull packages from." DEFINE_string mirror "$DEFAULT_EXT_MIRROR" "Ubuntu repository mirror to use." +DEFINE_string mirror2 "" "Optional Chromium repository mirror to use." DEFINE_string dest "$DEFAULT_DEST" "Destination directory for repository." DEFINE_string devlist "$DEFAULT_DEV_PKGLIST" \ "File listing packages to use for development." @@ -162,19 +163,22 @@ function update_suite { # Add packages to the suite echo "Downloading packages..." - for DEB in `grep -v '^#' < $PKGLIST | awk '{print $1}'` + grep -v '^#' < $PKGLIST | while read DEB DEB_VER DEB_PRIO DEB_SECTION DEB_PATH do + [ -z "$DEB" ] && continue echo "Adding $DEB..." - DEB_PRIO=`cat $PKGLIST | grep '^'$DEB' ' | awk '{print $3}'` - DEB_SECTION=`cat $PKGLIST | grep '^'$DEB' ' | awk '{print $4}'` - DEB_PATH=`cat $PKGLIST | grep '^'$DEB' ' | awk '{print $5}'` - DEB_FILE="$DEB_CACHE_DIR/"`basename $DEB_PATH` + DEB_FILE=$DEB_CACHE_DIR/${DEB_PATH##*/} # Download the package if necessary - if [ ! -e "$CHROOT/$DEB_FILE" ] + if [ ! -s "$CHROOT/$DEB_FILE" ] then - in_chroot wget --no-verbose "$FLAGS_mirror/${DEB_PATH}" -O "$DEB_FILE" + if [ -n "FLAGS_mirror2" ]; then + in_chroot wget --no-verbose "$FLAGS_mirror/${DEB_PATH}" -O "$DEB_FILE" || \ + in_chroot wget --no-verbose "$FLAGS_mirror2/${DEB_PATH}" -O "$DEB_FILE" + else + in_chroot wget --no-verbose "$FLAGS_mirror/${DEB_PATH}" -O "$DEB_FILE" + fi fi # Copy the file into the target suite with the correct priority