view build.sh @ 29:f3e1afd794a5

The zlib developers remove each old version as the new one as released, to discourage people from using it (I.E. zlib). Remind me to copy the mirroring architecture into the control image shared infrastructure.
author Rob Landley <rob@landley.net>
date Sun, 10 Jun 2012 20:30:25 -0500
parents 8c1a9d4cb1d2
children 676e1b843ee4
line wrap: on
line source

#!/bin/bash

if [ "$1" != "all" ] && [ ! -d "images/$1" ]
then
  echo 'Available images (or "all"):'
  ls images
  exit 1
fi

build_control_image()
{
  (
    IMAGENAME="$1"
    MYDIR=$(readlink -f images/"$1")
    BUILDER="$MYDIR"/build.sh
    [ -e "$BUILDER" ] || BUILDER=common/builder.sh

    source common/include.sh &&
    source $BUILDER &&
    squash_image
  )
}

if [ "$1" != all ]
then
  build_control_image "$1"
else
  for i in $(ls images)
  do
    echo "=== Checking $i"
    [ -e build/$i.hdc ] && echo "build/$i.hdc exists" && continue
    build_control_image "$i" || exit 1
  done
fi