revert previous incorrect version of commit and recommit correct version to allow...
[AROS.git] / scripts / gimmearos-v1.sh
blobdd95038b52a27e192ec69845267773b4ce12976a
1 #!/bin/bash
3 # Script for building AROS from the Subversion or GIT repository
5 # Currently only a limited amount of Linux distros is supported.
6 # If you improve this script, send modifications back to me, please.
7 # Matthias Rustler, mailto:mrustler@gmx.de
9 # This script is public domain. Use it at your own risk.
11 # $VER: gimmearos-v1.sh 1.14 (25.04.2019)
13 curdir="`pwd`"
14 srcdir="aros-src"
15 portsdir="$HOME/aros-ports-src"
16 tooldir="$HOME/aros-toolchain"
17 makeopts="-j3 -s"
18 configopts="--with-binutils-version=2.25 --with-gcc-version=6.3.0 --disable-sdl-hidd --with-portssources="$portsdir""
20 install_pkg()
22 if [ $# -ne 2 ]
23 then
24 echo "install_pkg() needs 2 arguments"
25 exit 100
27 echo -e "\nInstalling " $2
28 sudo $1 $2
29 if [ $? -ne 0 ]
30 then
31 echo -e "\n install failed. Script cancelled."
32 exit 100
37 echo -e "\n\n\n\n\n"
38 echo -e "***********************************************"
39 echo -e "* Script for downloading and building of AROS *"
40 echo -e "***********************************************"
41 echo -e "\n\n"
42 echo -e "*********************************"
43 echo -e "* Step 1: install prerequisites *"
44 echo -e "*********************************"
45 echo -e "The build system needs some packages to do its job."
46 echo -e "If you are asked for a password enter you admin password."
47 echo -e "\n1 .. Get packages with apt-get for Debian and similar (e.g. Ubuntu)"
48 echo -e " for building 32-bit AROS on 32-bit Linux or 64-bit-AROS on 64-bit-Linux"
49 echo -e "2 .. As 1) but with additional packages for building 32-bit AROS"
50 echo -e " on 64-bit Linux"
51 echo -e "3 .. Get packages with yum for Fedora"
52 echo -e "4 .. Get packages with pacman for Arch"
53 echo -e "5 .. Get packages with zypper for openSuse"
54 echo -e "6 .. As 5) but with additional packages for building 32-bit AROS"
55 echo -e " on 64-bit Linux"
56 echo -e "99 ..Skip this step"
57 echo -e "0 .. Exit"
59 echo -e "\nEnter number and press <Enter>:"
61 read input
62 case "$input" in
63 1 ) echo -e "\nInstalling prerequisites with apt-get..."
64 install_pkg "apt-get install" subversion
65 install_pkg "apt-get install" git-core
66 install_pkg "apt-get install" gcc
67 install_pkg "apt-get install" g++
68 install_pkg "apt-get install" make
69 install_pkg "apt-get install" gawk
70 install_pkg "apt-get install" bison
71 install_pkg "apt-get install" flex
72 install_pkg "apt-get install" bzip2
73 install_pkg "apt-get install" netpbm
74 install_pkg "apt-get install" autoconf
75 install_pkg "apt-get install" automake
76 install_pkg "apt-get install" libx11-dev
77 install_pkg "apt-get install" libxext-dev
78 install_pkg "apt-get install" libc6-dev
79 install_pkg "apt-get install" liblzo2-dev
80 install_pkg "apt-get install" libxxf86vm-dev
81 install_pkg "apt-get install" libpng-dev
82 install_pkg "apt-get install" libsdl1.2-dev
83 install_pkg "apt-get install" byacc
84 install_pkg "apt-get install" python-mako
85 install_pkg "apt-get install" libxcursor-dev
88 2 ) echo -e "\nInstalling prerequisites with apt-get..."
89 install_pkg "apt-get install" subversion
90 install_pkg "apt-get install" git-core
91 install_pkg "apt-get install" gcc
92 install_pkg "apt-get install" g++
93 install_pkg "apt-get install" make
94 install_pkg "apt-get install" gawk
95 install_pkg "apt-get install" bison
96 install_pkg "apt-get install" flex
97 install_pkg "apt-get install" bzip2
98 install_pkg "apt-get install" netpbm
99 install_pkg "apt-get install" autoconf
100 install_pkg "apt-get install" automake
101 install_pkg "apt-get install" libx11-dev
102 install_pkg "apt-get install" libxext-dev
103 install_pkg "apt-get install" libc6-dev
104 install_pkg "apt-get install" liblzo2-dev
105 install_pkg "apt-get install" libxxf86vm-dev
106 install_pkg "apt-get install" libpng-dev
107 install_pkg "apt-get install" gcc-multilib
108 install_pkg "apt-get install" libsdl1.2-dev
109 install_pkg "apt-get install" byacc
110 install_pkg "apt-get install" python-mako
111 install_pkg "apt-get install" libxcursor-dev
113 install_pkg "apt-get install" libc6-dev-i386
114 install_pkg "apt-get install" lib32gcc1
115 install_pkg "apt-get install" ia32-libs
118 3 ) echo -e "\nInstalling prerequisites with yum..."
119 install_pkg "yum install" subversion
120 install_pkg "yum install" git-core
121 install_pkg "yum install" gcc
122 install_pkg "yum install" gawk
123 install_pkg "yum install" bison
124 install_pkg "yum install" flex
125 install_pkg "yum install" bzip2
126 install_pkg "yum install" netpbm
127 install_pkg "yum install" autoconf
128 install_pkg "yum install" automake
129 install_pkg "yum install" libX11-devel
130 install_pkg "yum install" glibc-devel
131 install_pkg "yum install" lzo-devel
134 4 ) echo -e "\nInstalling prerequisites with pacman.."
135 echo -e "\nUpdating the List of software"
136 echo -e "\nEnter sudo password"
137 sudo pacman -Sy
138 install_pkg "pacman --needed --noconfirm -S" subversion
139 install_pkg "pacman --needed --noconfirm -S" git-core
140 install_pkg "pacman --needed --noconfirm -S" gcc
141 install_pkg "pacman --needed --noconfirm -S" gawk
142 install_pkg "pacman --needed --noconfirm -S" bison
143 install_pkg "pacman --needed --noconfirm -S" flex
144 install_pkg "pacman --needed --noconfirm -S" bzip2
145 install_pkg "pacman --needed --noconfirm -S" netpbm
146 install_pkg "pacman --needed --noconfirm -S" autoconf
147 install_pkg "pacman --needed --noconfirm -S" automake
148 #it appears as though the libx11-dev,libc6-dev,liblzo2-dev is not needed on arch
151 5 ) echo -e "\nInstalling prerequisites with zypper..."
152 # tools
153 install_pkg "zypper --non-interactive install" subversion
154 install_pkg "zypper --non-interactive install" git-core
155 install_pkg "zypper --non-interactive install" gcc
156 install_pkg "zypper --non-interactive install" gcc-c++
157 install_pkg "zypper --non-interactive install" make
158 install_pkg "zypper --non-interactive install" gawk
159 install_pkg "zypper --non-interactive install" bison
160 install_pkg "zypper --non-interactive install" flex
161 install_pkg "zypper --non-interactive install" bzip2
162 install_pkg "zypper --non-interactive install" netpbm
163 install_pkg "zypper --non-interactive install" autoconf
164 install_pkg "zypper --non-interactive install" automake
165 install_pkg "zypper --non-interactive install" patch
166 install_pkg "zypper --non-interactive install" cmake
167 install_pkg "zypper --non-interactive install" gperf
168 install_pkg "zypper --non-interactive install" perl-Switch
169 install_pkg "zypper --non-interactive install" byacc
171 # libs
172 install_pkg "zypper --non-interactive install" libXxf86vm1
173 install_pkg "zypper --non-interactive install" alsa-plugins-pulse
175 #devel
176 install_pkg "zypper --non-interactive install" libX11-devel
177 install_pkg "zypper --non-interactive install" glibc-devel
178 install_pkg "zypper --non-interactive install" libpng12-devel
179 install_pkg "zypper --non-interactive install" alsa-devel
182 6 ) echo -e "\nInstalling prerequisites with zypper..."
183 # tools
184 install_pkg "zypper --non-interactive install" subversion
185 install_pkg "zypper --non-interactive install" git-core
186 install_pkg "zypper --non-interactive install" gcc
187 install_pkg "zypper --non-interactive install" gcc-c++
188 install_pkg "zypper --non-interactive install" make
189 install_pkg "zypper --non-interactive install" gawk
190 install_pkg "zypper --non-interactive install" bison
191 install_pkg "zypper --non-interactive install" flex
192 install_pkg "zypper --non-interactive install" bzip2
193 install_pkg "zypper --non-interactive install" netpbm
194 install_pkg "zypper --non-interactive install" autoconf
195 install_pkg "zypper --non-interactive install" automake
196 install_pkg "zypper --non-interactive install" patch
197 install_pkg "zypper --non-interactive install" cmake
198 install_pkg "zypper --non-interactive install" gperf
199 install_pkg "zypper --non-interactive install" perl-Switch
200 install_pkg "zypper --non-interactive install" byacc
202 # libs
203 install_pkg "zypper --non-interactive install" libXxf86vm1
204 install_pkg "zypper --non-interactive install" alsa-plugins-pulse
206 #devel
207 install_pkg "zypper --non-interactive install" libX11-devel
208 install_pkg "zypper --non-interactive install" glibc-devel
209 install_pkg "zypper --non-interactive install" libpng12-devel
211 # 32-bit support
212 install_pkg "zypper --non-interactive install" gcc-32bit
213 install_pkg "zypper --non-interactive install" gcc-c++-32bit
214 install_pkg "zypper --non-interactive install" glibc-devel-32bit
215 install_pkg "zypper --non-interactive install" libXxf86vm1-32bit
216 install_pkg "zypper --non-interactive install" alsa-plugins-pulse-32bit
217 install_pkg "zypper --non-interactive install" alsa-devel-32bit
220 0 ) exit 0
222 esac
224 cd "$curdir"
226 input=""
227 until [ "$input" = "99" ]
229 echo -e "\n\n\n\n\n"
230 echo -e "***********************************************"
231 echo -e "* Step 2: get the sources from the repository *"
232 echo -e "***********************************************"
233 echo -e "\nYou can either use Subversion or Git. Git doesn't require"
234 echo -e "a password, but you'll get only read-only access."
235 echo -e "The repositories will be checked out into the current directory."
236 echo -e "\nABI V1 with | ABI V1 |"
237 echo -e "Subversion | with GIT | Content"
238 echo -e "------------+----------+--------------------------"
239 echo -e " 1 | 21 | Get AROS core (required)"
240 echo -e " 2 | 22 | Get contrib (optional)"
241 echo -e "\n 3 | 23 | Get ports source (optional, needs contrib)"
242 echo -e "\n 4 | --- | Get documentation source (optional)"
243 echo -e " 5 | --- | Get binaries (wallpapers, logos etc.) (optional)"
244 echo -e "\n99 .. Go to next step"
245 echo -e "0 .. Exit"
247 echo -e "\nEnter number and press <Enter>:"
249 read input
250 case "$input" in
251 1 ) echo -e "\nGetting AROS V1 core with Subversion...\n"
252 svn checkout https://svn.aros.org/svn/aros/trunk/AROS "$srcdir"
254 2 ) echo -e "\nGetting contrib V1 with Subversion...\n"
255 svn checkout https://svn.aros.org/svn/aros/trunk/contrib "$srcdir/contrib"
257 3 ) echo -e "\nGetting ports V1 with Subversion...\n"
258 svn checkout https://svn.aros.org/svn/aros/trunk/ports "$srcdir/ports"
260 4 ) echo -e "\nGetting documentation V1 with Subversion...\n"
261 svn checkout https://svn.aros.org/svn/aros/trunk/documentation "$srcdir/documentation"
263 5 ) echo -e "\nGetting binaries V1 with Subversion...\n"
264 svn checkout https://svn.aros.org/svn/aros/trunk/binaries "$srcdir/binaries"
267 21 ) echo -e "\nGetting AROS V1 core with Git...\n"
268 git clone git://repo.or.cz/AROS.git "$srcdir"
270 22 ) echo -e "\nGetting contrib V1 with Git...\n"
271 git clone git://repo.or.cz/AROS-Contrib.git "$srcdir/contrib"
273 23 ) echo -e "\nGetting ports V1 with Git...\n"
274 git clone git://repo.or.cz/AROS-Ports.git "$srcdir/ports"
277 0 ) exit 0
279 esac
280 done
282 cd "$curdir"
284 input=""
285 until [ "$input" = "99" ]
287 cd "$curdir"
289 echo -e "\n\n\n\n\n"
290 echo -e "*******************************"
291 echo -e "* Step 3: configure toolchain *"
292 echo -e "*******************************"
293 echo -e "\n 1 | i386 (32-bit)"
294 echo -e " 2 | x86_64 (64-bit)"
295 echo -e " 3 | m68k (32-bit)"
296 echo -e " 4 | armhf (32-bit)"
297 echo -e "\n99 .. Go to next step"
298 echo -e "0 .. Exit"
300 echo -e "\nEnter number and press <Enter>:"
302 read input
303 case "$input" in
304 1 ) echo -e "\nConfiguring i386 Toolchain...\n"
305 mkdir -p "$portsdir"
306 mkdir -p aros-i386-toolchain-builddir
307 cd aros-i386-toolchain-builddir
308 "../$srcdir/configure" $configopts --target=linux-i386 --with-aros-toolchain-install="$tooldir"-i386
310 2 ) echo -e "\nConfiguring x86_64 Toolchain...\n"
311 mkdir -p "$portsdir"
312 mkdir -p aros-x86_64-toolchain-builddir
313 cd aros-x86_64-toolchain-builddir
314 "../$srcdir/configure" $configopts --target=linux-x86_64 --with-aros-toolchain-install="$tooldir"-x86_64
316 3 ) echo -e "\nConfiguring m68k Toolchain...\n"
317 mkdir -p "$portsdir"
318 mkdir -p aros-m68k-toolchain-builddir
319 cd aros-m68k-toolchain-builddir
320 "../$srcdir/configure" $configopts --target=amiga-m68k --with-aros-toolchain-install="$tooldir"-m68k
322 4 ) echo -e "\nConfiguring armhf Toolchain...\n"
323 mkdir -p "$portsdir"
324 mkdir -p aros-armhf-toolchain-builddir
325 cd aros-armhf-toolchain-builddir
326 "../$srcdir/configure" $configopts --target=raspi-armhf --with-aros-toolchain-install="$tooldir"-armhf
329 0 ) exit 0
331 esac
332 done
335 cd "$curdir"
337 input=""
338 until [ "$input" = "99" ]
340 cd "$curdir"
342 echo -e "\n\n\n\n\n"
343 echo -e "***************************"
344 echo -e "* Step 4: build toolchain *"
345 echo -e "***************************"
346 echo -e "\nYou can only build what you've already configured."
347 echo -e "\n 1 | i386 (32-bit)"
348 echo -e " 2 | x86_64 (64-bit)"
349 echo -e " 3 | m68k (32-bit)"
350 echo -e " 4 | armhf (32-bit)"
351 echo -e "\n9 .. Go to next step"
352 echo -e "0 .. Exit"
353 echo -e "\nEnter number and press <Enter>:"
355 read input
356 case "$input" in
357 1 ) echo -e "\nBuilding i386 Toolchain...\n"
358 cd aros-i386-toolchain-builddir
359 make $makeopts crosstools
360 cd "$curdir"
361 rm -rf aros-i386-toolchain-builddir
363 2 ) echo -e "\nBuilding x86_64 Toolchain...\n"
364 cd aros-x86_64-toolchain-builddir
365 make $makeopts crosstools
366 cd "$curdir"
367 rm -rf aros-x86_64-toolchain-builddir
369 3 ) echo -e "\nBuilding m68k Toolchain...\n"
370 cd aros-m68k-toolchain-builddir
371 make $makeopts crosstools
372 cd "$curdir"
373 rm -rf aros-m68k-toolchain-builddir
375 4 ) echo -e "\nBuilding armhf Toolchain...\n"
376 cd aros-armhf-toolchain-builddir
377 make $makeopts crosstools
378 cd "$curdir"
379 rm -rf aros-armhf-toolchain-builddir
382 0 ) exit 0
384 esac
385 done
388 cd "$curdir"
390 input=""
391 until [ "$input" = "99" ]
393 cd "$curdir"
395 echo -e "\n\n\n\n\n"
396 echo -e "**************************"
397 echo -e "* Step 5: configure AROS *"
398 echo -e "**************************"
399 echo -e "\n 1 | linux-i386 (32-bit) debug"
400 echo -e " 2 | linux-i386 (32-bit)"
401 echo -e " 3 | linux-x86_64 (64-bit) debug"
402 echo -e " 4 | linux-x86_64 (64-bit)"
403 echo -e " 5 | pc-i386 (32-bit)"
404 echo -e " 6 | pc-x86_64 (64-bit)"
405 echo -e " 7 | pc-x86_64 SMP (64-bit)"
406 echo -e " 8 | amiga-m68k (32-bit)"
407 echo -e " 9 | raspi-armhf (32-bit)"
408 echo -e "\n99 .. Go to next step"
409 echo -e "0 .. Exit"
411 echo -e "\nEnter number and press <Enter>:"
413 read input
414 case "$input" in
415 1 ) echo -e "\nConfiguring linux-i386 V1 with full debug...\n"
416 mkdir -p "$portsdir"
417 mkdir -p aros-linux-i386-dbg
418 cd aros-linux-i386-dbg
419 "../$srcdir/configure" $configopts --target=linux-i386 --enable-debug --with-aros-toolchain-install="$tooldir"-i386 --with-aros-toolchain=yes
421 2 ) echo -e "\nConfiguring linux-i386 V1 without debug...\n"
422 mkdir -p "$portsdir"
423 mkdir -p aros-linux-i386
424 cd aros-linux-i386
425 "../$srcdir/configure" $configopts --target=linux-i386 --with-aros-toolchain-install="$tooldir"-i386 --with-aros-toolchain=yes
427 3 ) echo -e "\nConfiguring linux-x86_64 V1 with full debug...\n"
428 mkdir -p "$portsdir"
429 mkdir -p aros-linux-x86_64-dbg
430 cd aros-linux-x86_64-dbg
431 "../$srcdir/configure" $configopts --target=linux-x86_64 --enable-debug --with-aros-toolchain-install="$tooldir"-x86_64 --with-aros-toolchain=yes
433 4 ) echo -e "\nConfiguring linux-x86_64 V1 without debug...\n"
434 mkdir -p "$portsdir"
435 mkdir -p aros-linux-x86_64
436 cd aros-linux-x86_64
437 "../$srcdir/configure" $configopts --target=linux-x86_64 --with-aros-toolchain-install="$tooldir"-x86_64 --with-aros-toolchain=yes
439 5 ) echo -e "\nConfiguring pc-i386 V1...\n"
440 mkdir -p "$portsdir"
441 mkdir -p aros-pc-i386
442 cd aros-pc-i386
443 "../$srcdir/configure" $configopts --target=pc-i386 --with-aros-toolchain-install="$tooldir"-i386 --with-aros-toolchain=yes
445 6 ) echo -e "\nConfiguring pc-x86_64 V1...\n"
446 mkdir -p "$portsdir"
447 mkdir -p aros-pc-x86_64
448 cd aros-pc-x86_64
449 "../$srcdir/configure" $configopts --target=pc-x86_64 --with-aros-toolchain-install="$tooldir"-x86_64 --with-aros-toolchain=yes
451 7 ) echo -e "\nConfiguring pc-x86_64 SMP V1...\n"
452 mkdir -p "$portsdir"
453 mkdir -p aros-pc-x86_64-smp
454 cd aros-pc-x86_64-smp
455 "../$srcdir/configure" $configopts --target=pc-x86_64 --enable-target-variant=smp --with-aros-toolchain-install="$tooldir"-x86_64 --with-aros-toolchain=yes
457 8 ) echo -e "\nConfiguring amiga-m68k V1...\n"
458 mkdir -p "$portsdir"
459 mkdir -p aros-amiga-m68k
460 cd aros-amiga-m68k
461 "../$srcdir/configure" $configopts --target=amiga-m68k --with-serial-debug=yes --with-aros-toolchain-install="$tooldir"-m68k --with-aros-toolchain=yes
463 9 ) echo -e "\nConfiguring raspi-armhf V1...\n"
464 mkdir -p "$portsdir"
465 mkdir -p aros-raspi-armhf
466 cd aros-raspi-armhf
467 "../$srcdir/configure" $configopts --target=raspi-armhf --with-aros-toolchain-install="$tooldir"-armhf --with-aros-toolchain=yes
470 0 ) exit 0
472 esac
473 done
476 cd "$curdir"
478 input=""
479 until [ "$input" = "99" ]
481 cd "$curdir"
483 echo -e "\n\n\n\n\n"
484 echo -e "*****************"
485 echo -e "* Step 6: build *"
486 echo -e "*****************"
487 echo -e "\nYou can only build what you've already configured."
488 echo -e "\n 1 | linux-i386 (32-bit) debug"
489 echo -e " 2 | linux-i386 (32-bit)"
490 echo -e " 3 | linux-x86_64 (64-bit) debug"
491 echo -e " 4 | linux-x86_64 (64-bit)"
492 echo -e " 5 | pc-i386 (32-bit)"
493 echo -e " 6 | pc-x86_64 (64-bit)"
494 echo -e " 7 | pc-x86_64 SMP (64-bit)"
495 echo -e " 8 | amiga-m68k (32-bit)"
496 echo -e " 9 | raspi-armhf (32-bit)"
497 echo -e "\n99 .. Go to next step"
498 echo -e "0 .. Exit"
499 echo -e "\nEnter number and press <Enter>:"
501 read input
502 case "$input" in
503 1 ) echo -e "\nBuilding linux-i386 V1 with full debug...\n"
504 cd aros-linux-i386-dbg
505 make $makeopts
506 make $makeopts contrib
507 make $makeopts ports
508 echo -e "\nIf everything went well AROS will be available"
509 echo -e "in the directory aros-linux-i386-dbg/bin/<target>/AROS"
511 2 ) echo -e "\nBuilding linux-i386 V1 without debug...\n"
512 cd aros-linux-i386
513 make $makeopts
514 make $makeopts contrib
515 make $makeopts ports
516 echo -e "\nIf everything went well AROS will be available"
517 echo -e "in the directory aros-linux-i386/bin/<target>/AROS"
519 3 ) echo -e "\nBuilding linux-x86_64 V1 with full debug...\n"
520 cd aros-linux-x86_64-dbg
521 make $makeopts
522 make $makeopts contrib
523 make $makeopts ports
524 echo -e "\nIf everything went well AROS will be available"
525 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
527 4 ) echo -e "\nBuilding linux-x86_64 V1 without debug...\n"
528 cd aros-linux-x86_64
529 make $makeopts
530 make $makeopts contrib
531 make $makeopts ports
532 echo -e "\nIf everything went well AROS will be available"
533 echo -e "in the directory aros-linux-x86_64/bin/<target>/AROS"
535 5 ) echo -e "\nBuilding pc-i386 V1...\n"
536 cd aros-pc-i386
537 make $makeopts
538 make $makeopts contrib
539 make $makeopts ports
540 make $makeopts distfiles
541 echo -e "\nIf everything went well AROS will be available"
542 echo -e "in the directory aros-pc-i386/distfiles"
544 6 ) echo -e "\nBuilding pc-x86_64 V1...\n"
545 cd aros-pc-x86_64
546 make $makeopts
547 make $makeopts contrib
548 make $makeopts ports
549 make $makeopts distfiles
550 echo -e "\nIf everything went well AROS will be available"
551 echo -e "in the directory aros-pc-x86_64/distfiles"
553 7 ) echo -e "\nBuilding pc-x86_64 SMP V1...\n"
554 cd aros-pc-x86_64-smp
555 make $makeopts
556 make $makeopts contrib
557 make $makeopts ports
558 make $makeopts distfiles
559 echo -e "\nIf everything went well AROS will be available"
560 echo -e "in the directory aros-pc-x86_64-smp/distfiles"
562 8 ) echo -e "\nBuilding amiga-m68k V1...\n"
563 cd aros-amiga-m68k
564 make $makeopts
565 make $makeopts contrib
566 make $makeopts ports
567 make $makeopts distfiles
568 echo -e "\nIf everything went well AROS will be available"
569 echo -e "in the directory aros-amiga-m68k/distfiles"
571 9 ) echo -e "\nBuilding raspi-armhf V1...\n"
572 cd aros-raspi-armhf
573 make $makeopts
574 make $makeopts contrib
575 make $makeopts ports
576 make $makeopts distfiles
577 echo -e "\nIf everything went well AROS will be available"
578 echo -e "in the directory aros-raspi-armhf/distfiles"
581 0 ) exit 0
583 esac
584 done
586 cd "$curdir"
588 exit 0