summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-01-31 14:57:22 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-01-31 14:57:22 (GMT)
commit3fb046353628229bb16fb0cacb11316b1d9534e7 (patch)
treea2c8c85a02cc19a6ced4410e9300044a49092d20
parented19d3f919d7cc2988efe86a862f94582eaf7ce5 (diff)
scripts: add action to dump current configuration in humane-readable form
-rw-r--r--ct-ng.comp2
-rw-r--r--samples/samples.mk5
-rwxr-xr-xscripts/showSamples.sh23
3 files changed, 21 insertions, 9 deletions
diff --git a/ct-ng.comp b/ct-ng.comp
index d2c7124..e14b48e 100644
--- a/ct-ng.comp
+++ b/ct-ng.comp
@@ -16,7 +16,7 @@ _ct-ng () {
actions='help menuconfig oldconfig saveconfig
build build. build-all build-all.
- list-samples list-steps show-tuple show-all
+ list-samples list-steps show-tuple show-all show-config
clean distclean wiki-samples updatetools
tarball version'
diff --git a/samples/samples.mk b/samples/samples.mk
index a67a0ad..76023e9 100644
--- a/samples/samples.mk
+++ b/samples/samples.mk
@@ -36,6 +36,11 @@ help-env::
# ----------------------------------------------------------
# This part deals with printing samples information
+# Print the details of current configuration
+PHONY += show-config
+show-config: .config
+ @$(CT_LIB_DIR)/scripts/showSamples.sh -v current
+
# Prints the details of a sample
PHONY += $(patsubst %,show-%,$(CT_SAMPLES))
$(patsubst %,show-%,$(CT_SAMPLES)):
diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh
index 33e3081..7113585 100755
--- a/scripts/showSamples.sh
+++ b/scripts/showSamples.sh
@@ -20,14 +20,21 @@ dump_single_sample() {
[ "$1" = "-w" ] && wiki=1 && shift
local width="$1"
local sample="$2"
- if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
- sample_top="${CT_TOP_DIR}"
- sample_type="l"
- else
- sample_top="${CT_LIB_DIR}"
- sample_type="g"
- fi
- . "${sample_top}/samples/${sample}/crosstool.config"
+ case "${sample}" in
+ current)
+ sample_type="l"
+ . .config
+ ;;
+ *) if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
+ sample_top="${CT_TOP_DIR}"
+ sample_type="l"
+ else
+ sample_top="${CT_LIB_DIR}"
+ sample_type="g"
+ fi
+ . "${sample_top}/samples/${sample}/crosstool.config"
+ ;;
+ esac
if [ -z "${wiki}" ]; then
t_width=13
printf "%-*s [%s" ${width} "${sample}" "${sample_type}"