View previous topic :: View next topic |
Author |
Message |
ElAngelo
Joined: 10 Aug 2005 Posts: 77
|
Posted: Wed Jan 11, 2006 8:55 am Post subject: script to make new modules |
|
|
As building modules is sometimes boring (especially building the DETAILS file), i'm working on a interactive script that creates at least the DETAILS file for me
this is not finished yet
only try if you want to code yourself a bit
Code: |
#!/bin/bash
USER=`whoami`
if [ $USER = "root" ]
then
echo "you want to create this module in zlocal? y/n"
read ANSWER
case "$ANSWER" in
y )
cd /var/lib/lunar/moonbase/zlocal
;;
n )
echo "module will be build in current directory"
echo "testing will be impossible"
;;
esac
else
echo "module will be build in current directory"
echo "testing will be impossible"
echo "if you want to enable testing you should run this script as root"
fi
echo "name of new module?"
read MODULE
echo "new module is: $MODULE"
mkdir $MODULE
cd $MODULE
touch DETAILS
echo " MODULE=$MODULE" >> DETAILS
echo "version?"
read VERSION
echo "version of the module is: $VERSION"
echo " VERSION=$VERSION" >> DETAILS
echo "source name, choose option by number"
echo "1. $MODULE-$VERSION.tar.gz"
echo "2. $MODULE-$VERSION.tar.bz2"
echo "3. $MODULE"_"$VERSION.tar.gz"
echo "4. $MODULE"_"$VERSION.tar.bz2"
echo "5. other"
read SOURCE_TYPE
case "$SOURCE_TYPE" in
1 )
echo " SOURCE=\$MODULE-\$VERSION.tar.gz" >> DETAILS
SOURCE=$MODULE-$VERSION.tar.gz
;;
2 )
echo " SOURCE=\$MODULE-\$VERSION.tar.bz2" >> DETAILS
SOURCE=$MODULE-$VERSION.tar.bz2
;;
3 )
echo " SOURCE=\$MODULE_\$VERSION.tar.gz" >> DETAILS
SOURCE=$MODULE_$VERSION.tar.gz
;;
4 )
echo " SOURCE=\$MODULE_\$VERSION.tar.bz2z" >> DETAILS
SOURCE=$MODULE_$VERSION.tar.bz2
;;
5 )
echo "please provide the full source filename"
read SOURCE
echo " SOURCE=$SOURCE" >> DETAILS
;;
esac
|
|
|
Back to top |
|
 |
sofar

Joined: 11 Aug 2005 Posts: 172
|
Posted: Thu Jan 12, 2006 7:17 pm Post subject: bug |
|
|
Code: | SOURCE=$MODULE_$VERSION.tar.gz |
this is wrong, since bash things you are referring to $MOUDULE_ and not $MODULE (note the trailing underscore is a VALID character for a module)
use:
Code: | SOURCE=${MODULE}_$VERSION.tar.gz |
instead |
|
Back to top |
|
 |
|