#!/bin/bash # Populate a few source control directories. If they exist, they'll be used # instead of source tarballs. (Note: if you want to apply patches you'll have # to do it yourself, sources/patches only applies to tarballs.) mkdir -p packages && if test ! -d packages/busybox { git clone git://busybox.net/busybox packages/busybox || exit 1 } else { shell {cd packages/busybox && git pull} || exit 1 } if test ! -d packages/uClibc { git clone git://uclibc.org/uClibc packages/uClibc } else { shell {cd packages/uClibc && git pull} || exit 1 } if test ! -d packages/linux { git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 \ packages/linux || exit 1 } else { shell {cd packages/linux && git pull} || exit 1 } if test ! -d packages/toybox { hg clone http://landley.net/hg/toybox packages/toybox || exit 1 } else { shell {cd packages/toybox && hg pull -u} || exit 1 } (CommandList children: [ (AndOr children: [ (C {(mkdir)} {(-p)} {(packages)}) (If arms: [ (if_arm cond: [ (C {(Lit_Other "[")} {(KW_Bang "!")} {(-d)} {(packages/busybox)} {(Lit_Other "]")}) ] action: [ (AndOr children: [ (C {(git)} {(clone)} {(git) (Lit_Other ":") (//busybox.net/busybox)} {(packages/busybox)} ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) ] spids: [-1 34] ) ] else_action: [ (AndOr children: [ (Subshell child: (AndOr children: [(C {(cd)} {(packages/busybox)}) (C {(git)} {(pull)})] op_id: Op_DAmp ) spids: [56 66] ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) ] spids: [53 74] ) ] op_id: Op_DAmp ) (If arms: [ (if_arm cond: [(C {(Lit_Other "[")} {(KW_Bang "!")} {(-d)} {(packages/uClibc)} {(Lit_Other "]")})] action: [ (C {(git)} {(clone)} {(git) (Lit_Other ":") (//uclibc.org/uClibc)} {(packages/uClibc)}) ] spids: [-1 89] ) ] else_action: [ (AndOr children: [ (Subshell child: (AndOr children: [(C {(cd)} {(packages/uClibc)}) (C {(git)} {(pull)})] op_id: Op_DAmp ) spids: [105 115] ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) ] spids: [102 123] ) (If arms: [ (if_arm cond: [(C {(Lit_Other "[")} {(KW_Bang "!")} {(-d)} {(packages/linux)} {(Lit_Other "]")})] action: [ (AndOr children: [ (C {(git)} {(clone)} {(git) (Lit_Other ":") (//git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6) } {(packages/linux)} ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) ] spids: [-1 138] ) ] else_action: [ (AndOr children: [ (Subshell child: (AndOr children: [(C {(cd)} {(packages/linux)}) (C {(git)} {(pull)})] op_id: Op_DAmp ) spids: [162 172] ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) ] spids: [159 180] ) (If arms: [ (if_arm cond: [(C {(Lit_Other "[")} {(KW_Bang "!")} {(-d)} {(packages/toybox)} {(Lit_Other "]")})] action: [ (AndOr children: [ (C {(hg)} {(clone)} {(http) (Lit_Other ":") (//landley.net/hg/toybox)} {(packages/toybox)} ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) ] spids: [-1 195] ) ] else_action: [ (AndOr children: [ (Subshell child: (AndOr children: [(C {(cd)} {(packages/toybox)}) (C {(hg)} {(pull)} {(-u)})] op_id: Op_DAmp ) spids: [217 229] ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) ] spids: [214 237] ) ] )