From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WwH2b-0003Y9-VZ for ptxdist@pengutronix.de; Sun, 15 Jun 2014 22:28:38 +0200 Received: by mail-wg0-f47.google.com with SMTP id k14so4681204wgh.6 for ; Sun, 15 Jun 2014 13:28:32 -0700 (PDT) Received: from omega (p20030064A93CC6BDE2CB4EFFFE1BB546.dip0.t-ipconnect.de. [2003:64:a93c:c6bd:e2cb:4eff:fe1b:b546]) by mx.google.com with ESMTPSA id d43sm28955002eep.0.2014.06.15.13.28.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Jun 2014 13:28:31 -0700 (PDT) Date: Sun, 15 Jun 2014 22:28:26 +0200 From: Alexander Aring Message-ID: <20140615202824.GA31001@omega> MIME-Version: 1.0 Content-Disposition: inline Subject: [ptxdist] [RFC] idea about ptxdist development helpers Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Hi ptxdist hackers, I hacked several scripts to generate some search/replacing ptxdist code. For example: I run 'ptxdist install kbd', which contains many binary tools. The new ptxdist code style describes a list for that, because this will be easy to maintain. My hacked script 'list_generate' looks like following: ---snip #!/bin/bash LISTNAME=$1 NAME=$2 DIR=$3 echo "$LISTNAME-y:=" for i in `ls $DIR` do TO_UPPER=`echo $i | tr '[:lower:]' '[:upper:]'` if [ -x $DIR/$i ] && [ -f $DIR/$i ] && [ ! -h $DIR/$i ] then echo "${LISTNAME}-\$(PTXCONF_${NAME}_$TO_UPPER)+= $i" fi done ---snap and which replaced ${BSP} and ${PLATFORM}: ./list_generate KBD_TOOLS KBD ${BSP}/${PLATFORM}/packages/kbd-2.0.1/usr/bin generates: KBD_TOOLS-y:= KBD_TOOLS-$(PTXCONF_KBD_CHVT)+= chvt KBD_TOOLS-$(PTXCONF_KBD_DEALLOCVT)+= deallocvt KBD_TOOLS-$(PTXCONF_KBD_DUMPKEYS)+= dumpkeys KBD_TOOLS-$(PTXCONF_KBD_FGCONSOLE)+= fgconsole KBD_TOOLS-$(PTXCONF_KBD_GETKEYCODES)+= getkeycodes KBD_TOOLS-$(PTXCONF_KBD_KBDINFO)+= kbdinfo KBD_TOOLS-$(PTXCONF_KBD_KBD_MODE)+= kbd_mode KBD_TOOLS-$(PTXCONF_KBD_KBDRATE)+= kbdrate KBD_TOOLS-$(PTXCONF_KBD_LOADKEYS)+= loadkeys KBD_TOOLS-$(PTXCONF_KBD_LOADUNIMAP)+= loadunimap KBD_TOOLS-$(PTXCONF_KBD_MAPSCRN)+= mapscrn KBD_TOOLS-$(PTXCONF_KBD_OPENVT)+= openvt KBD_TOOLS-$(PTXCONF_KBD_PSFXTABLE)+= psfxtable KBD_TOOLS-$(PTXCONF_KBD_SETFONT)+= setfont KBD_TOOLS-$(PTXCONF_KBD_SETKEYCODES)+= setkeycodes KBD_TOOLS-$(PTXCONF_KBD_SETLEDS)+= setleds KBD_TOOLS-$(PTXCONF_KBD_SETMETAMODE)+= setmetamode KBD_TOOLS-$(PTXCONF_KBD_SETVTRGB)+= setvtrgb KBD_TOOLS-$(PTXCONF_KBD_SHOWCONSOLEFONT)+= showconsolefont KBD_TOOLS-$(PTXCONF_KBD_SHOWKEY)+= showkey KBD_TOOLS-$(PTXCONF_KBD_UNICODE_START)+= unicode_start KBD_TOOLS-$(PTXCONF_KBD_UNICODE_STOP)+= unicode_stop This is something which we need and we don't need to make some copy&paste which takes some minutes... I hacked this tool less in the minutes which my copy&paste would take to be done and yes, I need to intend manually. I think the idea is simple, but the question is maybe we should do a more cleaner (with intend support) mainline solution for that. This would support more than my hacked solution. I also have some scripts to generate help texts, search symlinks in binpath and so on. Or the corresponding script to generate the Kconfig menuentries. ---snap #!/bin/bash NAME=$1 DIR=$2 echo -e "if $NAME\n" for i in `ls $DIR` do TO_UPPER=`echo $i | tr '[:lower:]' '[:upper:]'` if [ -x $DIR/$i ] && [ -f $DIR/$i ] && [ ! -h $DIR/$i ] then echo "config ${NAME}_$TO_UPPER" echo -e "\tbool" echo -e "\tprompt \"$i\"" echo -e "\thelp" echo -e "\t FIXME" echo "" fi done echo "endif" ---snap which generates with: ./kconfig_help_generate KBD ${BSP}/${PLATFORM}/packages/kbd-2.0.1/usr/bin if KBD config KBD_CHVT bool prompt "chvt" help FIXME config KBD_DEALLOCVT bool prompt "deallocvt" help FIXME config KBD_DUMPKEYS bool prompt "dumpkeys" help FIXME config KBD_FGCONSOLE bool prompt "fgconsole" help FIXME config KBD_GETKEYCODES bool prompt "getkeycodes" help FIXME config KBD_KBDINFO bool prompt "kbdinfo" help FIXME config KBD_KBD_MODE bool prompt "kbd_mode" help FIXME .... endif These scripts for generating snippets for a newpackage would decrease the failure count and it will be faster to make some new packages. My question is: Is there any interest to have something like this in mainline ptxdist which provides some helper scripts like this? My solution is a self hacked solution for my private use... but I think I can do it better and then others ptxdist developers can use this. Then we should add some new ptxdist argument to generate some snippets. Maybe 'ptxdist snippet ...' or something else. :-) - Alex -- ptxdist mailing list ptxdist@pengutronix.de