tazwok view tazwok @ rev 14

fix: remove fs.cpio.gz
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Dec 15 11:06:52 2007 +0000 (2007-12-15)
parents 6389ab247fd9
children d8154d33d3e2
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/fs
298 ALL_FILES="$(find . -print)"
299 LAST_FILE=""
300 FILES_LIST=""
301 for i in $FILES_LIST; do
302 if [ "$LAST_FILE" != "" ]; then
303 case "$i" in
304 $LAST_FILE/*)
305 case "$(ls -ld \"$LAST_FILE\")" in
306 drwxr-xr-x\ *\ root\ root\ *);;
307 *) FILES_LIST="$FILES_LIST '${LAST_FILE#fs}'";;
308 esac;;
309 *) FILES_LIST="$FILES_LIST '${LAST_FILE#fs}'";;
310 esac
311 fi
312 LAST_FILE=$i
313 done
314 FILES_LIST="$FILES_LIST '${LAST_FILE#fs}'"
315 cd ..
316 eval 'for i in' $FILES_LIST '; do echo $i; done' > ../files.list
317 status
318 # Build cpio archives. Find, cpio and gzip the fs, finish by
319 # removing the fs tree.
320 echo -n "Compressing the fs... "
321 find fs -print | cpio -o -H newc | gzip > fs.cpio.gz && rm -rf fs
322 echo -n "Creating full cpio archive... "
323 find . -print | cpio -o -H newc > $PACKAGES_REPOSITORY/$PACKAGE-$VERSION.tazpkg
324 # Restore package tree in case we want to browse it.
325 echo -n "Restoring original package tree... "
326 zcat fs.cpio.gz | cpio -id
327 rm fs.cpio.gz && cd ..
328 # Log process.
329 echo "$PACKAGE-$VERSION.tazpkg (done)" >> $LOG
330 echo "================================================================================"
331 echo "Package $PACKAGE ($VERSION) generated."
332 echo "Size : `du -sh $PACKAGES_REPOSITORY/$PACKAGE-$VERSION.tazpkg`"
333 echo ""
334 }
336 ###################
337 # Tazwok commands #
338 ###################
340 case "$COMMAND" in
341 stats)
342 # Tazwok general statistics from the config file the wok.
343 #
344 echo ""
345 echo -e "\033[1mTazwok configuration statistics\033[0m
346 ================================================================================
347 Wok directory : $WOK
348 Packages repository : $PACKAGES_REPOSITORY
349 Sources repository : $SOURCES_REPOSITORY
350 Packages in the wok : `ls -1 $WOK | wc -l`
351 Cooked packages : `ls -1 $PACKAGES_REPOSITORY/*.tazpkg | wc -l`
352 ================================================================================"
353 echo ""
354 ;;
355 list)
356 # List packages in wok directory. User can specifiy a category
357 #
358 if [ "$2" = "category" ]; then
359 echo -e "\033[1m\nPackages categories :\033[0m $CATEGORIES\n"
360 exit 0
361 fi
362 # Check for an asked category.
363 if [ -n "$2" ]; then
364 ASKED_CATEGORY=$2
365 echo ""
366 echo -e "\033[1mPackages in category :\033[0m $ASKED_CATEGORY"
367 echo "================================================================================"
368 for pkg in $WOK/*
369 do
370 . $pkg/receipt
371 if [ "$CATEGORY" == "$ASKED_CATEGORY" ]; then
372 echo -n "$PACKAGE"
373 echo -e "\033[24G $VERSION"
374 packages=$(($packages+1))
375 fi
376 done
377 echo "================================================================================"
378 echo -e "$packages packages in category $ASKED_CATEGORY.\n"
379 else
380 # By default list all packages and version.
381 echo ""
382 echo -e "\033[1mList of packages in the wok\033[0m"
383 echo "================================================================================"
384 for pkg in $WOK/*
385 do
386 . $pkg/receipt
387 echo -n "$PACKAGE"
388 echo -en "\033[24G $VERSION"
389 echo -e "\033[42G $CATEGORY"
390 packages=$(($packages+1))
391 done
392 echo "================================================================================"
393 echo -e "$packages packages avalaible in the wok.\n"
394 fi
395 ;;
396 info)
397 # Informations about package.
398 #
399 check_for_package_on_cmdline
400 check_for_receipt
401 . $WOK/$PACKAGE/receipt
402 echo ""
403 echo -e "\033[1mTazwok package informations\033[0m
404 ================================================================================
405 Package : $PACKAGE
406 Version : $VERSION
407 Category : $CATEGORY
408 Short desc : $SHORT_DESC
409 Maintainer : $MAINTAINER"
410 if [ ! "$WEB_SITE" = "" ]; then
411 echo "Web site : $WEB_SITE"
412 fi
413 if [ ! "$DEPENDS" = "" ]; then
414 echo "Depends : $DEPENDS"
415 fi
416 if [ ! "$WANTED" = "" ]; then
417 echo "Wanted src : $WANTED"
418 fi
419 echo "================================================================================"
420 echo ""
422 ;;
423 check-log)
424 # We just cat the file log to view process info.
425 #
426 if [ ! -f "$LOG" ]; then
427 echo -e "\nNo process log found. The package is probably not cook.\n"
428 exit 0
429 else
430 echo ""
431 echo -e "\033[1mPackage process log for :\033[0m $PACKAGE"
432 echo "================================================================================"
433 cat $LOG
434 echo "================================================================================"
435 echo ""
436 fi
437 ;;
438 search)
439 # Search for a package by pattern or name.
440 #
441 if [ -z "$2" ]; then
442 echo -e "\nPlease specify a pattern or a package name to search."
443 echo -e "Example : 'tazwok search gcc'.\n"
444 exit 0
445 fi
446 echo ""
447 echo -e "\033[1mSearch result for :\033[0m $2"
448 echo "================================================================================"
449 list=`ls -1 $WOK | grep $2`
450 for pkg in $list
451 do
452 . $WOK/$pkg/receipt
453 echo -n "$PACKAGE "
454 echo -en "\033[24G $VERSION"
455 echo -e "\033[42G $CATEGORY"
456 packages=$(($packages+1))
457 done
458 echo "================================================================================"
459 echo "$packages packages found for : $2"
460 echo ""
461 ;;
462 compile)
463 # Configure and make a package with the receipt.
464 #
465 compile_package
466 ;;
467 genpkg)
468 # Generate a package
469 #
470 gen_package
471 ;;
472 cook)
473 # Compile and generate a package. Just execute tazwok with
474 # the good commands.
475 #
476 check_root
477 compile_package
478 gen_package
479 ;;
480 cook-list)
481 # Cook all packages listed in a file. The path to the cooklist must
482 # be specified on the cmdline.
483 #
484 check_root
485 check_for_list
486 for pkg in $LIST
487 do
488 tazwok compile $pkg
489 tazwok genpkg $pkg
490 done
491 ;;
492 clean)
493 # Clean up a package work directory.
494 #
495 check_for_package_on_cmdline
496 check_for_receipt
497 . $RECEIPT
498 cd $WOK/$PACKAGE
499 echo ""
500 echo "Cleaning $PACKAGE..."
501 echo "================================================================================"
502 if [ -d "taz" ]; then
503 echo -n "Removing taz files..."
504 rm -rf taz && status
505 fi
506 # Remove source tree if exist.
507 if [ -d "$PACKAGE-$VERSION" ]; then
508 echo -n "Removing source files..."
509 rm -rf $PACKAGE-$VERSION && status
510 fi
511 if [ -d "$SOURCE-$VERSION" ]; then
512 echo -n "Removing source files..."
513 rm -rf $SOURCE-$VERSION && status
514 fi
515 # Remove an envental $PACKAGE-build directory.
516 if [ -d "$PACKAGE-build" ]; then
517 echo -n "Removing build tree..."
518 rm -rf $PACKAGE-build && status
519 fi
520 # Remove process log file.
521 if [ -f "process.log" ]; then
522 echo -n "Removing process log file..."
523 rm process.log && status
524 fi
525 echo "$PACKAGE is clean. You can cook it again..."
526 echo ""
527 ;;
528 gen-clean-wok)
529 # Generate a clean wok from the current wok by copying all receipt
530 # and stuff directory.
531 #
532 if [ -z "$2" ]; then
533 echo -e "\nPlease specify the destination for the new clean wok.\n"
534 exit 0
535 else
536 dest=$2
537 mkdir -p $dest
538 fi
539 echo "New wok is going to : $dest"
540 for pkg in `ls -1 $WOK`
541 do
542 echo "----"
543 echo -n "Preparing $pkg..."
544 mkdir -p $dest/$pkg
545 status
546 echo -n "Copying the receipt..."
547 cp -a $WOK/$pkg/receipt $dest/$pkg
548 status
549 if [ -d "$WOK/$pkg/stuff" ]; then
550 echo -n "Copying all the stuff directory..."
551 cp -a $WOK/$pkg/stuff $dest/$pkg
552 status
553 fi
554 done
555 echo "================================================================================"
556 echo "Clean wok generated in : $dest"
557 echo "Packages cleaned : `ls -1 $dest | wc -l`"
558 echo ""
559 ;;
560 clean-wok)
561 # Clean all packages in the work directory
562 #
563 for pkg in `ls -1 $WOK`
564 do
565 tazwok clean $pkg
566 done
567 echo "================================================================================"
568 echo "`ls -1 $WOK | wc -l` packages cleaned."
569 echo ""
570 ;;
571 gen-list)
572 # cd in the directory to creat a packages.list and the md5sum file.
573 # Sed is used to remove all the .tazpkg extensions from the
574 # packages.list. The directory to move in by default is the repository
575 # if $3 is not empty cd into $3.
576 #
577 if [ -z "$2" ]; then
578 PACKAGES_REPOSITORY=$PACKAGES_REPOSITORY
579 else
580 if [ -d "$2" ]; then
581 PACKAGES_REPOSITORY=$2
582 else
583 echo -e "\nUnable to find directory : $2\n"
584 exit 0
585 fi
586 fi
587 cd $PACKAGES_REPOSITORY
588 # Remove old packages.list and md5sum, it well be soon rebuild.
589 rm -f packages.list packages.md5
590 echo ""
591 echo "Repository path : $PACKAGES_REPOSITORY"
592 echo -n "Creating the packages list... "
593 ls -1 > /tmp/packages.list
594 sed -i s/'.tazpkg'/''/ /tmp/packages.list
595 status
596 echo -n "Building the md5sum for all packages... "
597 md5sum * > packages.md5
598 status
599 mv /tmp/packages.list $PACKAGES_REPOSITORY
600 echo "================================================================================"
601 pkgs=`cat $PACKAGES_REPOSITORY/packages.list | wc -l`
602 echo "$pkgs packages in the repository."
603 echo ""
604 ;;
605 new-tree)
606 # Just creat a few directories and gen a empty receipt to prepare
607 # the creation of a new package.
608 #
609 check_for_package_on_cmdline
610 if [ -d $WOK/$PACKAGE ]; then
611 echo -e "\n$PACKAGE package tree already exist.\n"
612 exit 0
613 fi
614 echo "Creating : $WOK/$PACKAGE"
615 mkdir $WOK/$PACKAGE
616 cd $WOK/$PACKAGE
617 echo -n "Preparing the receipt..."
618 #
619 # Default receipt begin.
620 #
621 echo "# SliTaz package receipt." > receipt
622 echo "" >> receipt
623 echo "PACKAGE=\"$PACKAGE\"" >> receipt
624 # Finish the empty receipt.
625 cat >> receipt << "EOF"
626 VERSION=""
627 CATEGORY=""
628 SHORT_DESC=""
629 MAINTAINER=""
630 DEPENDS=""
631 TARBALL="$PACKAGE-$VERSION.tar.gz"
632 WEB_SITE=""
633 WGET_URL=""
635 # Rules to configure and make the package.
636 compile_rules()
637 {
638 cd $src
639 ./configure --prefix=/usr --infodir=/usr/share/info \
640 --mandir=/usr/share/man $CONFIGURE_ARGS
641 make
642 make DESTDIR=$PWD/_pkg install
643 }
645 # Rules to gen a SliTaz package suitable for Tazpkg.
646 genpkg_rules()
647 {
648 mkdir -p $fs/usr
649 cp -a $_pkg/usr/bin $fs/usr
650 strip -s $fs/usr/bin/*
651 }
653 EOF
654 #
655 # Default receipt end.
656 #
657 status
658 # Interactive mode, asking and seding.
659 if [ "$3" = "--interactive" ]; then
660 echo "Entering in interactive mode..."
661 echo "================================================================================"
662 echo "Package : $PACKAGE"
663 # Version.
664 echo -n "Version : " ; read anser
665 sed -i s/'VERSION=\"\"'/"VERSION=\"$anser\""/ receipt
666 # Category.
667 echo -n "Category : " ; read anser
668 sed -i s/'CATEGORY=\"\"'/"CATEGORY=\"$anser\""/ receipt
669 # Short description.
670 echo -n "Short desc : " ; read anser
671 sed -i s/'SHORT_DESC=\"\"'/"SHORT_DESC=\"$anser\""/ receipt
672 # Maintainer.
673 echo -n "Maintainer : " ; read anser
674 sed -i s/'MAINTAINER=\"\"'/"MAINTAINER=\"$anser\""/ receipt
675 # Web site.
676 echo -n "Web site : " ; read anser
677 sed -i s#'WEB_SITE=\"\"'#"WEB_SITE=\"$anser\""# receipt
678 echo ""
679 # Wget URL.
680 echo "Wget URL to download source tarball."
681 echo "Example : \$GNU_MIRROR/\$PACKAGE/\$TARBALL"
682 echo -n "Wget url : " ; read anser
683 sed -i s#'WGET_URL=\"\"'#"WGET_URL=\"$anser\""# receipt
684 # Ask for a stuff dir.
685 echo -n "Do you need a stuff directory ? (y/N) : " ; read anser
686 if [ "$anser" = "y" ]; then
687 echo -n "Creating the stuff directory..."
688 mkdir stuff && status
689 fi
690 # Ask for a description file.
691 echo -n "Are you going to write a description ? (y/N) : " ; read anser
692 if [ "$anser" = "y" ]; then
693 echo -n "Creating the description.txt file..."
694 echo "" > description.txt && status
695 fi
696 echo "================================================================================"
697 echo ""
698 fi
699 ;;
700 remove)
701 # Remove a package from the wok.
702 #
703 check_for_package_on_cmdline
704 echo ""
705 echo -n "Removing $PACKAGE..."
706 rm -rf $WOK/$PACKAGE && status
707 echo ""
708 ;;
709 usage|*)
710 # Print usage also for all unknow commands.
711 #
712 usage
713 ;;
714 esac
716 exit 0