view make/do-gethg.sh @ 81:6adf16f10d54

Split up make.sh so it's easier to call subsets of its functionality.
author Rob Landley <rob@landley.net>
date Tue, 23 Oct 2007 18:35:49 -0500
parents
children
line wrap: on
line source

#!/bin/sh

# Clone or update mercurial Linux kernel repository from kernel.org

if [ -z "$LNXDIR" ]
then
  echo set LNXDIR
  exit 1
fi

if [ ! -d "$LNXDIR" ]
then
  echo "Clone Linux kernel repository from kernel.org"

  mkdir -p "$LNXDIR"/hg &&
  cd "$LNXDIR"/hg &&
  hg clone http://kernel.org/hg/linux-2.6 hg
else
  # Update kernel mercurial repository.
  cd "$LNXDIR"/hg &&
  echo "Update Linux kernel from kernel.org"

  hg pull -u
fi

[ $? -ne 0 ] && exit 1