Patchwork [3/3] Add parsing of Config.in in ipk-post.sh.

login
register
mail settings
Submitter Jérôme Pouiller
Date Jan. 15, 2013, 4:47 p.m.
Message ID <1358268430-2431-4-git-send-email-jezz@sysmic.org>
Download mbox | patch
Permalink /patch/212242/
State Rejected
Headers show

Comments

Jérôme Pouiller - Jan. 15, 2013, 4:47 p.m.
Built packages now contains description from Buildroot.

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
---
 support/scripts/ipk-post.sh |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Patch

diff --git a/support/scripts/ipk-post.sh b/support/scripts/ipk-post.sh
index a5beacb..2bfd736 100755
--- a/support/scripts/ipk-post.sh
+++ b/support/scripts/ipk-post.sh
@@ -38,6 +38,23 @@  for P in $PKG $PKG-i18n $PKG-doc $PKG-dbg $PKG-dev; do
 	[ $P == $PKG-dbg  ] && echo "Depends: $PKG"
 	[ $P == $PKG-doc  ] && echo "Recommends: $PKG"
 	echo "Description: $PKG"
+	STATE=EMPTY
+	while IFS= read LINE; do
+		if [[ $STATE == GETINDENT ]]; then
+		INDENT="$(echo "$LINE" | grep -o '^[ 	]*')" 
+		STATE=GETHELP
+		fi
+		if [[ $STATE == GETHELP ]]; then
+		if [[ "$LINE" =~ ^"$INDENT" ]]; then
+			echo "	${LINE#$INDENT}"
+		elif [[ "$LINE" == "" ]]; then 
+			echo "	." 
+		else 
+			break
+		fi
+		fi
+		[[ "$LINE" =~ ^.*-*help-*$ ]] && STATE=GETINDENT
+	done < $PKG_DIR/Config.in
 	[ $P == $PKG-i18n ] &&  echo -e "	.\n	This package contains locales files"
 	[ $P == $PKG-dev  ] &&  echo -e "	.\n	This package contains developement files"
 	[ $P == $PKG-dbg  ] &&  echo -e "	.\n	This package contains debug symbols"