Mercurial > hg > aboriginal
annotate download.sh @ 10:7a1c606fd387
Script to download all the source code needed by the build.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 29 Nov 2006 01:08:30 -0500 |
parents | |
children | 1b1de34e3122 |
rev | line source |
---|---|
10
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/sh |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 # This isn't ready yet. |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 function download() |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 { |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 FILENAME=`echo "$URL" | sed 's .*/ '` |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 # The extra "" is so we test the sha1sum after the last download. |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
11 for i in "$URL" http://www.landley.net/code/firmware/mirror/"$FILENAME" "" |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
12 do |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 # Return success if we have a valid copy of the file |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 # Test first (so we don't re-download a file we've already got). |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
16 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
17 SUM=`cat "$SRCDIR/$FILENAME" | sha1sum | awk '{print $1}'` |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 if [ x"$SUM" == x"$SHA1" ] |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 then |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 touch "$SRCDIR/$FILENAME" |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 echo "Confirmed $FILENAME" |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 return 0 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 fi |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
24 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
25 # If there's a corrupted file, delete it. In theory it would be nice |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 # to resume downloads, but wget creates "*.1" files instead. |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
27 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
28 rm "$SRCDIR/$FILENAME" 2> /dev/null |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
29 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
30 # If we have another source, try to download file. |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 if [ -n "$i" ] |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
33 then |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
34 wget -P "$SRCDIR" "$i" |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 fi |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 done |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
37 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
38 # Return failure. |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
39 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
40 echo "Could not download $FILENAME" |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
41 return 1 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
42 } |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
43 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
44 # Lots and lots of source code. Download everything we haven't already got |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
45 # a copy of. |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
46 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
47 echo "=== Download source code." && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
48 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
49 export SRCDIR=sources/packages |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
50 mkdir -p $SRCDIR |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
51 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
52 # Base operating system |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
53 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
54 URL=http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.19-rc6.tar.bz2 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
55 SHA1=770e825da8ba9884fc4f7ca5fd473c24174365ad \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
56 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
57 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
58 URL=http://www.uclibc.org/downloads/snapshots/uClibc-20061128.tar.bz2 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
59 SHA1=50c024ac137262981348ad54e0f64d83db1bce4e \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
60 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
61 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
62 URL=http://www.busybox.net/downloads/busybox-1.2.2.tar.bz2 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
63 SHA1=59670600121c9dacfd61e72e34f4bd975ec2c36f \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
64 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
65 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
66 URL=http://superb-east.dl.sourceforge.net/sourceforge/squashfs/squashfs3.1.tar.gz \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
67 SHA1=89d537fd18190402ff226ff885ddbc14f6227a9b \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
68 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
69 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
70 # Build tools |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
71 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
72 URL=ftp://ftp.gnu.org/gnu/binutils/binutils-2.17.tar.bz2 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
73 SHA1=a557686eef68362ea31a3aa41ce274e3eeae1ef0 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
74 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
75 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
76 URL=ftp://ftp.gnu.org/gnu/gcc/gcc-4.1.1/gcc-core-4.1.1.tar.bz2 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
77 SHA1=147e12bf96a8d857fda1d43f0d7ea599b89cebf9 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
78 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
79 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
80 URL=ftp://ftp.gnu.org/gnu/make/make-3.81.tar.bz2 \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
81 SHA1=41ed86d941b9c8025aee45db56c0283169dcab3d \ |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
82 download && |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
83 |
7a1c606fd387
Script to download all the source code needed by the build.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
84 echo === Got all source. |