Skip to content

Commit ac00ff3

Browse files
committed
add usage script for select parameter for configure.
1 parent 398e3fd commit ac00ff3

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

bashrc/iconfig/build/Ask.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
#
3+
# Ask a question and return the answer
4+
5+
QUESTION=$1
6+
PARM=$2
7+
TEXT_FILE=$3
8+
while :; do
9+
echo -n "${QUESTION} [${PARM}] " >/dev/tty
10+
read ANSWER
11+
if [ "${ANSWER}" = "" ]; then
12+
break
13+
elif [ "${ANSWER}" = "?" ]; then
14+
cat build/${TEXT_FILE} >/dev/tty
15+
else
16+
echo ${ANSWER}
17+
break
18+
fi
19+
done
20+

bashrc/iconfig/build/prefix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
This is the base directory used for installation.
3+
System administrators would rather install softwares that are added to
4+
an already existing system into /usr/local, since /usr is sometimes
5+
mounted read-only.
6+
/usr/local is the default answer here.
7+

bashrc/iconfig/build/yesterday

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
The sa2 shell script uses a daily data file to create a daily report.
3+
By default it uses current daily data file (that is to say
4+
the daily data file created today).
5+
Yet it may be sometimes useful to tell it to use the daily data file
6+
of the day before (that is to say the one created yesterday), for
7+
example if sa2 is started at, say, 02:00 AM. In this case, answer y.
8+

bashrc/iconfig/iconfig

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
#@(#) Configuration script for sysstat
3+
# (C) 2000-2014 Sebastien GODARD (sysstat <at> orange.fr)
4+
5+
ASK="sh build/Ask.sh"
6+
7+
echo ; echo
8+
echo Welcome to sysstat\'s Interactive Configuration script!
9+
echo
10+
echo This script enables you to set the parameters value used by ./configure.
11+
echo Please enter the value for the parameters listed below.
12+
echo Press Return to tell ./configure to use the default value or to try to guess the proper one.
13+
echo "Defaut value for yes/no questions is no (parameter is NOT set)."
14+
echo You can enter a ? to display a help message at any time...
15+
echo
16+
17+
# Syntax: Ask <QUESTION> <PARM> <TEXT_FILE>
18+
19+
# Installation directory
20+
PREFIX=`${ASK} 'Installation directory:' "--prefix" "prefix"`
21+
if [ "${PREFIX}" != "" ]; then
22+
PREFIX="--prefix=${PREFIX} "
23+
fi
24+
25+
# sa2 processes data file of the day before
26+
YESTERDAY=`${ASK} 'sa2 uses daily data file of the day before? (y/n)' "--enable-yesterday" "yesterday"`
27+
if [ "${YESTERDAY}" = "y" ]; then
28+
YESTERDAY="--enable-yesterday "
29+
else
30+
YESTERDAY=""
31+
echo "Parameter --enable-yesterday is NOT set"
32+
fi
33+
34+
#echo
35+
#echo "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
36+
#${YESTERDAY}${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_MAN}${CRON}${RCDIR} \
37+
#${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}${STRIP}${COPY_ONLY}"
38+
#echo
39+
#
40+
#./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
41+
#${YESTERDAY}${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_MAN}${CRON}${RCDIR} \
42+
#${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}${STRIP}${COPY_ONLY}
43+

0 commit comments

Comments
 (0)