tazwok view tazwok @ rev 19

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