annotate etc/bundled-packages/test.sh @ 5477:90dcf2376909

Last minute notice fixups.
author Stephen J. Turnbull <stephen@xemacs.org>
date Fri, 29 Apr 2011 02:35:13 +0900
parents fd714e8ba81e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
5477
90dcf2376909 Last minute notice fixups.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5411
diff changeset
3 # Copyright 2007 Free Software Foundation
90dcf2376909 Last minute notice fixups.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5411
diff changeset
4
5411
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
5 # This file is part of XEmacs.
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
6
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
7 # XEmacs is free software: you can redistribute it and/or modify it
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
8 # under the terms of the GNU General Public License as published by the
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
9 # Free Software Foundation, either version 3 of the License, or (at your
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
10 # option) any later version.
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
11
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
12 # XEmacs is distributed in the hope that it will be useful, but WITHOUT
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
15 # for more details.
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
16
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
17 # You should have received a copy of the GNU General Public License
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
18 # along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
19
4354
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
20 # 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
21
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
22 # 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
23 # 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
24 # supports the -p flag to make parents.
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
25 # 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
26
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
27 # 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
28 # it runs to completion things are probably OK.
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
29
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
30 # configure the installation target
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
31
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
32 if test -z "$1"; then
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
33 TMP_TEST_DIR=/tmp/test/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
34 else
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
35 TMP_TEST_DIR=$1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
36 fi
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
37
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
38 srcdir=`pwd`
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
39 blddir=${TMP_TEST_DIR}/build
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
40 pkgdir=${TMP_TEST_DIR}/lib/xemacs
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
41
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
42 echo "**** srcdir = ${srcdir}"
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
43 echo "**** blddir = ${blddir}"
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
44 echo "**** pkgdir = ${pkgdir}"
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
45
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
46 if test -e "${pkgdir}"; then
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
47 echo "**** pkgdir (${pkgdir}) exists; bailing out."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
48 exit -1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
49 fi
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
50
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
51 # 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
52
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
53 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
54 mkdir -p etc/bundled-packages/saved
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
55 cd etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
56 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
57 mv -v *.tar.gz saved/
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
58 cd ../..
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
59
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
60 # configure in a temporary directory
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
61
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
62 if test -e ${blddir}; then
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
63 echo "**** blddir (${blddir}) exists; bailing out."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
64 exit -1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
65 fi
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
66 mkdir -p ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
67 cd ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
68 echo "**** Running 'configure'. This takes *several minutes*."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
69 echo "**** Redirecting configure output to ${blddir}/beta.err."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
70 ${srcdir}/configure >beta.err 2>&1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
71
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
72 # test check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
73
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
74 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
75 make check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
76 cd ${srcdir}/etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
77 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
78 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
79 tar czf bootstrap.tar.gz xemacs-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
80 rm xemacs-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
81 cd ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
82 make check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
83 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
84 cd ${srcdir}/etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
85 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
86 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
87 tar czf xemacs-sumo.tar.gz xemacs-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
88 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
89 rm xemacs-packages mule-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
90 cd ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
91 make check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
92
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
93 # test installation without package path given
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 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
96 make -C lib-src make-path
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
97 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
98 make install-bootstrap-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
99
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
100 # test installation with package path given
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
101
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
102 echo "**** Running 'configure'. This takes *several minutes*."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
103 echo "**** Redirecting configure output to ${blddir}/beta.err."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
104 ${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
105 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
106 make -C lib-src make-path
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
107 echo "**** Test install-bootstrap-packages."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
108 make install-bootstrap-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
109 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
110 ls ${pkgdir}/*
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
111
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
112 #### no tests below this line ####
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
113
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
114 # put tarballs back and clean up
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
115
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
116 cd ${srcdir}/etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
117 rm *.tar.gz
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
118 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
119 mv -v saved/*.tar.gz ../
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
120 rmdir saved
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
121 rm -rf ${blddir} ${pkgdir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
122 exit 0