tazwok view tazwok @ rev 16

Fixed cmd stats (no cooked packages)
author Christophe Lincoln <pankso@slitaz.org>
date Sun Dec 30 17:34:48 2007 +0100 (2007-12-30)
parents d8154d33d3e2
children 9a7c35669bbc
line source
1 #!/bin/sh
2 # Tazwok - SliTaz source compiler and binary packages generator/cooker.
3 #
4 # Tazwok can compile source package and creat binary packages suitable for
5 # Tazpkg (Tiny Autonomus zone package manager). You can build individuals
6 # package or a list a packages with one command, rebuild the full distro,
7 # generate a packages repository and also list and get info about packages.
8 #
9 # (C) 2007 SliTaz - GNU General Public License.
10 # Author : <pankso@slitaz.org>
11 #
12 VERSION=1.2
14 ####################
15 # Tazwok variables #
16 ####################
18 # Packages categories.
19 CATEGORIES="base-system base-apps x-window extra"
21 # Use words rater than numbers in the code.
22 COMMAND=$1
23 PACKAGE=$2
24 LIST=$2
26 # Include config file or exit if any file found.
27 if [ -f "/etc/tazwok.conf" ]; then
28 . /etc/tazwok.conf
29 else
30 echo -e "\nUnable to find the configuration file : /etc/tazwok.conf"
31 echo -e "Please read the Tazwok documentation.\n"
32 exit 0
33 fi
35 # Creat Taz wok needed directories if user is root.
36 if test $(id -u) = 0 ; then
37 # Check for the wok directory.
38 if [ ! -d "$WOK" ]; then
39 echo "Creating the wok directory..."
40 mkdir -p $WOK
41 chmod 777 $WOK
42 fi
43 # Check for the packages repository.
44 if [ ! -d "$PACKAGES_REPOSITORY" ]; then
45 echo "Creating the packages repository..."
46 mkdir -p $PACKAGES_REPOSITORY
47 fi
48 # Check for the sources repository.
49 if [ ! -d "$SOURCES_REPOSITORY" ]; then
50 echo "Creating the sources repository..."
51 mkdir -p $PACKAGES_REPOSITORY
52 fi
53 fi
55 # The path to the most important file used by Tazwok.
56 # The receipt is used to compile the source code and
57 # gen suitables packages for Tazpkg.
58 RECEIPT="$WOK/$PACKAGE/receipt"
60 # The path to the process log file.
61 LOG="$WOK/$PACKAGE/process.log"
63 ####################
64 # Tazwok functions #
65 ####################
67 # Print the usage (English).
68 usage ()
69 {
70 echo -e "\nSliTaz sources compiler and packages generator - Version: $VERSION\n
71 \033[1mUsage: \033[0m `basename $0` [command] [package|list|category|dir] [--option]
72 \033[1mCommands: \033[0m\n
73 usage Print this short usage.
74 stats Print Tazwok statistics from the config file and the wok.
75 list List all packages in the wok tree or by category.
76 info Get informations about a package in the wok.
77 check-log Check the process log file of a package.
78 search Search for a package in the wok by pattern or name.
79 compile Configure and build the package using the receipt rules.
80 genpkg Generate a suitable package for Tazpkg with the rules.
81 cook Compile and generate a package directly.
82 cook-list Cook all packages specified in the list by order.
83 clean Clean all generated files in the package tree.
84 new-tree Prepare a new package tree and receipt (--interactive).
85 gen-list Generate a packages.list and md5sum for a repository.
86 gen-clean-wok Gen a clean wok in a dir ('clean-wok' cleans current wok).
87 remove Remove a package from the wok.\n"
88 }
90 # Status function.
91 status()
92 {
93 local CHECK=$?
94 echo -en "\\033[70G[ "
95 if [ $CHECK = 0 ]; then
96 echo -en "\\033[1;33mOK"
97 else
98 echo -en "\\033[1;31mFailed"
99 fi
100 echo -e "\\033[0;39m ]"
101 }
103 # Check if user is root.
104 check_root()
105 {
106 if test $(id -u) != 0 ; then
107 echo -e "\nYou must be root to run `basename $0` with this option."
108 echo -e "Please type 'su' and root password to become super-user.\n"
109 exit 0
110 fi
111 }
113 # Check for a package name on cmdline.
114 check_for_package_on_cmdline()
115 {
116 if [ -z "$PACKAGE" ]; then
117 echo -e "\nYou must specify a package name on the command line."
118 echo -e "Example : tazwok $COMMAND package\n"
119 exit 0
120 fi
121 }
123 # Check for the receipt of a package used to cook.
124 check_for_receipt()
125 {
126 if [ ! -f "$RECEIPT" ]; then
127 echo -e "\nUnable to find the receipt : $RECEIPT\n"
128 exit 0
129 fi
130 }
132 # Check for a specified file list on cmdline.
133 check_for_list()
134 {
135 if [ -z "$LIST" ]; then
136 echo -e "\nPlease specify the path to the list of packages to cook.\n"
137 exit 0
138 fi
139 # Check if the list of packages exist.
140 if [ -f "$LIST" ]; then
141 LIST=`cat $LIST`
142 else
143 echo -e "\nUnable to find $LIST packages list.\n"
144 exit 0
145 fi
146 }
148 # Check for the wanted package if specified in WANTED
149 # receipt variable. Set the $src/$_pkg variable to help compiling
150 # and generating packages.
151 check_for_wanted()
152 {
153 if [ ! "$WANTED" = "" ]; then
154 echo -n "Checking for the wanted package..."
155 if [ ! -d "$WOK/$WANTED" ]; then
156 echo -e "\nWanted package is missing in the work directory.\n"
157 exit 0
158 fi
159 status
160 # Set wanted src path.
161 src=$WOK/$WANTED/$WANTED-$VERSION
162 _pkg=$src/_pkg
163 fi
164 }
166 # Configure and make a package with the receipt.
167 compile_package()
168 {
169 check_for_package_on_cmdline
170 # Include the receipt to get all needed variables and functions
171 # and cd into the work directory to start the work.
172 check_for_receipt
173 . $RECEIPT
174 # Log the package name and date.
175 echo "date `date +%Y%m%d\ \%H:%M:%S`" >> $LOG
176 echo "package $PACKAGE (compile)" >> $LOG
177 # Set wanted $src variable to help compiling.
178 if [ ! "$SOURCE" = "" ]; then
179 src=$WOK/$PACKAGE/$SOURCE-$VERSION
180 else
181 src=$WOK/$PACKAGE/$PACKAGE-$VERSION
182 fi
183 check_for_wanted
184 echo ""
185 echo "Starting to cook $PACKAGE..."
186 echo "================================================================================"
187 # Check for src tarball and wget if needed.
188 if [ ! "$TARBALL" = "" ]; then
189 echo "Checking for source tarball... "
190 if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ]; then
191 cd $SOURCES_REPOSITORY
192 wget $WGET_URL
193 # Exit if download failed to avoid errors.
194 if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ]; then
195 echo -e "\nDownload failed, exiting. Please check WGET_URL variable.\n"
196 exit 1
197 fi
198 else
199 echo -n "Source tarball exit... "
200 status
201 fi
202 # Untaring source if necessary. We dont need to extract source if
203 # the package is build with a wanted source package.
204 if [ "$WANTED" = "" ]; then
205 if [ ! -d $src ]; then
206 # Log process.
207 echo "untaring $TARBALL" >> $LOG
208 echo -n "Untaring $TARBALL... "
209 if [ "`basename $TARBALL | grep tar.bz2`" ]; then
210 tar xjf $SOURCES_REPOSITORY/$TARBALL -C $WOK/$PACKAGE
211 else
212 tar xzf $SOURCES_REPOSITORY/$TARBALL -C $WOK/$PACKAGE
213 fi
214 status
215 else
216 echo -n "Source direcory exit... " && status
217 fi
218 fi
219 fi
220 cd $WOK/$PACKAGE
221 # Log and execute compile_rules function if it exist, to configure and
222 # make the package if it exist.
223 if [ `cat $RECEIPT | grep compile_rules` ]; then
224 echo "executing compile_rules" >> $LOG
225 compile_rules
226 # Exit if compilation failed so the binary package
227 # is not generated when using the cook comand.
228 local CHECK=$?
229 if [ $CHECK = 0 ]; then
230 echo "================================================================================"
231 echo "$PACKAGE compiled on : `date +%Y%m%d\ \%H:%M:%S`"
232 echo ""
233 echo "compilation done : `date +%Y%m%d\ \%H:%M:%S`" >> $LOG
234 else
235 echo "================================================================================"
236 echo "Compilation failed. Please read the compilator output."
237 echo "" && exit 1
238 fi
239 else
240 echo "no compile_rules" >> $LOG
241 echo -e "No compile rules for $PACKAGE...\n"
242 fi
243 }
245 # Creat a package tree and build the gziped cpio archive
246 # to make a SliTaz (.tazpkg) package.
247 gen_package()
248 {
249 check_root
250 check_for_package_on_cmdline
251 check_for_receipt
252 . $RECEIPT
253 check_for_wanted
254 cd $WOK/$PACKAGE
255 # Remove old Tazwok package files.
256 if [ -d "taz" ]; then
257 rm -rf taz
258 rm -f $PACKAGES_REPOSITORY/$PACKAGE-$VERSION.tazpkg
259 fi
260 # Creat the package tree and set usful variables.
261 mkdir -p taz/$PACKAGE-$VERSION/fs
262 fs=taz/$PACKAGE-$VERSION/fs
263 # Set $src for standards package and $_pkg variables.
264 if [ "$WANTED" = "" ]; then
265 src=$WOK/$PACKAGE/$PACKAGE-$VERSION
266 _pkg=$src/_pkg
267 fi
268 if [ ! "$SOURCE" = "" ]; then
269 src=$WOK/$PACKAGE/$SOURCE-$VERSION
270 _pkg=$src/_pkg
271 fi
272 cd $WOK/$PACKAGE
273 # Execute genpkg_rules to build the package.
274 echo ""
275 echo "Bulding $PACKAGE with the receipt..."
276 echo "================================================================================"
277 if [ `cat $RECEIPT | grep genpkg_rules` ]; then
278 # Log process.
279 echo "executing genpkg_rules" >> $LOG
280 genpkg_rules
281 else
282 echo "No package rules to gen $PACKAGE..."
283 fi
284 # Copy the receipt and description (if exist) in
285 # the binary package tree.
286 cd $WOK/$PACKAGE
287 echo -n "Copying the receipt..."
288 cp receipt taz/$PACKAGE-$VERSION
289 status
290 if [ -f "description.txt" ]; then
291 echo -n "Copying the description file..."
292 cp description.txt taz/$PACKAGE-$VERSION
293 status
294 fi
295 # Creat the files.list by redirecting find outpout.
296 echo -n "Creating the list of files..."
297 cd taz/$PACKAGE-$VERSION
298 LAST_FILE=""
299 ( find fs -print; echo ) | while read file; do
300 if [ "$LAST_FILE" != "" ]; then
301 case "$file" in
302 $LAST_FILE/*)
303 case "$(ls -ld "$LAST_FILE")" in
304 drwxr-xr-x\ *\ root\ *\ root\ *);;
305 *) echo ${LAST_FILE#fs};;
306 esac;;
307 *) echo ${LAST_FILE#fs};;
308 esac
309 fi
310 LAST_FILE="$file"
311 done > files.list
312 status
313 # Build cpio archives. Find, cpio and gzip the fs, finish by
314 # removing the fs tree.
315 echo -n "Compressing the fs... "
316 find fs -print | cpio -o -H newc | gzip > fs.cpio.gz && rm -rf fs
317 echo -n "Creating full cpio archive... "
318 find . -print | cpio -o -H newc > $PACKAGES_REPOSITORY/$PACKAGE-$VERSION.tazpkg
319 # Restore package tree in case we want to browse it.
320 echo -n "Restoring original package tree... "
321 zcat fs.cpio.gz | cpio -id
322 rm fs.cpio.gz && cd ..
323 # Log process.
324 echo "$PACKAGE-$VERSION.tazpkg (done)" >> $LOG
325 echo "================================================================================"
326 echo "Package $PACKAGE ($VERSION) generated."
327 echo "Size : `du -sh $PACKAGES_REPOSITORY/$PACKAGE-$VERSION.tazpkg`"
328 echo ""
329 }
331 ###################
332 # Tazwok commands #
333 ###################
335 case "$COMMAND" in
336 stats)
337 # Tazwok general statistics from the config file the wok.
338 #
339 echo ""
340 echo -e "\033[1mTazwok configuration statistics\033[0m
341 ================================================================================
342 Wok directory : $WOK
343 Packages repository : $PACKAGES_REPOSITORY
344 Sources repository : $SOURCES_REPOSITORY
345 Packages in the wok : `ls -1 $WOK | wc -l`
346 Cooked packages : `ls -1 $PACKAGES_REPOSITORY/*.tazpkg 2>/dev/null | wc -l`
347 ================================================================================"
348 echo ""
349 ;;
350 list)
351 # List packages in wok directory. User can specifiy a category
352 #
353 if [ "$2" = "category" ]; then
354 echo -e "\033[1m\nPackages categories :\033[0m $CATEGORIES\n"
355 exit 0
356 fi
357 # Check for an asked category.
358 if [ -n "$2" ]; then
359 ASKED_CATEGORY=$2
360 echo ""
361 echo -e "\033[1mPackages in category :\033[0m $ASKED_CATEGORY"
362 echo "================================================================================"
363 for pkg in $WOK/*
364 do
365 . $pkg/receipt
366 if [ "$CATEGORY" == "$ASKED_CATEGORY" ]; then
367 echo -n "$PACKAGE"
368 echo -e "\033[24G $VERSION"
369 packages=$(($packages+1))
370 fi
371 done
372 echo "================================================================================"
373 echo -e "$packages packages in category $ASKED_CATEGORY.\n"
374 else
375 # By default list all packages and version.
376 echo ""
377 echo -e "\033[1mList of packages in the wok\033[0m"
378 echo "================================================================================"
379 for pkg in $WOK/*
380 do
381 . $pkg/receipt
382 echo -n "$PACKAGE"
383 echo -en "\033[24G $VERSION"
384 echo -e "\033[42G $CATEGORY"
385 packages=$(($packages+1))
386 done
387 echo "================================================================================"
388 echo -e "$packages packages avalaible in the wok.\n"
389 fi
390 ;;
391 info)
392 # Informations about package.
393 #
394 check_for_package_on_cmdline
395 check_for_receipt
396 . $WOK/$PACKAGE/receipt
397 echo ""
398 echo -e "\033[1mTazwok package informations\033[0m
399 ================================================================================
400 Package : $PACKAGE
401 Version : $VERSION
402 Category : $CATEGORY
403 Short desc : $SHORT_DESC
404 Maintainer : $MAINTAINER"
405 if [ ! "$WEB_SITE" = "" ]; then
406 echo "Web site : $WEB_SITE"
407 fi
408 if [ ! "$DEPENDS" = "" ]; then
409 echo "Depends : $DEPENDS"
410 fi
411 if [ ! "$WANTED" = "" ]; then
412 echo "Wanted src : $WANTED"
413 fi
414 echo "================================================================================"
415 echo ""
417 ;;
418 check-log)
419 # We just cat the file log to view process info.
420 #
421 if [ ! -f "$LOG" ]; then
422 echo -e "\nNo process log found. The package is probably not cook.\n"
423 exit 0
424 else
425 echo ""
426 echo -e "\033[1mPackage process log for :\033[0m $PACKAGE"
427 echo "================================================================================"
428 cat $LOG
429 echo "================================================================================"
430 echo ""
431 fi
432 ;;
433 search)
434 # Search for a package by pattern or name.
435 #
436 if [ -z "$2" ]; then
437 echo -e "\nPlease specify a pattern or a package name to search."
438 echo -e "Example : 'tazwok search gcc'.\n"
439 exit 0
440 fi
441 echo ""
442 echo -e "\033[1mSearch result for :\033[0m $2"
443 echo "================================================================================"
444 list=`ls -1 $WOK | grep $2`
445 for pkg in $list
446 do
447 . $WOK/$pkg/receipt
448 echo -n "$PACKAGE "
449 echo -en "\033[24G $VERSION"
450 echo -e "\033[42G $CATEGORY"
451 packages=$(($packages+1))
452 done
453 echo "================================================================================"
454 echo "$packages packages found for : $2"
455 echo ""
456 ;;
457 compile)
458 # Configure and make a package with the receipt.
459 #
460 compile_package
461 ;;
462 genpkg)
463 # Generate a package
464 #
465 gen_package
466 ;;
467 cook)
468 # Compile and generate a package. Just execute tazwok with
469 # the good commands.
470 #
471 check_root
472 compile_package
473 gen_package
474 ;;
475 cook-list)
476 # Cook all packages listed in a file. The path to the cooklist must
477 # be specified on the cmdline.
478 #
479 check_root
480 check_for_list
481 for pkg in $LIST
482 do
483 tazwok compile $pkg
484 tazwok genpkg $pkg
485 done
486 ;;
487 clean)
488 # Clean up a package work directory.
489 #
490 check_for_package_on_cmdline
491 check_for_receipt
492 . $RECEIPT
493 cd $WOK/$PACKAGE
494 echo ""
495 echo "Cleaning $PACKAGE..."
496 echo "================================================================================"
497 if [ -d "taz" ]; then
498 echo -n "Removing taz files..."
499 rm -rf taz && status
500 fi
501 # Remove source tree if exist.
502 if [ -d "$PACKAGE-$VERSION" ]; then
503 echo -n "Removing source files..."
504 rm -rf $PACKAGE-$VERSION && status
505 fi
506 if [ -d "$SOURCE-$VERSION" ]; then
507 echo -n "Removing source files..."
508 rm -rf $SOURCE-$VERSION && status
509 fi
510 # Remove an envental $PACKAGE-build directory.
511 if [ -d "$PACKAGE-build" ]; then
512 echo -n "Removing build tree..."
513 rm -rf $PACKAGE-build && status
514 fi
515 # Remove process log file.
516 if [ -f "process.log" ]; then
517 echo -n "Removing process log file..."
518 rm process.log && status
519 fi
520 echo "$PACKAGE is clean. You can cook it again..."
521 echo ""
522 ;;
523 gen-clean-wok)
524 # Generate a clean wok from the current wok by copying all receipt
525 # and stuff directory.
526 #
527 if [ -z "$2" ]; then
528 echo -e "\nPlease specify the destination for the new clean wok.\n"
529 exit 0
530 else
531 dest=$2
532 mkdir -p $dest
533 fi
534 echo "New wok is going to : $dest"
535 for pkg in `ls -1 $WOK`
536 do
537 echo "----"
538 echo -n "Preparing $pkg..."
539 mkdir -p $dest/$pkg
540 status
541 echo -n "Copying the receipt..."
542 cp -a $WOK/$pkg/receipt $dest/$pkg
543 status
544 if [ -d "$WOK/$pkg/stuff" ]; then
545 echo -n "Copying all the stuff directory..."
546 cp -a $WOK/$pkg/stuff $dest/$pkg
547 status
548 fi
549 done
550 echo "================================================================================"
551 echo "Clean wok generated in : $dest"
552 echo "Packages cleaned : `ls -1 $dest | wc -l`"
553 echo ""
554 ;;
555 clean-wok)
556 # Clean all packages in the work directory
557 #
558 for pkg in `ls -1 $WOK`
559 do
560 tazwok clean $pkg
561 done
562 echo "================================================================================"
563 echo "`ls -1 $WOK | wc -l` packages cleaned."
564 echo ""
565 ;;
566 gen-list)
567 # cd in the directory to creat a packages.list and the md5sum file.
568 # Sed is used to remove all the .tazpkg extensions from the
569 # packages.list. The directory to move in by default is the repository
570 # if $3 is not empty cd into $3.
571 #
572 if [ -z "$2" ]; then
573 PACKAGES_REPOSITORY=$PACKAGES_REPOSITORY
574 else
575 if [ -d "$2" ]; then
576 PACKAGES_REPOSITORY=$2
577 else
578 echo -e "\nUnable to find directory : $2\n"
579 exit 0
580 fi
581 fi
582 cd $PACKAGES_REPOSITORY
583 # Remove old packages.list and md5sum, it well be soon rebuild.
584 rm -f packages.list packages.md5
585 echo ""
586 echo "Repository path : $PACKAGES_REPOSITORY"
587 echo -n "Creating the packages list... "
588 ls -1 > /tmp/packages.list
589 sed -i s/'.tazpkg'/''/ /tmp/packages.list
590 status
591 echo -n "Building the md5sum for all packages... "
592 md5sum * > packages.md5
593 status
594 mv /tmp/packages.list $PACKAGES_REPOSITORY
595 echo "================================================================================"
596 pkgs=`cat $PACKAGES_REPOSITORY/packages.list | wc -l`
597 echo "$pkgs packages in the repository."
598 echo ""
599 ;;
600 new-tree)
601 # Just creat a few directories and gen a empty receipt to prepare
602 # the creation of a new package.
603 #
604 check_for_package_on_cmdline
605 if [ -d $WOK/$PACKAGE ]; then
606 echo -e "\n$PACKAGE package tree already exist.\n"
607 exit 0
608 fi
609 echo "Creating : $WOK/$PACKAGE"
610 mkdir $WOK/$PACKAGE
611 cd $WOK/$PACKAGE
612 echo -n "Preparing the receipt..."
613 #
614 # Default receipt begin.
615 #
616 echo "# SliTaz package receipt." > receipt
617 echo "" >> receipt
618 echo "PACKAGE=\"$PACKAGE\"" >> receipt
619 # Finish the empty receipt.
620 cat >> receipt << "EOF"
621 VERSION=""
622 CATEGORY=""
623 SHORT_DESC=""
624 MAINTAINER=""
625 DEPENDS=""
626 TARBALL="$PACKAGE-$VERSION.tar.gz"
627 WEB_SITE=""
628 WGET_URL=""
630 # Rules to configure and make the package.
631 compile_rules()
632 {
633 cd $src
634 ./configure --prefix=/usr --infodir=/usr/share/info \
635 --mandir=/usr/share/man $CONFIGURE_ARGS
636 make
637 make DESTDIR=$PWD/_pkg install
638 }
640 # Rules to gen a SliTaz package suitable for Tazpkg.
641 genpkg_rules()
642 {
643 mkdir -p $fs/usr
644 cp -a $_pkg/usr/bin $fs/usr
645 strip -s $fs/usr/bin/*
646 }
648 EOF
649 #
650 # Default receipt end.
651 #
652 status
653 # Interactive mode, asking and seding.
654 if [ "$3" = "--interactive" ]; then
655 echo "Entering in interactive mode..."
656 echo "================================================================================"
657 echo "Package : $PACKAGE"
658 # Version.
659 echo -n "Version : " ; read anser
660 sed -i s/'VERSION=\"\"'/"VERSION=\"$anser\""/ receipt
661 # Category.
662 echo -n "Category : " ; read anser
663 sed -i s/'CATEGORY=\"\"'/"CATEGORY=\"$anser\""/ receipt
664 # Short description.
665 echo -n "Short desc : " ; read anser
666 sed -i s/'SHORT_DESC=\"\"'/"SHORT_DESC=\"$anser\""/ receipt
667 # Maintainer.
668 echo -n "Maintainer : " ; read anser
669 sed -i s/'MAINTAINER=\"\"'/"MAINTAINER=\"$anser\""/ receipt
670 # Web site.
671 echo -n "Web site : " ; read anser
672 sed -i s#'WEB_SITE=\"\"'#"WEB_SITE=\"$anser\""# receipt
673 echo ""
674 # Wget URL.
675 echo "Wget URL to download source tarball."
676 echo "Example : \$GNU_MIRROR/\$PACKAGE/\$TARBALL"
677 echo -n "Wget url : " ; read anser
678 sed -i s#'WGET_URL=\"\"'#"WGET_URL=\"$anser\""# receipt
679 # Ask for a stuff dir.
680 echo -n "Do you need a stuff directory ? (y/N) : " ; read anser
681 if [ "$anser" = "y" ]; then
682 echo -n "Creating the stuff directory..."
683 mkdir stuff && status
684 fi
685 # Ask for a description file.
686 echo -n "Are you going to write a description ? (y/N) : " ; read anser
687 if [ "$anser" = "y" ]; then
688 echo -n "Creating the description.txt file..."
689 echo "" > description.txt && status
690 fi
691 echo "================================================================================"
692 echo ""
693 fi
694 ;;
695 remove)
696 # Remove a package from the wok.
697 #
698 check_for_package_on_cmdline
699 echo ""
700 echo -n "Removing $PACKAGE..."
701 rm -rf $WOK/$PACKAGE && status
702 echo ""
703 ;;
704 usage|*)
705 # Print usage also for all unknow commands.
706 #
707 usage
708 ;;
709 esac
711 exit 0