custom message for vm_query_exit
[minix3.git] / releasetools / fetch_u-boot.sh
blob140346402fb998100c0f96af13ae89aacc42ca0e
1 #!/bin/sh
3 # Perform a checkout / update the MINIX u-boot git repo if needed
4 #
5 # -o output dir
6 OUTPUT_DIR=""
7 GIT_VERSION=""
8 while getopts "o:n:?" c
9 do
10 case "$c" in
11 \?)
12 echo "Usage: $0 -o output dir -n version " >&2
13 exit 1
16 OUTPUT_DIR=$OPTARG
19 GIT_VERSION=$OPTARG
21 esac
22 done
26 # check arguments
28 if [ -z "$OUTPUT_DIR" -o -z "$GIT_VERSION" ]
29 then
30 echo "Missing required parameters OUTPUT_DIR=$OUTPUT_DIR GIT_VERSION=$GIT_VERSION"
31 echo "Usage: $0 -o output dir -n version " >&2
32 exit 1
37 # if the file doesn't exist it's easy , to a checkout
39 if [ ! -e "$OUTPUT_DIR" ]
40 then
41 git clone git://git.minix3.org/u-boot -b minix $OUTPUT_DIR
45 cd "$OUTPUT_DIR"
48 # perform an update
50 CURRENT_VERSION=`git rev-parse HEAD`
51 if [ "$CURRENT_VERSION" != "$GIT_VERSION" ]
52 then
53 echo "Current version $CURRENT_VERSION does not match wanted $GIT_VERSION performing update and checkout"
54 git fetch -v
55 git checkout $GIT_VERSION