Mercurial > hg > xemacs-beta
annotate etc/bundled-packages/test.sh @ 4774:26a007fa2f4c
Add GPL v2 or later notice to lib-src/ad2c with George Ferguson's permission.
See xemacs-patches message with ID
<870180fe0912151244y5bb656b0g8f28cf7c34e66420@mail.gmail.com>.
author | Jerry James <james@xemacs.org> |
---|---|
date | Tue, 15 Dec 2009 13:45:48 -0700 |
parents | 232d873b9705 |
children | fd714e8ba81e |
rev | line source |
---|---|
4354
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
1 # tests for the bundled packages feature |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
2 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
3 # usage: sh etc/bundled-packages/tests.sh [TMP_TEST_DIR] |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
4 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
5 # Always run this script from the top directory of the source tree. |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
6 # You need a mv that supports the -v for verbose flag, and a mkdir that |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
7 # supports the -p flag to make parents. |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
8 # Output from this script is preceded by 4 stars (****). |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
9 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
10 # This test script is probably more fragile than the build process, but if |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
11 # it runs to completion things are probably OK. |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
12 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
13 # configure the installation target |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
14 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
15 if test -z "$1"; then |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
16 TMP_TEST_DIR=/tmp/test/bundled-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
17 else |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
18 TMP_TEST_DIR=$1 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
19 fi |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
20 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
21 srcdir=`pwd` |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
22 blddir=${TMP_TEST_DIR}/build |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
23 pkgdir=${TMP_TEST_DIR}/lib/xemacs |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
24 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
25 echo "**** srcdir = ${srcdir}" |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
26 echo "**** blddir = ${blddir}" |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
27 echo "**** pkgdir = ${pkgdir}" |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
28 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
29 if test -e "${pkgdir}"; then |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
30 echo "**** pkgdir (${pkgdir}) exists; bailing out." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
31 exit -1 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
32 fi |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
33 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
34 # mv existing tarballs out of harm's way and make a fake one |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
35 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
36 echo "**** Moving existing tarballs to etc/bundled-packages/saved." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
37 mkdir -p etc/bundled-packages/saved |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
38 cd etc/bundled-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
39 echo "**** 'mv' may error because there are no files to move. It's harmless." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
40 mv -v *.tar.gz saved/ |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
41 cd ../.. |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
42 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
43 # configure in a temporary directory |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
44 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
45 if test -e ${blddir}; then |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
46 echo "**** blddir (${blddir}) exists; bailing out." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
47 exit -1 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
48 fi |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
49 mkdir -p ${blddir} |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
50 cd ${blddir} |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
51 echo "**** Running 'configure'. This takes *several minutes*." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
52 echo "**** Redirecting configure output to ${blddir}/beta.err." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
53 ${srcdir}/configure >beta.err 2>&1 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
54 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
55 # test check-available-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
56 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
57 echo "**** This test should produce no error and no output." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
58 make check-available-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
59 cd ${srcdir}/etc/bundled-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
60 echo "**** This test should explain how to install bootstrap packages." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
61 echo "This file pretends to be a bootstrap hierarchy." > xemacs-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
62 tar czf bootstrap.tar.gz xemacs-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
63 rm xemacs-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
64 cd ${blddir} |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
65 make check-available-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
66 echo "**** This test should explain how to install all three." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
67 cd ${srcdir}/etc/bundled-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
68 echo "This file pretends to be a xemacs-packages hierarchy." > xemacs-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
69 echo "This file pretends to be a mule-packages hierarchy." > mule-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
70 tar czf xemacs-sumo.tar.gz xemacs-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
71 tar czf xemacs-mule-sumo.tar.gz mule-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
72 rm xemacs-packages mule-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
73 cd ${blddir} |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
74 make check-available-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
75 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
76 # test installation without package path given |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
77 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
78 echo "**** Make the 'make-path' utility needed by the installation routine." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
79 make -C lib-src make-path |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
80 echo "**** This test should error because --with-late-packages wasn't given." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
81 make install-bootstrap-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
82 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
83 # test installation with package path given |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
84 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
85 echo "**** Running 'configure'. This takes *several minutes*." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
86 echo "**** Redirecting configure output to ${blddir}/beta.err." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
87 ${srcdir}/configure --with-late-packages=${pkgdir} >beta.err 2>&1 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
88 echo "**** Make the 'make-path' utility needed by the installation routine." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
89 make -C lib-src make-path |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
90 echo "**** Test install-bootstrap-packages." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
91 make install-bootstrap-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
92 echo "**** The following should list xemacs-packages in the right place." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
93 ls ${pkgdir}/* |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
94 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
95 #### no tests below this line #### |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
96 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
97 # put tarballs back and clean up |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
98 |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
99 cd ${srcdir}/etc/bundled-packages |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
100 rm *.tar.gz |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
101 echo "**** 'mv' may error because there are no files to move. It's harmless." |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
102 mv -v saved/*.tar.gz ../ |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
103 rmdir saved |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
104 rm -rf ${blddir} ${pkgdir} |
232d873b9705
Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff
changeset
|
105 exit 0 |