Browse Source

Config: add -t option to create new configs for a given target

Signed-off-by: Alejandro Mery <amery@geeks.cl>
stable/0.6
Alejandro Mery 10 years ago
parent
commit
d8854f53dc
1 changed files with 19 additions and 1 deletions
  1. +19
    -1
      scripts/Config

+ 19
- 1
scripts/Config

@ -33,10 +33,11 @@ oldconfig=
nobashmod= nobashmod=
cfgtmpdir= cfgtmpdir=
profile= profile=
target=
show_usage() { show_usage() {
echo echo
echo "Usage: $0 [ -delete | -oldconfig ] [ -cfg <config> ]"
echo "Usage: $0 [ -delete | -oldconfig | -t <target> ] [ -cfg <config> ]"
echo echo
echo "Other options:" echo "Other options:"
echo " -profile create a config.profile with profiling data" echo " -profile create a config.profile with profiling data"
@ -52,6 +53,7 @@ while [ "$1" ] ; do
-oldconfig) oldconfig='-oldconfig' ; shift ;; -oldconfig) oldconfig='-oldconfig' ; shift ;;
-nobashmod) nobashmod='-nobashmod' ; shift ;; -nobashmod) nobashmod='-nobashmod' ; shift ;;
-cfg) config="$2" ; shift ; shift ;; -cfg) config="$2" ; shift ; shift ;;
-t) target="$2" ; shift ; shift ;;
*) show_usage *) show_usage
exit 1 ;; exit 1 ;;
@ -69,6 +71,22 @@ if [ ! -d config/$config -a -n "$oldconfig" ]; then
exit 1 exit 1
fi fi
if [ -n "$target" ]; then
if [ -d "config/$config" ]; then
echo "Abort: -t is not supported for old configs"
echo
exit 1
elif [ ! -s "target/$target/config.in" ]; then
echo "Abort: $target: target doesn't exist"
echo
exit 1
else
mkdir "config/$config"
echo "export SDECFG_TARGET='$target'" > config/$config/config
oldconfig="-oldconfig"
fi
fi
if [ $delete_mode = 1 ] ; then if [ $delete_mode = 1 ] ; then
rm -rv config/$config rm -rv config/$config
exit $? exit $?

Loading…
Cancel
Save