cookutils view cook @ rev 15

Add debug info if cook error
author Christophe Lincoln <pankso@slitaz.org>
date Thu May 05 05:04:15 2011 +0200 (2011-05-05)
parents fa9a36a8c1f4
children dcf50aa1bb76
line source
1 #!/bin/sh
2 #
3 # Cook - A tool to cook and generate SliTaz packages. Read the README
4 # before adding or modifing any code in cook!
5 #
6 # Copyright (C) SliTaz GNU/Linux - GNU gpl v3
7 # Author: Christophe Lincoln <pankso@slitaz.org>
8 #
10 [ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf
11 [ -f "cook.conf" ] && . ./cook.conf
13 # Share activity and broken packages with the Cooker.
14 activity="$CACHE/activity"
15 broken="$CACHE/broken"
17 #
18 # Functions
19 #
21 usage() {
22 cat << EOT
24 $(echo -e "\033[1m$(gettext "Usage:")\033[0m") cook [package|command|list] [--option]
26 $(echo -e "\033[1m$(gettext "Commands:")\033[0m")
27 usage|help $(gettext "Display this short usage.")
28 list-wok $(gettext "List packages in the wok.")
29 setup $(gettext "Setup your build environment.")
30 test $(gettext "Test environment and cook a package.")
31 new $(gettext "Create a new package with receipt".)
32 list $(gettext "Cook a list of packages.")
33 clean-wok $(gettext "Clean-up all packages files.")
34 clean-src $(gettext "Clean-up all packages source.")
35 pkglist $(gettext "Create all packages.* lists.")
37 $(echo -e "\033[1m$(gettext "Options:")\033[0m")
38 --clean|-c Cook : $(gettext "clean the package in the wok.")
39 --install|-i Cook : $(gettext "and install the package.")
40 --wok|-w Setup: $(gettext "create also a wok from Hg repo.")
42 EOT
43 exit 0
44 }
46 # Be sure we root.
47 check_root() {
48 [ $(id -u) != 0 ] && gettext -e "\nYou must be root to cook.\n\n" && exit 0
49 }
51 separator() {
52 echo "================================================================================"
53 }
55 status() {
56 echo -en "\\033[70G[ "
57 if [ $? = 0 ]; then
58 echo -en "\\033[1;32mOK"
59 else
60 echo -en "\\033[1;31mFailed"
61 fi
62 echo -e "\\033[0;39m ]"
63 }
65 # Log activities, we want first letter capitalized.
66 log() {
67 grep ^[a-zA-Z0-9] | \
68 sed s"#^[A-Z]\([^']*\)#$(date '+%Y-%m-%d %H:%M') : \0#" >> $activity
69 }
71 # We dont want those escape in web interface.
72 clean_log() {
73 sed -i -e s'|\[70G\[ \[1;32m| |' \
74 -e s'|\[0;39m \]||' $LOGS/$pkg.log
75 }
77 # Be sure package exist in wok.
78 check_pkg_in_wok() {
79 if [ ! -d "$WOK/$pkg" ]; then
80 gettext -e "\nUnable to find package in the wok:"
81 echo -e " $pkg\n" && exit 1
82 fi
83 }
85 if_empty_value() {
86 if [ -z "$value" ]; then
87 gettext "QA: empty variable:"; echo -e " ${var}=\"\"\n"
88 exit 1
89 fi
90 }
92 # QA: check a receip consistency befor building.
93 receipt_quality() {
94 gettext -e "QA: checking package receipt...\n"
95 unset online
96 if ifconfig | grep -q -A 1 "^[a-z]*[0-9]" | fgrep 'addr:'; then
97 online="online"
98 fi
99 for var in PACKAGE VERSION CATEGORY SHORT_DESC MAINTAINER WEB_SITE
100 do
101 unset value
102 value=$(grep ^$var= receipt | cut -d \" -f 2)
103 case "$var" in
104 PACKAGE|VERSION|SHORT_DESC)
105 if_empty_value ;;
106 CATEGORY)
107 [ -z "$value" ] && value="empty"
108 valid="base-system x-window utilities network graphics \
109 multimedia office development system-tools security games \
110 misc meta non-free"
111 if ! echo "$valid" | grep -q -w "$value"; then
112 gettext "QA: unknow category:"; echo -e " $value\n"
113 exit 1
114 fi ;;
115 WEB_SITE)
116 # We dont check WGET_URL since if dl is needed it will fail.
117 # Break also if we not online. Here error is not fatal.
118 if_empty_value
119 [ -z "$online" ] || break
120 if ! busybox wget -s $value 2>/dev/null; then
121 gettext "QA: Unable to reach:"; echo -e " $value\n"
122 fi ;;
123 esac
124 done
125 }
127 # Executed before sourcing a receipt.
128 unset_receipt() {
129 unset DEPENDS BUILD_DEPENDS WANTED EXTRAVERSION WGET_URL PROVIDE TARBALL
130 }
132 # Path's used in receipt and by cook itself.
133 set_paths() {
134 pkgdir=$WOK/$PACKAGE
135 src=$pkgdir/source/$PACKAGE-$VERSION
136 pack=$pkgdir/taz/$PACKAGE-${VERSION}${EXTRAVERSION}
137 fs=$pack/fs
138 stuff=$pkgdir/stuff
139 install=$pkgdir/install
140 if [ "$WANTED" ]; then
141 src=$WOK/$WANTED/source/$WANTED-$VERSION
142 install=$WOK/$WANTED/install
143 fi
144 # Old way compatibility.
145 _pkg=$install
146 }
148 # Get package source.
149 get_source() {
150 case "$WGET_URL" in
151 http://*|ftp://*)
152 # Busybox Wget is better!
153 busybox wget -c -P $SRC $WGET_URL || \
154 (echo -e "ERROR: wget $WGET_URL" && exit 1) ;;
155 hg*|mercurial*)
156 # We are in cache so clone here and create a tarball
157 pwd=$(pwd)
158 if $(echo "$WGET_URL" | fgrep -q hg); then
159 url=${WGET_URL#hg|}
160 else
161 url=${WGET_URL#mercurial|}
162 fi
163 pkgsrc=${SOURCE:-$PACKAGE}-$VERSION
164 tarball=$pkgsrc.tar.bz2
165 gettext "Getting source from Hg: "; echo $url
166 gettext "Cloning to: "; echo "$pwd/$pkgsrc"
167 hg clone $url $pkgsrc || (echo "ERROR: hg clone $url" && exit 1)
168 gettext "Creating tarball: "; echo "$tarball"
169 tar cjf $tarball $pkgsrc || exit 1
170 mv $tarball $SRC && rm -rf $pkgsrc ;;
171 git*)
172 echo "TODO: git implementation in cook" && exit 1 ;;
173 svn*)
174 echo "TODO: svn implementation in cook" && exit 1 ;;
175 *)
176 gettext -e "\nERROR: Unable to handle:"; echo -e " $WGET_URL \n" | \
177 tee -a $LOGS/$PACKAGE.log
178 exit 1 ;;
179 esac
180 }
182 # Extract source package.
183 extract_source() {
184 gettext "Extracting:"; echo " $TARBALL"
185 case "$TARBALL" in
186 *.tar.gz|*.tgz) tar xzf $SRC/$TARBALL ;;
187 *.tar.bz2) tar xjf $SRC/$TARBALL ;;
188 *.tar.lzma) tar xaf $SRC/$TARBALL ;;
189 *.zip) unzip $SRC/$TARBALL ;;
190 esac
191 }
193 # Display cooked package summary.
194 summary() {
195 cd $WOK/$pkg
196 [ -d install ] && prod=$(du -sh install | awk '{print $1}' 2>/dev/null)
197 fs=$(du -sh taz/* | awk '{print $1}')
198 size=$(du -sh $PKGS/$PACKAGE-${VERSION}${EXTRAVERSION}.* | awk '{print $1}')
199 files=$(cat taz/$PACKAGE-*/files.list | wc -l)
200 gettext "Summary for:"; echo " $PACKAGE $VERSION"
201 separator
202 [ "$prod" ] && echo "Produce : $prod"
203 cat << EOT
204 Packed : $fs
205 Compressed : $size
206 Cook time : ${time}s
207 Files : $files
208 $(separator)
210 EOT
211 }
213 # Display debugging erroe info.
214 debug_info() {
215 echo "Debug information"
216 separator
217 fgrep ERROR $LOGS/$pkg.log
218 separator && echo ""
219 }
221 # Copy all generic files (locale, pixmaps, .desktop). We use standard paths,
222 # so some packages need to copy these files with the receipt and genpkg_rules.
223 copy_generic_files()
224 {
225 # $LOCALE is set in cook.conf
226 if [ "$LOCALE" ]; then
227 if [ -d "$_pkg/usr/share/locale" ]; then
228 mkdir -p $fs/usr/share/locale
229 for i in $LOCALE
230 do
231 if [ -d "$_pkg/usr/share/locale/$i" ]; then
232 cp -a $_pkg/usr/share/locale/$i $fs/usr/share/locale
233 fi
234 done
235 fi
236 fi
238 # Generic pixmaps copy can be disabled with GENERIC_PIXMAPS="no"
239 if [ "$GENERIC_PIXMAPS" != "no" ]; then
240 if [ -d "$_pkg/usr/share/pixmaps" ]; then
241 mkdir -p $fs/usr/share/pixmaps
242 cp -a $_pkg/usr/share/pixmaps/$PACKAGE.png \
243 $fs/usr/share/pixmaps 2>/dev/null
244 cp -a $_pkg/usr/share/pixmaps/$PACKAGE.xpm \
245 $fs/usr/share/pixmaps 2>/dev/null
246 fi
248 # Custom or homemade PNG pixmap can be in stuff.
249 if [ -f "$stuff/$PACKAGE.png" ]; then
250 mkdir -p $fs/usr/share/pixmaps
251 cp -a $stuff/$PACKAGE.png $fs/usr/share/pixmaps
252 fi
253 fi
255 # Desktop entry (.desktop).
256 if [ -d "$_pkg/usr/share/applications" ]; then
257 cp -a $_pkg/usr/share/applications $fs/usr/share
258 fi
260 # Homemade desktop file(s) can be in stuff.
261 if [ -d "$stuff/applications" ]; then
262 mkdir -p $fs/usr/share
263 cp -a $stuff/applications $fs/usr/share
264 fi
265 if [ -f "$stuff/$PACKAGE.desktop" ]; then
266 mkdir -p $fs/usr/share/applications
267 cp -a $stuff/$PACKAGE.desktop $fs/usr/share/applications
268 fi
269 }
271 # Find and strip : --strip-all (-s) or --strip-debug on static libs.
272 strip_package()
273 {
274 gettext "Executing strip on all files"
275 for dir in $fs/bin $fs/sbin $fs/usr/bin $fs/usr/sbin $fs/usr/games
276 do
277 if [ -d "$dir" ]; then
278 find $dir -type f -exec strip -s '{}' 2>/dev/null \;
279 fi
280 done
281 find $fs -name "*.so*" -exec strip -s '{}' 2>/dev/null \;
282 find $fs -name "*.a" -exec strip --strip-debug '{}' 2>/dev/null \;
283 status
284 }
286 # Remove installed deps.
287 remove_deps() {
288 # Now remove installed build deps.
289 diff="$CACHE/installed.diff"
290 deps=$(cat $diff | grep ^+[a-zA-Z0-9] | sed s/^+//)
291 nb=$(cat $diff | grep ^+[a-zA-Z0-9] | wc -l)
292 if [ -s "$CACHE/installed.diff" ]; then
293 gettext "Build dependencies to remove:"; echo " $nb"
294 gettext "Removing:"
295 for dep in $deps
296 do
297 echo -n " $dep"
298 yes | tazpkg remove $dep >/dev/null
299 done
300 echo ""
301 mv -f $CACHE/installed.diff $CACHE/installed.last.diff
302 fi
303 }
305 # The main cook function.
306 cookit() {
307 echo "Cook: $PACKAGE $VERSION"
308 separator
309 set_paths
310 [ "$QA" ] && receipt_quality
311 rm -rf install taz source $CACHE/error
313 # Disable -pipe if less than 512Mb free RAM.
314 free=$(free | fgrep '/+ buffers' | tr -s ' ' | cut -f 4 -d ' ')
315 if [ "$free" -lt 524288 ] && [ "$CFLAGS" != "${CFLAGS/-pipe}" ]; then
316 gettext -e "Disabling -pipe compile flag: $free RAM\n"
317 CFLAGS="${CFLAGS/-pipe}" && CFLAGS=$(echo "$CFLAGS" | tr -s ' ')
318 CXXFLAGS="${CXXFLAGS/-pipe}" && CXXFLAGS=$(echo "$CXXFLAGS" | tr -s ' ')
319 fi
320 unset free
322 # Export flags and path to be used by make
323 DESTDIR=$WOK/$PACKAGE/install
324 export DESTDIR MAKEFLAGS CFLAGS CXXFLAGS BUILD_HOST CONFIG_SITE
325 local LC_ALL=POSIX LANG=POSIX
327 # Check for build dep.
328 cd $INSTALLED && ls -1 > $CACHE/installed.list
329 [ "$DEPENDS" ] && gettext -e "Checking build dependencies...\n"
330 for dep in $BUILD_DEPENDS
331 do
332 if [ ! -d "$INSTALLED/$dep" ]; then
333 # Try local package first
334 if [ -f "$PKGS/$dep-*.tazpkg" ]; then
335 gettext "Installing dep (local):"; echo " $dep"
336 cd $PKGS && tazpkg install $dep-*.tazpkg >/dev/null
337 else
338 gettext "Installing dep (web/cache):"; echo " $dep"
339 tazpkg get-install $dep >/dev/null
340 fi
341 fi
342 done
343 ls -1 > $CACHE/installed.cook && cd $CACHE
345 # If a cook failed deps are not remove since we exit 1.
346 [ ! -s "installed.diff" ] && \
347 diff installed.list installed.cook > installed.diff
348 deps=$(cat installed.diff | grep ^+[a-zA-Z0-9] | wc -l)
350 # Get source tarball and make sure we have source dir named:
351 # $PACKAGE-$VERSION to be standard in receipts. Her we use tar.lzma
352 # tarball if it exist.
353 if [ "$WGET_URL" ] && [ ! -f "$SRC/$TARBALL" ]; then
354 if [ -f "$SRC/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ]; then
355 TARBALL=${SOURCE:-$PACKAGE}-$VERSION.tar.lzma
356 else
357 get_source || exit 1
358 fi
359 fi
360 if [ ! "$WANTED" ] && [ "$TARBALL" ] && [ ! -d "$src" ]; then
361 mkdir -p $pkgdir/source/tmp && cd $pkgdir/source/tmp
362 extract_source || exit 1
363 mv * ../$PACKAGE-$VERSION
364 cd .. && rm -rf tmp
365 fi
367 # Execute receipt rules.
368 if grep -q ^compile_rules $pkgdir/receipt; then
369 gettext -e "Executing: compile_rules\n"
370 [ -d "$src" ] && cd $src
371 compile_rules || exit 1
372 # Stay compatible with _pkg
373 [ -d $src/_pkg ] && mv $src/_pkg $install
374 # QA: compile_rules success so valid.
375 mkdir -p $install
376 else
377 # QA: No compile_rules so no error, valid.
378 mkdir -p $install
379 fi
380 if grep -q ^genpkg_rules $pkgdir/receipt; then
381 gettext -e "Executing: genpkg_rules\n"
382 cd $pkgdir
383 mkdir -p $fs && genpkg_rules || ( echo -e \
384 "\nERROR: genpkg_rules failed\n" | \
385 tee -a $LOGS/$pkg.log && exit 1 )
386 gettext -e "Now will pack the package.\n"
387 fi
388 separator && echo ""
389 }
391 # Cook quality assurance.
392 cookit_quality() {
393 if [ ! -d "$WOK/$pkg/install" ] && [ ! "$WANTED" ]; then
394 echo -e "ERROR: cook failed" | tee -a $LOGS/$pkg.log
395 fi
396 # ERROR can be echoed any time in cookit()
397 if grep -q ^ERROR $LOGS/$pkg.log; then
398 echo ""
399 debug_info | tee $CACHE/debug
400 # Debug info on top, easier to check errors.
401 cat $CACHE/debug $LOGS/$pkg.log > $CACHE/$pkg.debug
402 mv -f $CACHE/$pkg.debug $LOGS/$pkg.log
403 exit 1
404 fi
405 }
407 # Create the package.
408 packit() {
409 set_paths
410 echo "Packing: $PACKAGE ${VERSION}${EXTRAVERSION}"
411 separator
412 cd $pkgdir/taz
413 strip_package
414 for file in receipt description.txt
415 do
416 [ ! -f "../$file" ] && continue
417 gettext "Copying"; echo -n " $file..."
418 cp -f ../$file $pack && chown 0.0 $pack/$file && status
419 done
420 copy_generic_files
421 # Use Tazpkg to create a tazpkg package...
422 tazpkg pack $PACKAGE-${VERSION}${EXTRAVERSION} | grep "\[*\]"
423 separator && echo ""
424 }
426 # Verify package quality and consitensy.
427 packit_quality() {
428 if grep -q ^ERROR $LOGS/$pkg.log; then
429 exit 1
430 fi
431 if ! grep -q ^/ $WOK/$pkg/taz/$pkg-*/files.list; then
432 echo -e "ERROR: empty package\n" | tee -a $LOGS/$pkg.log && exit 1
433 else
434 mv -f $WOK/$pkg/taz/$pkg-*.tazpkg $PKGS
435 sed -i /^${pkg}$/d $broken
436 fi
437 }
439 #
440 # Commands
441 #
443 case "$1" in
444 usage|help)
445 usage ;;
446 list-wok)
447 gettext "List of packages in:"; echo " $WOK"
448 separator
449 cd $WOK && ls -1
450 separator
451 echo -n "Packages: " && ls | wc -l
452 echo "" ;;
453 setup)
454 # Setup a build environment
455 check_root
456 echo "Cook: setting up the environment" | log
457 gettext -e "\nSetting up your environment\n"
458 separator && cd $SLITAZ
459 gettext "Creating directories structure in:"; echo " $SLITAZ"
460 mkdir -p $WOK $PKGS $SRC $CACHE $LOGS
461 gettext -e "Checking for packages to install...\n"
462 for pkg in slitaz-toolchain tazdev intltool gettext
463 do
464 [ ! -d "$INSTALLED/$pkg" ] && tazpkg get-install $pkg
465 done
467 # Handle --options
468 case "$2" in
469 --wok)
470 [ ! -d "$INSTALLED/mercurial" ] && tazpkg get-install mercurial
471 [ -d "$WOK" ] && echo -e "A wok already exist.\n" && exit 1
472 hg clone $HG_URL ;;
473 --chroot)
474 echo "TODO: create a chroot with tazdev" ;;
475 esac
477 # SliTaz group and permissions
478 if ! grep -q ^slitaz /etc/group; then
479 gettext -e "Adding group: slitaz\n"
480 addgroup slitaz
481 fi
482 gettext -e "Setting permissions for slitaz group...\n"
483 chown -R root.slitaz $SLITAZ
484 chmod -R g+w $SLITAZ
485 separator
486 gettext -e "All done, ready to cook packages :-)\n\n" ;;
487 test)
488 # Test a cook environment.
489 echo "Cook test: testing the cook environment" | log
490 [ ! -d "$WOK" ] && exit 1
491 [ ! -d "$WOK/cooktest" ] && cp -r $DATA/cooktest $WOK
492 cook cooktest ;;
493 new)
494 # Create the package folder and an empty receipt.
495 pkg="$2"
496 [ "$pkg" ] || usage
497 echo ""
498 if [ -d "$WOK/$pkg" ]; then
499 echo -n "$pkg " && gettext "package already exist."
500 echo -e "\n" && exit 1
501 fi
502 gettext "Creating"; echo -n " $WOK/$pkg"
503 mkdir $WOK/$pkg && cd $WOK/$pkg && status
504 gettext "Preparing the package receipt..."
505 cp $DATA/receipt .
506 sed -i s"/^PACKAGE=.*/PACKAGE=\"$pkg\"/" receipt
507 status && echo "" ;;
508 list)
509 # Cook a list of packages (better use the Cooker since it will order
510 # packages before executing cook).
511 check_root
512 [ -z "$2" ] && gettext -e "\nNo list in argument.\n\n" && exit 1
513 [ ! -f "$2" ] && gettext -e "\nNo list found:" && \
514 echo -e " $2\n" && exit 1
515 echo "Cook list starting: $2" | log
516 for pkg in $(cat $2)
517 do
518 cook $pkg || broken
519 done ;;
520 clean-wok)
521 check_root
522 gettext -e "\nCleaning all packages files..."
523 rm -rf $WOK/*/taz $WOK/*/install $WOK/*/source
524 status && echo "" ;;
525 clean-src)
526 check_root
527 gettext -e "\nCleaning all packages source..."
528 rm -rf $WOK/*/source
529 status && echo "" ;;
530 pkglist)
531 # Create suitable packages list for TazPKG and only for builded packages.
532 [ "$2" ] && PKGS="$2"
533 [ ! -d "$PKGS" ] && \
534 gettext -e "\nPackages directory dont exist\n\n" && exit 1
535 cd $PKGS
536 echo "Cook pkglist: Creating all packages list" | log
537 gettext -e "\nCreating lists for:"; echo " $PKGS"
538 separator
539 rm -f packages.* files.list*
540 gettext -e "Creating: packages.list\n"
541 ls -1 | sed s'/.tazpkg//' > $PKGS/packages.list
542 gettext -e "Creating: packages.md5\n"
543 md5sum *.tazpkg > $PKGS/packages.md5
544 gettext -e "Creating: packages.desc\n"
545 gettext -e "Creating: packages.equiv\n"
546 cd $WOK
547 for pkg in *
548 do
549 unset_receipt
550 . $pkg/receipt
551 # packages.desc let us search easily in DB
552 if [ -f "$PKGS/$PACKAGE-${VERSION}${EXTRAVERSION}.tazpkg" ]; then
553 cat >> $PKGS/packages.desc << EOT
554 $PACKAGE | $VERSION$EXTRAVERSION | $SHORT_DESC | $CATEGORY | $WEB_SITE
555 EOT
556 # Packages.equiv is used by tazpkg install to check depends.
557 for i in $PROVIDE; do
558 DEST=""
559 echo $i | fgrep -q : && DEST="${i#*:}:"
560 if grep -qs ^${i%:*}= $PKGS/packages.equiv; then
561 sed -i "s/^${i%:*}=/${i%:*}=$DEST$PACKAGE /" \
562 $PKGS/packages.equiv
563 else
564 echo "${i%:*}=$DEST$PACKAGE" >> $PKGS/packages.equiv
565 fi
566 done
567 fi
568 done
569 # files.list.lzma
570 #lzma e files.list files.list.lzma
571 separator
572 nb=$(ls $PKGS/*.tazpkg | wc -l)
573 echo -e "Packages: $nb\n" ;;
574 *)
575 # Just cook and generate a package.
576 check_root
577 time=$(date +%s)
578 pkg="$1"
579 [ -z "$pkg" ] && usage
580 check_pkg_in_wok && echo ""
581 unset inst
582 unset_receipt
583 cd $WOK/$pkg && . ./receipt
585 # Handle --options
586 case "$2" in
587 --clean|-c)
588 gettext -e "Cleaning package:"; echo -n " $pkg"
589 cd $WOK/$pkg && rm -rf install taz source
590 status && echo "" && exit 0 ;;
591 --install|-i)
592 inst='yes' ;;
593 esac
595 # Check if wanted is build now so we have separate log files.
596 if [ "$WANTED" ] && [ ! -d "$WOK/$WANTED/install" ]; then
597 cook "$WANTED"
598 fi
600 # Cook and pack or exit on error and log everything.
601 cookit | tee $LOGS/$pkg.log
602 remove_deps | tee -a $LOGS/$pkg.log
603 cookit_quality
604 packit | tee -a $LOGS/$pkg.log
605 clean_log
606 packit_quality
608 # Time and summary
609 time=$(($(date +%s) - $time))
610 summary | tee -a $LOGS/$pkg.log
612 # Install package if requested
613 if [ "$inst" ]; then
614 if [ -f "$PKGS/$PACKAGE-${VERSION}${EXTRAVERSION}.tazpkg" ]; then
615 cd $PKGS && tazpkg install \
616 $PACKAGE-${VERSION}${EXTRAVERSION}.tazpkg --forced
617 else
618 gettext -e "Unable to install package, build have failed.\n\n"
619 exit 1
620 fi
621 fi
622 # Finally we DONT WANT to build the *-dev or packages with WANTED="$pkg"
623 # You automation: use the Cooker Build Bot.
624 #[ -d "$WOK/$pkg-dev" ] && cook $pkg-dev
625 ;;
626 esac
628 exit 0