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 7 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=
cfgtmpdir=
profile=
target=
show_usage() {
echo
echo "Usage: $0 [ -delete | -oldconfig ] [ -cfg <config> ]"
echo "Usage: $0 [ -delete | -oldconfig | -t <target> ] [ -cfg <config> ]"
echo
echo "Other options:"
echo " -profile create a config.profile with profiling data"
@ -52,6 +53,7 @@ while [ "$1" ] ; do
-oldconfig) oldconfig='-oldconfig' ; shift ;;
-nobashmod) nobashmod='-nobashmod' ; shift ;;
-cfg) config="$2" ; shift ; shift ;;
-t) target="$2" ; shift ; shift ;;
*) show_usage
exit 1 ;;
@ -69,6 +71,22 @@ if [ ! -d config/$config -a -n "$oldconfig" ]; then
exit 1
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
rm -rv config/$config
exit $?

Loading…
Cancel
Save